diff --git a/.github/workflows/ghcr_deploy.yml b/.github/workflows/ghcr_deploy.yml index cc40d1ac0c0..f574ec9c202 100644 --- a/.github/workflows/ghcr_deploy.yml +++ b/.github/workflows/ghcr_deploy.yml @@ -338,7 +338,9 @@ jobs: if [ -z "${CHART_LIST}" ]; then echo "current-version=0.1.0" | tee -a $GITHUB_OUTPUT else - printf '%s' "${CHART_LIST}" | grep '^version:' | awk 'BEGIN{FS=":"}{print "current-version="$2}' | tr -d " " | tee -a $GITHUB_OUTPUT + # Extract version and strip any prerelease suffix (e.g., 0.1.827-latest -> 0.1.827) + VERSION=$(printf '%s' "${CHART_LIST}" | grep '^version:' | awk 'BEGIN{FS=":"}{print $2}' | tr -d " " | cut -d'-' -f1) + echo "current-version=${VERSION}" | tee -a $GITHUB_OUTPUT fi env: HELM_EXPERIMENTAL_OCI: '1' @@ -351,11 +353,24 @@ jobs: current-version: ${{ steps.current_version.outputs.current-version || '0.1.0' }} version-fragment: 'bug' + # Add suffix for non-stable releases (semantic versioning) + - name: Calculate chart version with prerelease suffix + id: chart_version + shell: bash + run: | + BASE_VERSION="${{ steps.bump_version.outputs.next-version || '0.1.0' }}" + RELEASE_TYPE="${{ github.event.inputs.release_type }}" + if [ "$RELEASE_TYPE" = "stable" ]; then + echo "version=${BASE_VERSION}" | tee -a $GITHUB_OUTPUT + else + echo "version=${BASE_VERSION}-${RELEASE_TYPE}" | tee -a $GITHUB_OUTPUT + fi + - uses: ./.github/actions/helm-oci-chart-releaser with: name: ${{ env.CHART_NAME }} repository: ${{ env.REPO_OWNER }} - tag: ${{ github.event.inputs.chartVersion || steps.bump_version.outputs.next-version || '0.1.0' }} + tag: ${{ github.event.inputs.chartVersion || steps.chart_version.outputs.version || '0.1.0' }} app_version: ${{ steps.current_app_tag.outputs.latest_tag }} path: deploy/charts/${{ env.CHART_NAME }} registry: ${{ env.REGISTRY }} diff --git a/cookbook/litellm_proxy_server/braintrust_prompt_wrapper_README.md b/cookbook/litellm_proxy_server/braintrust_prompt_wrapper_README.md new file mode 100644 index 00000000000..1bf52d922c6 --- /dev/null +++ b/cookbook/litellm_proxy_server/braintrust_prompt_wrapper_README.md @@ -0,0 +1,279 @@ +# Braintrust Prompt Wrapper for LiteLLM + +This directory contains a wrapper server that enables LiteLLM to use prompts from [Braintrust](https://www.braintrust.dev/) through the generic prompt management API. + +## Architecture + +``` +┌─────────────┐ ┌──────────────────────┐ ┌─────────────┐ +│ LiteLLM │ ──────> │ Wrapper Server │ ──────> │ Braintrust │ +│ Client │ │ (This Server) │ │ API │ +└─────────────┘ └──────────────────────┘ └─────────────┘ + Uses generic Transforms Stores actual + prompt manager Braintrust format prompt templates + to LiteLLM format +``` + +## Components + +### 1. Generic Prompt Manager (`litellm/integrations/generic_prompt_management/`) + +A generic client that can work with any API implementing the `/beta/litellm_prompt_management` endpoint. + +**Expected API Response Format:** +```json +{ + "prompt_id": "string", + "prompt_template": [ + {"role": "system", "content": "You are a helpful assistant"}, + {"role": "user", "content": "Hello {name}"} + ], + "prompt_template_model": "gpt-4", + "prompt_template_optional_params": { + "temperature": 0.7, + "max_tokens": 100 + } +} +``` + +### 2. Braintrust Wrapper Server (`braintrust_prompt_wrapper_server.py`) + +A FastAPI server that: +- Implements the `/beta/litellm_prompt_management` endpoint +- Fetches prompts from Braintrust API +- Transforms Braintrust response format to LiteLLM format + +## Setup + +### Install Dependencies + +```bash +pip install fastapi uvicorn httpx litellm +``` + +### Set Environment Variables + +```bash +export BRAINTRUST_API_KEY="your-braintrust-api-key" +``` + +## Usage + +### Step 1: Start the Wrapper Server + +```bash +python braintrust_prompt_wrapper_server.py +``` + +The server will start on `http://localhost:8080` by default. + +You can customize the port and host: +```bash +export PORT=8000 +export HOST=0.0.0.0 +python braintrust_prompt_wrapper_server.py +``` + +### Step 2: Use with LiteLLM + +```python +import litellm +from litellm.integrations.generic_prompt_management import GenericPromptManager + +# Configure the generic prompt manager to use your wrapper server +generic_config = { + "api_base": "http://localhost:8080", + "api_key": "your-braintrust-api-key", # Will be passed to Braintrust + "timeout": 30, +} + +# Create the prompt manager +prompt_manager = GenericPromptManager(**generic_config) + +# Use with completion +response = litellm.completion( + model="generic_prompt/gpt-4", + prompt_id="your-braintrust-prompt-id", + prompt_variables={"name": "World"}, # Variables to substitute + messages=[{"role": "user", "content": "Additional message"}] +) + +print(response) +``` + +### Step 3: Direct API Testing + +You can also test the wrapper API directly: + +```bash +# Test with curl +curl -H "Authorization: Bearer YOUR_BRAINTRUST_TOKEN" \ + "http://localhost:8080/beta/litellm_prompt_management?prompt_id=YOUR_PROMPT_ID" + +# Health check +curl http://localhost:8080/health + +# Service info +curl http://localhost:8080/ +``` + +## API Documentation + +Once the server is running, visit: +- Swagger UI: `http://localhost:8080/docs` +- ReDoc: `http://localhost:8080/redoc` + +## Braintrust Format Transformation + +The wrapper automatically transforms Braintrust's response format: + +**Braintrust API Response:** +```json +{ + "id": "prompt-123", + "prompt_data": { + "prompt": { + "type": "chat", + "messages": [ + { + "role": "system", + "content": "You are a helpful assistant" + } + ] + }, + "options": { + "model": "gpt-4", + "params": { + "temperature": 0.7, + "max_tokens": 100 + } + } + } +} +``` + +**Transformed to LiteLLM Format:** +```json +{ + "prompt_id": "prompt-123", + "prompt_template": [ + { + "role": "system", + "content": "You are a helpful assistant" + } + ], + "prompt_template_model": "gpt-4", + "prompt_template_optional_params": { + "temperature": 0.7, + "max_tokens": 100 + } +} +``` + +## Supported Parameters + +The wrapper automatically maps these Braintrust parameters to LiteLLM: + +- `temperature` +- `max_tokens` / `max_completion_tokens` +- `top_p` +- `frequency_penalty` +- `presence_penalty` +- `n` +- `stop` +- `response_format` +- `tool_choice` +- `function_call` +- `tools` + +## Variable Substitution + +The generic prompt manager supports simple variable substitution: + +```python +# In your Braintrust prompt: +# "Hello {name}, welcome to {place}!" + +# In your code: +prompt_variables = { + "name": "Alice", + "place": "Wonderland" +} + +# Result: +# "Hello Alice, welcome to Wonderland!" +``` + +Supports both `{variable}` and `{{variable}}` syntax. + +## Error Handling + +The wrapper provides detailed error messages: + +- **401**: Missing or invalid Braintrust API token +- **404**: Prompt not found in Braintrust +- **502**: Failed to connect to Braintrust API +- **500**: Error transforming response + +## Production Deployment + +For production use: + +1. **Use HTTPS**: Deploy behind a reverse proxy with SSL +2. **Authentication**: Add authentication to the wrapper endpoint if needed +3. **Rate Limiting**: Implement rate limiting to prevent abuse +4. **Caching**: Consider caching prompt responses +5. **Monitoring**: Add logging and monitoring + +Example with Docker: + +```dockerfile +FROM python:3.11-slim + +WORKDIR /app + +RUN pip install fastapi uvicorn httpx + +COPY braintrust_prompt_wrapper_server.py . + +ENV PORT=8080 +ENV HOST=0.0.0.0 + +EXPOSE 8080 + +CMD ["python", "braintrust_prompt_wrapper_server.py"] +``` + +## Extending to Other Providers + +This pattern can be used with any prompt management provider: + +1. Create a wrapper server that implements `/beta/litellm_prompt_management` +2. Transform the provider's response to LiteLLM format +3. Use the generic prompt manager to connect + +Example providers: +- Langsmith +- PromptLayer +- Humanloop +- Custom internal systems + +## Troubleshooting + +### "No Braintrust API token provided" +- Set `BRAINTRUST_API_KEY` environment variable +- Or pass token in `Authorization: Bearer TOKEN` header + +### "Failed to connect to Braintrust API" +- Check your internet connection +- Verify Braintrust API is accessible +- Check firewall settings + +### "Prompt not found" +- Verify the prompt ID exists in Braintrust +- Check that your API token has access to the prompt + +## License + +This wrapper is part of the LiteLLM project and follows the same license. + diff --git a/cookbook/litellm_proxy_server/braintrust_prompt_wrapper_server.py b/cookbook/litellm_proxy_server/braintrust_prompt_wrapper_server.py new file mode 100644 index 00000000000..6379314c5b6 --- /dev/null +++ b/cookbook/litellm_proxy_server/braintrust_prompt_wrapper_server.py @@ -0,0 +1,274 @@ +""" +Mock server that implements the /beta/litellm_prompt_management endpoint +and acts as a wrapper for calling the Braintrust API. + +This server transforms Braintrust's prompt API response into the format +expected by LiteLLM's generic prompt management client. + +Usage: + python braintrust_prompt_wrapper_server.py + + # Then test with: + curl -H "Authorization: Bearer YOUR_BRAINTRUST_TOKEN" \ + "http://localhost:8080/beta/litellm_prompt_management?prompt_id=YOUR_PROMPT_ID" +""" + +import json +import os +from typing import Any, Dict, List, Optional + +import httpx +from fastapi import FastAPI, HTTPException, Header, Query +from fastapi.responses import JSONResponse +import uvicorn + + +app = FastAPI( + title="Braintrust Prompt Wrapper", + description="Wrapper server for Braintrust prompts to work with LiteLLM", + version="1.0.0", +) + + +def transform_braintrust_message(message: Dict[str, Any]) -> Dict[str, str]: + """ + Transform a Braintrust message to LiteLLM format. + + Braintrust message format: + { + "role": "system", + "content": "...", + "name": "..." (optional) + } + + LiteLLM format: + { + "role": "system", + "content": "..." + } + """ + result = { + "role": message.get("role", "user"), + "content": message.get("content", ""), + } + + # Include name if present + if "name" in message: + result["name"] = message["name"] + + return result + + +def transform_braintrust_response( + braintrust_response: Dict[str, Any], +) -> Dict[str, Any]: + """ + Transform Braintrust API response to LiteLLM prompt management format. + + Braintrust response format: + { + "objects": [{ + "id": "prompt_id", + "prompt_data": { + "prompt": { + "type": "chat", + "messages": [...], + "tools": "..." + }, + "options": { + "model": "gpt-4", + "params": { + "temperature": 0.7, + "max_tokens": 100, + ... + } + } + } + }] + } + + LiteLLM format: + { + "prompt_id": "prompt_id", + "prompt_template": [...], + "prompt_template_model": "gpt-4", + "prompt_template_optional_params": {...} + } + """ + # Extract the first object from the objects array if it exists + if "objects" in braintrust_response and len(braintrust_response["objects"]) > 0: + prompt_object = braintrust_response["objects"][0] + else: + prompt_object = braintrust_response + + prompt_data = prompt_object.get("prompt_data", {}) + prompt_info = prompt_data.get("prompt", {}) + options = prompt_data.get("options", {}) + + # Extract messages + messages = prompt_info.get("messages", []) + transformed_messages = [transform_braintrust_message(msg) for msg in messages] + + # Extract model + model = options.get("model") + + # Extract optional parameters + params = options.get("params", {}) + optional_params: Dict[str, Any] = {} + + # Map common parameters + param_mapping = { + "temperature": "temperature", + "max_tokens": "max_tokens", + "max_completion_tokens": "max_tokens", # Alternative name + "top_p": "top_p", + "frequency_penalty": "frequency_penalty", + "presence_penalty": "presence_penalty", + "n": "n", + "stop": "stop", + } + + for braintrust_param, litellm_param in param_mapping.items(): + if braintrust_param in params: + value = params[braintrust_param] + if value is not None: + optional_params[litellm_param] = value + + # Handle response_format + if "response_format" in params: + optional_params["response_format"] = params["response_format"] + + # Handle tool_choice + if "tool_choice" in params: + optional_params["tool_choice"] = params["tool_choice"] + + # Handle function_call + if "function_call" in params: + optional_params["function_call"] = params["function_call"] + + # Add tools if present + if "tools" in prompt_info and prompt_info["tools"]: + optional_params["tools"] = prompt_info["tools"] + + # Handle tool_functions from prompt_data + if "tool_functions" in prompt_data and prompt_data["tool_functions"]: + optional_params["tool_functions"] = prompt_data["tool_functions"] + + return { + "prompt_id": prompt_object.get("id"), + "prompt_template": transformed_messages, + "prompt_template_model": model, + "prompt_template_optional_params": optional_params if optional_params else None, + } + + +@app.get("/beta/litellm_prompt_management") +async def get_prompt( + prompt_id: str = Query(..., description="The Braintrust prompt ID to fetch"), + authorization: Optional[str] = Header( + None, description="Bearer token for Braintrust API" + ), +) -> JSONResponse: + """ + Fetch a prompt from Braintrust and transform it to LiteLLM format. + + Args: + prompt_id: The Braintrust prompt ID + authorization: Bearer token for Braintrust API (from header) + + Returns: + JSONResponse with the transformed prompt data + """ + # Extract token from Authorization header or environment + braintrust_token = None + if authorization and authorization.startswith("Bearer "): + braintrust_token = authorization.replace("Bearer ", "") + else: + braintrust_token = os.getenv("BRAINTRUST_API_KEY") + + if not braintrust_token: + raise HTTPException( + status_code=401, + detail="No Braintrust API token provided. Pass via Authorization header or set BRAINTRUST_API_KEY environment variable.", + ) + + # Call Braintrust API + braintrust_url = f"https://api.braintrust.dev/v1/prompt/{prompt_id}" + headers = { + "Authorization": f"Bearer {braintrust_token}", + "Accept": "application/json", + } + print(f"headers: {headers}") + print(f"braintrust_url: {braintrust_url}") + print(f"braintrust_token: {braintrust_token}") + + try: + async with httpx.AsyncClient(timeout=30.0) as client: + response = await client.get(braintrust_url, headers=headers) + response.raise_for_status() + braintrust_data = response.json() + except httpx.HTTPStatusError as e: + raise HTTPException( + status_code=e.response.status_code, + detail=f"Braintrust API error: {e.response.text}", + ) + except httpx.RequestError as e: + raise HTTPException( + status_code=502, + detail=f"Failed to connect to Braintrust API: {str(e)}", + ) + except json.JSONDecodeError as e: + raise HTTPException( + status_code=502, + detail=f"Failed to parse Braintrust API response: {str(e)}", + ) + + print(f"braintrust_data: {braintrust_data}") + # Transform the response + try: + transformed_data = transform_braintrust_response(braintrust_data) + print(f"transformed_data: {transformed_data}") + return JSONResponse(content=transformed_data) + except Exception as e: + raise HTTPException( + status_code=500, + detail=f"Failed to transform Braintrust response: {str(e)}", + ) + + +@app.get("/health") +async def health_check(): + """Health check endpoint.""" + return {"status": "healthy", "service": "braintrust-prompt-wrapper"} + + +@app.get("/") +async def root(): + """Root endpoint with service information.""" + return { + "service": "Braintrust Prompt Wrapper for LiteLLM", + "version": "1.0.0", + "endpoints": { + "prompt_management": "/beta/litellm_prompt_management?prompt_id=", + "health": "/health", + }, + "documentation": "/docs", + } + + +def main(): + """Run the server.""" + port = int(os.getenv("PORT", "8080")) + host = os.getenv("HOST", "0.0.0.0") + + print(f"🚀 Starting Braintrust Prompt Wrapper Server on {host}:{port}") + print(f"📚 API Documentation available at http://{host}:{port}/docs") + print( + f"🔑 Make sure to set BRAINTRUST_API_KEY environment variable or pass token in Authorization header" + ) + + uvicorn.run(app, host=host, port=port) + + +if __name__ == "__main__": + main() diff --git a/docs/my-website/docs/a2a_cost_tracking.md b/docs/my-website/docs/a2a_cost_tracking.md new file mode 100644 index 00000000000..86a79069e7c --- /dev/null +++ b/docs/my-website/docs/a2a_cost_tracking.md @@ -0,0 +1,115 @@ +# A2A Agent Cost Tracking + +LiteLLM supports adding custom cost tracking for A2A agents. You can configure: + +- **Flat cost per query** - A fixed cost charged for each agent request +- **Cost by input/output tokens** - Variable cost based on token usage + +This allows you to track and attribute costs for agent usage across your organization, making it easy to see how much each team or project is spending on agent calls. + +## Quick Start + +### 1. Navigate to Agents + +From the sidebar, click on "Agents" to open the agent management page. + +![Navigate to Agents](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/f9ac0752-6936-4dda-b7ed-f536fefcc79a/ascreenshot.jpeg?tl_px=208,326&br_px=2409,1557&force_format=jpeg&q=100&width=1120.0) + +### 2. Create a New Agent + +Click "+ Add New Agent" to open the creation form. You'll need to provide a few basic details: + +- **Agent Name** - A unique identifier for your agent (used in API calls) +- **Display Name** - A human-readable name shown in the UI + +![Enter Agent Name](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/f5bacfeb-67a0-4644-a400-b3d50b6b9ce5/ascreenshot.jpeg?tl_px=0,0&br_px=2617,1463&force_format=jpeg&q=100&width=1120.0) + +![Enter Display Name](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/6db6422b-fe85-4a8b-aa5c-39319f0d4621/ascreenshot.jpeg?tl_px=0,27&br_px=2617,1490&force_format=jpeg&q=100&width=1120.0) + +### 3. Configure Cost Settings + +Scroll down and click on "Cost Configuration" to expand the cost settings panel. This is where you define how much to charge for agent usage. + +![Click Cost Configuration](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/a3019ae8-629c-431b-b2d8-2743cc517be7/ascreenshot.jpeg?tl_px=0,653&br_px=2201,1883&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=388,416) + +### 4. Set Cost Per Query + +Enter the cost per query amount (in dollars). For example, entering `0.05` means each request to this agent will be charged $0.05. + +![Set Cost Per Query](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/91159f8a-1f66-4555-a166-600e4bdecc68/ascreenshot.jpeg?tl_px=0,653&br_px=2201,1883&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=372,281) + +![Enter Cost Amount](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/2add2f69-fd72-462e-9335-1e228c7150da/ascreenshot.jpeg?tl_px=0,420&br_px=2617,1884&force_format=jpeg&q=100&width=1120.0) + +### 5. Create the Agent + +Once you've configured everything, click "Create Agent" to save. Your agent is now ready to use with cost tracking enabled. + +![Create Agent](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/1876cf29-b8a7-4662-b944-2b86a8b7cd2e/ascreenshot.jpeg?tl_px=416,653&br_px=2618,1883&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=706,523) + +## Testing Cost Tracking + +Let's verify that cost tracking is working by sending a test request through the Playground. + +### 1. Go to Playground + +Click "Playground" in the sidebar to open the interactive testing interface. + +![Go to Playground](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/7d5d8338-6393-49a5-b255-86aef5bf5dfa/ascreenshot.jpeg?tl_px=0,0&br_px=2201,1230&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=41,98) + +### 2. Select A2A Endpoint + +By default, the Playground uses the chat completions endpoint. To test your agent, click "Endpoint Type" and select `/v1/a2a/message/send` from the dropdown. + +![Select Endpoint Type](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/4d066510-0878-4e0b-8abf-0b074fe2a560/ascreenshot.jpeg?tl_px=0,0&br_px=2201,1230&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=325,238) + +![Select A2A Endpoint](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/fe2f8957-4e8a-4331-b177-d5093480cf60/ascreenshot.jpeg?tl_px=0,0&br_px=2201,1230&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=333,261) + +### 3. Select Your Agent + +Now pick the agent you just created from the agent dropdown. You should see it listed by its display name. + +![Select Agent](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/8c7add70-fe72-48cb-ba33-9f53b989fcad/ascreenshot.jpeg?tl_px=0,150&br_px=2201,1381&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=287,277) + +### 4. Send a Test Message + +Type a message and hit send. You can use the suggested prompts or write your own. + +![Send Message](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/2c16acb1-4016-447e-88e9-c4522e408ea2/ascreenshot.jpeg?tl_px=15,653&br_px=2216,1883&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=524,443) + +Once the agent responds, the request is logged with the cost you configured. + +![Agent Response](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/2dcf7109-0be4-4d03-8333-ef45759c70c9/ascreenshot.jpeg?tl_px=0,0&br_px=2201,1230&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=494,273) + +## Viewing Cost in Logs + +Now let's confirm the cost was actually tracked. + +### 1. Navigate to Logs + +Click "Logs" in the sidebar to see all recent requests. + +![Go to Logs](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/c96abf3c-f06a-4401-ada6-04b6e8040453/ascreenshot.jpeg?tl_px=0,118&br_px=2201,1349&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=41,277) + +### 2. View Cost Attribution + +Find your agent request in the list. You'll see the cost column showing the amount you configured. This cost is now attributed to the API key that made the request, so you can track spend per team or project. + +![View Cost in Logs](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/1ae167ec-1a43-48a3-9251-43d4cb3e57f5/ascreenshot.jpeg?tl_px=335,11&br_px=2536,1242&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=524,277) + +## Cost Configuration Options + +You can mix and match these options depending on your pricing model: + +| Field | Description | +|-------|-------------| +| **Cost Per Query ($)** | Fixed cost charged for each agent request | +| **Input Cost Per Token ($)** | Cost per input token processed | +| **Output Cost Per Token ($)** | Cost per output token generated | + +For most use cases, a flat cost per query is simplest. Use token-based pricing if your agent costs vary significantly based on input/output length. + +## Related + +- [A2A Agent Gateway](./a2a.md) +- [Spend Tracking](./proxy/cost_tracking.md) + diff --git a/docs/my-website/docs/completion/input.md b/docs/my-website/docs/completion/input.md index bdbd0b04929..7df4f77017a 100644 --- a/docs/my-website/docs/completion/input.md +++ b/docs/my-website/docs/completion/input.md @@ -174,11 +174,11 @@ def completion( - `seed`: *integer or null (optional)* - This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. -- `tools`: *array (optional)* - A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. +- `tools`: *array (optional)* - A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. - - `type`: *string* - The type of the tool. Currently, only function is supported. + - `type`: *string* - The type of the tool. You can set this to `"function"` or `"mcp"` (matching the `/responses` schema) to call LiteLLM-registered MCP servers directly from `/chat/completions`. - - `function`: *object* - Required. + - `function`: *object* - Required for function tools. - `tool_choice`: *string or object (optional)* - Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. Specifying a particular function via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that function. @@ -247,4 +247,3 @@ def completion( - `eos_token`: *string (optional)* - Initial string applied at the end of a sequence - `hf_model_name`: *string (optional)* - [Sagemaker Only] The corresponding huggingface name of the model, used to pull the right chat template for the model. - diff --git a/docs/my-website/docs/mcp.md b/docs/my-website/docs/mcp.md index a9f7e249133..f9c9cbb4562 100644 --- a/docs/my-website/docs/mcp.md +++ b/docs/my-website/docs/mcp.md @@ -1137,6 +1137,37 @@ curl --location '/v1/responses' \ }' ``` +## Use MCP tools with `/chat/completions` + +:::tip Works with all providers +This flow is **provider-agnostic**: the same MCP tool definition works for _every_ LLM backend behind LiteLLM (OpenAI, Azure OpenAI, Anthropic, Amazon Bedrock, Vertex, self-hosted deployments, etc.). +::: + +LiteLLM Proxy also supports MCP-aware tooling on the classic `/v1/chat/completions` endpoint. Provide the MCP tool definition directly in the `tools` array and LiteLLM will fetch and transform the MCP server's tools into OpenAI-compatible function calls. When `require_approval` is set to `"never"`, the proxy automatically executes the returned tool calls and feeds the results back into the model before returning the assistant response. + +```bash title="Chat Completions with MCP Tools" showLineNumbers +curl --location '/v1/chat/completions' \ +--header 'Content-Type: application/json' \ +--header "Authorization: Bearer $LITELLM_API_KEY" \ +--data '{ + "model": "gpt-4o-mini", + "messages": [ + {"role": "user", "content": "Summarize the latest open PR."} + ], + "tools": [ + { + "type": "mcp", + "server_url": "litellm_proxy/mcp/github", + "server_label": "github_mcp", + "require_approval": "never" + } + ] +}' +``` + +If you omit `require_approval` or set it to any value other than `"never"`, the MCP tool calls are returned to the client so that you can review and execute them manually, matching the upstream OpenAI behavior. + + ## LiteLLM Proxy - Walk through MCP Gateway LiteLLM exposes an MCP Gateway for admins to add all their MCP servers to LiteLLM. The key benefits of using LiteLLM Proxy with MCP are: diff --git a/docs/my-website/docs/providers/google_ai_studio/files.md b/docs/my-website/docs/providers/google_ai_studio/files.md index ce61ce1a90b..17fe6e73d94 100644 --- a/docs/my-website/docs/providers/google_ai_studio/files.md +++ b/docs/my-website/docs/providers/google_ai_studio/files.md @@ -159,3 +159,150 @@ print(completion.choices[0].message) +## Azure Blob Storage Integration + +LiteLLM supports using Azure Blob Storage as a target storage backend for Gemini file uploads. This allows you to store files in Azure Data Lake Storage Gen2 instead of Google's managed storage. + +### Step 1: Setup Azure Blob Storage + +Configure your Azure Blob Storage account by setting the following environment variables: + +**Required Environment Variables:** +- `AZURE_STORAGE_ACCOUNT_NAME` - Your Azure Storage account name +- `AZURE_STORAGE_FILE_SYSTEM` - The container/filesystem name where files will be stored +- `AZURE_STORAGE_ACCOUNT_KEY` - Your account key + +### Step 2: Pass Azure Blob Storage as Target Storage + +When uploading files, specify `target_storage: "azure_storage"` to use Azure Blob Storage instead of the default storage. + +**Supported File Types:** + +Azure Blob Storage supports all Gemini-compatible file types: + +- **Images**: PNG, JPEG, WEBP +- **Audio**: AAC, FLAC, MP3, MPA, MPEG, MPGA, OPUS, PCM, WAV, WEBM +- **Video**: FLV, MOV, MPEG, MPEGPS, MPG, MP4, WEBM, WMV, 3GPP +- **Documents**: PDF, TXT + +> **Note:** Only small files can be sent as inline data because the total request size limit is 20 MB. + + +### Step 3: Upload Files with Azure Blob Storage for Gemini + + + + +1. Setup config.yaml + +```yaml +model_list: + - model_name: "gemini-2.5-flash" + litellm_params: + model: gemini/gemini-2.5-flash + api_key: os.environ/GEMINI_API_KEY +``` + +2. Set environment variables + +```bash +export AZURE_STORAGE_ACCOUNT_NAME="your-storage-account" +export AZURE_STORAGE_FILE_SYSTEM="your-container-name" +export AZURE_STORAGE_ACCOUNT_KEY="your-account-key" +``` +or add them in your `.env` + +3. Start proxy + +```bash +litellm --config config.yaml +``` + +4. Upload file with Azure Blob Storage + +```python +from openai import OpenAI + +client = OpenAI( + base_url="http://0.0.0.0:4000", + api_key="sk-1234" +) + +# Upload file to Azure Blob Storage +file = client.files.create( + file=open("document.pdf", "rb"), + purpose="user_data", + extra_body={ + "target_model_names": "gemini-2.0-flash", + "target_storage": "azure_storage" # 👈 Use Azure Blob Storage + } +) + +print(f"File uploaded to Azure Blob Storage: {file.id}") + +# Use the file with Gemini +completion = client.chat.completions.create( + model="gemini-2.0-flash", + messages=[ + { + "role": "user", + "content": [ + {"type": "text", "text": "Summarize this document"}, + { + "type": "file", + "file": { + "file_id": file.id, + } + } + ] + } + ] +) + +print(completion.choices[0].message.content) +``` + + + + +```bash +# Upload file with Azure Blob Storage +curl -X POST "http://0.0.0.0:4000/v1/files" \ + -H "Authorization: Bearer sk-1234" \ + -F "file=@document.pdf" \ + -F "purpose=user_data" \ + -F "target_storage=azure_storage" \ + -F "target_model_names=gemini-2.0-flash" \ + -F "custom_llm_provider=gemini" + +# Use the file with Gemini +curl -X POST "http://0.0.0.0:4000/v1/chat/completions" \ + -H "Authorization: Bearer sk-1234" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "gemini-2.0-flash", + "messages": [ + { + "role": "user", + "content": [ + {"type": "text", "text": "Summarize this document"}, + { + "type": "file", + "file": { + "file_id": "file-id-from-upload", + "format": "application/pdf" + } + } + ] + } + ] + }' +``` + + + + +:::info +Files uploaded to Azure Blob Storage are stored in your Azure account and can be accessed via the returned file ID. The file URL format is: `https://{account}.blob.core.windows.net/{container}/{path}` +::: + diff --git a/docs/my-website/docs/providers/langgraph.md b/docs/my-website/docs/providers/langgraph.md index 7361100ed85..9b4b24cf8f5 100644 --- a/docs/my-website/docs/providers/langgraph.md +++ b/docs/my-website/docs/providers/langgraph.md @@ -233,8 +233,65 @@ curl -s --request POST \ +## LiteLLM A2A Gateway + +You can also connect to LangGraph agents through LiteLLM's A2A (Agent-to-Agent) Gateway UI. This provides a visual way to register and test agents without writing code. + +### 1. Navigate to Agents + +From the sidebar, click "Agents" to open the agent management page, then click "+ Add New Agent". + +![Navigate to Agents](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/27429cae-f743-440a-a6aa-29fa7ee013db/ascreenshot.jpeg?tl_px=0,0&br_px=2201,1230&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=211,114) + +### 2. Select LangGraph Agent Type + +Click "A2A Standard" to see available agent types, then search for "langgraph" and select "Connect to LangGraph agents via the LangGraph Platform API". + +![Select A2A Standard](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/4add4088-683d-49ca-9374-23fd65dddf8e/ascreenshot.jpeg?tl_px=0,0&br_px=2201,1230&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=511,139) + +![Select LangGraph](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/fd197907-47c7-4e05-959c-c0d42264263c/ascreenshot.jpeg?tl_px=0,0&br_px=2201,1230&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=431,246) + +### 3. Configure the Agent + +Fill in the following fields: + +- **Agent Name** - A unique identifier (e.g., `lan-agent`) +- **LangGraph API Base** - Your LangGraph server URL, typically `http://127.0.0.1:2024/` +- **API Key** - Optional. LangGraph doesn't require an API key by default +- **Assistant ID** - Not used by LangGraph, you can enter any string here + +![Enter Agent Name](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/adce3df9-a67c-4d23-b2b5-05120738bc46/ascreenshot.jpeg?tl_px=0,0&br_px=2617,1463&force_format=jpeg&q=100&width=1120.0) + +![Enter API Base](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/6a6a03a7-f235-41db-b4ba-d32ced330f25/ascreenshot.jpeg?tl_px=0,251&br_px=2617,1714&force_format=jpeg&q=100&width=1120.0) + +Click "Create Agent" to save. + +![Create Agent](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/ddee4295-9a32-4cda-8e3f-543e5047eb6a/ascreenshot.jpeg?tl_px=416,653&br_px=2618,1883&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=686,316) + +### 4. Test in Playground + +Go to "Playground" in the sidebar to test your agent. Change the endpoint type to `/v1/a2a/message/send`. + +![Go to Playground](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/c4262189-95ac-4fbc-b5af-8aba8126e4f7/ascreenshot.jpeg?tl_px=0,0&br_px=2201,1230&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=41,104) + +![Select A2A Endpoint](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/6cbc8e93-7d0c-47fc-9ad4-562663f759d5/ascreenshot.jpeg?tl_px=0,0&br_px=2201,1230&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=324,265) + +### 5. Select Your Agent and Send a Message + +Pick your LangGraph agent from the dropdown and send a test message. + +![Select Agent](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/d01da2f1-3b89-47d7-ba95-de2dd8efbc1e/ascreenshot.jpeg?tl_px=0,92&br_px=2201,1323&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=348,277) + +![Send Message](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/79db724e-a99e-493a-9747-dc91cb398370/ascreenshot.jpeg?tl_px=51,653&br_px=2252,1883&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=524,444) + +The agent responds with its capabilities. You can now interact with your LangGraph agent through the A2A protocol. + +![Agent Response](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-12-13/82aa546a-0eb5-4836-b986-9aefcfe09e10/ascreenshot.jpeg?tl_px=295,28&br_px=2496,1259&force_format=jpeg&q=100&width=1120.0&wat=1&wat_opacity=0.7&wat_gravity=northwest&wat_url=https://colony-recorder.s3.us-west-1.amazonaws.com/images/watermarks/FB923C_standard.png&wat_pad=524,277) + ## Further Reading - [LangGraph Platform Documentation](https://langchain-ai.github.io/langgraph/cloud/quick_start/) - [LangGraph GitHub](https://github.com/langchain-ai/langgraph) +- [A2A Agent Gateway](../a2a.md) +- [A2A Cost Tracking](../a2a_cost_tracking.md) diff --git a/docs/my-website/docs/providers/milvus_vector_stores.md b/docs/my-website/docs/providers/milvus_vector_stores.md index 84f16fbc74a..44173511483 100644 --- a/docs/my-website/docs/providers/milvus_vector_stores.md +++ b/docs/my-website/docs/providers/milvus_vector_stores.md @@ -291,12 +291,265 @@ Give the key access to the virtual index and the embedding model. ### Developer Flow +#### MilvusRESTClient + +To use the passthrough API, you need a simple REST client. Copy this `milvus_rest_client.py` file to your project: + +
+Click to expand milvus_rest_client.py + +```python +""" +Simple Milvus REST API v2 Client +Based on: https://milvus.io/api-reference/restful/v2.6.x/ +""" + +import requests +from typing import List, Dict, Any, Optional + + +class DataType: + """Milvus data types""" + + INT64 = "Int64" + FLOAT_VECTOR = "FloatVector" + VARCHAR = "VarChar" + BOOL = "Bool" + FLOAT = "Float" + + +class CollectionSchema: + """Collection schema builder""" + + def __init__(self): + self.fields = [] + + def add_field( + self, + field_name: str, + data_type: str, + is_primary: bool = False, + dim: Optional[int] = None, + description: str = "", + ): + """Add a field to the schema""" + field = { + "fieldName": field_name, + "dataType": data_type, + "isPrimary": is_primary, + "description": description, + } + if data_type == DataType.FLOAT_VECTOR and dim: + field["elementTypeParams"] = {"dim": str(dim)} + self.fields.append(field) + return self + + def to_dict(self): + """Convert schema to dict for API""" + return {"fields": self.fields} + + +class IndexParams: + """Index parameters builder""" + + def __init__(self): + self.indexes = [] + + def add_index( + self, field_name: str, metric_type: str = "L2", index_name: Optional[str] = None + ): + """Add an index""" + index = { + "fieldName": field_name, + "indexName": index_name or f"{field_name}_index", + "metricType": metric_type, + } + self.indexes.append(index) + return self + + def to_list(self): + """Convert to list for API""" + return self.indexes + + +class MilvusRESTClient: + """ + Simple Milvus REST API v2 Client + + Reference: https://milvus.io/api-reference/restful/v2.6.x/ + """ + + def __init__(self, uri: str, token: str, db_name: str = "default"): + """ + Initialize Milvus REST client + + Args: + uri: Milvus server URI (e.g., http://localhost:19530) + token: Authentication token + db_name: Database name + """ + self.base_url = uri.rstrip("/") + self.token = token + self.db_name = db_name + self.headers = { + "Authorization": f"Bearer {token}", + "Content-Type": "application/json", + } + + def _make_request(self, endpoint: str, data: Dict[str, Any]) -> Dict[str, Any]: + """Make a POST request to Milvus API""" + url = f"{self.base_url}{endpoint}" + + # Add dbName if not already in data and not default + if "dbName" not in data and self.db_name != "default": + data["dbName"] = self.db_name + + try: + response = requests.post(url, json=data, headers=self.headers) + response.raise_for_status() + except requests.exceptions.HTTPError as e: + print(f"e.response.text: {e.response.content}") + raise e + + result = response.json() + + # Check for API errors + if result.get("code") != 0: + raise Exception( + f"Milvus API Error: {result.get('message', 'Unknown error')}" + ) + + return result + + def has_collection(self, collection_name: str) -> bool: + """ + Check if a collection exists + + Reference: https://milvus.io/api-reference/restful/v2.6.x/v2/Collection%20(v2)/Has.md + """ + try: + result = self._make_request( + "/v2/vectordb/collections/has", {"collectionName": collection_name} + ) + return result.get("data", {}).get("has", False) + except Exception: + return False + + def drop_collection(self, collection_name: str): + """ + Drop a collection + + Reference: https://milvus.io/api-reference/restful/v2.6.x/v2/Collection%20(v2)/Drop.md + """ + return self._make_request( + "/v2/vectordb/collections/drop", {"collectionName": collection_name} + ) + + def create_schema(self) -> CollectionSchema: + """Create a new collection schema""" + return CollectionSchema() + + def prepare_index_params(self) -> IndexParams: + """Create index parameters""" + return IndexParams() + + def create_collection( + self, + collection_name: str, + schema: CollectionSchema, + index_params: Optional[IndexParams] = None, + ): + """ + Create a collection + + Reference: https://milvus.io/api-reference/restful/v2.6.x/v2/Collection%20(v2)/Create.md + """ + data = {"collectionName": collection_name, "schema": schema.to_dict()} + + if index_params: + data["indexParams"] = index_params.to_list() + + return self._make_request("/v2/vectordb/collections/create", data) + + def describe_collection(self, collection_name: str) -> Dict[str, Any]: + """ + Describe a collection + + Reference: https://milvus.io/api-reference/restful/v2.6.x/v2/Collection%20(v2)/Describe.md + """ + result = self._make_request( + "/v2/vectordb/collections/describe", {"collectionName": collection_name} + ) + return result.get("data", {}) + + def insert( + self, + collection_name: str, + data: List[Dict[str, Any]], + partition_name: Optional[str] = None, + ): + """ + Insert data into a collection + + Reference: https://milvus.io/api-reference/restful/v2.6.x/v2/Vector%20(v2)/Insert.md + """ + payload = {"collectionName": collection_name, "data": data} + + if partition_name: + payload["partitionName"] = partition_name + + result = self._make_request("/v2/vectordb/entities/insert", payload) + return result.get("data", {}) + + def flush(self, collection_name: str): + """ + Flush collection data to storage + + Reference: https://milvus.io/api-reference/restful/v2.6.x/v2/Collection%20(v2)/Flush.md + """ + return self._make_request( + "/v2/vectordb/collections/flush", {"collectionName": collection_name} + ) + + def search( + self, + collection_name: str, + data: List[List[float]], + anns_field: str, + limit: int = 10, + search_params: Optional[Dict[str, Any]] = None, + output_fields: Optional[List[str]] = None, + ) -> List[List[Dict]]: + """ + Search for vectors + + Reference: https://milvus.io/api-reference/restful/v2.6.x/v2/Vector%20(v2)/Search.md + """ + payload = { + "collectionName": collection_name, + "data": data, + "annsField": anns_field, + "limit": limit, + } + + if search_params: + payload["searchParams"] = search_params + + if output_fields: + payload["outputFields"] = output_fields + + result = self._make_request("/v2/vectordb/entities/search", payload) + return result.get("data", []) +``` + +
+ #### 1. Create a collection with schema Note: Use the `/milvus` endpoint for the passthrough api that uses the `milvus` provider in your config. ```python -from milvus_rest_client import MilvusRESTClient, DataType +from milvus_rest_client import MilvusRESTClient, DataType # Use the client from above import random import time @@ -404,7 +657,7 @@ for i in range(5): Here's a full working example: ```python -from milvus_rest_client import MilvusRESTClient, DataType +from milvus_rest_client import MilvusRESTClient, DataType # Use the client from above import random import time diff --git a/docs/my-website/docs/providers/openai.md b/docs/my-website/docs/providers/openai.md index b170c6aba22..509a106d8a4 100644 --- a/docs/my-website/docs/providers/openai.md +++ b/docs/my-website/docs/providers/openai.md @@ -433,7 +433,7 @@ Expected Response: ### Advanced: Using `reasoning_effort` with `summary` field -By default, `reasoning_effort` accepts a string value (`"none"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`—`"xhigh"` is only supported on `gpt-5.1-codex-max`) and only sets the effort level without including a reasoning summary. +By default, `reasoning_effort` accepts a string value (`"none"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`—`"xhigh"` is only supported on `gpt-5.1-codex-max` and `gpt-5.2` models) and only sets the effort level without including a reasoning summary. To opt-in to the `summary` feature, you can pass `reasoning_effort` as a dictionary. **Note:** The `summary` field requires your OpenAI organization to have verification status. Using `summary` without verification will result in a 400 error from OpenAI. @@ -501,11 +501,13 @@ curl -X POST 'http://0.0.0.0:4000/chat/completions' \ | `gpt-5.1-codex` | `adaptive` | `low`, `medium`, `high` (no `minimal`) | | `gpt-5.1-codex-mini` | `adaptive` | `low`, `medium`, `high` (no `minimal`) | | `gpt-5.1-codex-max` | `adaptive` | `low`, `medium`, `high`, `xhigh` (no `minimal`) | +| `gpt-5.2` | `medium` | `none`, `low`, `medium`, `high`, `xhigh` | +| `gpt-5.2-pro` | `high` | `low`, `medium`, `high`, `xhigh` | | `gpt-5-pro` | `high` | `high` only | **Note:** - GPT-5.1 introduced a new `reasoning_effort="none"` setting for faster, lower-latency responses. This replaces the `"minimal"` setting from GPT-5. -- `gpt-5.1-codex-max` is the only model that supports `reasoning_effort="xhigh"`. All other models will reject this value. +- `gpt-5.1-codex-max` and `gpt-5.2` models support `reasoning_effort="xhigh"`. All other models will reject this value. - `gpt-5-pro` only accepts `reasoning_effort="high"`. Other values will return an error. - When `reasoning_effort` is not set (None), OpenAI defaults to the value shown in the "Default" column. diff --git a/docs/my-website/docs/proxy/guardrails/pillar_security.md b/docs/my-website/docs/proxy/guardrails/pillar_security.md index 9632376768b..de0b0d53614 100644 --- a/docs/my-website/docs/proxy/guardrails/pillar_security.md +++ b/docs/my-website/docs/proxy/guardrails/pillar_security.md @@ -233,7 +233,7 @@ curl -X POST "http://localhost:4000/v1/chat/completions" \ }' ``` -This provides clear, explicit conversation tracking that works seamlessly with LiteLLM's session management. +This provides clear, explicit conversation tracking that works seamlessly with LiteLLM's session management. When using monitor mode, the session ID is returned in the `x-pillar-session-id` response header for easy correlation and tracking. ### Actions on Flagged Content @@ -251,6 +251,73 @@ Logs the violation but allows the request to proceed: on_flagged_action: "monitor" ``` +**Response Headers:** + +You can opt in to receiving detection details in response headers by configuring `include_scanners: true` and/or `include_evidence: true`. When enabled, these headers are included for **every request**—not just flagged ones—enabling comprehensive metrics, false positive analysis, and threat investigation. + +- **`x-pillar-flagged`**: Boolean string indicating Pillar's blocking recommendation (`"true"` or `"false"`) +- **`x-pillar-scanners`**: URL-encoded JSON object showing scanner categories (e.g., `%7B%22jailbreak%22%3Atrue%7D`) — requires `include_scanners: true` +- **`x-pillar-evidence`**: URL-encoded JSON array of detection evidence (may contain items even when `flagged` is `false`) — requires `include_evidence: true` +- **`x-pillar-session-id`**: URL-encoded session ID for correlation and investigation + +:::info Understanding `flagged` vs Scanner Results +The `flagged` field is Pillar's **policy-level blocking recommendation**, which may differ from individual scanner results: + +- **`flagged: true`** → Pillar recommends blocking based on your configured policies +- **`flagged: false`** → Pillar does not recommend blocking, but individual scanners may still detect content + +For example, the `toxic_language` scanner might detect profanity (`scanners.toxic_language: true`) while `flagged` remains `false` if your Pillar policy doesn't block on toxic language alone. This allows you to: +- Monitor threats without blocking users +- Build metrics on detection rates vs block rates +- Analyze false positive rates by comparing scanner results to user feedback +::: + +The `x-pillar-scanners`, `x-pillar-evidence`, and `x-pillar-session-id` headers use URL encoding (percent-encoding) to convert JSON data into an ASCII-safe format. This is necessary because HTTP headers only support ISO-8859-1 characters and cannot contain raw JSON special characters (`{`, `"`, `:`) or Unicode text. To read these headers, first URL-decode the value, then parse it as JSON. + +LiteLLM truncates the `x-pillar-evidence` header to a maximum of 8 KB per header to avoid proxy limits. Note that most proxies and servers also enforce a total header size limit of approximately 32 KB across all headers combined. When truncation occurs, each affected evidence item includes an `"evidence_truncated": true` flag and the metadata contains `pillar_evidence_truncated: true`. + +**Example Response Headers (URL-encoded):** +```http +x-pillar-flagged: true +x-pillar-session-id: abc-123-def-456 +x-pillar-scanners: %7B%22jailbreak%22%3Atrue%2C%22prompt_injection%22%3Afalse%2C%22toxic_language%22%3Afalse%7D +x-pillar-evidence: %5B%7B%22category%22%3A%22prompt_injection%22%2C%22evidence%22%3A%22Ignore%20previous%20instructions%22%7D%5D +``` + +**After Decoding:** +```json +// x-pillar-scanners +{"jailbreak": true, "prompt_injection": false, "toxic_language": false} + +// x-pillar-evidence +[{"category": "prompt_injection", "evidence": "Ignore previous instructions"}] +``` + +**Decoding Example (Python):** + +```python +from urllib.parse import unquote +import json + +# Step 1: URL-decode the header value (converts %7B to {, %22 to ", etc.) +# Step 2: Parse the resulting JSON string +scanners = json.loads(unquote(response.headers["x-pillar-scanners"])) +evidence = json.loads(unquote(response.headers["x-pillar-evidence"])) + +# Session ID is a plain string, so only URL-decode is needed (no JSON parsing) +session_id = unquote(response.headers["x-pillar-session-id"]) +``` + +:::tip +LiteLLM mirrors the encoded values onto `metadata["pillar_response_headers"]` so you can inspect exactly what was returned. When truncation occurs, it sets `metadata["pillar_evidence_truncated"]` to `true` and marks affected evidence items with `"evidence_truncated": true`. Evidence text is shortened with a `...[truncated]` suffix, and entire evidence entries may be removed if necessary to stay under the 8 KB header limit. Check these flags to determine if full evidence details are available in your logs. +::: + +This allows your application to: +- Track threats without blocking legitimate users +- Implement custom handling logic based on threat types +- Build analytics and alerting on security events +- Correlate threats across requests using session IDs + ### Resilience and Error Handling #### Graceful Degradation (`fallback_on_error`) @@ -544,6 +611,79 @@ curl -X POST "http://localhost:4000/v1/chat/completions" \ } ``` + + + +**Monitor mode request with scanner detection:** + +```bash +# Test with content that triggers scanner detection +curl -v -X POST "http://localhost:4000/v1/chat/completions" \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer YOUR_LITELLM_PROXY_MASTER_KEY" \ + -d '{ + "model": "gpt-4.1-mini", + "messages": [{"role": "user", "content": "how do I rob a bank?"}], + "max_tokens": 50 + }' +``` + +**Expected response (Allowed with headers):** + +The request succeeds and returns the LLM response. Headers are included for **all requests** when `include_scanners` and `include_evidence` are enabled—even when `flagged` is `false`: + +```http +HTTP/1.1 200 OK +x-litellm-applied-guardrails: pillar-monitor-everything,pillar-monitor-everything +x-pillar-flagged: false +x-pillar-scanners: %7B%22jailbreak%22%3Afalse%2C%22safety%22%3Atrue%2C%22prompt_injection%22%3Afalse%2C%22pii%22%3Afalse%2C%22secret%22%3Afalse%2C%22toxic_language%22%3Afalse%7D +x-pillar-evidence: %5B%7B%22category%22%3A%22safety%22%2C%22type%22%3A%22non_violent_crimes%22%2C%22end_idx%22%3A20%2C%22evidence%22%3A%22how%20do%20I%20rob%20a%20bank%3F%22%2C%22metadata%22%3A%7B%22start_idx%22%3A0%2C%22end_idx%22%3A20%7D%7D%5D +x-pillar-session-id: d9433f86-b428-4ee7-93ee-e97a53f8a180 +``` + +Notice that `x-pillar-flagged: false` but `safety: true` in the scanners. This is because `flagged` represents Pillar's policy-level blocking recommendation, while individual scanners report their own detections. + +```python +from urllib.parse import unquote +import json + +scanners = json.loads(unquote(response.headers["x-pillar-scanners"])) +evidence = json.loads(unquote(response.headers["x-pillar-evidence"])) +session_id = unquote(response.headers["x-pillar-session-id"]) +flagged = response.headers["x-pillar-flagged"] == "true" + +# Scanner detected safety issue, but policy didn't flag for blocking +print(f"Flagged for blocking: {flagged}") # False +print(f"Safety issue detected: {scanners.get('safety')}") # True +print(f"Evidence: {evidence}") +# [{'category': 'safety', 'type': 'non_violent_crimes', 'evidence': 'how do I rob a bank?', ...}] +``` + +```json +{ + "id": "chatcmpl-xyz123", + "object": "chat.completion", + "model": "gpt-4.1-mini", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "I'm sorry, but I can't assist with that request." + }, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 14, + "completion_tokens": 11, + "total_tokens": 25 + } +} +``` + +**Note:** In monitor mode, scanner results and evidence are included in response headers for every request, allowing you to build metrics and analyze detection patterns. The `flagged` field indicates whether Pillar's policy recommends blocking—your application can use the detailed scanner data for custom alerting, analytics, or false positive analysis. + diff --git a/docs/my-website/docs/proxy/prometheus.md b/docs/my-website/docs/proxy/prometheus.md index 2dae463514a..cd2b3b68f37 100644 --- a/docs/my-website/docs/proxy/prometheus.md +++ b/docs/my-website/docs/proxy/prometheus.md @@ -49,6 +49,16 @@ http://localhost:4000/metrics # /metrics ``` +### Multiple Workers + +When using LiteLLM with multiple workers, you need to set the `PROMETHEUS_MULTIPROC_DIR` environment variable to enable aggregated metric collection across worker processes. + +```shell +export PROMETHEUS_MULTIPROC_DIR="/prometheus_multiproc" +``` + +This directory is used by the Prometheus client library to store metric files that can be shared across multiple worker processes. Make sure the directory exists and is writable by your LiteLLM process. + ## Virtual Keys, Teams, Internal Users Use this for for tracking per [user, key, team, etc.](virtual_keys) diff --git a/docs/my-website/docs/proxy/token_auth.md b/docs/my-website/docs/proxy/token_auth.md index 1db1b2a8965..fe928a596cf 100644 --- a/docs/my-website/docs/proxy/token_auth.md +++ b/docs/my-website/docs/proxy/token_auth.md @@ -247,6 +247,26 @@ OIDC Auth for API: [**See Walkthrough**](https://www.loom.com/share/00fe2deab59a - Validate if any group has model access - If all checks pass, allow the request +### Select Team via Request Header + +When a JWT token contains multiple teams (via `team_ids_jwt_field`), you can explicitly select which team to use for a request by passing the `x-litellm-team-id` header. + +```bash +curl -X POST 'http://0.0.0.0:4000/v1/chat/completions' \ +-H 'Content-Type: application/json' \ +-H 'Authorization: Bearer ' \ +-H 'x-litellm-team-id: team_id_2' \ +-d '{ + "model": "gpt-4", + "messages": [{"role": "user", "content": "Hello"}] +}' +``` + +**Validation:** +- The team ID in the header must exist in the JWT's `team_ids_jwt_field` list or match `team_id_jwt_field` +- If an invalid team is specified, a 403 error is returned +- If no header is provided, LiteLLM auto-selects the first team with access to the requested model + ### Custom JWT Validate diff --git a/docs/my-website/sidebars.js b/docs/my-website/sidebars.js index 3b0f399f8e5..22477a8f96f 100644 --- a/docs/my-website/sidebars.js +++ b/docs/my-website/sidebars.js @@ -411,7 +411,13 @@ const sidebars = { label: "/a2a - A2A Agent Gateway", items: [ "a2a", + "a2a_cost_tracking", "a2a_agent_permissions", + { + type: "link", + label: "Adding LangGraph Agents", + href: "/docs/providers/langgraph#litellm-a2a-gateway", + }, ], }, "assistants", diff --git a/enterprise/litellm_enterprise/proxy/hooks/managed_files.py b/enterprise/litellm_enterprise/proxy/hooks/managed_files.py index 608bb495885..6620db5ffa2 100644 --- a/enterprise/litellm_enterprise/proxy/hooks/managed_files.py +++ b/enterprise/litellm_enterprise/proxy/hooks/managed_files.py @@ -22,7 +22,6 @@ from litellm.proxy._types import ( ) from litellm.proxy.openai_files_endpoints.common_utils import ( _is_base64_encoded_unified_file_id, - convert_b64_uid_to_unified_uid, get_batch_id_from_unified_batch_id, get_model_id_from_unified_batch_id, ) @@ -42,6 +41,10 @@ from litellm.types.utils import ( LLMResponseTypes, SpecialEnums, ) +from litellm.proxy.openai_files_endpoints.common_utils import ( + get_content_type_from_file_object, + normalize_mime_type_for_provider, +) if TYPE_CHECKING: from litellm.types.llms.openai import HttpxBinaryResponseContent @@ -108,6 +111,17 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints): if file_object is not None: db_data["file_object"] = file_object.model_dump_json() + # Extract storage metadata from hidden params if present + hidden_params = getattr(file_object, "_hidden_params", {}) or {} + if "storage_backend" in hidden_params: + 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')}" + ) result = await self.prisma_client.db.litellm_managedfiletable.create( data=db_data @@ -268,7 +282,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints): ) return False - async def async_pre_call_hook( + async def async_pre_call_hook( # noqa: PLR0915 self, user_api_key_dict: UserAPIKeyAuth, cache: DualCache, @@ -287,15 +301,31 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints): await self.check_managed_file_id_access(data, user_api_key_dict) ### HANDLE TRANSFORMATIONS ### - if call_type == CallTypes.completion.value: + # Check both completion and acompletion call types + is_completion_call = ( + call_type == CallTypes.completion.value + or call_type == CallTypes.acompletion.value + ) + + if is_completion_call: messages = data.get("messages") + model = data.get("model", "") if messages: file_ids = self.get_file_ids_from_messages(messages) if file_ids: + # 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()) + 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: # Handle managed files in responses API input @@ -865,3 +895,124 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints): ) else: raise Exception(f"LiteLLM Managed File object with id={file_id} not found") + + async def _convert_storage_files_to_base64( + self, + messages: List[AllMessageValues], + file_ids: List[str], + litellm_parent_otel_span: Optional[Span], + ) -> 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. + """ + # Check each file_id to see if it's stored in a storage backend + 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) + except ValueError as e: + verbose_logger.warning( + 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) + + # 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) + except Exception as e: + verbose_logger.exception( + f"Error converting file {file_id} from storage backend to base64: {str(e)}" + ) + # Continue with other files even if one fails + continue + + 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( + self, + messages: List[AllMessageValues], + file_id: str, + base64_data_uri: str, + content_type: str, + ) -> 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 + base64_data_uri: The base64 data URI to use as replacement + content_type: The MIME type of the file (e.g., "image/jpeg", "application/pdf") + """ + for message in messages: + if message.get("role") == "user": + content = message.get("content") + if content and isinstance(content, list): + for element in content: + 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 + # Set format to help Gemini determine mime type + 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/litellm-proxy-extras/litellm_proxy_extras/migrations/20251210125210_add_storage_backend_to_managed_files/migration.sql b/litellm-proxy-extras/litellm_proxy_extras/migrations/20251210125210_add_storage_backend_to_managed_files/migration.sql new file mode 100644 index 00000000000..26f8d31d271 --- /dev/null +++ b/litellm-proxy-extras/litellm_proxy_extras/migrations/20251210125210_add_storage_backend_to_managed_files/migration.sql @@ -0,0 +1,4 @@ +-- AlterTable +ALTER TABLE "LiteLLM_ManagedFileTable" ADD COLUMN IF NOT EXISTS "storage_backend" TEXT; +ALTER TABLE "LiteLLM_ManagedFileTable" ADD COLUMN IF NOT EXISTS "storage_url" TEXT; + diff --git a/litellm/__init__.py b/litellm/__init__.py index 2c6f04a3aef..ef44aa53a13 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -399,7 +399,10 @@ disable_copilot_system_to_assistant: bool = ( public_mcp_servers: Optional[List[str]] = None public_model_groups: Optional[List[str]] = None public_agent_groups: Optional[List[str]] = None -public_model_groups_links: Dict[str, str] = {} +# Supports both old format (Dict[str, str]) and new format (Dict[str, Dict[str, Any]]) +# New format: { "displayName": { "url": "...", "index": 0 } } +# Old format: { "displayName": "url" } (for backward compatibility) +public_model_groups_links: Dict[str, Union[str, Dict[str, Any]]] = {} #### REQUEST PRIORITIZATION ####### priority_reservation: Optional[Dict[str, Union[float, PriorityReservationDict]]] = None priority_reservation_settings: "PriorityReservationSettings" = ( diff --git a/litellm/a2a_protocol/litellm_completion_bridge/handler.py b/litellm/a2a_protocol/litellm_completion_bridge/handler.py index 1f8892c91bf..2eab2551833 100644 --- a/litellm/a2a_protocol/litellm_completion_bridge/handler.py +++ b/litellm/a2a_protocol/litellm_completion_bridge/handler.py @@ -55,6 +55,7 @@ class A2ACompletionBridgeHandler: # Get completion params custom_llm_provider = litellm_params.get("custom_llm_provider") model = litellm_params.get("model", "agent") + api_key = litellm_params.get("api_key") # Build full model string if provider specified # Skip prepending if model already starts with the provider prefix @@ -72,6 +73,7 @@ class A2ACompletionBridgeHandler: model=full_model, messages=openai_messages, api_base=api_base, + api_key=api_key, stream=False, ) @@ -127,6 +129,7 @@ class A2ACompletionBridgeHandler: # Get completion params custom_llm_provider = litellm_params.get("custom_llm_provider") model = litellm_params.get("model", "agent") + api_key = litellm_params.get("api_key") # Build full model string if provider specified # Skip prepending if model already starts with the provider prefix @@ -157,6 +160,7 @@ class A2ACompletionBridgeHandler: model=full_model, messages=openai_messages, api_base=api_base, + api_key=api_key, stream=True, ) diff --git a/litellm/constants.py b/litellm/constants.py index 1dcbe073837..38d3e8a1753 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -54,6 +54,9 @@ MAX_SIZE_PER_ITEM_IN_MEMORY_CACHE_IN_KB = int( SINGLE_DEPLOYMENT_TRAFFIC_FAILURE_THRESHOLD = int( os.getenv("SINGLE_DEPLOYMENT_TRAFFIC_FAILURE_THRESHOLD", 1000) ) # Minimum number of requests to consider "reasonable traffic". Used for single-deployment cooldown logic. +DEFAULT_FAILURE_THRESHOLD_MINIMUM_REQUESTS = int( + os.getenv("DEFAULT_FAILURE_THRESHOLD_MINIMUM_REQUESTS", 5) +) # Minimum number of requests before applying error rate cooldown. Prevents cooldown from triggering on first failure. DEFAULT_REASONING_EFFORT_DISABLE_THINKING_BUDGET = int( os.getenv("DEFAULT_REASONING_EFFORT_DISABLE_THINKING_BUDGET", 0) diff --git a/litellm/files/main.py b/litellm/files/main.py index acf545e4319..a7c82290c29 100644 --- a/litellm/files/main.py +++ b/litellm/files/main.py @@ -27,6 +27,7 @@ from litellm.llms.vertex_ai.files.handler import VertexAIFilesHandler from litellm.types.llms.openai import ( CreateFileRequest, FileContentRequest, + FileExpiresAfter, FileTypes, HttpxBinaryResponseContent, OpenAIFileObject, @@ -58,6 +59,7 @@ anthropic_files_instance = AnthropicFilesHandler() async def acreate_file( file: FileTypes, purpose: Literal["assistants", "batch", "fine-tune"], + expires_after: Optional[FileExpiresAfter] = None, custom_llm_provider: Literal["openai", "azure", "vertex_ai", "bedrock", "hosted_vllm"] = "openai", extra_headers: Optional[Dict[str, str]] = None, extra_body: Optional[Dict[str, str]] = None, @@ -75,6 +77,7 @@ async def acreate_file( call_args = { "file": file, "purpose": purpose, + "expires_after": expires_after, "custom_llm_provider": custom_llm_provider, "extra_headers": extra_headers, "extra_body": extra_body, @@ -83,7 +86,6 @@ async def acreate_file( # Use a partial function to pass your keyword arguments func = partial(create_file, **call_args) - # Add the context to the function ctx = contextvars.copy_context() func_with_context = partial(ctx.run, func) @@ -102,6 +104,7 @@ async def acreate_file( def create_file( file: FileTypes, purpose: Literal["assistants", "batch", "fine-tune"], + expires_after: Optional[FileExpiresAfter] = None, custom_llm_provider: Optional[Literal["openai", "azure", "vertex_ai", "bedrock", "hosted_vllm"]] = None, extra_headers: Optional[Dict[str, str]] = None, extra_body: Optional[Dict[str, str]] = None, @@ -141,12 +144,21 @@ def create_file( elif timeout is None: timeout = 600.0 - _create_file_request = CreateFileRequest( - file=file, - purpose=purpose, - extra_headers=extra_headers, - extra_body=extra_body, - ) + if expires_after is not None: + _create_file_request = CreateFileRequest( + file=file, + purpose=purpose, + expires_after=expires_after, + extra_headers=extra_headers, + extra_body=extra_body, + ) + else: + _create_file_request = CreateFileRequest( + file=file, + purpose=purpose, + extra_headers=extra_headers, + extra_body=extra_body, + ) provider_config = ProviderConfigManager.get_provider_files_config( model="", diff --git a/litellm/integrations/anthropic_cache_control_hook.py b/litellm/integrations/anthropic_cache_control_hook.py index 8b0a96842e1..45b932a73af 100644 --- a/litellm/integrations/anthropic_cache_control_hook.py +++ b/litellm/integrations/anthropic_cache_control_hook.py @@ -7,16 +7,18 @@ Users can define """ import copy -from typing import Dict, List, Optional, Tuple, Union, cast +from typing import Any, Dict, List, Optional, Tuple, Union, cast from litellm._logging import verbose_logger from litellm.integrations.custom_logger import CustomLogger from litellm.integrations.custom_prompt_management import CustomPromptManagement +from litellm.integrations.prompt_management_base import PromptManagementClient from litellm.types.integrations.anthropic_cache_control_hook import ( CacheControlInjectionPoint, CacheControlMessageInjectionPoint, ) from litellm.types.llms.openai import AllMessageValues, ChatCompletionCachedContent +from litellm.types.prompts.init_prompts import PromptSpec from litellm.types.utils import StandardCallbackDynamicParams @@ -29,6 +31,7 @@ class AnthropicCacheControlHook(CustomPromptManagement): prompt_id: Optional[str], prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, ignore_prompt_manager_model: Optional[bool] = False, @@ -141,6 +144,78 @@ class AnthropicCacheControlHook(CustomPromptManagement): """Return the integration name for this hook.""" return "anthropic_cache_control_hook" + def should_run_prompt_management( + self, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], + dynamic_callback_params: StandardCallbackDynamicParams, + ) -> bool: + """Always return False since this is not a true prompt management system.""" + return False + + def _compile_prompt_helper( + self, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> PromptManagementClient: + """Not used - this hook only modifies messages, doesn't fetch prompts.""" + return PromptManagementClient( + prompt_id=prompt_id, + prompt_template=[], + prompt_template_model=None, + prompt_template_optional_params=None, + completed_messages=None, + ) + + async def async_compile_prompt_helper( + self, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> PromptManagementClient: + """Not used - this hook only modifies messages, doesn't fetch prompts.""" + return self._compile_prompt_helper( + prompt_id=prompt_id, + prompt_spec=prompt_spec, + prompt_variables=prompt_variables, + dynamic_callback_params=dynamic_callback_params, + prompt_label=prompt_label, + prompt_version=prompt_version, + ) + + async def async_get_chat_completion_prompt( + self, + model: str, + messages: List[AllMessageValues], + non_default_params: dict, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + litellm_logging_obj: Any, + prompt_spec: Optional[PromptSpec] = None, + tools: Optional[List[Dict]] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> Tuple[str, List[AllMessageValues], dict]: + """Async version - delegates to sync since no async operations needed.""" + return self.get_chat_completion_prompt( + model=model, + messages=messages, + non_default_params=non_default_params, + prompt_id=prompt_id, + prompt_variables=prompt_variables, + dynamic_callback_params=dynamic_callback_params, + prompt_label=prompt_label, + prompt_version=prompt_version, + ) + @staticmethod def should_use_anthropic_cache_control_hook(non_default_params: Dict) -> bool: if non_default_params.get("cache_control_injection_points", None): diff --git a/litellm/integrations/bitbucket/bitbucket_prompt_manager.py b/litellm/integrations/bitbucket/bitbucket_prompt_manager.py index 39759910730..aa6bff5509e 100644 --- a/litellm/integrations/bitbucket/bitbucket_prompt_manager.py +++ b/litellm/integrations/bitbucket/bitbucket_prompt_manager.py @@ -13,6 +13,7 @@ from litellm.integrations.prompt_management_base import ( PromptManagementClient, ) from litellm.types.llms.openai import AllMessageValues +from litellm.types.prompts.init_prompts import PromptSpec from litellm.types.utils import StandardCallbackDynamicParams from .bitbucket_client import BitBucketClient @@ -414,7 +415,8 @@ class BitBucketPromptManager(CustomPromptManagement): def should_run_prompt_management( self, - prompt_id: str, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], dynamic_callback_params: StandardCallbackDynamicParams, ) -> bool: """ @@ -423,11 +425,12 @@ class BitBucketPromptManager(CustomPromptManagement): For BitBucket, we always return True and handle the prompt loading in the _compile_prompt_helper method. """ - return True + return prompt_id is not None def _compile_prompt_helper( self, - prompt_id: str, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, prompt_label: Optional[str] = None, @@ -442,6 +445,9 @@ class BitBucketPromptManager(CustomPromptManagement): 3. Converts the rendered text into chat messages 4. Extracts model and optional parameters from metadata """ + if prompt_id is None: + raise ValueError("prompt_id is required for BitBucket prompt manager") + try: # Load the prompt from BitBucket if not already loaded if prompt_id not in self.prompt_manager.prompts: @@ -481,6 +487,31 @@ class BitBucketPromptManager(CustomPromptManagement): except Exception as e: raise ValueError(f"Error compiling prompt '{prompt_id}': {e}") + async def async_compile_prompt_helper( + self, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> PromptManagementClient: + """ + Async version of compile prompt helper. Since BitBucket operations use sync client, + this simply delegates to the sync version. + """ + if prompt_id is None: + raise ValueError("prompt_id is required for BitBucket prompt manager") + + return self._compile_prompt_helper( + prompt_id=prompt_id, + prompt_spec=prompt_spec, + prompt_variables=prompt_variables, + dynamic_callback_params=dynamic_callback_params, + prompt_label=prompt_label, + prompt_version=prompt_version, + ) + def get_chat_completion_prompt( self, model: str, @@ -489,6 +520,7 @@ class BitBucketPromptManager(CustomPromptManagement): prompt_id: Optional[str], prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, ignore_prompt_manager_model: Optional[bool] = False, @@ -505,6 +537,39 @@ class BitBucketPromptManager(CustomPromptManagement): prompt_id, prompt_variables, dynamic_callback_params, - prompt_label, - prompt_version, + prompt_spec=prompt_spec, + prompt_label=prompt_label, + prompt_version=prompt_version, + ) + + async def async_get_chat_completion_prompt( + self, + model: str, + messages: List[AllMessageValues], + non_default_params: dict, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + litellm_logging_obj: Any, + prompt_spec: Optional[PromptSpec] = None, + tools: Optional[List[Dict]] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> Tuple[str, List[AllMessageValues], dict]: + """ + Async version - delegates to PromptManagementBase async implementation. + """ + return await PromptManagementBase.async_get_chat_completion_prompt( + self, + model, + messages, + non_default_params, + prompt_id=prompt_id, + prompt_variables=prompt_variables, + litellm_logging_obj=litellm_logging_obj, + dynamic_callback_params=dynamic_callback_params, + prompt_spec=prompt_spec, + tools=tools, + prompt_label=prompt_label, + prompt_version=prompt_version, ) diff --git a/litellm/integrations/custom_logger.py b/litellm/integrations/custom_logger.py index 66d5553f5ca..6488128b215 100644 --- a/litellm/integrations/custom_logger.py +++ b/litellm/integrations/custom_logger.py @@ -20,6 +20,7 @@ from litellm.caching.caching import DualCache from litellm.constants import DEFAULT_MAX_RECURSE_DEPTH_SENSITIVE_DATA_MASKER from litellm.types.integrations.argilla import ArgillaItem from litellm.types.llms.openai import AllMessageValues, ChatCompletionRequest +from litellm.types.prompts.init_prompts import PromptSpec from litellm.types.utils import ( AdapterCompletionStreamWrapper, CallTypes, @@ -158,9 +159,12 @@ class CustomLogger: # https://docs.litellm.ai/docs/observability/custom_callbac prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, litellm_logging_obj: LiteLLMLoggingObj, + prompt_spec: Optional[PromptSpec] = None, tools: Optional[List[Dict]] = None, prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, + ignore_prompt_manager_model: Optional[bool] = False, + ignore_prompt_manager_optional_params: Optional[bool] = False, ) -> Tuple[str, List[AllMessageValues], dict]: """ Returns: @@ -178,6 +182,7 @@ class CustomLogger: # https://docs.litellm.ai/docs/observability/custom_callbac prompt_id: Optional[str], prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, ignore_prompt_manager_model: Optional[bool] = False, diff --git a/litellm/integrations/custom_prompt_management.py b/litellm/integrations/custom_prompt_management.py index 401280647bf..875ad8f1ef5 100644 --- a/litellm/integrations/custom_prompt_management.py +++ b/litellm/integrations/custom_prompt_management.py @@ -6,6 +6,7 @@ from litellm.integrations.prompt_management_base import ( PromptManagementClient, ) from litellm.types.llms.openai import AllMessageValues +from litellm.types.prompts.init_prompts import PromptSpec from litellm.types.utils import StandardCallbackDynamicParams @@ -29,6 +30,7 @@ class CustomPromptManagement(CustomLogger, PromptManagementBase): prompt_id: Optional[str], prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, ignore_prompt_manager_model: Optional[bool] = False, @@ -48,14 +50,16 @@ class CustomPromptManagement(CustomLogger, PromptManagementBase): def should_run_prompt_management( self, - prompt_id: str, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], dynamic_callback_params: StandardCallbackDynamicParams, ) -> bool: return True def _compile_prompt_helper( self, - prompt_id: str, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, prompt_label: Optional[str] = None, diff --git a/litellm/integrations/dotprompt/dotprompt_manager.py b/litellm/integrations/dotprompt/dotprompt_manager.py index 53a12914496..e3901bd9359 100644 --- a/litellm/integrations/dotprompt/dotprompt_manager.py +++ b/litellm/integrations/dotprompt/dotprompt_manager.py @@ -9,6 +9,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from litellm.integrations.custom_prompt_management import CustomPromptManagement from litellm.integrations.prompt_management_base import PromptManagementClient from litellm.types.llms.openai import AllMessageValues +from litellm.types.prompts.init_prompts import PromptSpec from litellm.types.utils import StandardCallbackDynamicParams from .prompt_manager import PromptManager, PromptTemplate @@ -82,7 +83,8 @@ class DotpromptManager(CustomPromptManagement): def should_run_prompt_management( self, - prompt_id: str, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], dynamic_callback_params: StandardCallbackDynamicParams, ) -> bool: """ @@ -90,6 +92,8 @@ class DotpromptManager(CustomPromptManagement): Returns True if the prompt_id exists in our prompt manager. """ + if prompt_id is None: + return False try: return prompt_id in self.prompt_manager.list_prompts() except Exception: @@ -98,7 +102,8 @@ class DotpromptManager(CustomPromptManagement): def _compile_prompt_helper( self, - prompt_id: str, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, prompt_label: Optional[str] = None, @@ -114,6 +119,9 @@ class DotpromptManager(CustomPromptManagement): 4. Extracts model and optional parameters from metadata """ + if prompt_id is None: + raise ValueError("prompt_id is required for dotprompt manager") + try: # Get the prompt template (versioned or base) @@ -153,6 +161,31 @@ class DotpromptManager(CustomPromptManagement): except Exception as e: raise ValueError(f"Error compiling prompt '{prompt_id}': {e}") + async def async_compile_prompt_helper( + self, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> PromptManagementClient: + """ + Async version of compile prompt helper. Since dotprompt operations are synchronous, + this simply delegates to the sync version. + """ + if prompt_id is None: + raise ValueError("prompt_id is required for dotprompt manager") + + return self._compile_prompt_helper( + prompt_id=prompt_id, + prompt_spec=prompt_spec, + prompt_variables=prompt_variables, + dynamic_callback_params=dynamic_callback_params, + prompt_label=prompt_label, + prompt_version=prompt_version, + ) + def get_chat_completion_prompt( self, model: str, @@ -161,6 +194,7 @@ class DotpromptManager(CustomPromptManagement): prompt_id: Optional[str], prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, ignore_prompt_manager_model: Optional[bool] = False, @@ -177,8 +211,43 @@ class DotpromptManager(CustomPromptManagement): prompt_id, prompt_variables, dynamic_callback_params, - prompt_label, - prompt_version, + prompt_spec=prompt_spec, + prompt_label=prompt_label, + prompt_version=prompt_version, + ) + + async def async_get_chat_completion_prompt( + self, + model: str, + messages: List[AllMessageValues], + non_default_params: dict, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + litellm_logging_obj: Any, + prompt_spec: Optional[PromptSpec] = None, + tools: Optional[List[Dict]] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> Tuple[str, List[AllMessageValues], dict]: + """ + Async version - delegates to PromptManagementBase async implementation. + """ + from litellm.integrations.prompt_management_base import PromptManagementBase + + return await PromptManagementBase.async_get_chat_completion_prompt( + self, + model, + messages, + non_default_params, + prompt_id=prompt_id, + prompt_variables=prompt_variables, + litellm_logging_obj=litellm_logging_obj, + dynamic_callback_params=dynamic_callback_params, + prompt_spec=prompt_spec, + tools=tools, + prompt_label=prompt_label, + prompt_version=prompt_version, ) def _convert_to_messages(self, rendered_content: str) -> List[AllMessageValues]: diff --git a/litellm/integrations/generic_prompt_management/__init__.py b/litellm/integrations/generic_prompt_management/__init__.py new file mode 100644 index 00000000000..7466dc9c68d --- /dev/null +++ b/litellm/integrations/generic_prompt_management/__init__.py @@ -0,0 +1,80 @@ +"""Generic prompt management integration for LiteLLM.""" + +from typing import TYPE_CHECKING, Optional + +if TYPE_CHECKING: + from .generic_prompt_manager import GenericPromptManager + from litellm.types.prompts.init_prompts import PromptLiteLLMParams, PromptSpec + from litellm.integrations.custom_prompt_management import CustomPromptManagement + +from litellm.types.prompts.init_prompts import SupportedPromptIntegrations + +from .generic_prompt_manager import GenericPromptManager + +# Global instances +global_generic_prompt_config: Optional[dict] = None + + +def set_global_generic_prompt_config(config: dict) -> None: + """ + Set the global generic prompt configuration. + + Args: + config: Dictionary containing generic prompt configuration + - api_base: Base URL for the API + - api_key: Optional API key for authentication + - timeout: Request timeout in seconds (default: 30) + """ + import litellm + + litellm.global_generic_prompt_config = config # type: ignore + + +def prompt_initializer( + litellm_params: "PromptLiteLLMParams", prompt_spec: "PromptSpec" +) -> "CustomPromptManagement": + """ + Initialize a prompt from a generic prompt management API. + """ + prompt_id = getattr(litellm_params, "prompt_id", None) + + api_base = litellm_params.api_base + api_key = litellm_params.api_key + if not api_base: + raise ValueError("api_base is required in generic_prompt_config") + + provider_specific_query_params = litellm_params.provider_specific_query_params + + try: + generic_prompt_manager = GenericPromptManager( + api_base=api_base, + api_key=api_key, + prompt_id=prompt_id, + additional_provider_specific_query_params=provider_specific_query_params, + **litellm_params.model_dump( + exclude_none=True, + exclude={ + "prompt_id", + "api_key", + "provider_specific_query_params", + "api_base", + }, + ), + ) + + return generic_prompt_manager + except Exception as e: + raise e + + +prompt_initializer_registry = { + SupportedPromptIntegrations.GENERIC_PROMPT_MANAGEMENT.value: prompt_initializer, +} + +# Export public API +__all__ = [ + "GenericPromptManager", + "set_global_generic_prompt_config", + "global_generic_prompt_config", + "prompt_initializer_registry", +] diff --git a/litellm/integrations/generic_prompt_management/generic_prompt_manager.py b/litellm/integrations/generic_prompt_management/generic_prompt_manager.py new file mode 100644 index 00000000000..9490d9fde1c --- /dev/null +++ b/litellm/integrations/generic_prompt_management/generic_prompt_manager.py @@ -0,0 +1,501 @@ +""" +Generic prompt manager that integrates with LiteLLM's prompt management system. +Fetches prompts from any API that implements the /beta/litellm_prompt_management endpoint. +""" + +import json +from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple + +import httpx + +from litellm.integrations.custom_prompt_management import CustomPromptManagement +from litellm.integrations.prompt_management_base import ( + PromptManagementBase, + PromptManagementClient, +) +from litellm.llms.custom_httpx.http_handler import ( + _get_httpx_client, + get_async_httpx_client, +) +from litellm.types.llms.custom_http import httpxSpecialProvider +from litellm.types.llms.openai import AllMessageValues +from litellm.types.prompts.init_prompts import PromptSpec +from litellm.types.utils import StandardCallbackDynamicParams + +if TYPE_CHECKING: + from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj + + +class GenericPromptManager(CustomPromptManagement): + """ + Generic prompt manager that integrates with LiteLLM's prompt management system. + + This class enables using prompts from any API that implements the + /beta/litellm_prompt_management endpoint. + + Usage: + # Configure API access + generic_config = { + "api_base": "https://your-api.com", + "api_key": "your-api-key", # optional + "timeout": 30, # optional, defaults to 30 + } + + # Use with completion + response = litellm.completion( + model="generic_prompt/gpt-4", + prompt_id="my_prompt_id", + prompt_variables={"variable": "value"}, + generic_prompt_config=generic_config, + messages=[{"role": "user", "content": "Additional message"}] + ) + """ + + def __init__( + self, + api_base: str, + api_key: Optional[str] = None, + timeout: int = 30, + prompt_id: Optional[str] = None, + additional_provider_specific_query_params: Optional[Dict[str, Any]] = None, + **kwargs, + ): + """ + Initialize the Generic Prompt Manager. + + Args: + api_base: Base URL for the API (e.g., "https://your-api.com") + api_key: Optional API key for authentication + timeout: Request timeout in seconds (default: 30) + prompt_id: Optional prompt ID to pre-load + """ + super().__init__(**kwargs) + self.api_base = api_base.rstrip("/") + self.api_key = api_key + self.timeout = timeout + self.prompt_id = prompt_id + self.additional_provider_specific_query_params = ( + additional_provider_specific_query_params + ) + self._prompt_cache: Dict[str, PromptManagementClient] = {} + + @property + def integration_name(self) -> str: + """Integration name used in model names like 'generic_prompt/gpt-4'.""" + return "generic_prompt" + + def _get_headers(self) -> Dict[str, str]: + """Get HTTP headers for API requests.""" + headers = { + "Content-Type": "application/json", + "Accept": "application/json", + } + if self.api_key: + headers["Authorization"] = f"Bearer {self.api_key}" + return headers + + def _fetch_prompt_from_api( + self, prompt_id: Optional[str], prompt_spec: Optional[PromptSpec] + ) -> Dict[str, Any]: + """ + Fetch a prompt from the API. + + Args: + prompt_id: The ID of the prompt to fetch + + Returns: + The prompt data from the API + + Raises: + Exception: If the API request fails + """ + if prompt_id is None and prompt_spec is None: + raise ValueError("prompt_id or prompt_spec is required") + + url = f"{self.api_base}/beta/litellm_prompt_management" + params = { + "prompt_id": prompt_id, + **(self.additional_provider_specific_query_params or {}), + } + http_client = _get_httpx_client() + + try: + + response = http_client.get( + url, + params=params, + headers=self._get_headers(), + ) + + response.raise_for_status() + return response.json() + except httpx.HTTPError as e: + raise Exception(f"Failed to fetch prompt '{prompt_id}' from API: {e}") + except json.JSONDecodeError as e: + raise Exception(f"Failed to parse prompt response for '{prompt_id}': {e}") + + async def async_fetch_prompt_from_api( + self, prompt_id: Optional[str], prompt_spec: Optional[PromptSpec] + ) -> Dict[str, Any]: + """ + Fetch a prompt from the API asynchronously. + """ + if prompt_id is None and prompt_spec is None: + raise ValueError("prompt_id or prompt_spec is required") + + url = f"{self.api_base}/beta/litellm_prompt_management" + params = { + "prompt_id": prompt_id, + **( + prompt_spec.litellm_params.provider_specific_query_params + if prompt_spec + and prompt_spec.litellm_params.provider_specific_query_params + else {} + ), + } + + http_client = get_async_httpx_client( + llm_provider=httpxSpecialProvider.PromptManagement, + ) + + try: + response = await http_client.get( + url, + params=params, + headers=self._get_headers(), + ) + response.raise_for_status() + return response.json() + except httpx.HTTPError as e: + raise Exception(f"Failed to fetch prompt '{prompt_id}' from API: {e}") + except json.JSONDecodeError as e: + raise Exception(f"Failed to parse prompt response for '{prompt_id}': {e}") + + def _parse_api_response( + self, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], + api_response: Dict[str, Any], + ) -> PromptManagementClient: + """ + Parse the API response into a PromptManagementClient structure. + + Expected API response format: + { + "prompt_id": "string", + "prompt_template": [ + {"role": "system", "content": "..."}, + {"role": "user", "content": "..."} + ], + "prompt_template_model": "gpt-4", # optional + "prompt_template_optional_params": { # optional + "temperature": 0.7, + "max_tokens": 100 + } + } + + Args: + prompt_id: The ID of the prompt + api_response: The response from the API + + Returns: + PromptManagementClient structure + """ + return PromptManagementClient( + prompt_id=prompt_id, + prompt_template=api_response.get("prompt_template", []), + prompt_template_model=api_response.get("prompt_template_model"), + prompt_template_optional_params=api_response.get( + "prompt_template_optional_params" + ), + completed_messages=None, + ) + + def should_run_prompt_management( + self, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], + dynamic_callback_params: StandardCallbackDynamicParams, + ) -> bool: + """ + Determine if prompt management should run based on the prompt_id. + + For Generic Prompt Manager, we always return True and handle the prompt loading + in the _compile_prompt_helper method. + """ + if prompt_id is not None or ( + prompt_spec is not None + and prompt_spec.litellm_params.provider_specific_query_params is not None + ): + return True + return False + + def _get_cache_key( + self, + prompt_id: Optional[str], + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> str: + return f"{prompt_id}:{prompt_label}:{prompt_version}" + + def _common_caching_logic( + self, + prompt_id: Optional[str], + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + prompt_variables: Optional[dict] = None, + ) -> Optional[PromptManagementClient]: + """ + Common caching logic for the prompt manager. + """ + # Check cache first + cache_key = self._get_cache_key(prompt_id, prompt_label, prompt_version) + if cache_key in self._prompt_cache: + cached_prompt = self._prompt_cache[cache_key] + # Return a copy with variables applied if needed + if prompt_variables: + return self._apply_variables(cached_prompt, prompt_variables) + return cached_prompt + return None + + def _compile_prompt_helper( + self, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> PromptManagementClient: + """ + Compile a prompt template into a PromptManagementClient structure. + + This method: + 1. Fetches the prompt from the API (with caching) + 2. Applies any prompt variables (if the API supports it) + 3. Returns the structured prompt data + + Args: + prompt_id: The ID of the prompt + prompt_variables: Variables to substitute in the template (optional) + dynamic_callback_params: Dynamic callback parameters + prompt_label: Optional label for the prompt version + prompt_version: Optional specific version number + + Returns: + PromptManagementClient structure + """ + cached_prompt = self._common_caching_logic( + prompt_id=prompt_id, + prompt_label=prompt_label, + prompt_version=prompt_version, + prompt_variables=prompt_variables, + ) + if cached_prompt: + return cached_prompt + + cache_key = self._get_cache_key(prompt_id, prompt_label, prompt_version) + try: + # Fetch from API + api_response = self._fetch_prompt_from_api(prompt_id, prompt_spec) + + # Parse the response + prompt_client = self._parse_api_response( + prompt_id, prompt_spec, api_response + ) + + # Cache the result + self._prompt_cache[cache_key] = prompt_client + + # Apply variables if provided + if prompt_variables: + prompt_client = self._apply_variables(prompt_client, prompt_variables) + + return prompt_client + + except Exception as e: + raise ValueError(f"Error compiling prompt '{prompt_id}': {e}") + + async def async_compile_prompt_helper( + self, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> PromptManagementClient: + + # Check cache first + cached_prompt = self._common_caching_logic( + prompt_id=prompt_id, + prompt_label=prompt_label, + prompt_version=prompt_version, + prompt_variables=prompt_variables, + ) + if cached_prompt: + return cached_prompt + + cache_key = self._get_cache_key(prompt_id, prompt_label, prompt_version) + + try: + # Fetch from API + + api_response = await self.async_fetch_prompt_from_api( + prompt_id=prompt_id, prompt_spec=prompt_spec + ) + + # Parse the response + prompt_client = self._parse_api_response( + prompt_id, prompt_spec, api_response + ) + + # Cache the result + self._prompt_cache[cache_key] = prompt_client + + # Apply variables if provided + if prompt_variables: + prompt_client = self._apply_variables(prompt_client, prompt_variables) + + return prompt_client + + except Exception as e: + raise ValueError( + f"Error compiling prompt '{prompt_id}': {e}, prompt_spec: {prompt_spec}" + ) + + def _apply_variables( + self, + prompt_client: PromptManagementClient, + variables: Dict[str, Any], + ) -> PromptManagementClient: + """ + Apply variables to the prompt template. + + This performs simple string substitution using {variable_name} syntax. + + Args: + prompt_client: The prompt client structure + variables: Variables to substitute + + Returns: + Updated PromptManagementClient with variables applied + """ + # Create a copy of the prompt template with variables applied + updated_messages: List[AllMessageValues] = [] + for message in prompt_client["prompt_template"]: + updated_message = dict(message) # type: ignore + if "content" in updated_message and isinstance( + updated_message["content"], str + ): + content = updated_message["content"] + for key, value in variables.items(): + content = content.replace(f"{{{key}}}", str(value)) + content = content.replace( + f"{{{{{key}}}}}", str(value) + ) # Also support {{key}} + updated_message["content"] = content + updated_messages.append(updated_message) # type: ignore + + return PromptManagementClient( + prompt_id=prompt_client["prompt_id"], + prompt_template=updated_messages, + prompt_template_model=prompt_client["prompt_template_model"], + prompt_template_optional_params=prompt_client[ + "prompt_template_optional_params" + ], + completed_messages=None, + ) + + async def async_get_chat_completion_prompt( + self, + model: str, + messages: List[AllMessageValues], + non_default_params: dict, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + litellm_logging_obj: "LiteLLMLoggingObj", + prompt_spec: Optional[PromptSpec] = None, + tools: Optional[List[Dict]] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ignore_prompt_manager_model: Optional[bool] = False, + ignore_prompt_manager_optional_params: Optional[bool] = False, + ) -> Tuple[str, List[AllMessageValues], dict]: + """ + Get chat completion prompt and return processed model, messages, and parameters. + """ + + return await PromptManagementBase.async_get_chat_completion_prompt( + self, + model, + messages, + non_default_params, + prompt_id=prompt_id, + prompt_variables=prompt_variables, + litellm_logging_obj=litellm_logging_obj, + dynamic_callback_params=dynamic_callback_params, + prompt_spec=prompt_spec, + tools=tools, + prompt_label=prompt_label, + prompt_version=prompt_version, + ignore_prompt_manager_model=( + ignore_prompt_manager_model + or prompt_spec.litellm_params.ignore_prompt_manager_model + if prompt_spec + else False + ), + ignore_prompt_manager_optional_params=( + ignore_prompt_manager_optional_params + or prompt_spec.litellm_params.ignore_prompt_manager_optional_params + if prompt_spec + else False + ), + ) + + def get_chat_completion_prompt( + self, + model: str, + messages: List[AllMessageValues], + non_default_params: dict, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ignore_prompt_manager_model: Optional[bool] = False, + ignore_prompt_manager_optional_params: Optional[bool] = False, + ) -> Tuple[str, List[AllMessageValues], dict]: + """ + Get chat completion prompt and return processed model, messages, and parameters. + """ + return PromptManagementBase.get_chat_completion_prompt( + self, + model, + messages, + non_default_params, + prompt_id=prompt_id, + prompt_variables=prompt_variables, + dynamic_callback_params=dynamic_callback_params, + prompt_spec=prompt_spec, + prompt_label=prompt_label, + prompt_version=prompt_version, + ignore_prompt_manager_model=( + ignore_prompt_manager_model + or prompt_spec.litellm_params.ignore_prompt_manager_model + if prompt_spec + else False + ), + ignore_prompt_manager_optional_params=( + ignore_prompt_manager_optional_params + or prompt_spec.litellm_params.ignore_prompt_manager_optional_params + if prompt_spec + else False + ), + ) + + def clear_cache(self) -> None: + """Clear the prompt cache.""" + self._prompt_cache.clear() diff --git a/litellm/integrations/gitlab/gitlab_prompt_manager.py b/litellm/integrations/gitlab/gitlab_prompt_manager.py index 9931c007dc7..85335a811a3 100644 --- a/litellm/integrations/gitlab/gitlab_prompt_manager.py +++ b/litellm/integrations/gitlab/gitlab_prompt_manager.py @@ -13,6 +13,7 @@ from litellm.integrations.prompt_management_base import ( PromptManagementClient, ) from litellm.types.llms.openai import AllMessageValues +from litellm.types.prompts.init_prompts import PromptSpec from litellm.types.utils import StandardCallbackDynamicParams GITLAB_PREFIX = "gitlab::" @@ -454,19 +455,24 @@ class GitLabPromptManager(CustomPromptManagement): def should_run_prompt_management( self, - prompt_id: str, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], dynamic_callback_params: StandardCallbackDynamicParams, ) -> bool: - return True + return prompt_id is not None def _compile_prompt_helper( self, - prompt_id: str, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, ) -> PromptManagementClient: + if prompt_id is None: + raise ValueError("prompt_id is required for GitLab prompt manager") + try: decoded_id = decode_prompt_id(prompt_id) if decoded_id not in self.prompt_manager.prompts: @@ -505,6 +511,31 @@ class GitLabPromptManager(CustomPromptManagement): except Exception as e: raise ValueError(f"Error compiling prompt '{prompt_id}': {e}") + async def async_compile_prompt_helper( + self, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> PromptManagementClient: + """ + Async version of compile prompt helper. Since GitLab operations use sync client, + this simply delegates to the sync version. + """ + if prompt_id is None: + raise ValueError("prompt_id is required for GitLab prompt manager") + + return self._compile_prompt_helper( + prompt_id=prompt_id, + prompt_spec=prompt_spec, + prompt_variables=prompt_variables, + dynamic_callback_params=dynamic_callback_params, + prompt_label=prompt_label, + prompt_version=prompt_version, + ) + def get_chat_completion_prompt( self, model: str, @@ -513,6 +544,7 @@ class GitLabPromptManager(CustomPromptManagement): prompt_id: Optional[str], prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, ignore_prompt_manager_model: Optional[bool] = False, @@ -526,8 +558,41 @@ class GitLabPromptManager(CustomPromptManagement): prompt_id, prompt_variables, dynamic_callback_params, - prompt_label, - prompt_version, + prompt_spec=prompt_spec, + prompt_label=prompt_label, + prompt_version=prompt_version, + ) + + async def async_get_chat_completion_prompt( + self, + model: str, + messages: List[AllMessageValues], + non_default_params: dict, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + litellm_logging_obj: Any, + prompt_spec: Optional[PromptSpec] = None, + tools: Optional[List[Dict]] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> Tuple[str, List[AllMessageValues], dict]: + """ + Async version - delegates to PromptManagementBase async implementation. + """ + return await PromptManagementBase.async_get_chat_completion_prompt( + self, + model, + messages, + non_default_params, + prompt_id=prompt_id, + prompt_variables=prompt_variables, + litellm_logging_obj=litellm_logging_obj, + dynamic_callback_params=dynamic_callback_params, + prompt_spec=prompt_spec, + tools=tools, + prompt_label=prompt_label, + prompt_version=prompt_version, ) diff --git a/litellm/integrations/langfuse/langfuse_prompt_management.py b/litellm/integrations/langfuse/langfuse_prompt_management.py index ebab9840036..8e562238cc7 100644 --- a/litellm/integrations/langfuse/langfuse_prompt_management.py +++ b/litellm/integrations/langfuse/langfuse_prompt_management.py @@ -13,6 +13,7 @@ from litellm.integrations.custom_logger import CustomLogger from litellm.integrations.prompt_management_base import PromptManagementClient from litellm.litellm_core_utils.asyncify import run_async_function from litellm.types.llms.openai import AllMessageValues, ChatCompletionSystemMessage +from litellm.types.prompts.init_prompts import PromptSpec from litellm.types.utils import StandardCallbackDynamicParams, StandardLoggingPayload from ...litellm_core_utils.specialty_caches.dynamic_logging_cache import ( @@ -183,6 +184,7 @@ class LangfusePromptManagement(LangFuseLogger, PromptManagementBase, CustomLogge prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, litellm_logging_obj: LiteLLMLoggingObj, + prompt_spec: Optional[PromptSpec] = None, tools: Optional[List[Dict]] = None, prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, @@ -200,9 +202,12 @@ class LangfusePromptManagement(LangFuseLogger, PromptManagementBase, CustomLogge def should_run_prompt_management( self, - prompt_id: str, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], dynamic_callback_params: StandardCallbackDynamicParams, ) -> bool: + if prompt_id is None: + return False langfuse_client = langfuse_client_init( langfuse_public_key=dynamic_callback_params.get("langfuse_public_key"), langfuse_secret=dynamic_callback_params.get("langfuse_secret"), @@ -217,12 +222,16 @@ class LangfusePromptManagement(LangFuseLogger, PromptManagementBase, CustomLogge def _compile_prompt_helper( self, - prompt_id: str, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, ) -> PromptManagementClient: + if prompt_id is None: + raise ValueError("prompt_id is required for Langfuse prompt management") + langfuse_client = langfuse_client_init( langfuse_public_key=dynamic_callback_params.get("langfuse_public_key"), langfuse_secret=dynamic_callback_params.get("langfuse_secret"), @@ -257,6 +266,24 @@ class LangfusePromptManagement(LangFuseLogger, PromptManagementBase, CustomLogge completed_messages=None, ) + async def async_compile_prompt_helper( + self, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> PromptManagementClient: + return self._compile_prompt_helper( + prompt_id=prompt_id, + prompt_variables=prompt_variables, + dynamic_callback_params=dynamic_callback_params, + prompt_spec=prompt_spec, + prompt_label=prompt_label, + prompt_version=prompt_version, + ) + def log_success_event(self, kwargs, response_obj, start_time, end_time): return run_async_function( self.async_log_success_event, kwargs, response_obj, start_time, end_time diff --git a/litellm/integrations/opentelemetry.py b/litellm/integrations/opentelemetry.py index 9f9d45d0e7d..c82a715ce4d 100644 --- a/litellm/integrations/opentelemetry.py +++ b/litellm/integrations/opentelemetry.py @@ -248,6 +248,9 @@ class OpenTelemetry(CustomLogger): self._operation_duration_histogram = None self._token_usage_histogram = None self._cost_histogram = None + self._time_to_first_token_histogram = None + self._time_per_output_token_histogram = None + self._response_duration_histogram = None return from opentelemetry import metrics @@ -300,6 +303,21 @@ class OpenTelemetry(CustomLogger): description="GenAI request cost", unit="USD", ) + self._time_to_first_token_histogram = meter.create_histogram( + name="gen_ai.client.response.time_to_first_token", + description="Time to first token for streaming requests", + unit="s", + ) + self._time_per_output_token_histogram = meter.create_histogram( + name="gen_ai.client.response.time_per_output_token", + description="Average time per output token (generation time / completion tokens)", + unit="s", + ) + self._response_duration_histogram = meter.create_histogram( + name="gen_ai.client.response.duration", + description="Total LLM API generation time (excludes LiteLLM overhead)", + unit="s", + ) def _init_logs(self, logger_provider): # nothing to do if events disabled @@ -612,8 +630,9 @@ class OpenTelemetry(CustomLogger): if self.config.enable_events: self._emit_semantic_logs(kwargs, response_obj, span) - # 6. End parent span - if parent_span is not None: + # 6. End parent span (only if it wasn't reused as the primary span) + # If parent_span was reused as the primary span, it was already ended in _start_primary_span + if parent_span is not None and parent_span is not span: parent_span.end(end_time=self._to_ns(datetime.now())) def _start_primary_span( @@ -727,6 +746,152 @@ class OpenTelemetry(CustomLogger): if self._cost_histogram and cost: self._cost_histogram.record(cost, attributes=common_attrs) + # Record latency metrics (TTFT, TPOT, and Total Generation Time) + self._record_time_to_first_token_metric(kwargs, common_attrs) + self._record_time_per_output_token_metric( + kwargs, response_obj, end_time, duration_s, common_attrs + ) + self._record_response_duration_metric(kwargs, end_time, common_attrs) + + def _record_time_to_first_token_metric(self, kwargs: dict, common_attrs: dict): + """Record Time to First Token (TTFT) metric for streaming requests.""" + optional_params = kwargs.get("optional_params", {}) + is_streaming = optional_params.get("stream", False) + + if not (self._time_to_first_token_histogram and is_streaming): + return + + # Use api_call_start_time for precision (matches Prometheus implementation) + # This excludes LiteLLM overhead and measures pure LLM API latency + api_call_start_time = kwargs.get("api_call_start_time", None) + completion_start_time = kwargs.get("completion_start_time", None) + + if api_call_start_time is not None and completion_start_time is not None: + # Convert to timestamps if needed (handles both datetime and float) + if isinstance(api_call_start_time, datetime): + api_call_start_ts = api_call_start_time.timestamp() + else: + api_call_start_ts = api_call_start_time + + if isinstance(completion_start_time, datetime): + completion_start_ts = completion_start_time.timestamp() + else: + completion_start_ts = completion_start_time + + time_to_first_token_seconds = completion_start_ts - api_call_start_ts + self._time_to_first_token_histogram.record( + time_to_first_token_seconds, attributes=common_attrs + ) + + def _record_time_per_output_token_metric( + self, + kwargs: dict, + response_obj: Optional[Any], + end_time: datetime, + duration_s: float, + common_attrs: dict, + ): + """Record Time Per Output Token (TPOT) metric. + + Calculated as: generation_time / completion_tokens + - For streaming: uses end_time - completion_start_time (time to generate all tokens after first) + - For non-streaming: uses end_time - api_call_start_time (total generation time) + """ + if not self._time_per_output_token_histogram: + return + + # Get completion tokens from response_obj + completion_tokens = None + if response_obj and (usage := response_obj.get("usage")): + completion_tokens = usage.get("completion_tokens") + + if completion_tokens is None or completion_tokens <= 0: + return + + # Calculate generation time + completion_start_time = kwargs.get("completion_start_time", None) + api_call_start_time = kwargs.get("api_call_start_time", None) + + # Convert end_time to timestamp + if isinstance(end_time, datetime): + end_time_ts = end_time.timestamp() + else: + end_time_ts = end_time + + if completion_start_time is not None: + # Streaming: use completion_start_time (when first token arrived) + # This measures time to generate all tokens after the first one + if isinstance(completion_start_time, datetime): + completion_start_ts = completion_start_time.timestamp() + else: + completion_start_ts = completion_start_time + + generation_time_seconds = end_time_ts - completion_start_ts + elif api_call_start_time is not None: + # Non-streaming: use api_call_start_time (total generation time) + if isinstance(api_call_start_time, datetime): + api_call_start_ts = api_call_start_time.timestamp() + else: + api_call_start_ts = api_call_start_time + + generation_time_seconds = end_time_ts - api_call_start_ts + else: + # Fallback: use duration_s (already calculated as (end_time - start_time).total_seconds()) + generation_time_seconds = duration_s + + if generation_time_seconds > 0: + time_per_output_token_seconds = generation_time_seconds / completion_tokens + self._time_per_output_token_histogram.record( + time_per_output_token_seconds, attributes=common_attrs + ) + + def _record_response_duration_metric( + self, + kwargs: dict, + end_time: Union[datetime, float], + common_attrs: dict, + ): + """Record Total Generation Time (response duration) metric. + + Measures pure LLM API generation time: end_time - api_call_start_time + This excludes LiteLLM overhead and measures only the LLM provider's response time. + Works for both streaming and non-streaming requests. + + Mirrors Prometheus's litellm_llm_api_latency_metric. + Uses kwargs.get("end_time") with fallback to parameter for consistency with Prometheus. + """ + if not self._response_duration_histogram: + return + + api_call_start_time = kwargs.get("api_call_start_time", None) + if api_call_start_time is None: + return + + # Use end_time from kwargs if available (matches Prometheus), otherwise use parameter + # For streaming: end_time is when the stream completes (final chunk received) + # For non-streaming: end_time is when the response is received + _end_time = kwargs.get("end_time") or end_time + if _end_time is None: + _end_time = datetime.now() + + # Convert to timestamps if needed (handles both datetime and float) + if isinstance(api_call_start_time, datetime): + api_call_start_ts = api_call_start_time.timestamp() + else: + api_call_start_ts = api_call_start_time + + if isinstance(_end_time, datetime): + end_time_ts = _end_time.timestamp() + else: + end_time_ts = _end_time + + response_duration_seconds = end_time_ts - api_call_start_ts + + if response_duration_seconds > 0: + self._response_duration_histogram.record( + response_duration_seconds, attributes=common_attrs + ) + def _emit_semantic_logs(self, kwargs, response_obj, span: Span): if not self.config.enable_events: return @@ -1226,7 +1391,7 @@ class OpenTelemetry(CustomLogger): value=usage.get("prompt_tokens"), ) - ######################################################################## + ######################################################################## ########## LLM Request Medssages / tools / content Attributes ########### ######################################################################### diff --git a/litellm/integrations/prompt_management_base.py b/litellm/integrations/prompt_management_base.py index 90321ad0fa8..b32f78c0dea 100644 --- a/litellm/integrations/prompt_management_base.py +++ b/litellm/integrations/prompt_management_base.py @@ -1,14 +1,18 @@ from abc import ABC, abstractmethod from typing import Any, Dict, List, Optional, Tuple -from typing_extensions import TypedDict +from typing_extensions import TYPE_CHECKING, TypedDict from litellm.types.llms.openai import AllMessageValues +from litellm.types.prompts.init_prompts import PromptSpec from litellm.types.utils import StandardCallbackDynamicParams +if TYPE_CHECKING: + from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj + class PromptManagementClient(TypedDict): - prompt_id: str + prompt_id: Optional[str] prompt_template: List[AllMessageValues] prompt_template_model: Optional[str] prompt_template_optional_params: Optional[Dict[str, Any]] @@ -24,7 +28,8 @@ class PromptManagementBase(ABC): @abstractmethod def should_run_prompt_management( self, - prompt_id: str, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], dynamic_callback_params: StandardCallbackDynamicParams, ) -> bool: pass @@ -32,7 +37,8 @@ class PromptManagementBase(ABC): @abstractmethod def _compile_prompt_helper( self, - prompt_id: str, + prompt_id: Optional[str], + prompt_spec: Optional[PromptSpec], prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, prompt_label: Optional[str] = None, @@ -40,6 +46,18 @@ class PromptManagementBase(ABC): ) -> PromptManagementClient: pass + @abstractmethod + async def async_compile_prompt_helper( + self, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> PromptManagementClient: + pass + def merge_messages( self, prompt_template: List[AllMessageValues], @@ -55,10 +73,41 @@ class PromptManagementBase(ABC): dynamic_callback_params: StandardCallbackDynamicParams, prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, + prompt_spec: Optional[PromptSpec] = None, ) -> PromptManagementClient: compiled_prompt_client = self._compile_prompt_helper( prompt_id=prompt_id, + prompt_spec=prompt_spec, + prompt_variables=prompt_variables, + dynamic_callback_params=dynamic_callback_params, + prompt_label=prompt_label, + prompt_version=prompt_version, + ) + + try: + messages = compiled_prompt_client["prompt_template"] + client_messages + except Exception as e: + raise ValueError( + f"Error compiling prompt: {e}. Prompt id={prompt_id}, prompt_variables={prompt_variables}, client_messages={client_messages}, dynamic_callback_params={dynamic_callback_params}" + ) + + compiled_prompt_client["completed_messages"] = messages + return compiled_prompt_client + + async def async_compile_prompt( + self, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + client_messages: List[AllMessageValues], + dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ) -> PromptManagementClient: + compiled_prompt_client = await self.async_compile_prompt_helper( + prompt_id=prompt_id, + prompt_spec=prompt_spec, prompt_variables=prompt_variables, dynamic_callback_params=dynamic_callback_params, prompt_label=prompt_label, @@ -83,6 +132,39 @@ class PromptManagementBase(ABC): else: return model.replace("{}/".format(self.integration_name), "") + def post_compile_prompt_processing( + self, + prompt_template: PromptManagementClient, + messages: List[AllMessageValues], + non_default_params: dict, + model: str, + ignore_prompt_manager_model: Optional[bool] = False, + ignore_prompt_manager_optional_params: Optional[bool] = False, + ): + completed_messages = prompt_template["completed_messages"] or messages + + prompt_template_optional_params = ( + prompt_template["prompt_template_optional_params"] or {} + ) + + updated_non_default_params = { + **non_default_params, + **( + prompt_template_optional_params + if not ignore_prompt_manager_optional_params + else {} + ), + } + + if not ignore_prompt_manager_model: + model = self._get_model_from_prompt( + prompt_management_client=prompt_template, model=model + ) + else: + model = model + + return model, completed_messages, updated_non_default_params + def get_chat_completion_prompt( self, model: str, @@ -91,6 +173,7 @@ class PromptManagementBase(ABC): prompt_id: Optional[str], prompt_variables: Optional[dict], dynamic_callback_params: StandardCallbackDynamicParams, + prompt_spec: Optional[PromptSpec] = None, prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, ignore_prompt_manager_model: Optional[bool] = False, @@ -100,7 +183,9 @@ class PromptManagementBase(ABC): if prompt_id is None: raise ValueError("prompt_id is required for Prompt Management Base class") if not self.should_run_prompt_management( - prompt_id=prompt_id, dynamic_callback_params=dynamic_callback_params + prompt_id=prompt_id, + prompt_spec=prompt_spec, + dynamic_callback_params=dynamic_callback_params, ): return model, messages, non_default_params @@ -113,26 +198,53 @@ class PromptManagementBase(ABC): prompt_version=prompt_version, ) - completed_messages = prompt_template["completed_messages"] or messages - - prompt_template_optional_params = ( - prompt_template["prompt_template_optional_params"] or {} + return self.post_compile_prompt_processing( + prompt_template=prompt_template, + messages=messages, + non_default_params=non_default_params, + model=model, + ignore_prompt_manager_model=ignore_prompt_manager_model, + ignore_prompt_manager_optional_params=ignore_prompt_manager_optional_params, ) - if not ignore_prompt_manager_optional_params: - updated_non_default_params = { - **non_default_params, - **prompt_template_optional_params, - } - else: - updated_non_default_params = non_default_params + async def async_get_chat_completion_prompt( + self, + model: str, + messages: List[AllMessageValues], + non_default_params: dict, + prompt_id: Optional[str], + prompt_variables: Optional[dict], + dynamic_callback_params: StandardCallbackDynamicParams, + litellm_logging_obj: "LiteLLMLoggingObj", + prompt_spec: Optional[PromptSpec] = None, + tools: Optional[List[Dict]] = None, + prompt_label: Optional[str] = None, + prompt_version: Optional[int] = None, + ignore_prompt_manager_model: Optional[bool] = False, + ignore_prompt_manager_optional_params: Optional[bool] = False, + ) -> Tuple[str, List[AllMessageValues], dict]: + if not self.should_run_prompt_management( + prompt_id=prompt_id, + prompt_spec=prompt_spec, + dynamic_callback_params=dynamic_callback_params, + ): + return model, messages, non_default_params - if not ignore_prompt_manager_model: - model = self._get_model_from_prompt( - prompt_management_client=prompt_template, model=model - ) - else: - model = model + prompt_template = await self.async_compile_prompt( + prompt_id=prompt_id, + prompt_variables=prompt_variables, + client_messages=messages, + dynamic_callback_params=dynamic_callback_params, + prompt_spec=prompt_spec, + prompt_label=prompt_label, + prompt_version=prompt_version, + ) - - return model, completed_messages, updated_non_default_params + return self.post_compile_prompt_processing( + prompt_template=prompt_template, + messages=messages, + non_default_params=non_default_params, + model=model, + ignore_prompt_manager_model=ignore_prompt_manager_model, + ignore_prompt_manager_optional_params=ignore_prompt_manager_optional_params, + ) diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py index e1277138456..f2f6a785969 100644 --- a/litellm/litellm_core_utils/litellm_logging.py +++ b/litellm/litellm_core_utils/litellm_logging.py @@ -85,6 +85,7 @@ from litellm.types.llms.openai import ( ResponsesAPIResponse, ) from litellm.types.mcp import MCPPostCallResponseObject +from litellm.types.prompts.init_prompts import PromptSpec from litellm.types.rerank import RerankResponse from litellm.types.utils import ( CachingDetails, @@ -265,6 +266,7 @@ def _get_cached_prometheus_logger(): global _PrometheusLogger if _PrometheusLogger is None: from litellm.integrations.prometheus import PrometheusLogger + _PrometheusLogger = PrometheusLogger return _PrometheusLogger @@ -601,8 +603,9 @@ class Logging(LiteLLMLoggingBaseClass): model: str, messages: List[AllMessageValues], non_default_params: Dict, - prompt_id: Optional[str], prompt_variables: Optional[dict], + prompt_id: Optional[str] = None, + prompt_spec: Optional[PromptSpec] = None, prompt_management_logger: Optional[CustomLogger] = None, prompt_label: Optional[str] = None, prompt_version: Optional[int] = None, @@ -613,6 +616,7 @@ class Logging(LiteLLMLoggingBaseClass): model=model, non_default_params=non_default_params, prompt_id=prompt_id, + prompt_spec=prompt_spec, dynamic_callback_params=self.standard_callback_dynamic_params, ) ) @@ -627,6 +631,7 @@ class Logging(LiteLLMLoggingBaseClass): messages=messages, non_default_params=non_default_params or {}, prompt_id=prompt_id, + prompt_spec=prompt_spec, prompt_variables=prompt_variables, dynamic_callback_params=self.standard_callback_dynamic_params, prompt_label=prompt_label, @@ -640,8 +645,9 @@ class Logging(LiteLLMLoggingBaseClass): model: str, messages: List[AllMessageValues], non_default_params: Dict, - prompt_id: Optional[str], prompt_variables: Optional[dict], + prompt_id: Optional[str] = None, + prompt_spec: Optional[PromptSpec] = None, prompt_management_logger: Optional[CustomLogger] = None, tools: Optional[List[Dict]] = None, prompt_label: Optional[str] = None, @@ -654,6 +660,7 @@ class Logging(LiteLLMLoggingBaseClass): tools=tools, non_default_params=non_default_params, prompt_id=prompt_id, + prompt_spec=prompt_spec, dynamic_callback_params=self.standard_callback_dynamic_params, ) ) @@ -668,6 +675,7 @@ class Logging(LiteLLMLoggingBaseClass): messages=messages, non_default_params=non_default_params or {}, prompt_id=prompt_id, + prompt_spec=prompt_spec, prompt_variables=prompt_variables, dynamic_callback_params=self.standard_callback_dynamic_params, litellm_logging_obj=self, @@ -681,6 +689,7 @@ class Logging(LiteLLMLoggingBaseClass): def _auto_detect_prompt_management_logger( self, prompt_id: str, + prompt_spec: Optional[PromptSpec], dynamic_callback_params: StandardCallbackDynamicParams, ) -> Optional[CustomLogger]: """ @@ -706,6 +715,7 @@ class Logging(LiteLLMLoggingBaseClass): try: if logger.should_run_prompt_management( prompt_id=prompt_id, + prompt_spec=prompt_spec, dynamic_callback_params=dynamic_callback_params, ): self.model_call_details["prompt_integration"] = ( @@ -724,6 +734,7 @@ class Logging(LiteLLMLoggingBaseClass): non_default_params: Dict, tools: Optional[List[Dict]] = None, prompt_id: Optional[str] = None, + prompt_spec: Optional[PromptSpec] = None, dynamic_callback_params: Optional[StandardCallbackDynamicParams] = None, ) -> Optional[CustomLogger]: """ @@ -756,6 +767,7 @@ class Logging(LiteLLMLoggingBaseClass): if prompt_id and dynamic_callback_params is not None: auto_detected_logger = self._auto_detect_prompt_management_logger( prompt_id=prompt_id, + prompt_spec=prompt_spec, dynamic_callback_params=dynamic_callback_params, ) if auto_detected_logger is not None: @@ -3516,7 +3528,7 @@ def _init_custom_logger_compatible_class( # noqa: PLR0915 return _literalai_logger # type: ignore elif logging_integration == "prometheus": PrometheusLogger = _get_cached_prometheus_logger() - + for callback in _in_memory_loggers: if isinstance(callback, PrometheusLogger): return callback # type: ignore @@ -3835,9 +3847,7 @@ def _init_custom_logger_compatible_class( # noqa: PLR0915 _in_memory_loggers.append(_otel_logger) return _otel_logger # type: ignore elif logging_integration == "weave_otel": - from litellm.integrations.opentelemetry import ( - OpenTelemetryConfig, - ) + from litellm.integrations.opentelemetry import OpenTelemetryConfig from litellm.integrations.weave.weave_otel import ( WeaveOtelLogger, get_weave_otel_config, diff --git a/litellm/llms/base_llm/files/azure_blob_storage_backend.py b/litellm/llms/base_llm/files/azure_blob_storage_backend.py new file mode 100644 index 00000000000..db3aa50d89a --- /dev/null +++ b/litellm/llms/base_llm/files/azure_blob_storage_backend.py @@ -0,0 +1,312 @@ +""" +Azure Blob Storage backend implementation for file storage. + +This module implements the Azure Blob Storage backend for storing files +in Azure Data Lake Storage Gen2. It inherits from AzureBlobStorageLogger +to reuse all authentication and Azure Storage operations. +""" + +import time +from typing import Optional +from urllib.parse import quote + +from litellm._logging import verbose_logger +from litellm._uuid import uuid + +from .storage_backend import BaseFileStorageBackend +from litellm.integrations.azure_storage.azure_storage import AzureBlobStorageLogger + + +class AzureBlobStorageBackend(BaseFileStorageBackend, AzureBlobStorageLogger): + """ + Azure Blob Storage backend implementation. + + Inherits from AzureBlobStorageLogger to reuse: + - Authentication (account key and Azure AD) + - Service client management + - Token management + - All Azure Storage helper methods + + Reads configuration from the same environment variables as AzureBlobStorageLogger. + """ + + def __init__(self, **kwargs): + """ + Initialize Azure Blob Storage backend. + + Inherits all functionality from AzureBlobStorageLogger which handles: + - Reading environment variables + - Authentication (account key and Azure AD) + - Service client management + - Token management + + Environment variables (same as AzureBlobStorageLogger): + - AZURE_STORAGE_ACCOUNT_NAME (required) + - AZURE_STORAGE_FILE_SYSTEM (required) + - AZURE_STORAGE_ACCOUNT_KEY (optional, if using account key auth) + - AZURE_STORAGE_TENANT_ID (optional, if using Azure AD) + - AZURE_STORAGE_CLIENT_ID (optional, if using Azure AD) + - AZURE_STORAGE_CLIENT_SECRET (optional, if using Azure AD) + + Note: We skip periodic_flush since we're not using this as a logger. + """ + # Initialize AzureBlobStorageLogger (handles all auth and config) + AzureBlobStorageLogger.__init__(self, **kwargs) + + # Disable logging functionality - we're only using this for file storage + # The periodic_flush task will be created but will do nothing since we override it + + async def periodic_flush(self): + """ + Override to do nothing - we're not using this as a logger. + This prevents the periodic flush task from doing any work. + """ + # Do nothing - this class is used for file storage, not logging + return + + async def async_log_success_event(self, *args, **kwargs): + """ + Override to do nothing - we're not using this as a logger. + """ + # Do nothing - this class is used for file storage, not logging + pass + + async def async_log_failure_event(self, *args, **kwargs): + """ + Override to do nothing - we're not using this as a logger. + """ + # Do nothing - this class is used for file storage, not logging + pass + + def _generate_file_name( + self, original_filename: str, file_naming_strategy: str + ) -> str: + """Generate file name based on naming strategy.""" + if file_naming_strategy == "original_filename": + # Use original filename, but sanitize it + return quote(original_filename, safe="") + elif file_naming_strategy == "timestamp": + # Use timestamp + extension = original_filename.split(".")[-1] if "." in original_filename else "" + timestamp = int(time.time() * 1000) # milliseconds + return f"{timestamp}.{extension}" if extension else str(timestamp) + else: # default to "uuid" + # Use UUID + extension = original_filename.split(".")[-1] if "." in original_filename else "" + file_uuid = str(uuid.uuid4()) + return f"{file_uuid}.{extension}" if extension else file_uuid + + async def upload_file( + self, + file_content: bytes, + filename: str, + content_type: str, + path_prefix: Optional[str] = None, + file_naming_strategy: str = "uuid", + ) -> str: + """ + Upload a file to Azure Blob Storage. + + Returns the blob URL in format: https://{account}.blob.core.windows.net/{container}/{path} + """ + try: + # Generate file name + file_name = self._generate_file_name(filename, file_naming_strategy) + + # Build full path + if path_prefix: + # Remove leading/trailing slashes and normalize + prefix = path_prefix.strip("/") + full_path = f"{prefix}/{file_name}" + else: + full_path = file_name + + if self.azure_storage_account_key: + # Use Azure SDK with account key (reuse logger's method) + storage_url = await self._upload_file_with_account_key( + file_content=file_content, + full_path=full_path, + ) + else: + # Use REST API with Azure AD token (reuse logger's methods) + storage_url = await self._upload_file_with_azure_ad( + file_content=file_content, + full_path=full_path, + ) + + verbose_logger.debug( + f"Successfully uploaded file to Azure Blob Storage: {storage_url}" + ) + return storage_url + + except Exception as e: + verbose_logger.exception(f"Error uploading file to Azure Blob Storage: {str(e)}") + raise + + async def _upload_file_with_account_key( + self, file_content: bytes, full_path: str + ) -> str: + """Upload file using Azure SDK with account key authentication.""" + # Reuse the logger's service client method + service_client = await self.get_service_client() + file_system_client = service_client.get_file_system_client( + file_system=self.azure_storage_file_system + ) + + # Create filesystem (container) if it doesn't exist + if not await file_system_client.exists(): + await file_system_client.create_file_system() + verbose_logger.debug(f"Created filesystem: {self.azure_storage_file_system}") + + # Extract directory and filename (similar to logger's pattern) + path_parts = full_path.split("/") + if len(path_parts) > 1: + directory_path = "/".join(path_parts[:-1]) + file_name = path_parts[-1] + + # Create directory if needed (like logger does) + directory_client = file_system_client.get_directory_client(directory_path) + if not await directory_client.exists(): + await directory_client.create_directory() + verbose_logger.debug(f"Created directory: {directory_path}") + + # Get file client from directory (same pattern as logger) + file_client = directory_client.get_file_client(file_name) + else: + # No directory, create file directly in root + file_client = file_system_client.get_file_client(full_path) + + # Create, append, and flush (same pattern as logger's upload_to_azure_data_lake_with_azure_account_key) + await file_client.create_file() + await file_client.append_data(data=file_content, offset=0, length=len(file_content)) + await file_client.flush_data(position=len(file_content), offset=0) + + # Return blob URL (not DFS URL) + blob_url = f"https://{self.azure_storage_account_name}.blob.core.windows.net/{self.azure_storage_file_system}/{full_path}" + return blob_url + + async def _upload_file_with_azure_ad( + self, file_content: bytes, full_path: str + ) -> str: + """Upload file using REST API with Azure AD authentication.""" + # Reuse the logger's token management + await self.set_valid_azure_ad_token() + + from litellm.llms.custom_httpx.http_handler import ( + get_async_httpx_client, + httpxSpecialProvider, + ) + + async_client = get_async_httpx_client( + llm_provider=httpxSpecialProvider.LoggingCallback + ) + + # Use DFS endpoint for upload + base_url = f"https://{self.azure_storage_account_name}.dfs.core.windows.net/{self.azure_storage_file_system}/{full_path}" + + # Execute 3-step upload process: create, append, flush + # Reuse the logger's helper methods + await self._create_file(async_client, base_url) + # Append data - logger's _append_data expects string, so we create our own for bytes + await self._append_data_bytes(async_client, base_url, file_content) + await self._flush_data(async_client, base_url, len(file_content)) + + # Return blob URL (not DFS URL) + blob_url = f"https://{self.azure_storage_account_name}.blob.core.windows.net/{self.azure_storage_file_system}/{full_path}" + return blob_url + + async def _append_data_bytes( + self, client, base_url: str, file_content: bytes + ): + """Append binary data to file using REST API.""" + from litellm.constants import AZURE_STORAGE_MSFT_VERSION + + headers = { + "x-ms-version": AZURE_STORAGE_MSFT_VERSION, + "Content-Type": "application/octet-stream", + "Authorization": f"Bearer {self.azure_auth_token}", + } + response = await client.patch( + f"{base_url}?action=append&position=0", + headers=headers, + content=file_content, + ) + response.raise_for_status() + + async def download_file(self, storage_url: str) -> bytes: + """ + Download a file from Azure Blob Storage. + + Args: + storage_url: Blob URL in format: https://{account}.blob.core.windows.net/{container}/{path} + + Returns: + bytes: File content + """ + try: + # Parse blob URL to extract path + # URL format: https://{account}.blob.core.windows.net/{container}/{path} + if ".blob.core.windows.net/" not in storage_url: + raise ValueError(f"Invalid Azure Blob Storage URL: {storage_url}") + + # Extract path after container name + container_and_path = storage_url.split(".blob.core.windows.net/", 1)[1] + path_parts = container_and_path.split("/", 1) + if len(path_parts) < 2: + raise ValueError(f"Invalid Azure Blob Storage URL format: {storage_url}") + file_path = path_parts[1] # Path after container name + + if self.azure_storage_account_key: + # Use Azure SDK (reuse logger's service client) + return await self._download_file_with_account_key(file_path) + else: + # Use REST API (reuse logger's token management) + return await self._download_file_with_azure_ad(file_path) + + except Exception as e: + verbose_logger.exception(f"Error downloading file from Azure Blob Storage: {str(e)}") + raise + + async def _download_file_with_account_key(self, file_path: str) -> bytes: + """Download file using Azure SDK with account key.""" + # Reuse the logger's service client method + service_client = await self.get_service_client() + file_system_client = service_client.get_file_system_client( + file_system=self.azure_storage_file_system + ) + # Ensure filesystem exists (should already exist, but check for safety) + if not await file_system_client.exists(): + raise ValueError(f"Filesystem {self.azure_storage_file_system} does not exist") + file_client = file_system_client.get_file_client(file_path) + # Download file + download_response = await file_client.download_file() + file_content = await download_response.readall() + return file_content + + async def _download_file_with_azure_ad(self, file_path: str) -> bytes: + """Download file using REST API with Azure AD token.""" + # Reuse the logger's token management + await self.set_valid_azure_ad_token() + + from litellm.llms.custom_httpx.http_handler import ( + get_async_httpx_client, + httpxSpecialProvider, + ) + from litellm.constants import AZURE_STORAGE_MSFT_VERSION + + async_client = get_async_httpx_client( + llm_provider=httpxSpecialProvider.LoggingCallback + ) + + # Use blob endpoint for download (simpler than DFS) + blob_url = f"https://{self.azure_storage_account_name}.blob.core.windows.net/{self.azure_storage_file_system}/{file_path}" + + headers = { + "x-ms-version": AZURE_STORAGE_MSFT_VERSION, + "Authorization": f"Bearer {self.azure_auth_token}", + } + + response = await async_client.get(blob_url, headers=headers) + response.raise_for_status() + return response.content + diff --git a/litellm/llms/base_llm/files/storage_backend.py b/litellm/llms/base_llm/files/storage_backend.py new file mode 100644 index 00000000000..d9570452950 --- /dev/null +++ b/litellm/llms/base_llm/files/storage_backend.py @@ -0,0 +1,79 @@ +""" +Base storage backend interface for file storage backends. + +This module defines the abstract base class that all file storage backends +(e.g., Azure Blob Storage, S3, GCS) must implement. +""" + +from abc import ABC, abstractmethod +from typing import Optional + + +class BaseFileStorageBackend(ABC): + """ + Abstract base class for file storage backends. + + All storage backends (Azure Blob Storage, S3, GCS, etc.) must implement + these methods to provide a consistent interface for file operations. + """ + + @abstractmethod + async def upload_file( + self, + file_content: bytes, + filename: str, + content_type: str, + path_prefix: Optional[str] = None, + file_naming_strategy: str = "uuid", + ) -> str: + """ + Upload a file to the storage backend. + + Args: + file_content: The file content as bytes + filename: Original filename (may be used for naming strategy) + content_type: MIME type of the file + path_prefix: Optional path prefix for organizing files + file_naming_strategy: Strategy for naming files ("uuid", "timestamp", "original_filename") + + Returns: + str: The storage URL where the file can be accessed/downloaded + + Raises: + Exception: If upload fails + """ + pass + + @abstractmethod + async def download_file(self, storage_url: str) -> bytes: + """ + Download a file from the storage backend. + + Args: + storage_url: The storage URL returned from upload_file + + Returns: + bytes: The file content + + Raises: + Exception: If download fails + """ + pass + + async def delete_file(self, storage_url: str) -> None: + """ + Delete a file from the storage backend. + + This is optional and can be overridden by backends that support deletion. + Default implementation does nothing. + + Args: + storage_url: The storage URL of the file to delete + + Raises: + Exception: If deletion fails + """ + # Default implementation: no-op + # Backends can override if they support deletion + pass + diff --git a/litellm/llms/base_llm/files/storage_backend_factory.py b/litellm/llms/base_llm/files/storage_backend_factory.py new file mode 100644 index 00000000000..1685f3fbd26 --- /dev/null +++ b/litellm/llms/base_llm/files/storage_backend_factory.py @@ -0,0 +1,41 @@ +""" +Factory for creating storage backend instances. + +This module provides a factory function to instantiate the correct storage backend +based on the backend type. Backends use the same configuration as their corresponding +callbacks (e.g., azure_storage uses the same env vars as AzureBlobStorageLogger). +""" + +from litellm._logging import verbose_logger + +from .azure_blob_storage_backend import AzureBlobStorageBackend +from .storage_backend import BaseFileStorageBackend + + +def get_storage_backend(backend_type: str) -> BaseFileStorageBackend: + """ + Factory function to create a storage backend instance. + + Backends are configured using the same environment variables as their + corresponding callbacks. For example, "azure_storage" uses the same + env vars as AzureBlobStorageLogger. + + Args: + backend_type: Backend type identifier (e.g., "azure_storage") + + Returns: + BaseFileStorageBackend: Instance of the appropriate storage backend + + Raises: + ValueError: If backend_type is not supported + """ + verbose_logger.debug(f"Creating storage backend: type={backend_type}") + + if backend_type == "azure_storage": + return AzureBlobStorageBackend() + else: + raise ValueError( + f"Unsupported storage backend type: {backend_type}. " + f"Supported types: azure_storage" + ) + diff --git a/litellm/llms/bedrock/chat/agentcore/sse_iterator.py b/litellm/llms/bedrock/chat/agentcore/sse_iterator.py index e0da4fcd44f..90c5ada769f 100644 --- a/litellm/llms/bedrock/chat/agentcore/sse_iterator.py +++ b/litellm/llms/bedrock/chat/agentcore/sse_iterator.py @@ -5,7 +5,7 @@ Handles Server-Sent Events (SSE) streaming responses from AgentCore. """ import json -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any, Optional import httpx @@ -19,262 +19,234 @@ if TYPE_CHECKING: class AgentCoreSSEStreamIterator: - """Iterator for AgentCore SSE streaming responses. Supports both sync and async iteration.""" + """ + Iterator for AgentCore SSE streaming responses. + Supports both sync and async iteration. + + CRITICAL: The line iterators are created lazily on first access and reused. + We must NOT create new iterators in __aiter__/__iter__ because + CustomStreamWrapper calls __aiter__ on every call to its __anext__, + which would create new iterators and cause StreamConsumed errors. + """ def __init__(self, response: httpx.Response, model: str): self.response = response self.model = model self.finished = False - self.line_iterator = None - self.async_line_iterator = None + self._sync_iter: Any = None + self._async_iter: Any = None + self._sync_iter_initialized = False + self._async_iter_initialized = False def __iter__(self): - """Initialize sync iteration.""" - self.line_iterator = self.response.iter_lines() + """Initialize sync iteration - create iterator lazily on first call only.""" + if not self._sync_iter_initialized: + self._sync_iter = iter(self.response.iter_lines()) + self._sync_iter_initialized = True return self def __aiter__(self): - """Initialize async iteration.""" - self.async_line_iterator = self.response.aiter_lines() + """Initialize async iteration - create iterator lazily on first call only.""" + if not self._async_iter_initialized: + self._async_iter = self.response.aiter_lines().__aiter__() + self._async_iter_initialized = True return self - def __next__(self) -> ModelResponse: - """Sync iteration - parse SSE events and yield ModelResponse chunks.""" + def _parse_sse_line(self, line: str) -> Optional[ModelResponse]: + """ + Parse a single SSE line and return a ModelResponse chunk if applicable. + + AgentCore SSE format: + - data: {"event": {"contentBlockDelta": {"delta": {"text": "..."}}}} + - data: {"event": {"metadata": {"usage": {...}}}} + - data: {"message": {...}} + """ + line = line.strip() + if not line or not line.startswith("data:"): + return None + + json_str = line[5:].strip() + if not json_str: + return None + try: - if self.line_iterator is None: + data = json.loads(json_str) + + # Skip non-dict data (some lines contain Python repr strings) + if not isinstance(data, dict): + return None + + # Process content delta events + if "event" in data and isinstance(data["event"], dict): + event_payload = data["event"] + content_block_delta = event_payload.get("contentBlockDelta") + + if content_block_delta: + delta = content_block_delta.get("delta", {}) + text = delta.get("text", "") + + if text: + # Return chunk with text + chunk = ModelResponse( + id=f"chatcmpl-{uuid.uuid4()}", + created=0, + model=self.model, + object="chat.completion.chunk", + ) + + chunk.choices = [ + StreamingChoices( + finish_reason=None, + index=0, + delta=Delta(content=text, role="assistant"), + ) + ] + + return chunk + + # Check for metadata/usage - this signals the end + metadata = event_payload.get("metadata") + if metadata and "usage" in metadata: + chunk = ModelResponse( + id=f"chatcmpl-{uuid.uuid4()}", + created=0, + model=self.model, + object="chat.completion.chunk", + ) + + chunk.choices = [ + StreamingChoices( + finish_reason="stop", + index=0, + delta=Delta(), + ) + ] + + usage_data: AgentCoreUsage = metadata["usage"] # type: ignore + setattr( + chunk, + "usage", + Usage( + prompt_tokens=usage_data.get("inputTokens", 0), + completion_tokens=usage_data.get("outputTokens", 0), + total_tokens=usage_data.get("totalTokens", 0), + ), + ) + + self.finished = True + return chunk + + # Check for final message (alternative finish signal) + if "message" in data and isinstance(data["message"], dict): + if not self.finished: + chunk = ModelResponse( + id=f"chatcmpl-{uuid.uuid4()}", + created=0, + model=self.model, + object="chat.completion.chunk", + ) + + chunk.choices = [ + StreamingChoices( + finish_reason="stop", + index=0, + delta=Delta(), + ) + ] + + self.finished = True + return chunk + + except json.JSONDecodeError: + verbose_logger.debug(f"Skipping non-JSON SSE line: {line[:100]}") + + return None + + def _create_final_chunk(self) -> ModelResponse: + """Create a final chunk to signal stream completion.""" + chunk = ModelResponse( + id=f"chatcmpl-{uuid.uuid4()}", + created=0, + model=self.model, + object="chat.completion.chunk", + ) + + chunk.choices = [ + StreamingChoices( + finish_reason="stop", + index=0, + delta=Delta(), + ) + ] + + return chunk + + def __next__(self) -> ModelResponse: + """ + Sync iteration - parse SSE events and yield ModelResponse chunks. + + Uses next() on the stored iterator to properly resume between calls. + """ + try: + if self._sync_iter is None: raise StopIteration - for line in self.line_iterator: - line = line.strip() - - if not line or not line.startswith('data:'): - continue - - # Extract JSON from SSE line - json_str = line[5:].strip() - if not json_str: - continue - + + # Keep getting lines until we have a result to return + while True: try: - data = json.loads(json_str) - - # Skip non-dict data - if not isinstance(data, dict): - continue - - # Process content delta events - if "event" in data and isinstance(data["event"], dict): - event_payload = data["event"] - content_block_delta = event_payload.get("contentBlockDelta") - - if content_block_delta: - delta = content_block_delta.get("delta", {}) - text = delta.get("text", "") - - if text: - # Yield chunk with text - chunk = ModelResponse( - id=f"chatcmpl-{uuid.uuid4()}", - created=0, - model=self.model, - object="chat.completion.chunk", - ) - - chunk.choices = [ - StreamingChoices( - finish_reason=None, - index=0, - delta=Delta(content=text, role="assistant"), - ) - ] - - return chunk - - # Check for metadata/usage - metadata = event_payload.get("metadata") - if metadata and "usage" in metadata: - # This is the final chunk with usage - chunk = ModelResponse( - id=f"chatcmpl-{uuid.uuid4()}", - created=0, - model=self.model, - object="chat.completion.chunk", - ) - - chunk.choices = [ - StreamingChoices( - finish_reason="stop", - index=0, - delta=Delta(), - ) - ] - - usage_data: AgentCoreUsage = metadata["usage"] # type: ignore - setattr(chunk, "usage", Usage( - prompt_tokens=usage_data.get("inputTokens", 0), - completion_tokens=usage_data.get("outputTokens", 0), - total_tokens=usage_data.get("totalTokens", 0), - )) - - self.finished = True - return chunk - - # Check for final message (alternative finish signal) - if "message" in data and isinstance(data["message"], dict): - if not self.finished: - chunk = ModelResponse( - id=f"chatcmpl-{uuid.uuid4()}", - created=0, - model=self.model, - object="chat.completion.chunk", - ) - - chunk.choices = [ - StreamingChoices( - finish_reason="stop", - index=0, - delta=Delta(), - ) - ] - - self.finished = True - return chunk - - except json.JSONDecodeError: - verbose_logger.debug(f"Skipping non-JSON SSE line: {line[:100]}") - continue - - # Stream ended naturally - raise StopIteration + line = next(self._sync_iter) + except StopIteration: + # Stream ended - send final chunk if not already finished + if not self.finished: + self.finished = True + return self._create_final_chunk() + raise + + result = self._parse_sse_line(line) + if result is not None: + return result except StopIteration: raise except httpx.StreamConsumed: - # This is expected when the stream has been fully consumed raise StopIteration except httpx.StreamClosed: - # This is expected when the stream is closed raise StopIteration except Exception as e: verbose_logger.error(f"Error in AgentCore SSE stream: {str(e)}") raise StopIteration async def __anext__(self) -> ModelResponse: - """Async iteration - parse SSE events and yield ModelResponse chunks.""" + """ + Async iteration - parse SSE events and yield ModelResponse chunks. + + Uses __anext__() on the stored iterator to properly resume between calls. + """ try: - if self.async_line_iterator is None: + if self._async_iter is None: raise StopAsyncIteration - async for line in self.async_line_iterator: - line = line.strip() - - if not line or not line.startswith('data:'): - continue - - # Extract JSON from SSE line - json_str = line[5:].strip() - if not json_str: - continue - + + # Keep getting lines until we have a result to return + while True: try: - data = json.loads(json_str) - - # Skip non-dict data - if not isinstance(data, dict): - continue - - # Process content delta events - if "event" in data and isinstance(data["event"], dict): - event_payload = data["event"] - content_block_delta = event_payload.get("contentBlockDelta") - - if content_block_delta: - delta = content_block_delta.get("delta", {}) - text = delta.get("text", "") - - if text: - # Yield chunk with text - chunk = ModelResponse( - id=f"chatcmpl-{uuid.uuid4()}", - created=0, - model=self.model, - object="chat.completion.chunk", - ) - - chunk.choices = [ - StreamingChoices( - finish_reason=None, - index=0, - delta=Delta(content=text, role="assistant"), - ) - ] - - return chunk - - # Check for metadata/usage - metadata = event_payload.get("metadata") - if metadata and "usage" in metadata: - # This is the final chunk with usage - chunk = ModelResponse( - id=f"chatcmpl-{uuid.uuid4()}", - created=0, - model=self.model, - object="chat.completion.chunk", - ) - - chunk.choices = [ - StreamingChoices( - finish_reason="stop", - index=0, - delta=Delta(), - ) - ] - - usage_data: AgentCoreUsage = metadata["usage"] # type: ignore - setattr(chunk, "usage", Usage( - prompt_tokens=usage_data.get("inputTokens", 0), - completion_tokens=usage_data.get("outputTokens", 0), - total_tokens=usage_data.get("totalTokens", 0), - )) - - self.finished = True - return chunk - - # Check for final message (alternative finish signal) - if "message" in data and isinstance(data["message"], dict): - if not self.finished: - chunk = ModelResponse( - id=f"chatcmpl-{uuid.uuid4()}", - created=0, - model=self.model, - object="chat.completion.chunk", - ) - - chunk.choices = [ - StreamingChoices( - finish_reason="stop", - index=0, - delta=Delta(), - ) - ] - - self.finished = True - return chunk - - except json.JSONDecodeError: - verbose_logger.debug(f"Skipping non-JSON SSE line: {line[:100]}") - continue - - # Stream ended naturally - raise StopAsyncIteration + line = await self._async_iter.__anext__() + except StopAsyncIteration: + # Stream ended - send final chunk if not already finished + if not self.finished: + self.finished = True + return self._create_final_chunk() + raise + + result = self._parse_sse_line(line) + if result is not None: + return result except StopAsyncIteration: raise except httpx.StreamConsumed: - # This is expected when the stream has been fully consumed raise StopAsyncIteration except httpx.StreamClosed: - # This is expected when the stream is closed raise StopAsyncIteration except Exception as e: verbose_logger.error(f"Error in AgentCore SSE stream: {str(e)}") raise StopAsyncIteration - diff --git a/litellm/llms/bedrock/embed/embedding.py b/litellm/llms/bedrock/embed/embedding.py index 7152d7ce15c..56900d296a5 100644 --- a/litellm/llms/bedrock/embed/embedding.py +++ b/litellm/llms/bedrock/embed/embedding.py @@ -286,11 +286,12 @@ class BedrockEmbedding(BaseAWSLLM): "headers": prepped.headers, }, ) + headers_for_request = dict(prepped.headers) if hasattr(prepped, 'headers') else {} response = self._make_sync_call( client=client, timeout=timeout, api_base=prepped.url, - headers=prepped.headers, # type: ignore + headers=headers_for_request, data=data, ) @@ -352,11 +353,14 @@ class BedrockEmbedding(BaseAWSLLM): "headers": prepped.headers, }, ) + # Convert CaseInsensitiveDict to regular dict for httpx compatibility + # This ensures custom headers are properly forwarded, especially with IAM roles and custom api_base + headers_for_request = dict(prepped.headers) if hasattr(prepped, 'headers') else {} response = await self._make_async_call( client=client, timeout=timeout, api_base=prepped.url, - headers=prepped.headers, # type: ignore + headers=headers_for_request, data=data, ) @@ -562,6 +566,8 @@ class BedrockEmbedding(BaseAWSLLM): ) ## ROUTING ## + # Convert CaseInsensitiveDict to regular dict for httpx compatibility + headers_for_request = dict(prepped.headers) if hasattr(prepped, 'headers') else {} return cohere_embedding( model=model, input=input, @@ -575,7 +581,7 @@ class BedrockEmbedding(BaseAWSLLM): aembedding=aembedding, timeout=timeout, client=client, - headers=prepped.headers, # type: ignore + headers=headers_for_request, ) async def _get_async_invoke_status( diff --git a/litellm/llms/bedrock/rerank/handler.py b/litellm/llms/bedrock/rerank/handler.py index f5a532bec15..06f1e9e86c9 100644 --- a/litellm/llms/bedrock/rerank/handler.py +++ b/litellm/llms/bedrock/rerank/handler.py @@ -34,7 +34,7 @@ class BedrockRerankHandler(BaseAWSLLM): if client is None: client = get_async_httpx_client(llm_provider=litellm.LlmProviders.BEDROCK) try: - response = await client.post(url=prepared_request["endpoint_url"], headers=prepared_request["prepped"].headers, data=prepared_request["body"]) # type: ignore + response = await client.post(url=prepared_request["endpoint_url"], headers=dict(prepared_request["prepped"].headers), data=prepared_request["body"]) response.raise_for_status() except httpx.HTTPStatusError as err: error_code = err.response.status_code @@ -84,7 +84,7 @@ class BedrockRerankHandler(BaseAWSLLM): additional_args={ "complete_input_dict": data, "api_base": prepared_request["endpoint_url"], - "headers": prepared_request["prepped"].headers, + "headers": dict(prepared_request["prepped"].headers), }, ) @@ -94,7 +94,7 @@ class BedrockRerankHandler(BaseAWSLLM): if client is None or not isinstance(client, HTTPHandler): client = _get_httpx_client() try: - response = client.post(url=prepared_request["endpoint_url"], headers=prepared_request["prepped"].headers, data=prepared_request["body"]) # type: ignore + response = client.post(url=prepared_request["endpoint_url"], headers=dict(prepared_request["prepped"].headers), data=prepared_request["body"]) response.raise_for_status() except httpx.HTTPStatusError as err: error_code = err.response.status_code diff --git a/litellm/llms/openai/chat/gpt_5_transformation.py b/litellm/llms/openai/chat/gpt_5_transformation.py index 1b3abb20d63..3fffa335fdc 100644 --- a/litellm/llms/openai/chat/gpt_5_transformation.py +++ b/litellm/llms/openai/chat/gpt_5_transformation.py @@ -51,6 +51,12 @@ class OpenAIGPT5Config(OpenAIGPTConfig): model_name = model.split("/")[-1] return model_name.startswith("gpt-5.2-pro") + @classmethod + def is_model_gpt_5_2_model(cls, model: str) -> bool: + """Check if the model is a gpt-5.2 variant (including pro).""" + model_name = model.split("/")[-1] + return model_name.startswith("gpt-5.2") + def get_supported_openai_params(self, model: str) -> list: from litellm.utils import supports_tool_choice @@ -89,14 +95,14 @@ class OpenAIGPT5Config(OpenAIGPTConfig): if reasoning_effort is not None and reasoning_effort == "xhigh": if not ( self.is_model_gpt_5_1_codex_max_model(model) - or self.is_model_gpt_5_2_pro_model(model) + or self.is_model_gpt_5_2_model(model) ): if litellm.drop_params or drop_params: non_default_params.pop("reasoning_effort", None) else: raise litellm.utils.UnsupportedParamsError( message=( - "reasoning_effort='xhigh' is only supported for gpt-5.1-codex-max." + "reasoning_effort='xhigh' is only supported for gpt-5.1-codex-max and gpt-5.2 models." ), status_code=400, ) diff --git a/litellm/llms/openai/openai.py b/litellm/llms/openai/openai.py index bb9225fc79b..e04def0d9c8 100644 --- a/litellm/llms/openai/openai.py +++ b/litellm/llms/openai/openai.py @@ -1,6 +1,7 @@ import time import types from typing import ( + TYPE_CHECKING, Any, AsyncIterator, Callable, @@ -10,7 +11,6 @@ from typing import ( List, Literal, Optional, - TYPE_CHECKING, Union, cast, ) @@ -20,6 +20,7 @@ import httpx if TYPE_CHECKING: from aiohttp import ClientSession + import openai from openai import AsyncOpenAI, OpenAI from openai.types.beta.assistant_deleted import AssistantDeleted @@ -1549,7 +1550,7 @@ class OpenAIFilesAPI(BaseLLM): create_file_data: CreateFileRequest, openai_client: AsyncOpenAI, ) -> OpenAIFileObject: - response = await openai_client.files.create(**create_file_data) + response = await openai_client.files.create(**create_file_data) # type: ignore[arg-type] return OpenAIFileObject(**response.model_dump()) def create_file( @@ -1585,7 +1586,7 @@ class OpenAIFilesAPI(BaseLLM): return self.acreate_file( # type: ignore create_file_data=create_file_data, openai_client=openai_client ) - response = cast(OpenAI, openai_client).files.create(**create_file_data) + response = cast(OpenAI, openai_client).files.create(**create_file_data) # type: ignore[arg-type] return OpenAIFileObject(**response.model_dump()) async def afile_content( diff --git a/litellm/main.py b/litellm/main.py index 20089b4c234..b08ffd16e3d 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -69,6 +69,7 @@ from litellm.constants import ( ) from litellm.exceptions import LiteLLMUnknownProvider from litellm.integrations.custom_logger import CustomLogger +from litellm.litellm_core_utils.asyncify import run_async_function from litellm.litellm_core_utils.audio_utils.utils import ( calculate_request_duration, get_audio_file_for_health_check, @@ -299,7 +300,6 @@ MOCK_RESPONSE_TYPE = Union[str, Exception, dict, ModelResponse, ModelResponseStr class LiteLLM: - def __init__( self, *, @@ -1091,6 +1091,22 @@ def completion( # type: ignore # noqa: PLR0915 tools = validate_and_fix_openai_tools(tools=tools) # validate tool_choice tool_choice = validate_chat_completion_tool_choice(tool_choice=tool_choice) + + skip_mcp_handler = kwargs.pop("_skip_mcp_handler", False) + if not skip_mcp_handler and tools: + from litellm.responses.mcp.chat_completions_handler import ( + handle_chat_completion_with_mcp, + ) + + mcp_handler_context = locals().copy() + completion_callable = globals().get("acompletion") + mcp_result = run_async_function( + handle_chat_completion_with_mcp, + mcp_handler_context, + completion_callable, + ) + if mcp_result is not None: + return mcp_result ######### unpacking kwargs ##################### args = locals() api_base = kwargs.get("api_base", None) @@ -1181,7 +1197,6 @@ def completion( # type: ignore # noqa: PLR0915 prompt_id=prompt_id, non_default_params=non_default_params ) ): - ( model, messages, @@ -2130,7 +2145,7 @@ def completion( # type: ignore # noqa: PLR0915 config = litellm.GenAIHubOrchestrationConfig.get_config() for k, v in config.items(): if ( - k not in optional_params + k not in optional_params ): # completion(top_k=3) > openai_config(top_k=3) <- allows for dynamic variables to be passed in optional_params[k] = v @@ -2300,7 +2315,6 @@ def completion( # type: ignore # noqa: PLR0915 try: if use_base_llm_http_handler: - response = base_llm_http_handler.completion( model=model, messages=messages, @@ -3413,9 +3427,9 @@ def completion( # type: ignore # noqa: PLR0915 "aws_region_name" not in optional_params or optional_params["aws_region_name"] is None ): - optional_params["aws_region_name"] = ( - aws_bedrock_client.meta.region_name - ) + optional_params[ + "aws_region_name" + ] = aws_bedrock_client.meta.region_name bedrock_route = BedrockModelInfo.get_bedrock_route(model) if bedrock_route == "converse": @@ -3633,7 +3647,6 @@ def completion( # type: ignore # noqa: PLR0915 if api_key is not None and "Authorization" not in headers: headers["Authorization"] = f"Bearer {api_key}" - response = base_llm_http_handler.completion( model=model, stream=stream, @@ -3769,7 +3782,6 @@ def completion( # type: ignore # noqa: PLR0915 ) raise e elif custom_llm_provider == "gradient_ai": - api_base = litellm.api_base or api_base response = base_llm_http_handler.completion( model=model, @@ -4420,7 +4432,7 @@ def embedding( # noqa: PLR0915 litellm_params=litellm_params_dict, ) elif custom_llm_provider == "github_copilot": - api_key = (api_key or litellm.api_key) + api_key = api_key or litellm.api_key response = base_llm_http_handler.embedding( model=model, input=input, @@ -5585,9 +5597,9 @@ def adapter_completion( new_kwargs = translation_obj.translate_completion_input_params(kwargs=kwargs) response: Union[ModelResponse, CustomStreamWrapper] = completion(**new_kwargs) # type: ignore - translated_response: Optional[Union[BaseModel, AdapterCompletionStreamWrapper]] = ( - None - ) + translated_response: Optional[ + Union[BaseModel, AdapterCompletionStreamWrapper] + ] = None if isinstance(response, ModelResponse): translated_response = translation_obj.translate_completion_output_params( response=response @@ -6292,9 +6304,9 @@ def speech( # noqa: PLR0915 ElevenLabsTextToSpeechConfig.ELEVENLABS_QUERY_PARAMS_KEY ] = query_params - litellm_params_dict[ElevenLabsTextToSpeechConfig.ELEVENLABS_VOICE_ID_KEY] = ( - voice_id - ) + litellm_params_dict[ + ElevenLabsTextToSpeechConfig.ELEVENLABS_VOICE_ID_KEY + ] = voice_id if api_base is not None: litellm_params_dict["api_base"] = api_base @@ -6344,16 +6356,16 @@ def speech( # noqa: PLR0915 text_to_speech_provider_config = VertexAITextToSpeechConfig() # Cast to specific Vertex AI config type to access dispatch method - vertex_config = cast( - VertexAITextToSpeechConfig, text_to_speech_provider_config - ) + vertex_config = cast(VertexAITextToSpeechConfig, text_to_speech_provider_config) # Store Vertex AI specific params in litellm_params_dict - litellm_params_dict.update({ - "vertex_project": generic_optional_params.vertex_project, - "vertex_location": generic_optional_params.vertex_location, - "vertex_credentials": generic_optional_params.vertex_credentials, - }) + litellm_params_dict.update( + { + "vertex_project": generic_optional_params.vertex_project, + "vertex_location": generic_optional_params.vertex_location, + "vertex_credentials": generic_optional_params.vertex_credentials, + } + ) response = vertex_config.dispatch_text_to_speech( model=model, @@ -6724,9 +6736,9 @@ def stream_chunk_builder( # noqa: PLR0915 ] if len(content_chunks) > 0: - response["choices"][0]["message"]["content"] = ( - processor.get_combined_content(content_chunks) - ) + response["choices"][0]["message"][ + "content" + ] = processor.get_combined_content(content_chunks) thinking_blocks = [ chunk @@ -6737,9 +6749,9 @@ def stream_chunk_builder( # noqa: PLR0915 ] if len(thinking_blocks) > 0: - response["choices"][0]["message"]["thinking_blocks"] = ( - processor.get_combined_thinking_content(thinking_blocks) - ) + response["choices"][0]["message"][ + "thinking_blocks" + ] = processor.get_combined_thinking_content(thinking_blocks) reasoning_chunks = [ chunk @@ -6750,9 +6762,9 @@ def stream_chunk_builder( # noqa: PLR0915 ] if len(reasoning_chunks) > 0: - response["choices"][0]["message"]["reasoning_content"] = ( - processor.get_combined_reasoning_content(reasoning_chunks) - ) + response["choices"][0]["message"][ + "reasoning_content" + ] = processor.get_combined_reasoning_content(reasoning_chunks) annotation_chunks = [ chunk diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 5fd7ff4a0cf..1ca26164431 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -3424,6 +3424,172 @@ "supports_tool_choice": true, "supports_vision": true }, + "azure/gpt-5.2": { + "cache_read_input_token_cost": 1.75e-07, + "input_cost_per_token": 1.75e-06, + "litellm_provider": "azure", + "max_input_tokens": 400000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.4e-05, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text", + "image" + ], + "supports_function_calling": true, + "supports_native_streaming": true, + "supports_parallel_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true + }, + "azure/gpt-5.2-2025-12-11": { + "cache_read_input_token_cost": 1.75e-07, + "cache_read_input_token_cost_priority": 3.5e-07, + "input_cost_per_token": 1.75e-06, + "input_cost_per_token_priority": 3.5e-06, + "litellm_provider": "azure", + "max_input_tokens": 400000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 1.4e-05, + "output_cost_per_token_priority": 2.8e-05, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text", + "image" + ], + "supports_function_calling": true, + "supports_native_streaming": true, + "supports_parallel_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_service_tier": true, + "supports_vision": true + }, + "azure/gpt-5.2-chat-2025-12-11": { + "cache_read_input_token_cost": 1.75e-07, + "cache_read_input_token_cost_priority": 3.5e-07, + "input_cost_per_token": 1.75e-06, + "input_cost_per_token_priority": 3.5e-06, + "litellm_provider": "azure", + "max_input_tokens": 128000, + "max_output_tokens": 16384, + "max_tokens": 16384, + "mode": "chat", + "output_cost_per_token": 1.4e-05, + "output_cost_per_token_priority": 2.8e-05, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_function_calling": true, + "supports_native_streaming": true, + "supports_parallel_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true + }, + "azure/gpt-5.2-pro": { + "input_cost_per_token": 2.1e-05, + "litellm_provider": "azure", + "max_input_tokens": 400000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "responses", + "output_cost_per_token": 1.68e-04, + "supported_endpoints": [ + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_function_calling": true, + "supports_native_streaming": true, + "supports_parallel_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true, + "supports_web_search": true + }, + "azure/gpt-5.2-pro-2025-12-11": { + "input_cost_per_token": 2.1e-05, + "litellm_provider": "azure", + "max_input_tokens": 400000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "responses", + "output_cost_per_token": 1.68e-04, + "supported_endpoints": [ + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_function_calling": true, + "supports_native_streaming": true, + "supports_parallel_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true, + "supports_web_search": true + }, "azure/gpt-image-1": { "input_cost_per_pixel": 4.0054321e-08, "litellm_provider": "azure", @@ -15088,15 +15254,15 @@ "tool_use_system_prompt_tokens": 159 }, "global.anthropic.claude-haiku-4-5-20251001-v1:0": { - "cache_creation_input_token_cost": 1.375e-06, - "cache_read_input_token_cost": 1.1e-07, - "input_cost_per_token": 1.1e-06, + "cache_creation_input_token_cost": 1.25e-06, + "cache_read_input_token_cost": 1e-07, + "input_cost_per_token": 1e-06, "litellm_provider": "bedrock_converse", "max_input_tokens": 200000, "max_output_tokens": 64000, "max_tokens": 64000, "mode": "chat", - "output_cost_per_token": 5.5e-06, + "output_cost_per_token": 5e-06, "source": "https://aws.amazon.com/about-aws/whats-new/2025/10/claude-4-5-haiku-anthropic-amazon-bedrock", "supports_assistant_prefill": true, "supports_computer_use": true, @@ -24668,6 +24834,32 @@ "supports_vision": true, "tool_use_system_prompt_tokens": 159 }, + "eu.anthropic.claude-opus-4-5-20251101-v1:0": { + "cache_creation_input_token_cost": 6.25e-06, + "cache_read_input_token_cost": 5e-07, + "input_cost_per_token": 5e-06, + "litellm_provider": "bedrock_converse", + "max_input_tokens": 200000, + "max_output_tokens": 64000, + "max_tokens": 64000, + "mode": "chat", + "output_cost_per_token": 2.5e-05, + "search_context_cost_per_query": { + "search_context_size_high": 0.01, + "search_context_size_low": 0.01, + "search_context_size_medium": 0.01 + }, + "supports_assistant_prefill": true, + "supports_computer_use": true, + "supports_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true, + "tool_use_system_prompt_tokens": 159 + }, "us.anthropic.claude-sonnet-4-20250514-v1:0": { "cache_creation_input_token_cost": 3.75e-06, "cache_read_input_token_cost": 3e-07, @@ -30478,5 +30670,4 @@ "litellm_provider": "fireworks_ai", "mode": "chat" } - } \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/ow7maE3ylEFeAhstEXacR/_buildManifest.js b/litellm/proxy/_experimental/out/_next/static/1PY3Wl46M_g34vYqk3clZ/_buildManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/ow7maE3ylEFeAhstEXacR/_buildManifest.js rename to litellm/proxy/_experimental/out/_next/static/1PY3Wl46M_g34vYqk3clZ/_buildManifest.js diff --git a/litellm/proxy/_experimental/out/_next/static/ow7maE3ylEFeAhstEXacR/_ssgManifest.js b/litellm/proxy/_experimental/out/_next/static/1PY3Wl46M_g34vYqk3clZ/_ssgManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/ow7maE3ylEFeAhstEXacR/_ssgManifest.js rename to litellm/proxy/_experimental/out/_next/static/1PY3Wl46M_g34vYqk3clZ/_ssgManifest.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1200-44dc8792c58b34e3.js b/litellm/proxy/_experimental/out/_next/static/chunks/1200-44dc8792c58b34e3.js new file mode 100644 index 00000000000..b4a969f7867 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1200-44dc8792c58b34e3.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1200],{90246:function(e,l,t){t.d(l,{n:function(){return s}});function s(e){let l=[e];return{all:l,lists:()=>[...l,"list"],list:e=>[...l,"list",{params:e}],details:()=>[...l,"detail"],detail:e=>[...l,"detail",e]}}},55584:function(e,l,t){t.d(l,{L:function(){return i}});var s=t(19250),a=t(11713);let r=(0,t(90246).n)("uiSettings"),i=e=>(0,a.a)({queryKey:r.list({}),queryFn:async()=>await (0,s.getUiSettings)(e),enabled:!!e,staleTime:36e5,gcTime:36e5})},31200:function(e,l,t){t.d(l,{Z:function(){return lJ}});var s=t(57437),a=t(29827),r=t(49804),i=t(67101),n=t(84264),o=t(2265),d=t(9114),c=t(19250),m=t(42673);let u=async(e,l,t)=>{try{var s,a;console.log("handling submit for formValues:",e);let l=e.model_mappings||[];if("model_mappings"in e&&delete e.model_mappings,e.model&&e.model.includes("all-wildcard")){let t=e.custom_llm_provider,a=(null!==(s=m.fK[t])&&void 0!==s?s:t.toLowerCase())+"/*";e.model_name=a,l.push({public_name:a,litellm_model:a}),e.model=a}let t=[];for(let s of l){let l={},r={},i=s.public_name;for(let[t,i]of(l.model=s.litellm_model,e.input_cost_per_token&&(e.input_cost_per_token=Number(e.input_cost_per_token)/1e6),e.output_cost_per_token&&(e.output_cost_per_token=Number(e.output_cost_per_token)/1e6),l.model=s.litellm_model,console.log("formValues add deployment:",e),Object.entries(e)))if(""!==i&&"custom_pricing"!==t&&"pricing_model"!==t&&"cache_control"!==t){if("model_name"==t)l.model=i;else if("custom_llm_provider"==t){console.log("custom_llm_provider:",i);let e=null!==(a=m.fK[i])&&void 0!==a?a:i.toLowerCase();l.custom_llm_provider=e,console.log("custom_llm_provider mappingResult:",e)}else if("model"==t)continue;else if("base_model"===t)r[t]=i;else if("team_id"===t)r.team_id=i;else if("model_access_group"===t)r.access_groups=i;else if("mode"==t)console.log("placing mode in modelInfo"),r.mode=i,delete l.mode;else if("custom_model_name"===t)l.model=i;else if("litellm_extra_params"==t){console.log("litellm_extra_params:",i);let e={};if(i&&void 0!=i){try{e=JSON.parse(i)}catch(e){throw d.Z.fromBackend("Failed to parse LiteLLM Extra Params: "+e),Error("Failed to parse litellm_extra_params: "+e)}for(let[t,s]of Object.entries(e))l[t]=s}}else if("model_info_params"==t){console.log("model_info_params:",i);let e={};if(i&&void 0!=i){try{e=JSON.parse(i)}catch(e){throw d.Z.fromBackend("Failed to parse LiteLLM Extra Params: "+e),Error("Failed to parse litellm_extra_params: "+e)}for(let[l,t]of Object.entries(e))r[l]=t}}else if("input_cost_per_token"===t||"output_cost_per_token"===t||"input_cost_per_second"===t){i&&(l[t]=Number(i));continue}else l[t]=i}t.push({litellmParamsObj:l,modelInfoObj:r,modelName:i})}return t}catch(e){d.Z.fromBackend("Failed to create model: "+e)}},h=async(e,l,t,s)=>{try{let a=await u(e,l,t);if(!a||0===a.length)return;for(let e of a){let{litellmParamsObj:t,modelInfoObj:s,modelName:a}=e,r={model_name:a,litellm_params:t,model_info:s},i=await (0,c.modelCreateCall)(l,r);console.log("response for model create call: ".concat(i.data))}s&&s(),t.resetFields()}catch(e){d.Z.fromBackend("Failed to add model: "+e)}};var x=t(11713),p=t(90246);let g=(0,p.n)("credentials"),f=e=>(0,x.a)({queryKey:g.list({}),queryFn:async()=>await (0,c.credentialListCall)(e),enabled:!!e}),j=(0,p.n)("models");(0,p.n)("modelHub");let v=(e,l,t)=>(0,x.a)({queryKey:j.list({filters:{...l&&{userID:l},...t&&{userRole:t}}}),queryFn:async()=>await (0,c.modelInfoCall)(e,l,t),enabled:!!(e&&l&&t)});var _=t(53410),y=t(74998),b=t(62490),N=t(10032),Z=t(21609),w=t(31283),C=t(57840),S=t(22116),k=t(37592),A=t(99981),E=t(5545);let M=(0,p.n)("providerFields"),I=()=>(0,x.a)({queryKey:M.list({}),queryFn:async()=>await (0,c.getProviderCreateMetadata)(),staleTime:864e5,gcTime:864e5});var F=t(3632),P=t(56522),L=t(47451),T=t(69410),R=t(65319),O=t(4260);let{Link:V}=C.default,D=e=>{var l,t,s,a,r;let i="password"===e.field_type?"password":"select"===e.field_type?"select":"upload"===e.field_type?"upload":"textarea"===e.field_type?"textarea":"text";return{key:e.key,label:e.label,placeholder:null!==(l=e.placeholder)&&void 0!==l?l:void 0,tooltip:null!==(t=e.tooltip)&&void 0!==t?t:void 0,required:null!==(s=e.required)&&void 0!==s&&s,type:i,options:null!==(a=e.options)&&void 0!==a?a:void 0,defaultValue:null!==(r=e.default_value)&&void 0!==r?r:void 0}},z={};var q=e=>{let{selectedProvider:l,uploadProps:t}=e,a=m.Cl[l],r=N.Z.useFormInstance(),{data:i,isLoading:n,error:d}=I(),c=o.useMemo(()=>{if(!i)return null;let e={};return i.forEach(l=>{let t=l.provider_display_name,s=l.credential_fields.map(D);e[t]=s,l.provider&&(e[l.provider]=s),l.litellm_provider&&(e[l.litellm_provider]=s)}),e},[i]);o.useEffect(()=>{c&&Object.assign(z,c)},[c]);let u=o.useMemo(()=>{var e;let t=null!==(e=z[a])&&void 0!==e?e:z[l];if(t)return t;if(!i)return[];let s=i.find(e=>e.provider_display_name===a||e.provider===l||e.litellm_provider===l);if(!s)return[];let r=s.credential_fields.map(D);return z[s.provider_display_name]=r,s.provider&&(z[s.provider]=r),s.litellm_provider&&(z[s.litellm_provider]=r),r},[a,l,i]),h={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let l=new FileReader;l.onload=e=>{if(e.target){let l=e.target.result;console.log("Setting field value from JSON, length: ".concat(l.length)),r.setFieldsValue({vertex_credentials:l}),console.log("Form values after setting:",r.getFieldsValue())}},l.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered in ProviderSpecificFields"),console.log("Current form values:",r.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList)}};return(0,s.jsxs)(s.Fragment,{children:[n&&0===u.length&&(0,s.jsx)(L.Z,{children:(0,s.jsx)(T.Z,{span:24,children:(0,s.jsx)(P.x,{className:"mb-2",children:"Loading provider fields..."})})}),d&&0===u.length&&(0,s.jsx)(L.Z,{children:(0,s.jsx)(T.Z,{span:24,children:(0,s.jsx)(P.x,{className:"mb-2 text-red-500",children:d instanceof Error?d.message:"Failed to load provider credential fields"})})}),u.map(e=>{var l;return(0,s.jsxs)(o.Fragment,{children:[(0,s.jsx)(N.Z.Item,{label:e.label,name:e.key,rules:e.required?[{required:!0,message:"Required"}]:void 0,tooltip:e.tooltip,className:"vertex_credentials"===e.key?"mb-0":void 0,children:"select"===e.type?(0,s.jsx)(k.default,{placeholder:e.placeholder,defaultValue:e.defaultValue,children:null===(l=e.options)||void 0===l?void 0:l.map(e=>(0,s.jsx)(k.default.Option,{value:e,children:e},e))}):"upload"===e.type?(0,s.jsx)(R.default,{...h,onChange:l=>{(null==t?void 0:t.onChange)&&t.onChange(l),setTimeout(()=>{let l=r.getFieldValue(e.key);console.log("".concat(e.key," value after upload:"),JSON.stringify(l))},500)},children:(0,s.jsx)(E.ZP,{icon:(0,s.jsx)(F.Z,{}),children:"Click to Upload"})}):"textarea"===e.type?(0,s.jsx)(O.default.TextArea,{placeholder:e.placeholder,defaultValue:e.defaultValue,rows:6,style:{fontFamily:"monospace",fontSize:"12px"}}):(0,s.jsx)(P.o,{placeholder:e.placeholder,type:"password"===e.type?"password":"text",defaultValue:e.defaultValue})}),"vertex_credentials"===e.key&&(0,s.jsx)(L.Z,{children:(0,s.jsx)(T.Z,{children:(0,s.jsx)(P.x,{className:"mb-3 mt-1",children:"Give a gcp service account(.json file)"})})}),"base_model"===e.key&&(0,s.jsxs)(L.Z,{children:[(0,s.jsx)(T.Z,{span:10}),(0,s.jsx)(T.Z,{span:10,children:(0,s.jsxs)(P.x,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,s.jsx)(V,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]},e.key)})]})};let{Link:B}=C.default;var U=e=>{let{open:l,onCancel:t,onAddCredential:a,uploadProps:r}=e,[i]=N.Z.useForm(),[n,d]=(0,o.useState)(m.Cl.OpenAI);return(0,s.jsx)(S.Z,{title:"Add New Credential",open:l,onCancel:()=>{t(),i.resetFields()},footer:null,width:600,children:(0,s.jsxs)(N.Z,{form:i,onFinish:e=>{a(Object.entries(e).reduce((e,l)=>{let[t,s]=l;return""!==s&&null!=s&&(e[t]=s),e},{})),i.resetFields()},layout:"vertical",children:[(0,s.jsx)(N.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],children:(0,s.jsx)(w.o,{placeholder:"Enter a friendly name for these credentials"})}),(0,s.jsx)(N.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"Helper to auto-populate provider specific fields",children:(0,s.jsx)(k.default,{showSearch:!0,onChange:e=>{d(e),i.setFieldValue("custom_llm_provider",e)},children:Object.entries(m.Cl).map(e=>{let[l,t]=e;return(0,s.jsx)(k.default.Option,{value:l,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("img",{src:m.cd[t],alt:"".concat(l," logo"),className:"w-5 h-5",onError:e=>{let l=e.target,s=l.parentElement;if(s){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),s.replaceChild(e,l)}}}),(0,s.jsx)("span",{children:t})]})},l)})})}),(0,s.jsx)(q,{selectedProvider:n,uploadProps:r}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(B,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(E.ZP,{onClick:()=>{t(),i.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(E.ZP,{htmlType:"submit",children:"Add Credential"})]})]})]})})};let{Link:G}=C.default;function H(e){let{open:l,onCancel:t,onUpdateCredential:a,uploadProps:r,existingCredential:i}=e,[n]=N.Z.useForm(),[d,c]=(0,o.useState)(m.Cl.Anthropic);return(0,o.useEffect)(()=>{if(i){let e=Object.entries(i.credential_values||{}).reduce((e,l)=>{let[t,s]=l;return e[t]=null!=s?s:null,e},{});n.setFieldsValue({credential_name:i.credential_name,custom_llm_provider:i.credential_info.custom_llm_provider,...e}),c(i.credential_info.custom_llm_provider)}},[i]),(0,s.jsx)(S.Z,{title:"Edit Credential",open:l,onCancel:()=>{t(),n.resetFields()},footer:null,width:600,destroyOnHidden:!0,children:(0,s.jsxs)(N.Z,{form:n,onFinish:e=>{a(Object.entries(e).reduce((e,l)=>{let[t,s]=l;return""!==s&&null!=s&&(e[t]=s),e},{})),n.resetFields()},layout:"vertical",children:[(0,s.jsx)(N.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==i?void 0:i.credential_name,children:(0,s.jsx)(w.o,{placeholder:"Enter a friendly name for these credentials",disabled:null!=i&&!!i.credential_name})}),(0,s.jsx)(N.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"Helper to auto-populate provider specific fields",children:(0,s.jsx)(k.default,{showSearch:!0,onChange:e=>{c(e),n.setFieldValue("custom_llm_provider",e)},children:Object.entries(m.Cl).map(e=>{let[l,t]=e;return(0,s.jsx)(k.default.Option,{value:l,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("img",{src:m.cd[t],alt:"".concat(l," logo"),className:"w-5 h-5",onError:e=>{let l=e.target,s=l.parentElement;if(s){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),s.replaceChild(e,l)}}}),(0,s.jsx)("span",{children:t})]})},l)})})}),(0,s.jsx)(q,{selectedProvider:d,uploadProps:r}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(G,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(E.ZP,{onClick:()=>{t(),n.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(E.ZP,{htmlType:"submit",children:"Update Credential"})]})]})]})})}var K=t(39760),J=e=>{var l;let{uploadProps:t}=e,{accessToken:a}=(0,K.Z)(),{data:r,refetch:i}=f(a),n=(null==r?void 0:r.credentials)||[],[m,u]=(0,o.useState)(!1),[h,x]=(0,o.useState)(!1),[p,g]=(0,o.useState)(null),[j,v]=(0,o.useState)(null),[w,C]=(0,o.useState)(!1),[S,k]=(0,o.useState)(!1),[A]=N.Z.useForm(),E=["credential_name","custom_llm_provider"],M=async e=>{if(!a)return;let l=Object.entries(e).filter(e=>{let[l]=e;return!E.includes(l)}).reduce((e,l)=>{let[t,s]=l;return{...e,[t]:s}},{}),t={credential_name:e.credential_name,credential_values:l,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,c.credentialUpdateCall)(a,e.credential_name,t),d.Z.success("Credential updated successfully"),x(!1),await i()},I=async e=>{if(!a)return;let l=Object.entries(e).filter(e=>{let[l]=e;return!E.includes(l)}).reduce((e,l)=>{let[t,s]=l;return{...e,[t]:s}},{}),t={credential_name:e.credential_name,credential_values:l,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,c.credentialCreateCall)(a,t),d.Z.success("Credential added successfully"),u(!1),await i()},F=e=>{let l={openai:"blue",azure:"indigo",anthropic:"purple",default:"gray"},t=l[e.toLowerCase()]||l.default;return(0,s.jsx)(b.Ct,{color:t,size:"xs",children:e})},P=async()=>{if(a&&j){k(!0);try{await (0,c.credentialDeleteCall)(a,j.credential_name),d.Z.success("Credential deleted successfully"),await i()}catch(e){d.Z.error("Failed to delete credential")}finally{v(null),C(!1),k(!1)}}},L=e=>{v(e),C(!0)};return(0,s.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto p-2",children:[(0,s.jsx)(b.zx,{onClick:()=>u(!0),children:"Add Credential"}),(0,s.jsx)("div",{className:"flex justify-between items-center mt-4 mb-4",children:(0,s.jsx)(b.xv,{children:"Configured credentials for different AI providers. Add and manage your API credentials."})}),(0,s.jsx)(b.Zb,{children:(0,s.jsxs)(b.iA,{children:[(0,s.jsx)(b.ss,{children:(0,s.jsxs)(b.SC,{children:[(0,s.jsx)(b.xs,{children:"Credential Name"}),(0,s.jsx)(b.xs,{children:"Provider"}),(0,s.jsx)(b.xs,{children:"Actions"})]})}),(0,s.jsx)(b.RM,{children:n&&0!==n.length?n.map((e,l)=>{var t;return(0,s.jsxs)(b.SC,{children:[(0,s.jsx)(b.pj,{children:e.credential_name}),(0,s.jsx)(b.pj,{children:F((null===(t=e.credential_info)||void 0===t?void 0:t.custom_llm_provider)||"-")}),(0,s.jsxs)(b.pj,{children:[(0,s.jsx)(b.zx,{icon:_.Z,variant:"light",size:"sm",onClick:()=>{g(e),x(!0)}}),(0,s.jsx)(b.zx,{icon:y.Z,variant:"light",size:"sm",onClick:()=>L(e),className:"ml-2"})]})]},l)}):(0,s.jsx)(b.SC,{children:(0,s.jsx)(b.pj,{colSpan:4,className:"text-center py-4 text-gray-500",children:"No credentials configured"})})})]})}),m&&(0,s.jsx)(U,{onAddCredential:I,open:m,onCancel:()=>u(!1),uploadProps:t}),h&&(0,s.jsx)(H,{open:h,existingCredential:p,onUpdateCredential:M,uploadProps:t,onCancel:()=>x(!1)}),(0,s.jsx)(Z.Z,{isOpen:w,onCancel:()=>{v(null),C(!1)},onOk:P,title:"Delete Credential?",message:"Are you sure you want to delete this credential? This action cannot be undone and may break existing integrations.",resourceInformationTitle:"Credential Information",resourceInformation:[{label:"Credential Name",value:null==j?void 0:j.credential_name},{label:"Provider",value:(null==j?void 0:null===(l=j.credential_info)||void 0===l?void 0:l.custom_llm_provider)||"-"}],confirmLoading:S,requiredConfirmation:null==j?void 0:j.credential_name})]})};let W=e=>{var l;return(null==e?void 0:null===(l=e.model_info)||void 0===l?void 0:l.team_public_model_name)?e.model_info.team_public_model_name:(null==e?void 0:e.model_name)||"-"};var Y=t(23628),$=t(47323),Q=t(12485),X=t(18135),ee=t(35242),el=t(29706),et=t(77991),es=t(20347),ea=t(59341),er=t(5945),ei=t(84376),en=t(29),eo=t.n(en),ed=t(23496),ec=t(35291),em=t(23639),eu=t(15424);let{Text:eh}=C.default;var ex=e=>{let{formValues:l,accessToken:t,testMode:a,modelName:r="this model",onClose:i,onTestComplete:n}=e,[m,h]=o.useState(null),[x,p]=o.useState(null),[g,f]=o.useState(null),[j,v]=o.useState(!0),[_,y]=o.useState(!1),[b,N]=o.useState(!1),Z=async()=>{v(!0),N(!1),h(null),p(null),f(null),y(!1),await new Promise(e=>setTimeout(e,100));try{console.log("Testing connection with form values:",l);let a=await u(l,t,null);if(!a){console.log("No result from prepareModelAddRequest"),h("Failed to prepare model data. Please check your form inputs."),y(!1),v(!1);return}console.log("Result from prepareModelAddRequest:",a);let{litellmParamsObj:r,modelInfoObj:i,modelName:n}=a[0],o=await (0,c.testConnectionRequest)(t,r,i,null==i?void 0:i.mode);if("success"===o.status)d.Z.success("Connection test successful!"),h(null),y(!0);else{var e,s;let l=(null===(e=o.result)||void 0===e?void 0:e.error)||o.message||"Unknown error";h(l),p(r),f(null===(s=o.result)||void 0===s?void 0:s.raw_request_typed_dict),y(!1)}}catch(e){console.error("Test connection error:",e),h(e instanceof Error?e.message:String(e)),y(!1)}finally{v(!1),n&&n()}};o.useEffect(()=>{let e=setTimeout(()=>{Z()},200);return()=>clearTimeout(e)},[]);let w=e=>e?e.split("stack trace:")[0].trim().replace(/^litellm\.(.*?)Error: /,""):"Unknown error",C="string"==typeof m?w(m):(null==m?void 0:m.message)?w(m.message):"Unknown error",S=g?((e,l,t)=>{let s=JSON.stringify(l,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[l,t]=e;return"-H '".concat(l,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(s,"\n }'")})(g.raw_request_api_base,g.raw_request_body,g.raw_request_headers||{}):"";return(0,s.jsxs)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:[j?(0,s.jsxs)("div",{style:{textAlign:"center",padding:"32px 20px"},className:"jsx-dc9a0e2d897fe63b",children:[(0,s.jsx)("div",{style:{marginBottom:"16px"},className:"jsx-dc9a0e2d897fe63b loading-spinner",children:(0,s.jsx)("div",{style:{border:"3px solid #f3f3f3",borderTop:"3px solid #1890ff",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite",margin:"0 auto"},className:"jsx-dc9a0e2d897fe63b"})}),(0,s.jsxs)(eh,{style:{fontSize:"16px"},children:["Testing connection to ",r,"..."]}),(0,s.jsx)(eo(),{id:"dc9a0e2d897fe63b",children:"@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}"})]}):_?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 20px"},children:[(0,s.jsx)("div",{style:{color:"#52c41a",fontSize:"24px",display:"flex",alignItems:"center"},children:(0,s.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})})}),(0,s.jsxs)(eh,{type:"success",style:{fontSize:"18px",fontWeight:500,marginLeft:"10px"},children:["Connection to ",r," successful!"]})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"20px"},children:[(0,s.jsx)(ec.Z,{style:{color:"#ff4d4f",fontSize:"24px",marginRight:"12px"}}),(0,s.jsxs)(eh,{type:"danger",style:{fontSize:"18px",fontWeight:500},children:["Connection to ",r," failed"]})]}),(0,s.jsxs)("div",{style:{backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"8px",padding:"16px",marginBottom:"20px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.03)"},children:[(0,s.jsxs)(eh,{strong:!0,style:{display:"block",marginBottom:"8px"},children:["Error:"," "]}),(0,s.jsx)(eh,{type:"danger",style:{fontSize:"14px",lineHeight:"1.5"},children:C}),m&&(0,s.jsx)("div",{style:{marginTop:"12px"},children:(0,s.jsx)(E.ZP,{type:"link",onClick:()=>N(!b),style:{paddingLeft:0,height:"auto"},children:b?"Hide Details":"Show Details"})})]}),b&&(0,s.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,s.jsx)(eh,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"Troubleshooting Details"}),(0,s.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"200px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:"string"==typeof m?m:JSON.stringify(m,null,2)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(eh,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"API Request"}),(0,s.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"250px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:S||"No request data available"}),(0,s.jsx)(E.ZP,{style:{marginTop:"8px"},icon:(0,s.jsx)(em.Z,{}),onClick:()=>{navigator.clipboard.writeText(S||""),d.Z.success("Copied to clipboard")},children:"Copy to Clipboard"})]})]})}),(0,s.jsx)(ed.Z,{style:{margin:"24px 0 16px"}}),(0,s.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,s.jsx)(E.ZP,{type:"link",href:"https://docs.litellm.ai/docs/providers",target:"_blank",icon:(0,s.jsx)(eu.Z,{}),children:"View Documentation"})})]})};let ep=async(e,l,t,s)=>{try{console.log("=== AUTO ROUTER SUBMIT HANDLER CALLED ==="),console.log("handling auto router submit for formValues:",e),console.log("Access token:",l?"Present":"Missing"),console.log("Form:",t?"Present":"Missing"),console.log("Callback:",s?"Present":"Missing");let a={model_name:e.auto_router_name,litellm_params:{model:"auto_router/".concat(e.auto_router_name),auto_router_config:JSON.stringify(e.auto_router_config),auto_router_default_model:e.auto_router_default_model},model_info:{}};e.auto_router_embedding_model&&"custom"!==e.auto_router_embedding_model?a.litellm_params.auto_router_embedding_model=e.auto_router_embedding_model:e.custom_embedding_model&&(a.litellm_params.auto_router_embedding_model=e.custom_embedding_model),e.team_id&&(a.model_info.team_id=e.team_id),e.model_access_group&&e.model_access_group.length>0&&(a.model_info.access_groups=e.model_access_group),console.log("Auto router configuration to be created:",a),console.log("Auto router config (stringified):",a.litellm_params.auto_router_config),console.log("Calling modelCreateCall with:",{accessToken:l?"Present":"Missing",config:a});let r=await (0,c.modelCreateCall)(l,a);console.log("response for auto router create call:",r),t.resetFields()}catch(e){console.error("Failed to add auto router:",e),d.Z.fromBackend("Failed to add auto router: "+e)}};var eg=t(10703),ef=t(44851),ej=t(19015),ev=t(96473),e_=t(70464),ey=t(26349),eb=t(92280);let{TextArea:eN}=O.default,{Panel:eZ}=ef.default;var ew=e=>{let{modelInfo:l,value:t,onChange:a}=e,[r,i]=(0,o.useState)([]),[n,d]=(0,o.useState)(!1),[c,m]=(0,o.useState)([]);(0,o.useEffect)(()=>{if(null==t?void 0:t.routes){let e=t.routes.map((e,l)=>({id:e.id||"route-".concat(l,"-").concat(Date.now()),model:e.name||e.model||"",utterances:e.utterances||[],description:e.description||"",score_threshold:e.score_threshold||.5}));i(e),m(e.map(e=>e.id))}else i([]),m([])},[t]);let u=e=>{let l=r.filter(l=>l.id!==e);i(l),x(l),m(l=>l.filter(l=>l!==e))},h=(e,l,t)=>{let s=r.map(s=>s.id===e?{...s,[l]:t}:s);i(s),x(s)},x=e=>{let l={routes:e.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))};null==a||a(l)},p=l.map(e=>({value:e.model_group,label:e.model_group}));return(0,s.jsxs)("div",{className:"w-full max-w-none",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6 w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(eb.x,{className:"text-lg font-semibold",children:"Routes Configuration"}),(0,s.jsx)(A.Z,{title:"Configure routing logic to automatically select the best model based on user input patterns",children:(0,s.jsx)(eu.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(E.ZP,{type:"primary",icon:(0,s.jsx)(ev.Z,{}),onClick:()=>{let e="route-".concat(Date.now()),l=[...r,{id:e,model:"",utterances:[],description:"",score_threshold:.5}];i(l),x(l),m(l=>[...l,e])},className:"bg-blue-600 hover:bg-blue-700",children:"Add Route"})]}),0===r.length?(0,s.jsx)("div",{className:"text-center py-12 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed border-gray-200 mb-6",children:(0,s.jsx)(eb.x,{children:"No routes configured. Click “Add Route” to get started."})}):(0,s.jsx)("div",{className:"space-y-3 mb-6 w-full",children:r.map((e,l)=>(0,s.jsx)(er.Z,{className:"border border-gray-200 shadow-sm w-full",bodyStyle:{padding:0},children:(0,s.jsx)(ef.default,{ghost:!0,expandIcon:e=>{let{isActive:l}=e;return(0,s.jsx)(e_.Z,{rotate:l?180:0})},activeKey:c,onChange:e=>m(Array.isArray(e)?e:[e].filter(Boolean)),items:[{key:e.id,label:(0,s.jsxs)("div",{className:"flex justify-between items-center py-2",children:[(0,s.jsxs)(eb.x,{className:"font-medium text-base",children:["Route ",l+1,": ",e.model||"Unnamed"]}),(0,s.jsx)(E.ZP,{type:"text",danger:!0,icon:(0,s.jsx)(ey.Z,{}),onClick:l=>{l.stopPropagation(),u(e.id)},className:"mr-2"})]}),children:(0,s.jsxs)("div",{className:"px-6 pb-6 w-full",children:[(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsx)(eb.x,{className:"text-sm font-medium mb-2 block",children:"Model"}),(0,s.jsx)(k.default,{value:e.model,onChange:l=>h(e.id,"model",l),placeholder:"Select model",showSearch:!0,style:{width:"100%"},options:p})]}),(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsx)(eb.x,{className:"text-sm font-medium mb-2 block",children:"Description"}),(0,s.jsx)(eN,{value:e.description,onChange:l=>h(e.id,"description",l.target.value),placeholder:"Describe when this route should be used...",rows:2,style:{width:"100%"}})]}),(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(eb.x,{className:"text-sm font-medium",children:"Score Threshold"}),(0,s.jsx)(A.Z,{title:"Minimum similarity score to route to this model (0-1)",children:(0,s.jsx)(eu.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(ej.Z,{value:e.score_threshold,onChange:l=>h(e.id,"score_threshold",l||0),min:0,max:1,step:.1,style:{width:"100%"},placeholder:"0.5"})]}),(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(eb.x,{className:"text-sm font-medium",children:"Example Utterances"}),(0,s.jsx)(A.Z,{title:"Training examples for this route. Type an utterance and press Enter to add it.",children:(0,s.jsx)(eu.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(eb.x,{className:"text-xs text-gray-500 mb-2",children:"Type an utterance and press Enter to add it. You can also paste multiple lines."}),(0,s.jsx)(k.default,{mode:"tags",value:e.utterances,onChange:l=>h(e.id,"utterances",l),placeholder:"Type an utterance and press Enter...",style:{width:"100%"},tokenSeparators:["\n"],maxTagCount:"responsive",allowClear:!0})]})]})}]})},e.id))}),(0,s.jsxs)("div",{className:"border-t pt-6 w-full",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4 w-full",children:[(0,s.jsx)(eb.x,{className:"text-lg font-semibold",children:"JSON Preview"}),(0,s.jsx)(E.ZP,{type:"link",onClick:()=>d(!n),className:"text-blue-600 p-0",children:n?"Hide":"Show"})]}),n&&(0,s.jsx)(er.Z,{className:"bg-gray-50 w-full",children:(0,s.jsx)("pre",{className:"text-sm overflow-auto max-h-64 w-full",children:JSON.stringify({routes:r.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))},null,2)})})]})]})};let{Title:eC,Link:eS}=C.default;var ek=e=>{let{form:l,handleOk:t,accessToken:a,userRole:r}=e,[i,n]=(0,o.useState)(!1),[m,u]=(0,o.useState)(!1),[h,x]=(0,o.useState)(""),[p,g]=(0,o.useState)([]),[f,j]=(0,o.useState)([]),[v,_]=(0,o.useState)(!1),[y,b]=(0,o.useState)(!1),[Z,w]=(0,o.useState)(null);(0,o.useEffect)(()=>{(async()=>{g((await (0,c.modelAvailableCall)(a,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[a]),(0,o.useEffect)(()=>{(async()=>{try{let e=await (0,eg.p)(a);console.log("Fetched models for auto router:",e),j(e)}catch(e){console.error("Error fetching model info for auto router:",e)}})()},[a]);let M=es.ZL.includes(r),I=async()=>{u(!0),x("test-".concat(Date.now())),n(!0)},F=()=>{console.log("Auto router submit triggered!"),console.log("Router config:",Z);let e=l.getFieldsValue();if(console.log("Form values:",e),!e.auto_router_name){d.Z.fromBackend("Please enter an Auto Router Name");return}if(!e.auto_router_default_model){d.Z.fromBackend("Please select a Default Model");return}if(l.setFieldsValue({custom_llm_provider:"auto_router",model:e.auto_router_name,api_key:"not_required_for_auto_router"}),!Z||!Z.routes||0===Z.routes.length){d.Z.fromBackend("Please configure at least one route for the auto router");return}if(Z.routes.filter(e=>!e.name||!e.description||0===e.utterances.length).length>0){d.Z.fromBackend("Please ensure all routes have a target model, description, and at least one utterance");return}l.validateFields().then(e=>{console.log("Form validation passed, submitting with values:",e);let s={...e,auto_router_config:Z};console.log("Final submit values:",s),ep(s,a,l,t)}).catch(e=>{console.error("Validation failed:",e);let l=e.errorFields||[];if(l.length>0){let e=l.map(e=>{let l=e.name[0];return({auto_router_name:"Auto Router Name",auto_router_default_model:"Default Model",auto_router_embedding_model:"Embedding Model"})[l]||l});d.Z.fromBackend("Please fill in the following required fields: ".concat(e.join(", ")))}else d.Z.fromBackend("Please fill in all required fields")})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eC,{level:2,children:"Add Auto Router"}),(0,s.jsx)(P.x,{className:"text-gray-600 mb-6",children:"Create an auto router with intelligent routing logic that automatically selects the best model based on user input patterns and semantic matching."}),(0,s.jsx)(er.Z,{children:(0,s.jsxs)(N.Z,{form:l,onFinish:F,labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,s.jsx)(N.Z.Item,{rules:[{required:!0,message:"Auto router name is required"}],label:"Auto Router Name",name:"auto_router_name",tooltip:"Unique name for this auto router configuration",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(P.o,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,s.jsx)("div",{className:"w-full mb-4",children:(0,s.jsx)(ew,{modelInfo:f,value:Z,onChange:e=>{w(e),l.setFieldValue("auto_router_config",e)}})}),(0,s.jsx)(N.Z.Item,{rules:[{required:!0,message:"Default model is required"}],label:"Default Model",name:"auto_router_default_model",tooltip:"Fallback model to use when auto routing logic cannot determine the best model",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(k.default,{placeholder:"Select a default model",onChange:e=>{_("custom"===e)},options:[...Array.from(new Set(f.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0})}),(0,s.jsx)(N.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",tooltip:"Optional: Embedding model to use for semantic routing decisions",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(k.default,{value:l.getFieldValue("auto_router_embedding_model"),placeholder:"Select an embedding model (optional)",onChange:e=>{b("custom"===e),l.setFieldValue("auto_router_embedding_model",e)},options:[...Array.from(new Set(f.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0,allowClear:!0})}),(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Settings"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),M&&(0,s.jsx)(N.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to control who can access this auto router",children:(0,s.jsx)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:p.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})}),(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(C.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{className:"space-x-2",children:[(0,s.jsx)(E.ZP,{onClick:I,loading:m,children:"Test Connect"}),(0,s.jsx)(E.ZP,{onClick:()=>{console.log("Add Auto Router button clicked!"),console.log("Current router config:",Z),console.log("Current form values:",l.getFieldsValue()),F()},children:"Add Auto Router"})]})]})]})}),(0,s.jsx)(S.Z,{title:"Connection Test Results",open:i,onCancel:()=>{n(!1),u(!1)},footer:[(0,s.jsx)(E.ZP,{onClick:()=>{n(!1),u(!1)},children:"Close"},"close")],width:700,children:i&&(0,s.jsx)(ex,{formValues:l.getFieldsValue(),accessToken:a,testMode:"chat",modelName:l.getFieldValue("auto_router_name"),onClose:()=>{n(!1),u(!1)},onTestComplete:()=>u(!1)},h)})]})};let eA=[{value:"chat",label:"Chat - /chat/completions"},{value:"completion",label:"Completion - /completions"},{value:"embedding",label:"Embedding - /embeddings"},{value:"audio_speech",label:"Audio Speech - /audio/speech"},{value:"audio_transcription",label:"Audio Transcription - /audio/transcriptions"},{value:"image_generation",label:"Image Generation - /images/generations"},{value:"video_generation",label:"Video Generation - /videos"},{value:"rerank",label:"Rerank - /rerank"},{value:"realtime",label:"Realtime - /realtime"},{value:"batch",label:"Batch - /batch"},{value:"ocr",label:"OCR - /ocr"}];var eE=t(63709),eM=t(26210),eI=t(34766),eF=t(45246),eP=t(24199);let{Text:eL}=C.default;var eT=e=>{let{form:l,showCacheControl:t,onCacheControlChange:a}=e,r=e=>{let t=l.getFieldValue("litellm_extra_params");try{let s=t?JSON.parse(t):{};e.length>0?s.cache_control_injection_points=e:delete s.cache_control_injection_points,Object.keys(s).length>0?l.setFieldValue("litellm_extra_params",JSON.stringify(s,null,2)):l.setFieldValue("litellm_extra_params","")}catch(e){console.error("Error updating cache control points:",e)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.Z.Item,{label:"Cache Control Injection Points",name:"cache_control",valuePropName:"checked",className:"mb-4",tooltip:"Tell litellm where to inject cache control checkpoints. You can specify either by role (to apply to all messages of that role) or by specific message index.",children:(0,s.jsx)(eE.Z,{onChange:a,className:"bg-gray-600"})}),t&&(0,s.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,s.jsx)(eL,{className:"text-sm text-gray-500 block mb-4",children:"Providers like Anthropic, Bedrock API require users to specify where to inject cache control checkpoints, litellm can automatically add them for you as a cost saving feature."}),(0,s.jsx)(N.Z.List,{name:"cache_control_injection_points",initialValue:[{location:"message"}],children:(e,t)=>{let{add:a,remove:i}=t;return(0,s.jsxs)(s.Fragment,{children:[e.map((t,a)=>(0,s.jsxs)("div",{className:"flex items-center mb-4 gap-4",children:[(0,s.jsx)(N.Z.Item,{...t,label:"Type",name:[t.name,"location"],initialValue:"message",className:"mb-0",style:{width:"180px"},children:(0,s.jsx)(k.default,{disabled:!0,options:[{value:"message",label:"Message"}]})}),(0,s.jsx)(N.Z.Item,{...t,label:"Role",name:[t.name,"role"],className:"mb-0",style:{width:"180px"},tooltip:"LiteLLM will mark all messages of this role as cacheable",children:(0,s.jsx)(k.default,{placeholder:"Select a role",allowClear:!0,options:[{value:"user",label:"User"},{value:"system",label:"System"},{value:"assistant",label:"Assistant"}],onChange:()=>{r(l.getFieldValue("cache_control_points"))}})}),(0,s.jsx)(N.Z.Item,{...t,label:"Index",name:[t.name,"index"],className:"mb-0",style:{width:"180px"},tooltip:"(Optional) If set litellm will mark the message at this index as cacheable",children:(0,s.jsx)(eP.Z,{type:"number",placeholder:"Optional",step:1,onChange:()=>{r(l.getFieldValue("cache_control_points"))}})}),e.length>1&&(0,s.jsx)(eF.Z,{className:"text-red-500 cursor-pointer text-lg ml-12",onClick:()=>{i(t.name),setTimeout(()=>{r(l.getFieldValue("cache_control_points"))},0)}})]},t.key)),(0,s.jsx)(N.Z.Item,{children:(0,s.jsxs)("button",{type:"button",className:"flex items-center justify-center w-full border border-dashed border-gray-300 py-2 px-4 text-gray-600 hover:text-blue-600 hover:border-blue-300 transition-all rounded",onClick:()=>a(),children:[(0,s.jsx)(ev.Z,{className:"mr-2"}),"Add Injection Point"]})})]})}})]})]})},eR=t(9309);let{Link:eO}=C.default;var eV=e=>{let{showAdvancedSettings:l,setShowAdvancedSettings:t,teams:a,guardrailsList:r,tagsList:i}=e,[n]=N.Z.useForm(),[d,c]=o.useState(!1),[m,u]=o.useState("per_token"),[h,x]=o.useState(!1),p=(e,l)=>l&&(isNaN(Number(l))||0>Number(l))?Promise.reject("Please enter a valid positive number"):Promise.resolve();return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(eM.UQ,{className:"mt-2 mb-4",children:[(0,s.jsx)(eM._m,{children:(0,s.jsx)("b",{children:"Advanced Settings"})}),(0,s.jsx)(eM.X1,{children:(0,s.jsxs)("div",{className:"bg-white rounded-lg",children:[(0,s.jsx)(N.Z.Item,{label:"Custom Pricing",name:"custom_pricing",valuePropName:"checked",className:"mb-4",children:(0,s.jsx)(eE.Z,{onChange:e=>{c(e),e||n.setFieldsValue({input_cost_per_token:void 0,output_cost_per_token:void 0,input_cost_per_second:void 0})},className:"bg-gray-600"})}),(0,s.jsx)(N.Z.Item,{label:(0,s.jsxs)("span",{children:["Guardrails"," ",(0,s.jsx)(A.Z,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(eu.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:"Select existing guardrails. Go to 'Guardrails' tab to create new guardrails.",children:(0,s.jsx)(k.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:r.map(e=>({value:e,label:e}))})}),(0,s.jsx)(N.Z.Item,{label:"Tags",name:"tags",className:"mb-4",children:(0,s.jsx)(k.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter tags",options:Object.values(i).map(e=>({value:e.name,label:e.name,title:e.description||e.name}))})}),d&&(0,s.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,s.jsx)(N.Z.Item,{label:"Pricing Model",name:"pricing_model",className:"mb-4",children:(0,s.jsx)(k.default,{defaultValue:"per_token",onChange:e=>u(e),options:[{value:"per_token",label:"Per Million Tokens"},{value:"per_second",label:"Per Second"}]})}),"per_token"===m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.Z.Item,{label:"Input Cost (per 1M tokens)",name:"input_cost_per_token",rules:[{validator:p}],className:"mb-4",children:(0,s.jsx)(eM.oi,{})}),(0,s.jsx)(N.Z.Item,{label:"Output Cost (per 1M tokens)",name:"output_cost_per_token",rules:[{validator:p}],className:"mb-4",children:(0,s.jsx)(eM.oi,{})})]}):(0,s.jsx)(N.Z.Item,{label:"Cost Per Second",name:"input_cost_per_second",rules:[{validator:p}],className:"mb-4",children:(0,s.jsx)(eM.oi,{})})]}),(0,s.jsx)(N.Z.Item,{label:"Use in pass through routes",name:"use_in_pass_through",valuePropName:"checked",className:"mb-4 mt-4",tooltip:(0,s.jsxs)("span",{children:["Allow using these credentials in pass through routes."," ",(0,s.jsx)(eO,{href:"https://docs.litellm.ai/docs/pass_through/vertex_ai",target:"_blank",children:"Learn more"})]}),children:(0,s.jsx)(eE.Z,{onChange:e=>{let l=n.getFieldValue("litellm_extra_params");try{let t=l?JSON.parse(l):{};e?t.use_in_pass_through=!0:delete t.use_in_pass_through,Object.keys(t).length>0?n.setFieldValue("litellm_extra_params",JSON.stringify(t,null,2)):n.setFieldValue("litellm_extra_params","")}catch(l){e?n.setFieldValue("litellm_extra_params",JSON.stringify({use_in_pass_through:!0},null,2)):n.setFieldValue("litellm_extra_params","")}},className:"bg-gray-600"})}),(0,s.jsx)(eT,{form:n,showCacheControl:h,onCacheControlChange:e=>{if(x(e),!e){let e=n.getFieldValue("litellm_extra_params");try{let l=e?JSON.parse(e):{};delete l.cache_control_injection_points,Object.keys(l).length>0?n.setFieldValue("litellm_extra_params",JSON.stringify(l,null,2)):n.setFieldValue("litellm_extra_params","")}catch(e){n.setFieldValue("litellm_extra_params","")}}}}),(0,s.jsx)(N.Z.Item,{label:"LiteLLM Params",name:"litellm_extra_params",tooltip:"Optional litellm params used for making a litellm.completion() call.",className:"mb-4 mt-4",rules:[{validator:eR.Ac}],children:(0,s.jsx)(eI.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,s.jsxs)(L.Z,{className:"mb-4",children:[(0,s.jsx)(T.Z,{span:10}),(0,s.jsx)(T.Z,{span:10,children:(0,s.jsxs)(eM.xv,{className:"text-gray-600 text-sm",children:["Pass JSON of litellm supported params"," ",(0,s.jsx)(eO,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]}),(0,s.jsx)(N.Z.Item,{label:"Model Info",name:"model_info_params",tooltip:"Optional model info params. Returned when calling `/model/info` endpoint.",className:"mb-0",rules:[{validator:eR.Ac}],children:(0,s.jsx)(eI.Z,{rows:4,placeholder:'{ "mode": "chat" }'})})]})})]})})},eD=t(56609),ez=t(67187);let eq=e=>{let{content:l,children:t,width:a="auto",className:r=""}=e,[i,n]=(0,o.useState)(!1),[d,c]=(0,o.useState)("top"),m=(0,o.useRef)(null),u=()=>{if(m.current){let e=m.current.getBoundingClientRect(),l=e.top,t=window.innerHeight-e.bottom;l<300&&t>300?c("bottom"):c("top")}};return(0,s.jsxs)("div",{className:"relative inline-block",ref:m,children:[t||(0,s.jsx)(ez.Z,{className:"ml-1 text-gray-500 cursor-help",onMouseEnter:()=>{u(),n(!0)},onMouseLeave:()=>n(!1)}),i&&(0,s.jsxs)("div",{className:"absolute left-1/2 -translate-x-1/2 z-50 bg-black/90 text-white p-2 rounded-md text-sm font-normal shadow-lg ".concat(r),style:{["top"===d?"bottom":"top"]:"100%",width:a,marginBottom:"top"===d?"8px":"0",marginTop:"bottom"===d?"8px":"0"},children:[l,(0,s.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 w-0 h-0",style:{top:"top"===d?"100%":"auto",bottom:"bottom"===d?"100%":"auto",borderTop:"top"===d?"6px solid rgba(0, 0, 0, 0.9)":"6px solid transparent",borderBottom:"bottom"===d?"6px solid rgba(0, 0, 0, 0.9)":"6px solid transparent",borderLeft:"6px solid transparent",borderRight:"6px solid transparent"}})]})]})};var eB=()=>{let e=N.Z.useFormInstance(),[l,t]=(0,o.useState)(0),a=N.Z.useWatch("model",e)||[],r=Array.isArray(a)?a:[a],i=N.Z.useWatch("custom_model_name",e),n=!r.includes("all-wildcard"),d=N.Z.useWatch("custom_llm_provider",e);if((0,o.useEffect)(()=>{if(i&&r.includes("custom")){let l=(e.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?d===m.Cl.Azure?{public_name:i,litellm_model:"azure/".concat(i)}:{public_name:i,litellm_model:i}:e);e.setFieldValue("model_mappings",l),t(e=>e+1)}},[i,r,d,e]),(0,o.useEffect)(()=>{if(r.length>0&&!r.includes("all-wildcard")){let l=e.getFieldValue("model_mappings")||[];if(l.length!==r.length||!r.every(e=>l.some(l=>"custom"===e?"custom"===l.litellm_model||l.litellm_model===i:d===m.Cl.Azure?l.litellm_model==="azure/".concat(e):l.litellm_model===e))){let l=r.map(e=>"custom"===e&&i?d===m.Cl.Azure?{public_name:i,litellm_model:"azure/".concat(i)}:{public_name:i,litellm_model:i}:d===m.Cl.Azure?{public_name:e,litellm_model:"azure/".concat(e)}:{public_name:e,litellm_model:e});e.setFieldValue("model_mappings",l),t(e=>e+1)}}},[r,i,d,e]),!n)return null;let c=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-2 font-normal",children:"The name you specify in your API calls to LiteLLM Proxy"}),(0,s.jsxs)("div",{className:"mb-2 font-normal",children:[(0,s.jsx)("strong",{children:"Example:"})," If you name your public model"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"example-name"}),", and choose"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"openai/qwen-plus-latest"})," as the LiteLLM model"]}),(0,s.jsxs)("div",{className:"mb-2 font-normal",children:[(0,s.jsx)("strong",{children:"Usage:"})," You make an API call to the LiteLLM proxy with"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:'model = "example-name"'})]}),(0,s.jsxs)("div",{className:"font-normal",children:[(0,s.jsx)("strong",{children:"Result:"})," LiteLLM sends"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"qwen-plus-latest"})," to the provider"]})]}),u=(0,s.jsx)("div",{children:"The model name LiteLLM will send to the LLM API"}),h=[{title:(0,s.jsxs)("span",{className:"flex items-center",children:["Public Model Name",(0,s.jsx)(eq,{content:c,width:"500px"})]}),dataIndex:"public_name",key:"public_name",render:(l,t,a)=>(0,s.jsx)(w.o,{value:l,onChange:l=>{let t=[...e.getFieldValue("model_mappings")];t[a].public_name=l.target.value,e.setFieldValue("model_mappings",t)}})},{title:(0,s.jsxs)("span",{className:"flex items-center",children:["LiteLLM Model Name",(0,s.jsx)(eq,{content:u,width:"360px"})]}),dataIndex:"litellm_model",key:"litellm_model"}];return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(N.Z.Item,{label:"Model Mappings",name:"model_mappings",tooltip:"Map public model names to LiteLLM model names for load balancing",labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",rules:[{required:!0,validator:async(e,l)=>{if(!l||0===l.length)throw Error("At least one model mapping is required");if(l.filter(e=>!e.public_name||""===e.public_name.trim()).length>0)throw Error("All model mappings must have valid public names")}}],children:(0,s.jsx)(eD.Z,{dataSource:e.getFieldValue("model_mappings"),columns:h,pagination:!1,size:"small"},l)})})},eU=e=>{let{selectedProvider:l,providerModels:t,getPlaceholder:a}=e,r=N.Z.useFormInstance(),i=e=>{let t=e.target.value,s=(r.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?l===m.Cl.Azure?{public_name:t,litellm_model:"azure/".concat(t)}:{public_name:t,litellm_model:t}:e);r.setFieldsValue({model_mappings:s})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(N.Z.Item,{label:"LiteLLM Model Name(s)",tooltip:"The model name LiteLLM will send to the LLM API",className:"mb-0",children:[(0,s.jsx)(N.Z.Item,{name:"model",rules:[{required:!0,message:"Please enter ".concat(l===m.Cl.Azure?"a deployment name":"at least one model",".")}],noStyle:!0,children:l===m.Cl.Azure||l===m.Cl.OpenAI_Compatible||l===m.Cl.Ollama?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(P.o,{placeholder:a(l),onChange:l===m.Cl.Azure?e=>{let l=e.target.value,t=l?[{public_name:l,litellm_model:"azure/".concat(l)}]:[];r.setFieldsValue({model:l,model_mappings:t})}:void 0})}):t.length>0?(0,s.jsx)(k.default,{mode:"multiple",allowClear:!0,showSearch:!0,placeholder:"Select models",onChange:e=>{let t=Array.isArray(e)?e:[e];if(t.includes("all-wildcard"))r.setFieldsValue({model_name:void 0,model_mappings:[]});else if(JSON.stringify(r.getFieldValue("model"))!==JSON.stringify(t)){let e=t.map(e=>l===m.Cl.Azure?{public_name:e,litellm_model:"azure/".concat(e)}:{public_name:e,litellm_model:e});r.setFieldsValue({model:t,model_mappings:e})}},optionFilterProp:"children",filterOption:(e,l)=>{var t;return(null!==(t=null==l?void 0:l.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{label:"Custom Model Name (Enter below)",value:"custom"},{label:"All ".concat(l," Models (Wildcard)"),value:"all-wildcard"},...t.map(e=>({label:e,value:e}))],style:{width:"100%"}}):(0,s.jsx)(P.o,{placeholder:a(l)})}),(0,s.jsx)(N.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.model!==l.model,children:e=>{let{getFieldValue:t}=e,a=t("model")||[];return(Array.isArray(a)?a:[a]).includes("custom")&&(0,s.jsx)(N.Z.Item,{name:"custom_model_name",rules:[{required:!0,message:"Please enter a custom model name."}],className:"mt-2",children:(0,s.jsx)(P.o,{placeholder:l===m.Cl.Azure?"Enter Azure deployment name":"Enter custom model name",onChange:i})})}})]}),(0,s.jsxs)(L.Z,{children:[(0,s.jsx)(T.Z,{span:10}),(0,s.jsx)(T.Z,{span:14,children:(0,s.jsx)(P.x,{className:"mb-3 mt-1",children:l===m.Cl.Azure?"Your deployment name will be saved as the public model name, and LiteLLM will use 'azure/deployment-name' internally":"The model name LiteLLM will send to the LLM API"})})]})]})};let{Title:eG,Link:eH}=C.default;var eK=e=>{let{form:l,handleOk:t,selectedProvider:a,setSelectedProvider:r,providerModels:i,setProviderModelsFn:d,getPlaceholder:u,uploadProps:h,showAdvancedSettings:x,setShowAdvancedSettings:p,teams:g,credentials:f,accessToken:j,userRole:v,premiumUser:_}=e,[y]=N.Z.useForm(),[b,Z]=(0,o.useState)("chat"),[w,M]=(0,o.useState)(!1),[F,P]=(0,o.useState)(!1),[R,O]=(0,o.useState)([]),[V,D]=(0,o.useState)({}),[z,B]=(0,o.useState)(""),{data:U,isLoading:G,error:H}=I();(0,o.useEffect)(()=>{(async()=>{try{let e=(await (0,c.getGuardrailsList)(j)).guardrails.map(e=>e.guardrail_name);O(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[j]),(0,o.useEffect)(()=>{(async()=>{try{let e=await (0,c.tagListCall)(j);D(e)}catch(e){console.error("Failed to fetch tags:",e)}})()},[j]);let K=async()=>{P(!0),B("test-".concat(Date.now())),M(!0)},[J,W]=(0,o.useState)(!1),[Y,$]=(0,o.useState)([]);(0,o.useEffect)(()=>{(async()=>{$((await (0,c.modelAvailableCall)(j,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[j]);let en=(0,o.useMemo)(()=>U?[...U].sort((e,l)=>e.provider_display_name.localeCompare(l.provider_display_name)):[],[U]),eo=H?H instanceof Error?H.message:"Failed to load providers":null,ed=es.ZL.includes(v);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(X.Z,{className:"w-full",children:[(0,s.jsxs)(ee.Z,{className:"mb-4",children:[(0,s.jsx)(Q.Z,{children:"Add Model"}),(0,s.jsx)(Q.Z,{children:"Add Auto Router"})]}),(0,s.jsxs)(et.Z,{children:[(0,s.jsxs)(el.Z,{children:[(0,s.jsx)(eG,{level:2,children:"Add Model"}),(0,s.jsx)(er.Z,{children:(0,s.jsx)(N.Z,{form:l,onFinish:e=>{console.log("\uD83D\uDD25 Form onFinish triggered with values:",e),t()},onFinishFailed:e=>{console.log("\uD83D\uDCA5 Form onFinishFailed triggered:",e)},labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"E.g. OpenAI, Azure OpenAI, Anthropic, Bedrock, etc.",labelCol:{span:10},labelAlign:"left",children:(0,s.jsxs)(k.default,{showSearch:!0,loading:G,placeholder:G?"Loading providers...":"Select a provider",optionFilterProp:"data-label",onChange:e=>{r(e),d(e),l.setFieldsValue({custom_llm_provider:e}),l.setFieldsValue({model:[],model_name:void 0})},children:[eo&&0===en.length&&(0,s.jsx)(k.default.Option,{value:"",children:eo},"__error"),en.map(e=>{var l;let t=e.provider_display_name,a=e.provider,r=null!==(l=m.cd[t])&&void 0!==l?l:"";return(0,s.jsx)(k.default.Option,{value:a,"data-label":t,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[r?(0,s.jsx)("img",{src:r,alt:"".concat(t," logo"),className:"w-5 h-5",onError:e=>{let l=e.currentTarget,s=l.parentElement;if(s&&s.contains(l))try{let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),s.replaceChild(e,l)}catch(e){console.error("Failed to replace provider logo fallback:",e)}}}):(0,s.jsx)("div",{className:"w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:t.charAt(0)}),(0,s.jsx)("span",{children:t})]})},a)})]})}),(0,s.jsx)(eU,{selectedProvider:a,providerModels:i,getPlaceholder:u}),(0,s.jsx)(eB,{}),(0,s.jsx)(N.Z.Item,{label:"Mode",name:"mode",className:"mb-1",children:(0,s.jsx)(k.default,{style:{width:"100%"},value:b,onChange:e=>Z(e),options:eA})}),(0,s.jsxs)(L.Z,{children:[(0,s.jsx)(T.Z,{span:10}),(0,s.jsx)(T.Z,{span:10,children:(0,s.jsxs)(n.Z,{className:"mb-5 mt-1",children:[(0,s.jsx)("strong",{children:"Optional"})," - LiteLLM endpoint to use when health checking this model"," ",(0,s.jsx)(eH,{href:"https://docs.litellm.ai/docs/proxy/health#health",target:"_blank",children:"Learn more"})]})})]}),(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)(C.default.Text,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter new provider credentials below"})}),(0,s.jsx)(N.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",initialValue:null,children:(0,s.jsx)(k.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,l)=>{var t;return(null!==(t=null==l?void 0:l.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...f.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,s.jsx)(N.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.litellm_credential_name!==l.litellm_credential_name||e.provider!==l.provider,children:e=>{let{getFieldValue:l}=e,t=l("litellm_credential_name");return(console.log("\uD83D\uDD11 Credential Name Changed:",t),t)?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,s.jsx)(q,{selectedProvider:a,uploadProps:h})]})}}),(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Model Info Settings"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,s.jsx)(N.Z.Item,{label:"Team-BYOK Model",tooltip:"Only use this model + credential combination for this team. Useful when teams want to onboard their own OpenAI keys.",className:"mb-4",children:(0,s.jsx)(A.Z,{title:_?"":"This is an enterprise-only feature. Upgrade to premium to restrict model+credential combinations to a specific team.",placement:"top",children:(0,s.jsx)(ea.Z,{checked:J,onChange:e=>{W(e),e||l.setFieldValue("team_id",void 0)},disabled:!_})})}),J&&(0,s.jsx)(N.Z.Item,{label:"Select Team",name:"team_id",className:"mb-4",tooltip:"Only keys for this team will be able to call this model.",rules:[{required:J&&!ed,message:"Please select a team."}],children:(0,s.jsx)(ei.Z,{teams:g,disabled:!_})}),ed&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(N.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to give users access to select models, and add new ones to the group over time.",children:(0,s.jsx)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:Y.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})}),(0,s.jsx)(eV,{showAdvancedSettings:x,setShowAdvancedSettings:p,teams:g,guardrailsList:R,tagsList:V}),(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(C.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{className:"space-x-2",children:[(0,s.jsx)(E.ZP,{onClick:K,loading:F,children:"Test Connect"}),(0,s.jsx)(E.ZP,{htmlType:"submit",children:"Add Model"})]})]})]})})})]}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(ek,{form:y,handleOk:()=>{y.validateFields().then(e=>{ep(e,j,y,t)}).catch(e=>{console.error("Validation failed:",e)})},accessToken:j,userRole:v})})]})]}),(0,s.jsx)(S.Z,{title:"Connection Test Results",open:w,onCancel:()=>{M(!1),P(!1)},footer:[(0,s.jsx)(E.ZP,{onClick:()=>{M(!1),P(!1)},children:"Close"},"close")],width:700,children:w&&(0,s.jsx)(ex,{formValues:l.getFieldsValue(),accessToken:j,testMode:b,modelName:l.getFieldValue("model_name")||l.getFieldValue("model"),onClose:()=>{M(!1),P(!1)},onTestComplete:()=>P(!1)},z)})]})},eJ=t(10900),eW=t(45589),eY=t(78489),e$=t(12514),eQ=t(49566),eX=t(96761),e0=t(30401),e1=t(78867),e2=t(59872),e4=e=>{let{isVisible:l,onCancel:t,onSuccess:a,modelData:r,accessToken:i,userRole:n}=e,[m]=N.Z.useForm(),[u,h]=(0,o.useState)(!1),[x,p]=(0,o.useState)([]),[g,f]=(0,o.useState)([]),[j,v]=(0,o.useState)(!1),[_,y]=(0,o.useState)(!1),[b,Z]=(0,o.useState)(null);(0,o.useEffect)(()=>{l&&r&&w()},[l,r]),(0,o.useEffect)(()=>{let e=async()=>{if(i)try{let e=await (0,c.modelAvailableCall)(i,"","",!1,null,!0,!0);p(e.data.map(e=>e.id))}catch(e){console.error("Error fetching model access groups:",e)}},t=async()=>{if(i)try{let e=await (0,eg.p)(i);f(e)}catch(e){console.error("Error fetching model info:",e)}};l&&(e(),t())},[l,i]);let w=()=>{try{var e,l,t,s,a,i;let n=null;(null===(e=r.litellm_params)||void 0===e?void 0:e.auto_router_config)&&(n="string"==typeof r.litellm_params.auto_router_config?JSON.parse(r.litellm_params.auto_router_config):r.litellm_params.auto_router_config),Z(n),m.setFieldsValue({auto_router_name:r.model_name,auto_router_default_model:(null===(l=r.litellm_params)||void 0===l?void 0:l.auto_router_default_model)||"",auto_router_embedding_model:(null===(t=r.litellm_params)||void 0===t?void 0:t.auto_router_embedding_model)||"",model_access_group:(null===(s=r.model_info)||void 0===s?void 0:s.access_groups)||[]});let o=new Set(g.map(e=>e.model_group));v(!o.has(null===(a=r.litellm_params)||void 0===a?void 0:a.auto_router_default_model)),y(!o.has(null===(i=r.litellm_params)||void 0===i?void 0:i.auto_router_embedding_model))}catch(e){console.error("Error parsing auto router config:",e),d.Z.fromBackend("Error loading auto router configuration")}},C=async()=>{try{h(!0);let e=await m.validateFields(),l={...r.litellm_params,auto_router_config:JSON.stringify(b),auto_router_default_model:e.auto_router_default_model,auto_router_embedding_model:e.auto_router_embedding_model||void 0},s={...r.model_info,access_groups:e.model_access_group||[]},n={model_name:e.auto_router_name,litellm_params:l,model_info:s};await (0,c.modelPatchUpdateCall)(i,n,r.model_info.id);let o={...r,model_name:e.auto_router_name,litellm_params:l,model_info:s};d.Z.success("Auto router configuration updated successfully"),a(o),t()}catch(e){console.error("Error updating auto router:",e),d.Z.fromBackend("Failed to update auto router configuration")}finally{h(!1)}},A=g.map(e=>({value:e.model_group,label:e.model_group}));return(0,s.jsx)(S.Z,{title:"Edit Auto Router Configuration",open:l,onCancel:t,footer:[(0,s.jsx)(E.ZP,{onClick:t,children:"Cancel"},"cancel"),(0,s.jsx)(E.ZP,{loading:u,onClick:C,children:"Save Changes"},"submit")],width:1e3,destroyOnClose:!0,children:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)(P.x,{className:"text-gray-600",children:"Edit the auto router configuration including routing logic, default models, and access settings."}),(0,s.jsxs)(N.Z,{form:m,layout:"vertical",className:"space-y-4",children:[(0,s.jsx)(N.Z.Item,{label:"Auto Router Name",name:"auto_router_name",rules:[{required:!0,message:"Auto router name is required"}],children:(0,s.jsx)(P.o,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(ew,{modelInfo:g,value:b,onChange:e=>{Z(e)}})}),(0,s.jsx)(N.Z.Item,{label:"Default Model",name:"auto_router_default_model",rules:[{required:!0,message:"Default model is required"}],children:(0,s.jsx)(k.default,{placeholder:"Select a default model",onChange:e=>{v("custom"===e)},options:[...A,{value:"custom",label:"Enter custom model name"}],showSearch:!0})}),(0,s.jsx)(N.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",children:(0,s.jsx)(k.default,{placeholder:"Select an embedding model (optional)",onChange:e=>{y("custom"===e)},options:[...A,{value:"custom",label:"Enter custom model name"}],showSearch:!0,allowClear:!0})}),"Admin"===n&&(0,s.jsx)(N.Z.Item,{label:"Model Access Groups",name:"model_access_group",tooltip:"Control who can access this auto router",children:(0,s.jsx)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:x.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})]})]})})};let{Title:e5,Link:e6}=C.default;var e3=e=>{let{isVisible:l,onCancel:t,onAddCredential:a,existingCredential:r,setIsCredentialModalOpen:i}=e,[n]=N.Z.useForm();return console.log("existingCredential in add credentials tab: ".concat(JSON.stringify(r))),(0,s.jsx)(S.Z,{title:"Reuse Credentials",visible:l,onCancel:()=>{t(),n.resetFields()},footer:null,width:600,children:(0,s.jsxs)(N.Z,{form:n,onFinish:e=>{a(e),n.resetFields(),i(!1)},layout:"vertical",children:[(0,s.jsx)(N.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==r?void 0:r.credential_name,children:(0,s.jsx)(w.o,{placeholder:"Enter a friendly name for these credentials"})}),Object.entries((null==r?void 0:r.credential_values)||{}).map(e=>{let[l,t]=e;return(0,s.jsx)(N.Z.Item,{label:l,name:l,initialValue:t,children:(0,s.jsx)(w.o,{placeholder:"Enter ".concat(l),disabled:!0})},l)}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(e6,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(E.ZP,{onClick:()=>{t(),n.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(E.ZP,{htmlType:"submit",children:"Reuse Credentials"})]})]})]})})};function e8(e){var l,t,a,r,u,h,x,p,g,f,j,v,_,b,Z,w,C,M,I,F,P,L,T,R,V,D,z,q,B,U,G,H;let{modelId:K,onClose:J,modelData:$,accessToken:es,userID:ea,userRole:er,editModel:ei,setEditModalVisible:en,setSelectedModel:eo,onModelUpdate:ed,modelAccessGroups:ec}=e,[em]=N.Z.useForm(),[eh,ex]=(0,o.useState)(null),[ep,eg]=(0,o.useState)(!1),[ef,ej]=(0,o.useState)(!1),[ev,e_]=(0,o.useState)(!1),[ey,eb]=(0,o.useState)(!1),[eN,eZ]=(0,o.useState)(!1),[ew,eC]=(0,o.useState)(null),[eS,ek]=(0,o.useState)(!1),[eA,eE]=(0,o.useState)({}),[eM,eI]=(0,o.useState)(!1),[eF,eL]=(0,o.useState)([]),[eO,eV]=(0,o.useState)({}),eD=("Admin"===er||(null==$?void 0:null===(l=$.model_info)||void 0===l?void 0:l.created_by)===ea)&&(null==$?void 0:null===(t=$.model_info)||void 0===t?void 0:t.db_model),ez="Admin"===er,eq=(null==$?void 0:null===(a=$.litellm_params)||void 0===a?void 0:a.auto_router_config)!=null,eB=(null==$?void 0:null===(r=$.litellm_params)||void 0===r?void 0:r.litellm_credential_name)!=null&&(null==$?void 0:null===(u=$.litellm_params)||void 0===u?void 0:u.litellm_credential_name)!=void 0;console.log("usingExistingCredential, ",eB),console.log("modelData.litellm_params.litellm_credential_name, ",null==$?void 0:null===(h=$.litellm_params)||void 0===h?void 0:h.litellm_credential_name),console.log("tagsList, ",null===(x=$.litellm_params)||void 0===x?void 0:x.tags),(0,o.useEffect)(()=>{let e=async()=>{var e,l,t,s,a,r,i;if(!es)return;let n=await (0,c.modelInfoV1Call)(es,K);console.log("modelInfoResponse, ",n);let o=n.data[0];o&&!o.litellm_model_name&&(o={...o,litellm_model_name:null!==(i=null!==(r=null!==(a=null==o?void 0:null===(l=o.litellm_params)||void 0===l?void 0:l.litellm_model_name)&&void 0!==a?a:null==o?void 0:null===(t=o.litellm_params)||void 0===t?void 0:t.model)&&void 0!==r?r:null==o?void 0:null===(s=o.model_info)||void 0===s?void 0:s.key)&&void 0!==i?i:null}),ex(o),(null==o?void 0:null===(e=o.litellm_params)||void 0===e?void 0:e.cache_control_injection_points)&&ek(!0)},l=async()=>{if(es)try{let e=(await (0,c.getGuardrailsList)(es)).guardrails.map(e=>e.guardrail_name);eL(e)}catch(e){console.error("Failed to fetch guardrails:",e)}},t=async()=>{if(es)try{let e=await (0,c.tagListCall)(es);eV(e)}catch(e){console.error("Failed to fetch tags:",e)}};(async()=>{if(console.log("accessToken, ",es),!es||eB)return;let e=await (0,c.credentialGetCall)(es,null,K);console.log("existingCredentialResponse, ",e),eC({credential_name:e.credential_name,credential_values:e.credential_values,credential_info:e.credential_info})})(),e(),l(),t()},[es,K]);let eU=async e=>{var l;if(console.log("values, ",e),!es)return;let t={credential_name:e.credential_name,model_id:K,credential_info:{custom_llm_provider:null===(l=eh.litellm_params)||void 0===l?void 0:l.custom_llm_provider}};d.Z.info("Storing credential.."),console.log("credentialResponse, ",await (0,c.credentialCreateCall)(es,t)),d.Z.success("Credential stored successfully")},eG=async e=>{try{var l;let t;if(!es)return;eb(!0),console.log("values.model_name, ",e.model_name);let s={};try{s=e.litellm_extra_params?JSON.parse(e.litellm_extra_params):{}}catch(e){d.Z.fromBackend("Invalid JSON in LiteLLM Params"),eb(!1);return}let a={...e.litellm_params,...s,model:e.litellm_model_name,api_base:e.api_base,custom_llm_provider:e.custom_llm_provider,organization:e.organization,tpm:e.tpm,rpm:e.rpm,max_retries:e.max_retries,timeout:e.timeout,stream_timeout:e.stream_timeout,input_cost_per_token:e.input_cost/1e6,output_cost_per_token:e.output_cost/1e6,tags:e.tags};e.guardrails&&(a.guardrails=e.guardrails),e.cache_control&&(null===(l=e.cache_control_injection_points)||void 0===l?void 0:l.length)>0?a.cache_control_injection_points=e.cache_control_injection_points:delete a.cache_control_injection_points;try{t=e.model_info?JSON.parse(e.model_info):$.model_info,e.model_access_group&&(t={...t,access_groups:e.model_access_group})}catch(e){d.Z.fromBackend("Invalid JSON in Model Info");return}let r={model_name:e.model_name,litellm_params:a,model_info:t};await (0,c.modelPatchUpdateCall)(es,r,K);let i={...eh,model_name:e.model_name,litellm_model_name:e.litellm_model_name,litellm_params:a,model_info:t};ex(i),ed&&ed(i),d.Z.success("Model settings updated successfully"),e_(!1),eZ(!1)}catch(e){console.error("Error updating model:",e),d.Z.fromBackend("Failed to update model settings")}finally{eb(!1)}};if(!$)return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)(eY.Z,{icon:eJ.Z,variant:"light",onClick:J,className:"mb-4",children:"Back to Models"}),(0,s.jsx)(n.Z,{children:"Model not found"})]});let eH=async()=>{if(es)try{var e,l,t;d.Z.info("Testing connection...");let s=await (0,c.testConnectionRequest)(es,{custom_llm_provider:eh.litellm_params.custom_llm_provider,litellm_credential_name:eh.litellm_params.litellm_credential_name,model:eh.litellm_model_name},{mode:null===(e=eh.model_info)||void 0===e?void 0:e.mode},null===(l=eh.model_info)||void 0===l?void 0:l.mode);if("success"===s.status)d.Z.success("Connection test successful!");else throw Error((null==s?void 0:null===(t=s.result)||void 0===t?void 0:t.error)||(null==s?void 0:s.message)||"Unknown error")}catch(e){e instanceof Error?d.Z.error("Error testing connection: "+(0,eR.aS)(e.message,100)):d.Z.error("Error testing connection: "+String(e))}},eK=async()=>{try{if(!es)return;await (0,c.modelDeleteCall)(es,K),d.Z.success("Model deleted successfully"),ed&&ed({deleted:!0,model_info:{id:K}}),J()}catch(e){console.error("Error deleting the model:",e),d.Z.fromBackend("Failed to delete model")}},e5=async(e,l)=>{await (0,e2.vQ)(e)&&(eE(e=>({...e,[l]:!0})),setTimeout(()=>{eE(e=>({...e,[l]:!1}))},2e3))};return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(eY.Z,{icon:eJ.Z,variant:"light",onClick:J,className:"mb-4",children:"Back to Models"}),(0,s.jsxs)(eX.Z,{children:["Public Model Name: ",W($)]}),(0,s.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,s.jsx)(n.Z,{className:"text-gray-500 font-mono",children:$.model_info.id}),(0,s.jsx)(E.ZP,{type:"text",size:"small",icon:eA["model-id"]?(0,s.jsx)(e0.Z,{size:12}):(0,s.jsx)(e1.Z,{size:12}),onClick:()=>e5($.model_info.id,"model-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eA["model-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(eY.Z,{variant:"secondary",icon:Y.Z,onClick:eH,className:"flex items-center gap-2","data-testid":"test-connection-button",children:"Test Connection"}),(0,s.jsx)(eY.Z,{icon:eW.Z,variant:"secondary",onClick:()=>ej(!0),className:"flex items-center",disabled:!ez,"data-testid":"reuse-credentials-button",children:"Re-use Credentials"}),(0,s.jsx)(eY.Z,{icon:y.Z,variant:"secondary",onClick:()=>eg(!0),className:"flex items-center text-red-500 border-red-500 hover:text-red-700",disabled:!eD,"data-testid":"delete-model-button",children:"Delete Model"})]})]}),(0,s.jsxs)(X.Z,{children:[(0,s.jsxs)(ee.Z,{className:"mb-6",children:[(0,s.jsx)(Q.Z,{children:"Overview"}),(0,s.jsx)(Q.Z,{children:"Raw JSON"})]}),(0,s.jsxs)(et.Z,{children:[(0,s.jsxs)(el.Z,{children:[(0,s.jsxs)(i.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6 mb-6",children:[(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(n.Z,{children:"Provider"}),(0,s.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[$.provider&&(0,s.jsx)("img",{src:(0,m.dr)($.provider).logo,alt:"".concat($.provider," logo"),className:"w-4 h-4",onError:e=>{let l=e.currentTarget,t=l.parentElement;if(t&&t.contains(l))try{var s;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(s=$.provider)||void 0===s?void 0:s.charAt(0))||"-",t.replaceChild(e,l)}catch(e){console.error("Failed to replace provider logo fallback:",e)}}}),(0,s.jsx)(eX.Z,{children:$.provider||"Not Set"})]})]}),(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(n.Z,{children:"LiteLLM Model"}),(0,s.jsx)("div",{className:"mt-2 overflow-hidden",children:(0,s.jsx)(A.Z,{title:$.litellm_model_name||"Not Set",children:(0,s.jsx)("div",{className:"break-all text-sm font-medium leading-relaxed cursor-pointer",children:$.litellm_model_name||"Not Set"})})})]}),(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(n.Z,{children:"Pricing"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(n.Z,{children:["Input: $",$.input_cost,"/1M tokens"]}),(0,s.jsxs)(n.Z,{children:["Output: $",$.output_cost,"/1M tokens"]})]})]})]}),(0,s.jsxs)("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-x-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Created At"," ",$.model_info.created_at?new Date($.model_info.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"Not Set"]}),(0,s.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),"Created By ",$.model_info.created_by||"Not Set"]})]}),(0,s.jsxs)(e$.Z,{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(eX.Z,{children:"Model Settings"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[eq&&eD&&!eN&&(0,s.jsx)(eY.Z,{onClick:()=>eI(!0),className:"flex items-center",children:"Edit Auto Router"}),eD?!eN&&(0,s.jsx)(eY.Z,{onClick:()=>eZ(!0),className:"flex items-center",children:"Edit Settings"}):(0,s.jsx)(A.Z,{title:"Only DB models can be edited. You must be an admin or the creator of the model to edit it.",children:(0,s.jsx)(eu.Z,{})})]})]}),eh?(0,s.jsx)(N.Z,{form:em,onFinish:eG,initialValues:{model_name:eh.model_name,litellm_model_name:eh.litellm_model_name,api_base:eh.litellm_params.api_base,custom_llm_provider:eh.litellm_params.custom_llm_provider,organization:eh.litellm_params.organization,tpm:eh.litellm_params.tpm,rpm:eh.litellm_params.rpm,max_retries:eh.litellm_params.max_retries,timeout:eh.litellm_params.timeout,stream_timeout:eh.litellm_params.stream_timeout,input_cost:eh.litellm_params.input_cost_per_token?1e6*eh.litellm_params.input_cost_per_token:(null===(p=eh.model_info)||void 0===p?void 0:p.input_cost_per_token)*1e6||null,output_cost:(null===(g=eh.litellm_params)||void 0===g?void 0:g.output_cost_per_token)?1e6*eh.litellm_params.output_cost_per_token:(null===(f=eh.model_info)||void 0===f?void 0:f.output_cost_per_token)*1e6||null,cache_control:null!==(j=eh.litellm_params)&&void 0!==j&&!!j.cache_control_injection_points,cache_control_injection_points:(null===(v=eh.litellm_params)||void 0===v?void 0:v.cache_control_injection_points)||[],model_access_group:Array.isArray(null===(_=eh.model_info)||void 0===_?void 0:_.access_groups)?eh.model_info.access_groups:[],guardrails:Array.isArray(null===(b=eh.litellm_params)||void 0===b?void 0:b.guardrails)?eh.litellm_params.guardrails:[],tags:Array.isArray(null===(Z=eh.litellm_params)||void 0===Z?void 0:Z.tags)?eh.litellm_params.tags:[],litellm_extra_params:JSON.stringify(eh.litellm_params||{},null,2)},layout:"vertical",onValuesChange:()=>e_(!0),children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Model Name"}),eN?(0,s.jsx)(N.Z.Item,{name:"model_name",className:"mb-0",children:(0,s.jsx)(eQ.Z,{placeholder:"Enter model name"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:eh.model_name})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"LiteLLM Model Name"}),eN?(0,s.jsx)(N.Z.Item,{name:"litellm_model_name",className:"mb-0",children:(0,s.jsx)(eQ.Z,{placeholder:"Enter LiteLLM model name"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:eh.litellm_model_name})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Input Cost (per 1M tokens)"}),eN?(0,s.jsx)(N.Z.Item,{name:"input_cost",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter input cost"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==eh?void 0:null===(w=eh.litellm_params)||void 0===w?void 0:w.input_cost_per_token)?((null===(C=eh.litellm_params)||void 0===C?void 0:C.input_cost_per_token)*1e6).toFixed(4):(null==eh?void 0:null===(M=eh.model_info)||void 0===M?void 0:M.input_cost_per_token)?(1e6*eh.model_info.input_cost_per_token).toFixed(4):null})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Output Cost (per 1M tokens)"}),eN?(0,s.jsx)(N.Z.Item,{name:"output_cost",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter output cost"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==eh?void 0:null===(I=eh.litellm_params)||void 0===I?void 0:I.output_cost_per_token)?(1e6*eh.litellm_params.output_cost_per_token).toFixed(4):(null==eh?void 0:null===(F=eh.model_info)||void 0===F?void 0:F.output_cost_per_token)?(1e6*eh.model_info.output_cost_per_token).toFixed(4):null})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"API Base"}),eN?(0,s.jsx)(N.Z.Item,{name:"api_base",className:"mb-0",children:(0,s.jsx)(eQ.Z,{placeholder:"Enter API base"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(P=eh.litellm_params)||void 0===P?void 0:P.api_base)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Custom LLM Provider"}),eN?(0,s.jsx)(N.Z.Item,{name:"custom_llm_provider",className:"mb-0",children:(0,s.jsx)(eQ.Z,{placeholder:"Enter custom LLM provider"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(L=eh.litellm_params)||void 0===L?void 0:L.custom_llm_provider)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Organization"}),eN?(0,s.jsx)(N.Z.Item,{name:"organization",className:"mb-0",children:(0,s.jsx)(eQ.Z,{placeholder:"Enter organization"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(T=eh.litellm_params)||void 0===T?void 0:T.organization)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"TPM (Tokens per Minute)"}),eN?(0,s.jsx)(N.Z.Item,{name:"tpm",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter TPM"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(R=eh.litellm_params)||void 0===R?void 0:R.tpm)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"RPM (Requests per Minute)"}),eN?(0,s.jsx)(N.Z.Item,{name:"rpm",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter RPM"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(V=eh.litellm_params)||void 0===V?void 0:V.rpm)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Max Retries"}),eN?(0,s.jsx)(N.Z.Item,{name:"max_retries",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter max retries"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(D=eh.litellm_params)||void 0===D?void 0:D.max_retries)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Timeout (seconds)"}),eN?(0,s.jsx)(N.Z.Item,{name:"timeout",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter timeout"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(z=eh.litellm_params)||void 0===z?void 0:z.timeout)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Stream Timeout (seconds)"}),eN?(0,s.jsx)(N.Z.Item,{name:"stream_timeout",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter stream timeout"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(q=eh.litellm_params)||void 0===q?void 0:q.stream_timeout)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Model Access Groups"}),eN?(0,s.jsx)(N.Z.Item,{name:"model_access_group",className:"mb-0",children:(0,s.jsx)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:null==ec?void 0:ec.map(e=>({value:e,label:e}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(B=eh.model_info)||void 0===B?void 0:B.access_groups)?Array.isArray(eh.model_info.access_groups)?eh.model_info.access_groups.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:eh.model_info.access_groups.map((e,l)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:e},l))}):"No groups assigned":eh.model_info.access_groups:"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(n.Z,{className:"font-medium",children:["Guardrails",(0,s.jsx)(A.Z,{title:"Apply safety guardrails to this model to filter content or enforce policies",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(eu.Z,{style:{marginLeft:"4px"}})})})]}),eN?(0,s.jsx)(N.Z.Item,{name:"guardrails",className:"mb-0",children:(0,s.jsx)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing guardrails or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:eF.map(e=>({value:e,label:e}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(U=eh.litellm_params)||void 0===U?void 0:U.guardrails)?Array.isArray(eh.litellm_params.guardrails)?eh.litellm_params.guardrails.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:eh.litellm_params.guardrails.map((e,l)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:e},l))}):"No guardrails assigned":eh.litellm_params.guardrails:"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Tags"}),eN?(0,s.jsx)(N.Z.Item,{name:"tags",className:"mb-0",children:(0,s.jsx)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing tags or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:Object.values(eO).map(e=>({value:e.name,label:e.name,title:e.description||e.name}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(G=eh.litellm_params)||void 0===G?void 0:G.tags)?Array.isArray(eh.litellm_params.tags)?eh.litellm_params.tags.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:eh.litellm_params.tags.map((e,l)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-purple-100 text-purple-800",children:e},l))}):"No tags assigned":eh.litellm_params.tags:"Not Set"})]}),eN?(0,s.jsx)(eT,{form:em,showCacheControl:eS,onCacheControlChange:e=>ek(e)}):(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Cache Control"}),(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(H=eh.litellm_params)||void 0===H?void 0:H.cache_control_injection_points)?(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:"Enabled"}),(0,s.jsx)("div",{className:"mt-2",children:eh.litellm_params.cache_control_injection_points.map((e,l)=>(0,s.jsxs)("div",{className:"text-sm text-gray-600 mb-1",children:["Location: ",e.location,",",e.role&&(0,s.jsxs)("span",{children:[" Role: ",e.role]}),void 0!==e.index&&(0,s.jsxs)("span",{children:[" Index: ",e.index]})]},l))})]}):"Disabled"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Model Info"}),eN?(0,s.jsx)(N.Z.Item,{name:"model_info",className:"mb-0",children:(0,s.jsx)(O.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}',defaultValue:JSON.stringify($.model_info,null,2)})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(0,s.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(eh.model_info,null,2)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(n.Z,{className:"font-medium",children:["LiteLLM Params",(0,s.jsx)(A.Z,{title:"Optional litellm params used for making a litellm.completion() call. Some params are automatically added by LiteLLM.",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(eu.Z,{style:{marginLeft:"4px"}})})})]}),eN?(0,s.jsx)(N.Z.Item,{name:"litellm_extra_params",rules:[{validator:eR.Ac}],children:(0,s.jsx)(O.default.TextArea,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(0,s.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(eh.litellm_params,null,2)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Team ID"}),(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:$.model_info.team_id||"Not Set"})]})]}),eN&&(0,s.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,s.jsx)(eY.Z,{variant:"secondary",onClick:()=>{em.resetFields(),e_(!1),eZ(!1)},disabled:ey,children:"Cancel"}),(0,s.jsx)(eY.Z,{variant:"primary",onClick:()=>em.submit(),loading:ey,children:"Save Changes"})]})]})}):(0,s.jsx)(n.Z,{children:"Loading..."})]})]}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(e$.Z,{children:(0,s.jsx)("pre",{className:"bg-gray-100 p-4 rounded text-xs overflow-auto",children:JSON.stringify($,null,2)})})})]})]}),ep&&(0,s.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,s.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,s.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,s.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,s.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,s.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,s.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,s.jsx)("div",{className:"sm:flex sm:items-start",children:(0,s.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,s.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Model"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this model?"})})]})})}),(0,s.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,s.jsx)(E.ZP,{onClick:eK,className:"ml-2",danger:!0,children:"Delete"}),(0,s.jsx)(E.ZP,{onClick:()=>eg(!1),children:"Cancel"})]})]})]})}),ef&&!eB?(0,s.jsx)(e3,{isVisible:ef,onCancel:()=>ej(!1),onAddCredential:eU,existingCredential:ew,setIsCredentialModalOpen:ej}):(0,s.jsx)(S.Z,{open:ef,onCancel:()=>ej(!1),title:"Using Existing Credential",children:(0,s.jsx)(n.Z,{children:$.litellm_params.litellm_credential_name})}),(0,s.jsx)(e4,{isVisible:eM,onCancel:()=>eI(!1),onSuccess:e=>{ex(e),ed&&ed(e)},modelData:eh||$,accessToken:es||"",userRole:er||""})]})}var e9=t(33293),e7=t(11318),le=t(8048),ll=t(41649);let lt=e=>{let{provider:l,className:t="w-4 h-4"}=e,[a,r]=(0,o.useState)(!1),{logo:i}=(0,m.dr)(l);return a||!i?(0,s.jsx)("div",{className:"".concat(t," rounded-full bg-gray-200 flex items-center justify-center text-xs"),children:(null==l?void 0:l.charAt(0))||"-"}):(0,s.jsx)("img",{src:i,alt:"".concat(l," logo"),className:t,onError:()=>r(!0)})},ls=(e,l,t,a,r,i,n,o,d,c,m)=>[{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model ID"}),accessorKey:"model_info.id",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)(A.Z,{title:t.model_info.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>a(t.model_info.id),children:t.model_info.id})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model Information"}),accessorKey:"model_name",size:250,cell:e=>{let{row:l}=e,t=l.original,a=i(l.original)||"-",r=(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Provider:"})," ",t.provider||"-"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Public Model Name:"})," ",a]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"LiteLLM Model Name:"})," ",t.litellm_model_name||"-"]})]});return(0,s.jsx)(A.Z,{title:r,children:(0,s.jsxs)("div",{className:"flex items-start space-x-2 min-w-0 w-full max-w-[250px]",children:[(0,s.jsx)("div",{className:"flex-shrink-0 mt-0.5",children:t.provider?(0,s.jsx)(lt,{provider:t.provider}):(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:"-"})}),(0,s.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-gray-900 truncate max-w-[210px]",children:a}),(0,s.jsx)("div",{className:"text-xs text-gray-500 truncate mt-0.5 max-w-[210px]",children:t.litellm_model_name||"-"})]})]})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Credentials"}),accessorKey:"litellm_credential_name",size:180,cell:e=>{var l;let{row:t}=e,a=null===(l=t.original.litellm_params)||void 0===l?void 0:l.litellm_credential_name;return a?(0,s.jsx)(A.Z,{title:"Credential: ".concat(a),children:(0,s.jsxs)("div",{className:"flex items-center space-x-2 max-w-[180px]",children:[(0,s.jsx)(eW.Z,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}),(0,s.jsx)("span",{className:"text-xs truncate",title:a,children:a})]})}):(0,s.jsxs)("div",{className:"flex items-center space-x-2 max-w-[180px]",children:[(0,s.jsx)(eW.Z,{className:"w-4 h-4 text-gray-300 flex-shrink-0"}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"No credentials"})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Created By"}),accessorKey:"model_info.created_by",sortingFn:"datetime",size:160,cell:e=>{var l;let{row:t}=e,a=t.original,r=!(null===(l=a.model_info)||void 0===l?void 0:l.db_model),i=a.model_info.created_by,n=a.model_info.created_at?new Date(a.model_info.created_at).toLocaleDateString():null;return(0,s.jsxs)("div",{className:"flex flex-col min-w-0 max-w-[160px]",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-gray-900 truncate",title:r?"Defined in config":i||"Unknown",children:r?"Defined in config":i||"Unknown"}),(0,s.jsx)("div",{className:"text-xs text-gray-500 truncate mt-0.5",title:r?"Config file":n||"Unknown date",children:r?"-":n||"Unknown date"})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Updated At"}),accessorKey:"model_info.updated_at",sortingFn:"datetime",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)("span",{className:"text-xs",children:t.model_info.updated_at?new Date(t.model_info.updated_at).toLocaleDateString():"-"})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Costs"}),accessorKey:"input_cost",size:120,cell:e=>{let{row:l}=e,t=l.original,a=t.input_cost,r=t.output_cost;return a||r?(0,s.jsx)(A.Z,{title:"Cost per 1M tokens",children:(0,s.jsxs)("div",{className:"flex flex-col min-w-0 max-w-[120px]",children:[a&&(0,s.jsxs)("div",{className:"text-xs font-medium text-gray-900 truncate",children:["In: $",a]}),r&&(0,s.jsxs)("div",{className:"text-xs text-gray-500 truncate mt-0.5",children:["Out: $",r]})]})}):(0,s.jsx)("div",{className:"max-w-[120px]",children:(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"-"})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Team ID"}),accessorKey:"model_info.team_id",cell:e=>{let{row:l}=e,t=l.original;return t.model_info.team_id?(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(A.Z,{title:t.model_info.team_id,children:(0,s.jsxs)(eY.Z,{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:()=>r(t.model_info.team_id),children:[t.model_info.team_id.slice(0,7),"..."]})})}):"-"}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model Access Group"}),accessorKey:"model_info.model_access_group",enableSorting:!1,cell:e=>{let{row:l}=e,t=l.original,a=t.model_info.access_groups;if(!a||0===a.length)return"-";let r=t.model_info.id,i=c.has(r),n=a.length>1,o=()=>{let e=new Set(c);i?e.delete(r):e.add(r),m(e)};return(0,s.jsxs)("div",{className:"flex items-center gap-1 overflow-hidden",children:[(0,s.jsx)(ll.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:a[0]}),(i||!n&&2===a.length)&&a.slice(1).map((e,l)=>(0,s.jsx)(ll.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:e},l+1)),n&&(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),o()},className:"text-xs text-blue-600 hover:text-blue-800 px-1 py-0.5 rounded hover:bg-blue-50 h-5 leading-tight flex-shrink-0 whitespace-nowrap",children:i?"−":"+".concat(a.length-1)})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Status"}),accessorKey:"model_info.db_model",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)("div",{className:"\n inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium\n ".concat(t.model_info.db_model?"bg-blue-50 text-blue-600":"bg-gray-100 text-gray-600","\n "),children:t.model_info.db_model?"DB Model":"Config Model"})}},{id:"actions",header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Actions"}),cell:t=>{var r,i;let{row:n}=t,o=n.original,c="Admin"===e||(null===(r=o.model_info)||void 0===r?void 0:r.created_by)===l,m=!(null===(i=o.model_info)||void 0===i?void 0:i.db_model);return(0,s.jsx)("div",{className:"flex items-center justify-end gap-2 pr-4",children:m?(0,s.jsx)(A.Z,{title:"Config model cannot be deleted on the dashboard. Please delete it from the config file.",children:(0,s.jsx)($.Z,{icon:y.Z,size:"sm",className:"opacity-50 cursor-not-allowed"})}):(0,s.jsx)(A.Z,{title:"Delete model",children:(0,s.jsx)($.Z,{icon:y.Z,size:"sm",onClick:()=>{c&&(a(o.model_info.id),d(!1))},className:c?"cursor-pointer hover:text-red-600":"opacity-50 cursor-not-allowed"})})})}}];var la=t(27281),lr=t(57365),li=e=>{let{selectedModelGroup:l,setSelectedModelGroup:t,availableModelGroups:a,availableModelAccessGroups:r,setSelectedModelId:d,setSelectedTeamId:c,setEditModel:m,modelData:u}=e,{userId:h,userRole:x,premiumUser:p}=(0,K.Z)(),{teams:g}=(0,e7.Z)(),[f,j]=(0,o.useState)(""),[v,_]=(0,o.useState)("current_team"),[y,b]=(0,o.useState)("personal"),[N,Z]=(0,o.useState)(!1),[w,C]=(0,o.useState)(null),[S,k]=(0,o.useState)(new Set),[A,E]=(0,o.useState)({pageIndex:0,pageSize:50}),M=(0,o.useRef)(null),I=(0,o.useMemo)(()=>u&&u.data&&0!==u.data.length?u.data.filter(e=>{var t,s,a,r,i,n;let o=""===f||e.model_name.toLowerCase().includes(f.toLowerCase()),d="all"===l||e.model_name===l||!l||"wildcard"===l&&(null===(t=e.model_name)||void 0===t?void 0:t.includes("*")),c="all"===w||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(w))||!w,m=!0;if("current_team"===v){if("personal"===y)m=(null===(a=e.model_info)||void 0===a?void 0:a.direct_access)===!0;else{let l=(null===(i=e.model_info)||void 0===i?void 0:null===(r=i.access_via_team_ids)||void 0===r?void 0:r.includes(y.team_id))===!0,t=(null===(n=y.models)||void 0===n?void 0:n.some(l=>{var t,s;return null===(s=e.model_info)||void 0===s?void 0:null===(t=s.access_groups)||void 0===t?void 0:t.includes(l)}))===!0;m=l||t}}return o&&d&&c&&m}):[],[u,f,l,w,y,v]),F=(0,o.useMemo)(()=>{let e=A.pageIndex*A.pageSize,l=e+A.pageSize;return I.slice(e,l)},[I,A.pageIndex,A.pageSize]);return(0,o.useEffect)(()=>{E(e=>({...e,pageIndex:0}))},[f,l,w,y,v]),(0,s.jsx)(el.Z,{children:(0,s.jsx)(i.Z,{children:(0,s.jsx)("div",{className:"flex flex-col space-y-4",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,s.jsxs)("div",{className:"border-b px-6 py-4 bg-gray-50",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)(n.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,s.jsxs)(la.Z,{className:"w-80",defaultValue:"personal",value:"personal"===y?"personal":y.team_id,onValueChange:e=>{if("personal"===e)b("personal");else{let l=null==g?void 0:g.find(l=>l.team_id===e);l&&b(l)}},children:[(0,s.jsx)(lr.Z,{value:"personal",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"Personal"})]})}),null==g?void 0:g.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:e.team_alias?"".concat(e.team_alias.slice(0,30),"..."):"Team ".concat(e.team_id.slice(0,30),"...")})]})},e.team_id))]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)(n.Z,{className:"text-lg font-semibold text-gray-900",children:"View:"}),(0,s.jsxs)(la.Z,{className:"w-64",defaultValue:"current_team",value:v,onValueChange:e=>_(e),children:[(0,s.jsx)(lr.Z,{value:"current_team",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"Current Team Models"})]})}),(0,s.jsx)(lr.Z,{value:"all",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-gray-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"All Available Models"})]})})]})]})]}),"current_team"===v&&(0,s.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,s.jsx)(eu.Z,{className:"text-gray-400 mt-0.5 flex-shrink-0 text-xs"}),(0,s.jsx)("div",{className:"text-xs text-gray-500",children:"personal"===y?(0,s.jsxs)("span",{children:["To access these models: Create a Virtual Key without selecting a team on the"," ",(0,s.jsx)("a",{href:"/public?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]}):(0,s.jsxs)("span",{children:['To access these models: Create a Virtual Key and select Team as "',"string"!=typeof y?y.team_alias||y.team_id:"",'" on the'," ",(0,s.jsx)("a",{href:"/public?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]})})]})]}),(0,s.jsx)("div",{className:"border-b px-6 py-4",children:(0,s.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("div",{className:"relative w-64",children:[(0,s.jsx)("input",{type:"text",placeholder:"Search model names...",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:f,onChange:e=>j(e.target.value)}),(0,s.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,s.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,s.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(N?"bg-gray-100":""),onClick:()=>Z(!N),children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,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"})}),"Filters"]}),(0,s.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{j(""),t("all"),C(null),b("personal"),_("current_team"),E({pageIndex:0,pageSize:50})},children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),N&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,s.jsx)("div",{className:"w-64",children:(0,s.jsxs)(la.Z,{value:null!=l?l:"all",onValueChange:e=>t("all"===e?"all":e),placeholder:"Filter by Public Model Name",children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Models"}),(0,s.jsx)(lr.Z,{value:"wildcard",children:"Wildcard Models (*)"}),a.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,children:e},l))]})}),(0,s.jsx)("div",{className:"w-64",children:(0,s.jsxs)(la.Z,{value:null!=w?w:"all",onValueChange:e=>C("all"===e?null:e),placeholder:"Filter by Model Access Group",children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Model Access Groups"}),r.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,children:e},l))]})})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-sm text-gray-700",children:I.length>0?"Showing ".concat(A.pageIndex*A.pageSize+1," - ").concat(Math.min((A.pageIndex+1)*A.pageSize,I.length)," of ").concat(I.length," results"):"Showing 0 results"}),I.length>A.pageSize&&(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("button",{onClick:()=>E(e=>({...e,pageIndex:e.pageIndex-1})),disabled:0===A.pageIndex,className:"px-3 py-1 text-sm border rounded-md ".concat(0===A.pageIndex?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,s.jsx)("button",{onClick:()=>E(e=>({...e,pageIndex:e.pageIndex+1})),disabled:A.pageIndex>=Math.ceil(I.length/A.pageSize)-1,className:"px-3 py-1 text-sm border rounded-md ".concat(A.pageIndex>=Math.ceil(I.length/A.pageSize)-1?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})]})]})}),(0,s.jsx)(le.C,{columns:ls(x,h,p,d,c,W,()=>{},()=>{},m,S,k),data:F,isLoading:!1,table:M})]})})})})},ln=t(75105),lo=t(40278),ld=t(97765),lc=t(21626),lm=t(97214),lu=t(28241),lh=t(58834),lx=t(69552),lp=t(71876),lg=t(39789),lf=t(79326),lj=t(2356),lv=t(59664),l_=e=>{let{modelMetrics:l,modelMetricsCategories:t,customTooltip:a,premiumUser:r}=e;return(0,s.jsx)(lv.Z,{title:"Time to First token (s)",className:"h-72",data:l,index:"date",showLegend:!1,categories:t,colors:["indigo","rose"],connectNulls:!0,customTooltip:a})},ly=e=>{let{setSelectedAPIKey:l,keys:t,teams:a,setSelectedCustomer:r,allEndUsers:i}=e,{premiumUser:d}=(0,K.Z)(),[c,m]=(0,o.useState)(null);return(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"mb-1",children:"Select API Key Name"}),d?(0,s.jsxs)("div",{children:[(0,s.jsxs)(la.Z,{defaultValue:"all-keys",children:[(0,s.jsx)(lr.Z,{value:"all-keys",onClick:()=>{l(null)},children:"All Keys"},"all-keys"),null==t?void 0:t.map((e,t)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,s.jsx)(lr.Z,{value:String(t),onClick:()=>{l(e)},children:e.key_alias},t):null)]}),(0,s.jsx)(n.Z,{className:"mt-1",children:"Select Customer Name"}),(0,s.jsxs)(la.Z,{defaultValue:"all-customers",children:[(0,s.jsx)(lr.Z,{value:"all-customers",onClick:()=>{r(null)},children:"All Customers"},"all-customers"),null==i?void 0:i.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>{r(e)},children:e},l))]}),(0,s.jsx)(n.Z,{className:"mt-1",children:"Select Team"}),(0,s.jsxs)(la.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=c?c:"all",onValueChange:e=>m("all"===e?null:e),children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Teams"}),null==a?void 0:a.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"mt-1",children:"Select Team"}),(0,s.jsxs)(la.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=c?c:"all",onValueChange:e=>m("all"===e?null:e),children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Teams"}),null==a?void 0:a.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]})]})},lb=e=>{let{dateValue:l,setDateValue:t,selectedModelGroup:a,availableModelGroups:d,setShowAdvancedFilters:m,modelMetrics:u,modelMetricsCategories:h,streamingModelMetrics:x,streamingModelMetricsCategories:p,customTooltip:g,slowResponsesData:f,modelExceptions:j,globalExceptionData:v,allExceptions:_,globalExceptionPerDeployment:y,setSelectedAPIKey:b,keys:N,setSelectedCustomer:Z,teams:w,allEndUsers:C,selectedAPIKey:S,selectedCustomer:k,selectedTeam:A,setSelectedModelGroup:E,setModelMetrics:M,setModelMetricsCategories:I,setStreamingModelMetrics:F,setStreamingModelMetricsCategories:P,setSlowResponsesData:L,setModelExceptions:T,setAllExceptions:R,setGlobalExceptionData:O,setGlobalExceptionPerDeployment:V}=e,{accessToken:D,userId:z,userRole:q,premiumUser:B}=(0,K.Z)();(0,o.useEffect)(()=>{U(a,l.from,l.to)},[S,k,A]);let U=async(e,l,t)=>{if(console.log("Updating model metrics for group:",e),!D||!z||!q||!l||!t)return;console.log("inside updateModelMetrics - startTime:",l,"endTime:",t),E(e);let s=null==S?void 0:S.token;void 0===s&&(s=null);let a=k;void 0===a&&(a=null);try{let r=await (0,c.modelMetricsCall)(D,z,q,e,l.toISOString(),t.toISOString(),s,a);console.log("Model metrics response:",r),M(r.data),I(r.all_api_bases);let i=await (0,c.streamingModelMetricsCall)(D,e,l.toISOString(),t.toISOString());F(i.data),P(i.all_api_bases);let n=await (0,c.modelExceptionsCall)(D,z,q,e,l.toISOString(),t.toISOString(),s,a);console.log("Model exceptions response:",n),T(n.data),R(n.exception_types);let o=await (0,c.modelMetricsSlowResponsesCall)(D,z,q,e,l.toISOString(),t.toISOString(),s,a);if(console.log("slowResponses:",o),L(o),e){let s=await (0,c.adminGlobalActivityExceptions)(D,null==l?void 0:l.toISOString().split("T")[0],null==t?void 0:t.toISOString().split("T")[0],e);O(s);let a=await (0,c.adminGlobalActivityExceptionsPerDeployment)(D,null==l?void 0:l.toISOString().split("T")[0],null==t?void 0:t.toISOString().split("T")[0],e);V(a)}}catch(e){console.error("Failed to fetch model metrics",e)}};return(0,s.jsxs)(el.Z,{children:[(0,s.jsx)("div",{className:"mb-4 rounded-md border border-red-500 bg-red-50 p-4",children:(0,s.jsx)(n.Z,{className:"font-semibold text-red-700",children:"This page is deprecated and will be removed in the future. Some functionality may not work as expected."})}),(0,s.jsxs)(i.Z,{numItems:4,className:"mt-2 mb-2",children:[(0,s.jsx)(r.Z,{children:(0,s.jsx)(lg.Z,{value:l,className:"mr-2",onValueChange:e=>{t(e),U(a,e.from,e.to)}})}),(0,s.jsxs)(r.Z,{className:"ml-2",children:[(0,s.jsx)(n.Z,{children:"Select Model Group"}),(0,s.jsx)(la.Z,{defaultValue:a||d[0],value:a||d[0],children:d.map((e,t)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>U(e,l.from,l.to),children:e},t))})]}),(0,s.jsx)(r.Z,{children:(0,s.jsx)(lf.Z,{trigger:"click",content:(0,s.jsx)(ly,{allEndUsers:C,keys:N,setSelectedAPIKey:b,setSelectedCustomer:Z,teams:w}),overlayStyle:{width:"20vw"},children:(0,s.jsx)(eY.Z,{icon:lj.Z,size:"md",variant:"secondary",className:"mt-4 ml-2",style:{border:"none"},onClick:()=>m(!0)})})})]}),(0,s.jsxs)(i.Z,{numItems:2,children:[(0,s.jsx)(r.Z,{children:(0,s.jsx)(e$.Z,{className:"mr-2 max-h-[400px] min-h-[400px]",children:(0,s.jsxs)(X.Z,{children:[(0,s.jsxs)(ee.Z,{variant:"line",defaultValue:"1",children:[(0,s.jsx)(Q.Z,{value:"1",children:"Avg. Latency per Token"}),(0,s.jsx)(Q.Z,{value:"2",children:"Time to first token"})]}),(0,s.jsxs)(et.Z,{children:[(0,s.jsxs)(el.Z,{children:[(0,s.jsx)("p",{className:"text-gray-500 italic",children:" (seconds/token)"}),(0,s.jsx)(n.Z,{className:"text-gray-500 italic mt-1 mb-1",children:"average Latency for successfull requests divided by the total tokens"}),u&&h&&(0,s.jsx)(ln.Z,{title:"Model Latency",className:"h-72",data:u,showLegend:!1,index:"date",categories:h,connectNulls:!0,customTooltip:g})]}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(l_,{modelMetrics:x,modelMetricsCategories:p,customTooltip:g,premiumUser:B})})]})]})})}),(0,s.jsx)(r.Z,{children:(0,s.jsx)(e$.Z,{className:"ml-2 max-h-[400px] min-h-[400px] overflow-y-auto",children:(0,s.jsxs)(lc.Z,{children:[(0,s.jsx)(lh.Z,{children:(0,s.jsxs)(lp.Z,{children:[(0,s.jsx)(lx.Z,{children:"Deployment"}),(0,s.jsx)(lx.Z,{children:"Success Responses"}),(0,s.jsxs)(lx.Z,{children:["Slow Responses ",(0,s.jsx)("p",{children:"Success Responses taking 600+s"})]})]})}),(0,s.jsx)(lm.Z,{children:f.map((e,l)=>(0,s.jsxs)(lp.Z,{children:[(0,s.jsx)(lu.Z,{children:e.api_base}),(0,s.jsx)(lu.Z,{children:e.total_count}),(0,s.jsx)(lu.Z,{children:e.slow_count})]},l))})]})})})]}),(0,s.jsx)(i.Z,{numItems:1,className:"gap-2 w-full mt-2",children:(0,s.jsxs)(e$.Z,{children:[(0,s.jsxs)(eX.Z,{children:["All Exceptions for ",a]}),(0,s.jsx)(lo.Z,{className:"h-60",data:j,index:"model",categories:_,stack:!0,yAxisWidth:30})]})}),(0,s.jsxs)(i.Z,{numItems:1,className:"gap-2 w-full mt-2",children:[(0,s.jsxs)(e$.Z,{children:[(0,s.jsxs)(eX.Z,{children:["All Up Rate Limit Errors (429) for ",a]}),(0,s.jsxs)(i.Z,{numItems:1,children:[(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(ld.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors ",v.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lo.Z,{className:"h-40",data:v.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]}),(0,s.jsx)(r.Z,{})]})]}),B?(0,s.jsx)(s.Fragment,{children:y.map((e,l)=>(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(eX.Z,{children:e.api_base?e.api_base:"Unknown API Base"}),(0,s.jsx)(i.Z,{numItems:1,children:(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(ld.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors (429) ",e.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lo.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]},l))}):(0,s.jsx)(s.Fragment,{children:y&&y.length>0&&y.slice(0,1).map((e,l)=>(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(eX.Z,{children:"✨ Rate Limit Errors by Deployment"}),(0,s.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to see exceptions for all deployments"}),(0,s.jsx)(eY.Z,{variant:"primary",className:"mb-2",children:(0,s.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})}),(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(eX.Z,{children:e.api_base}),(0,s.jsx)(i.Z,{numItems:1,children:(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(ld.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors ",e.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lo.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]})]},l))})]})]})};let lN={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"};var lZ=e=>{let{selectedModelGroup:l,setSelectedModelGroup:t,availableModelGroups:a,globalRetryPolicy:r,setGlobalRetryPolicy:i,defaultRetry:o,modelGroupRetryPolicy:d,setModelGroupRetryPolicy:c,handleSaveRetrySettings:m}=e;return(0,s.jsxs)(el.Z,{children:[(0,s.jsx)("div",{className:"flex items-center gap-4 mb-6",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(n.Z,{children:"Retry Policy Scope:"}),(0,s.jsxs)(la.Z,{className:"ml-2 w-48",defaultValue:"global",value:"global"===l?"global":l||a[0],onValueChange:e=>t(e),children:[(0,s.jsx)(lr.Z,{value:"global",children:"Global Default"}),a.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>t(e),children:e},l))]})]})}),"global"===l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eX.Z,{children:"Global Retry Policy"}),(0,s.jsx)(n.Z,{className:"mb-6",children:"Default retry settings applied to all model groups unless overridden"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(eX.Z,{children:["Retry Policy for ",l]}),(0,s.jsx)(n.Z,{className:"mb-6",children:"Model-specific retry settings. Falls back to global defaults if not set."})]}),lN&&(0,s.jsx)("table",{children:(0,s.jsx)("tbody",{children:Object.entries(lN).map((e,t)=>{var a,m,u,h;let x,[p,g]=e;if("global"===l)x=null!==(a=null==r?void 0:r[g])&&void 0!==a?a:o;else{let e=null==d?void 0:null===(m=d[l])||void 0===m?void 0:m[g];x=null!=e?e:null!==(u=null==r?void 0:r[g])&&void 0!==u?u:o}return(0,s.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)(n.Z,{children:p}),"global"!==l&&(0,s.jsxs)(n.Z,{className:"text-xs text-gray-500 ml-2",children:["(Global: ",null!==(h=null==r?void 0:r[g])&&void 0!==h?h:o,")"]})]}),(0,s.jsx)("td",{children:(0,s.jsx)(ej.Z,{className:"ml-5",value:x,min:0,step:1,onChange:e=>{"global"===l?i(l=>null==e?l:{...null!=l?l:{},[g]:e}):c(t=>{var s;let a=null!==(s=null==t?void 0:t[l])&&void 0!==s?s:{};return{...null!=t?t:{},[l]:{...a,[g]:e}}})}})})]},t)})})}),(0,s.jsx)(eY.Z,{className:"mt-6 mr-8",onClick:m,children:"Save"})]})},lw=t(58760),lC=t(867),lS=t(3810),lk=t(89245),lA=t(5540),lE=t(8881);let{Text:lM}=C.default;var lI=e=>{let{accessToken:l,onReloadSuccess:t,buttonText:a="Reload Price Data",showIcon:r=!0,size:i="middle",type:n="primary",className:m=""}=e,[u,h]=(0,o.useState)(!1),[x,p]=(0,o.useState)(!1),[g,f]=(0,o.useState)(!1),[j,v]=(0,o.useState)(!1),[_,y]=(0,o.useState)(6),[b,N]=(0,o.useState)(null),[Z,w]=(0,o.useState)(!1);(0,o.useEffect)(()=>{C();let e=setInterval(()=>{C()},3e4);return()=>clearInterval(e)},[l]);let C=async()=>{if(l){w(!0);try{console.log("Fetching reload status...");let e=await (0,c.getModelCostMapReloadStatus)(l);console.log("Received status:",e),N(e)}catch(e){console.error("Failed to fetch reload status:",e),N({scheduled:!1,interval_hours:null,last_run:null,next_run:null})}finally{w(!1)}}},k=async()=>{if(!l){d.Z.fromBackend("No access token available");return}h(!0);try{let e=await (0,c.reloadModelCostMap)(l);"success"===e.status?(d.Z.success("Price data reloaded successfully! ".concat(e.models_count||0," models updated.")),null==t||t(),await C()):d.Z.fromBackend("Failed to reload price data")}catch(e){console.error("Error reloading price data:",e),d.Z.fromBackend("Failed to reload price data. Please try again.")}finally{h(!1)}},A=async()=>{if(!l){d.Z.fromBackend("No access token available");return}if(_<=0){d.Z.fromBackend("Hours must be greater than 0");return}p(!0);try{let e=await (0,c.scheduleModelCostMapReload)(l,_);"success"===e.status?(d.Z.success("Periodic reload scheduled for every ".concat(_," hours")),v(!1),await C()):d.Z.fromBackend("Failed to schedule periodic reload")}catch(e){console.error("Error scheduling reload:",e),d.Z.fromBackend("Failed to schedule periodic reload. Please try again.")}finally{p(!1)}},M=async()=>{if(!l){d.Z.fromBackend("No access token available");return}f(!0);try{let e=await (0,c.cancelModelCostMapReload)(l);"success"===e.status?(d.Z.success("Periodic reload cancelled successfully"),await C()):d.Z.fromBackend("Failed to cancel periodic reload")}catch(e){console.error("Error cancelling reload:",e),d.Z.fromBackend("Failed to cancel periodic reload. Please try again.")}finally{f(!1)}},I=e=>{if(!e)return"Never";try{return new Date(e).toLocaleString()}catch(l){return e}};return(0,s.jsxs)("div",{className:m,children:[(0,s.jsxs)(lw.Z,{direction:"horizontal",size:"middle",style:{marginBottom:16},children:[(0,s.jsx)(lC.Z,{title:"Hard Refresh Price Data",description:"This will immediately fetch the latest pricing information from the remote source. Continue?",onConfirm:k,okText:"Yes",cancelText:"No",okButtonProps:{style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem",transition:"all 0.2s ease-in-out"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#4f46e5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1"}},children:(0,s.jsx)(E.ZP,{type:n,size:i,loading:u,icon:r?(0,s.jsx)(lk.Z,{}):void 0,style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem",transition:"all 0.2s ease-in-out"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#4f46e5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1"},children:a})}),(null==b?void 0:b.scheduled)?(0,s.jsx)(E.ZP,{type:"default",size:i,danger:!0,icon:(0,s.jsx)(lE.Z,{}),loading:g,onClick:M,style:{borderColor:"#ff4d4f",color:"#ff4d4f",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem"},children:"Cancel Periodic Reload"}):(0,s.jsx)(E.ZP,{type:"default",size:i,icon:(0,s.jsx)(lA.Z,{}),onClick:()=>v(!0),style:{borderColor:"#d9d9d9",color:"#6366f1",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem"},children:"Set Up Periodic Reload"})]}),b&&(0,s.jsx)(er.Z,{size:"small",style:{backgroundColor:"#f8f9fa",border:"1px solid #e9ecef",borderRadius:8},children:(0,s.jsxs)(lw.Z,{direction:"vertical",size:"small",style:{width:"100%"},children:[b.scheduled?(0,s.jsx)("div",{children:(0,s.jsxs)(lS.Z,{color:"green",icon:(0,s.jsx)(lA.Z,{}),children:["Scheduled every ",b.interval_hours," hours"]})}):(0,s.jsx)(lM,{type:"secondary",children:"No periodic reload scheduled"}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lM,{type:"secondary",style:{fontSize:"12px"},children:"Last run:"}),(0,s.jsx)(lM,{style:{fontSize:"12px"},children:I(b.last_run)})]}),b.scheduled&&(0,s.jsxs)(s.Fragment,{children:[b.next_run&&(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lM,{type:"secondary",style:{fontSize:"12px"},children:"Next run:"}),(0,s.jsx)(lM,{style:{fontSize:"12px"},children:I(b.next_run)})]}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lM,{type:"secondary",style:{fontSize:"12px"},children:"Status:"}),(0,s.jsx)(lS.Z,{color:(null==b?void 0:b.scheduled)?b.last_run?"success":"processing":"default",children:(null==b?void 0:b.scheduled)?b.last_run?"Active":"Ready":"Not scheduled"})]})]})]})}),(0,s.jsxs)(S.Z,{title:"Set Up Periodic Reload",open:j,onOk:A,onCancel:()=>v(!1),confirmLoading:x,okText:"Schedule",cancelText:"Cancel",okButtonProps:{style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white"}},children:[(0,s.jsx)("div",{style:{marginBottom:16},children:(0,s.jsx)(lM,{children:"Set up automatic reload of price data every:"})}),(0,s.jsx)("div",{style:{marginBottom:16},children:(0,s.jsx)(ej.Z,{min:1,max:168,value:_,onChange:e=>y(e||6),addonAfter:"hours",style:{width:"100%"}})}),(0,s.jsx)("div",{children:(0,s.jsxs)(lM,{type:"secondary",children:["This will automatically fetch the latest pricing data from the remote source every ",_," hours."]})})]})]})},lF=e=>{let{setModelMap:l}=e,{accessToken:t}=(0,K.Z)();return(0,s.jsx)(el.Z,{children:(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)(eX.Z,{children:"Price Data Management"}),(0,s.jsx)(n.Z,{className:"text-tremor-content",children:"Manage model pricing data and configure automatic reload schedules"})]}),(0,s.jsx)(lI,{accessToken:t,onReloadSuccess:()=>{(async()=>{l(await (0,c.modelCostMap)())})()},buttonText:"Reload Price Data",size:"middle",type:"primary",className:"w-full"})]})})},lP=t(55584),lL=t(4156),lT=t(15731),lR=t(91126);let lO=(e,l,t,a,r,i,n,o,d,c,m)=>[{header:()=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(lL.Z,{checked:t,indeterminate:l.length>0&&!t,onChange:e=>r(e.target.checked),onClick:e=>e.stopPropagation()}),(0,s.jsx)("span",{children:"Model ID"})]}),accessorKey:"model_info.id",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:t}=e,r=t.original,i=r.model_name,n=l.includes(i);return(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(lL.Z,{checked:n,onChange:e=>a(i,e.target.checked),onClick:e=>e.stopPropagation()}),(0,s.jsx)(A.Z,{title:r.model_info.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>m&&m(r.model_info.id),children:r.model_info.id})})]})}},{header:"Model Name",accessorKey:"model_name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,t=l.original,a=o(t)||t.model_name;return(0,s.jsx)("div",{className:"font-medium text-sm",children:(0,s.jsx)(A.Z,{title:a,children:(0,s.jsx)("div",{className:"truncate max-w-[200px]",children:a})})})}},{header:"Health Status",accessorKey:"health_status",enableSorting:!0,sortingFn:(e,l,t)=>{var s,a;let r=e.getValue("health_status")||"unknown",i=l.getValue("health_status")||"unknown",n={healthy:0,checking:1,unknown:2,unhealthy:3};return(null!==(s=n[r])&&void 0!==s?s:4)-(null!==(a=n[i])&&void 0!==a?a:4)},cell:l=>{var t;let{row:a}=l,r=a.original,i={status:r.health_status,loading:r.health_loading,error:r.health_error};if(i.loading)return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse"}),(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}),(0,s.jsx)(eb.x,{className:"text-gray-600 text-sm",children:"Checking..."})]});let o=r.model_name,d="healthy"===i.status&&(null===(t=e[o])||void 0===t?void 0:t.successResponse);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[n(i.status),d&&c&&(0,s.jsx)(A.Z,{title:"View response details",placement:"top",children:(0,s.jsx)("button",{onClick:()=>{var l;return c(o,null===(l=e[o])||void 0===l?void 0:l.successResponse)},className:"p-1 text-green-600 hover:text-green-800 hover:bg-green-50 rounded cursor-pointer transition-colors",children:(0,s.jsx)(lT.Z,{className:"h-4 w-4"})})})]})}},{header:"Error Details",accessorKey:"health_error",enableSorting:!1,cell:l=>{let{row:t}=l,a=t.original.model_name,r=e[a];if(!(null==r?void 0:r.error))return(0,s.jsx)(eb.x,{className:"text-gray-400 text-sm",children:"No errors"});let i=r.error,n=r.fullError||r.error;return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"max-w-[200px]",children:(0,s.jsx)(A.Z,{title:i,placement:"top",children:(0,s.jsx)(eb.x,{className:"text-red-600 text-sm truncate",children:i})})}),d&&n!==i&&(0,s.jsx)(A.Z,{title:"View full error details",placement:"top",children:(0,s.jsx)("button",{onClick:()=>d(a,i,n),className:"p-1 text-red-600 hover:text-red-800 hover:bg-red-50 rounded cursor-pointer transition-colors",children:(0,s.jsx)(lT.Z,{className:"h-4 w-4"})})})]})}},{header:"Last Check",accessorKey:"last_check",enableSorting:!0,sortingFn:(e,l,t)=>{let s=e.getValue("last_check")||"Never checked",a=l.getValue("last_check")||"Never checked";if("Never checked"===s&&"Never checked"===a)return 0;if("Never checked"===s)return 1;if("Never checked"===a)return -1;if("Check in progress..."===s&&"Check in progress..."===a)return 0;if("Check in progress..."===s)return -1;if("Check in progress..."===a)return 1;let r=new Date(s),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)(eb.x,{className:"text-gray-600 text-sm",children:t.health_loading?"Check in progress...":t.last_check})}},{header:"Last Success",accessorKey:"last_success",enableSorting:!0,sortingFn:(e,l,t)=>{let s=e.getValue("last_success")||"Never succeeded",a=l.getValue("last_success")||"Never succeeded";if("Never succeeded"===s&&"Never succeeded"===a)return 0;if("Never succeeded"===s)return 1;if("Never succeeded"===a)return -1;if("None"===s&&"None"===a)return 0;if("None"===s)return 1;if("None"===a)return -1;let r=new Date(s),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:l=>{let{row:t}=l,a=e[t.original.model_name],r=(null==a?void 0:a.lastSuccess)||"None";return(0,s.jsx)(eb.x,{className:"text-gray-600 text-sm",children:r})}},{header:"Actions",id:"actions",cell:e=>{let{row:l}=e,t=l.original,a=t.model_name,r=t.health_status&&"none"!==t.health_status,n=t.health_loading?"Checking...":r?"Re-run Health Check":"Run Health Check";return(0,s.jsx)(A.Z,{title:n,placement:"top",children:(0,s.jsx)("button",{className:"p-2 rounded-md transition-colors ".concat(t.health_loading?"text-gray-400 cursor-not-allowed bg-gray-100":"text-indigo-600 hover:text-indigo-700 hover:bg-indigo-50"),onClick:()=>{t.health_loading||i(a)},disabled:t.health_loading,children:t.health_loading?(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse"}),(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}):r?(0,s.jsx)(Y.Z,{className:"h-4 w-4"}):(0,s.jsx)(lR.Z,{className:"h-4 w-4"})})})},enableSorting:!1}],lV=[{pattern:/Missing .* API Key/i,replacement:"Missing API Key"},{pattern:/Connection timeout/i,replacement:"Connection timeout"},{pattern:/Network.*not.*ok/i,replacement:"Network connection failed"},{pattern:/403.*Forbidden/i,replacement:"Access forbidden - check API key permissions"},{pattern:/401.*Unauthorized/i,replacement:"Unauthorized - invalid API key"},{pattern:/429.*rate limit/i,replacement:"Rate limit exceeded"},{pattern:/500.*Internal Server Error/i,replacement:"Provider internal server error"},{pattern:/litellm\.AuthenticationError/i,replacement:"Authentication failed"},{pattern:/litellm\.RateLimitError/i,replacement:"Rate limit exceeded"},{pattern:/litellm\.APIError/i,replacement:"API error"}];var lD=e=>{let{accessToken:l,modelData:t,all_models_on_proxy:a,getDisplayModelName:r,setSelectedModelId:i}=e,[d,m]=(0,o.useState)({}),[u,h]=(0,o.useState)([]),[x,p]=(0,o.useState)(!1),[g,f]=(0,o.useState)(!1),[j,v]=(0,o.useState)(null),[_,y]=(0,o.useState)(!1),[b,N]=(0,o.useState)(null),Z=(0,o.useRef)(null);(0,o.useEffect)(()=>{l&&(null==t?void 0:t.data)&&(async()=>{let e={};t.data.forEach(l=>{e[l.model_name]={status:"none",lastCheck:"None",lastSuccess:"None",loading:!1,error:void 0,fullError:void 0,successResponse:void 0}});try{let s=await (0,c.latestHealthChecksCall)(l);s&&s.latest_health_checks&&"object"==typeof s.latest_health_checks&&Object.entries(s.latest_health_checks).forEach(l=>{let[s,a]=l;if(!a)return;let r=null,i=t.data.find(e=>e.model_name===s);if(i)r=i.model_name;else{let e=t.data.find(e=>e.model_info&&e.model_info.id===s);if(e)r=e.model_name;else if(a.model_name){let e=t.data.find(e=>e.model_name===a.model_name);e&&(r=e.model_name)}}if(r){let l=a.error_message||void 0;e[r]={status:a.status||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():"None",loading:!1,error:l?w(l):void 0,fullError:l,successResponse:"healthy"===a.status?a:void 0}}})}catch(e){console.warn("Failed to load health check history (using default states):",e)}m(e)})()},[l,t]);let w=e=>{var l;if(!e)return"Health check failed";let t="string"==typeof e?e:JSON.stringify(e),s=t.match(/(\w+Error):\s*(\d{3})/i);if(s)return"".concat(s[1],": ").concat(s[2]);let a=t.match(/(AuthenticationError|RateLimitError|BadRequestError|InternalServerError|TimeoutError|NotFoundError|ForbiddenError|ServiceUnavailableError|BadGatewayError|ContentPolicyViolationError|\w+Error)/i),r=t.match(/\b(400|401|403|404|408|429|500|502|503|504)\b/);if(a&&r)return"".concat(a[1],": ").concat(r[1]);if(r){let e=r[1];return"".concat({400:"BadRequestError",401:"AuthenticationError",403:"ForbiddenError",404:"NotFoundError",408:"TimeoutError",429:"RateLimitError",500:"InternalServerError",502:"BadGatewayError",503:"ServiceUnavailableError",504:"GatewayTimeoutError"}[e],": ").concat(e)}if(a){let e=a[1],l={AuthenticationError:"401",RateLimitError:"429",BadRequestError:"400",InternalServerError:"500",TimeoutError:"408",NotFoundError:"404",ForbiddenError:"403",ServiceUnavailableError:"503",BadGatewayError:"502",GatewayTimeoutError:"504",ContentPolicyViolationError:"400"}[e];return l?"".concat(e,": ").concat(l):e}for(let{pattern:e,replacement:l}of lV)if(e.test(t))return l;if(/missing.*api.*key|invalid.*key|unauthorized/i.test(t))return"AuthenticationError: 401";if(/rate.*limit|too.*many.*requests/i.test(t))return"RateLimitError: 429";if(/timeout|timed.*out/i.test(t))return"TimeoutError: 408";if(/not.*found/i.test(t))return"NotFoundError: 404";if(/forbidden|access.*denied/i.test(t))return"ForbiddenError: 403";if(/internal.*server.*error/i.test(t))return"InternalServerError: 500";let i=t.replace(/[\n\r]+/g," ").replace(/\s+/g," ").trim(),n=null===(l=i.split(/[.!?]/)[0])||void 0===l?void 0:l.trim();return n&&n.length>0?n.length>100?n.substring(0,97)+"...":n:i.length>100?i.substring(0,97)+"...":i},C=async e=>{if(l){m(l=>({...l,[e]:{...l[e],loading:!0,status:"checking"}}));try{var s,a;let r=await (0,c.individualModelHealthCheckCall)(l,e),i=new Date().toLocaleString();if(r.unhealthy_count>0&&r.unhealthy_endpoints&&r.unhealthy_endpoints.length>0){let l=(null===(s=r.unhealthy_endpoints[0])||void 0===s?void 0:s.error)||"Health check failed",t=w(l);m(s=>{var a;return{...s,[e]:{status:"unhealthy",lastCheck:i,lastSuccess:(null===(a=s[e])||void 0===a?void 0:a.lastSuccess)||"None",loading:!1,error:t,fullError:l}}})}else m(l=>({...l,[e]:{status:"healthy",lastCheck:i,lastSuccess:i,loading:!1,successResponse:r}}));try{let s=await (0,c.latestHealthChecksCall)(l),r=t.data.find(l=>l.model_name===e);if(r){let l=r.model_info.id,t=null===(a=s.latest_health_checks)||void 0===a?void 0:a[l];if(t){let l=t.error_message||void 0;m(s=>{var a,r,i,n,o,d,c;return{...s,[e]:{status:t.status||(null===(a=s[e])||void 0===a?void 0:a.status)||"unknown",lastCheck:t.checked_at?new Date(t.checked_at).toLocaleString():(null===(r=s[e])||void 0===r?void 0:r.lastCheck)||"None",lastSuccess:"healthy"===t.status?t.checked_at?new Date(t.checked_at).toLocaleString():(null===(i=s[e])||void 0===i?void 0:i.lastSuccess)||"None":(null===(n=s[e])||void 0===n?void 0:n.lastSuccess)||"None",loading:!1,error:l?w(l):null===(o=s[e])||void 0===o?void 0:o.error,fullError:l||(null===(d=s[e])||void 0===d?void 0:d.fullError),successResponse:"healthy"===t.status?t:null===(c=s[e])||void 0===c?void 0:c.successResponse}}})}}}catch(e){console.debug("Could not fetch updated status from database (non-critical):",e)}}catch(a){let l=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),s=w(t);m(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:l,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:s,fullError:t}}})}}},k=async()=>{let e=u.length>0?u:a,s=e.reduce((e,l)=>(e[l]={...d[l],loading:!0,status:"checking"},e),{});m(e=>({...e,...s}));let r={},i=e.map(async e=>{if(l)try{let s=await (0,c.individualModelHealthCheckCall)(l,e);r[e]=s;let a=new Date().toLocaleString();if(s.unhealthy_count>0&&s.unhealthy_endpoints&&s.unhealthy_endpoints.length>0){var t;let l=(null===(t=s.unhealthy_endpoints[0])||void 0===t?void 0:t.error)||"Health check failed",r=w(l);m(t=>{var s;return{...t,[e]:{status:"unhealthy",lastCheck:a,lastSuccess:(null===(s=t[e])||void 0===s?void 0:s.lastSuccess)||"None",loading:!1,error:r,fullError:l}}})}else m(l=>({...l,[e]:{status:"healthy",lastCheck:a,lastSuccess:a,loading:!1,successResponse:s}}))}catch(a){console.error("Health check failed for ".concat(e,":"),a);let l=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),s=w(t);m(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:l,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:s,fullError:t}}})}});await Promise.allSettled(i);try{if(!l)return;let s=await (0,c.latestHealthChecksCall)(l);s.latest_health_checks&&Object.entries(s.latest_health_checks).forEach(l=>{let[s,a]=l,r=t.data.find(e=>e.model_info.id===s);if(r&&e.includes(r.model_name)&&a){let e=r.model_name,l=a.error_message||void 0;m(t=>{let s=t[e];return{...t,[e]:{status:a.status||(null==s?void 0:s.status)||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():(null==s?void 0:s.lastCheck)||"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():(null==s?void 0:s.lastSuccess)||"None",loading:!1,error:l?w(l):null==s?void 0:s.error,fullError:l||(null==s?void 0:s.fullError),successResponse:"healthy"===a.status?a:null==s?void 0:s.successResponse}}})}})}catch(e){console.warn("Failed to fetch updated health statuses from database (non-critical):",e)}},A=e=>{p(e),e?h(a):h([])},M=()=>{f(!1),v(null)},I=()=>{y(!1),N(null)};return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(eX.Z,{children:"Model Health Status"}),(0,s.jsx)(n.Z,{className:"text-gray-600 mt-1",children:"Run health checks on individual models to verify they are working correctly"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[u.length>0&&(0,s.jsx)(eY.Z,{size:"sm",variant:"light",onClick:()=>A(!1),className:"px-3 py-1 text-sm",children:"Clear Selection"}),(0,s.jsx)(eY.Z,{size:"sm",variant:"secondary",onClick:k,disabled:Object.values(d).some(e=>e.loading),className:"px-3 py-1 text-sm",children:u.length>0&&u.length{l?h(l=>[...l,e]):(h(l=>l.filter(l=>l!==e)),p(!1))},A,C,e=>{switch(e){case"healthy":return(0,s.jsx)(ll.Z,{color:"emerald",children:"healthy"});case"unhealthy":return(0,s.jsx)(ll.Z,{color:"red",children:"unhealthy"});case"checking":return(0,s.jsx)(ll.Z,{color:"blue",children:"checking"});case"none":return(0,s.jsx)(ll.Z,{color:"gray",children:"none"});default:return(0,s.jsx)(ll.Z,{color:"gray",children:"unknown"})}},r,(e,l,t)=>{v({modelName:e,cleanedError:l,fullError:t}),f(!0)},(e,l)=>{N({modelName:e,response:l}),y(!0)},i),data:t.data.map(e=>{let l=d[e.model_name]||{status:"none",lastCheck:"None",loading:!1};return{model_name:e.model_name,model_info:e.model_info,provider:e.provider,litellm_model_name:e.litellm_model_name,health_status:l.status,last_check:l.lastCheck,last_success:l.lastSuccess||"None",health_loading:l.loading,health_error:l.error,health_full_error:l.fullError}}),isLoading:!1,table:Z})}),(0,s.jsx)(S.Z,{title:j?"Health Check Error - ".concat(j.modelName):"Error Details",open:g,onCancel:M,footer:[(0,s.jsx)(E.ZP,{onClick:M,children:"Close"},"close")],width:800,children:j&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Error:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-red-50 border border-red-200 rounded-md",children:(0,s.jsx)(n.Z,{className:"text-red-800",children:j.cleanedError})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Full Error Details:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,s.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:j.fullError})})]})]})}),(0,s.jsx)(S.Z,{title:b?"Health Check Response - ".concat(b.modelName):"Response Details",open:_,onCancel:I,footer:[(0,s.jsx)(E.ZP,{onClick:I,children:"Close"},"close")],width:800,children:b&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Status:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-green-50 border border-green-200 rounded-md",children:(0,s.jsx)(n.Z,{className:"text-green-800",children:"Health check passed successfully"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Response Details:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,s.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:JSON.stringify(b.response,null,2)})})]})]})})]})},lz=t(86462),lq=t(47686),lB=t(77355),lU=t(93416),lG=t(95704),lH=e=>{let{accessToken:l,initialModelGroupAlias:t={},onAliasUpdate:a}=e,[r,i]=(0,o.useState)([]),[n,m]=(0,o.useState)({aliasName:"",targetModelGroup:""}),[u,h]=(0,o.useState)(null),[x,p]=(0,o.useState)(!0);(0,o.useEffect)(()=>{i(Object.entries(t).map((e,l)=>{var t;let[s,a]=e;return{id:"".concat(l,"-").concat(s),aliasName:s,targetModelGroup:"string"==typeof a?a:null!==(t=null==a?void 0:a.model)&&void 0!==t?t:""}}))},[t]);let g=async e=>{if(!l)return console.error("Access token is missing"),!1;try{let t={};return e.forEach(e=>{t[e.aliasName]=e.targetModelGroup}),console.log("Saving model group alias:",t),await (0,c.setCallbacksCall)(l,{router_settings:{model_group_alias:t}}),a&&a(t),!0}catch(e){return console.error("Failed to save model group alias settings:",e),d.Z.fromBackend("Failed to save model group alias settings"),!1}},f=async()=>{if(!n.aliasName||!n.targetModelGroup){d.Z.fromBackend("Please provide both alias name and target model group");return}if(r.some(e=>e.aliasName===n.aliasName)){d.Z.fromBackend("An alias with this name already exists");return}let e=[...r,{id:"".concat(Date.now(),"-").concat(n.aliasName),aliasName:n.aliasName,targetModelGroup:n.targetModelGroup}];await g(e)&&(i(e),m({aliasName:"",targetModelGroup:""}),d.Z.success("Alias added successfully"))},j=e=>{h({...e})},v=async()=>{if(!u)return;if(!u.aliasName||!u.targetModelGroup){d.Z.fromBackend("Please provide both alias name and target model group");return}if(r.some(e=>e.id!==u.id&&e.aliasName===u.aliasName)){d.Z.fromBackend("An alias with this name already exists");return}let e=r.map(e=>e.id===u.id?u:e);await g(e)&&(i(e),h(null),d.Z.success("Alias updated successfully"))},_=()=>{h(null)},b=async e=>{let l=r.filter(l=>l.id!==e);await g(l)&&(i(l),d.Z.success("Alias deleted successfully"))},N=r.reduce((e,l)=>(e[l.aliasName]=l.targetModelGroup,e),{});return(0,s.jsxs)(lG.Zb,{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>p(!x),children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)(lG.Dx,{className:"mb-0",children:"Model Group Alias Settings"}),(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Create aliases for your model groups to simplify API calls. For example, you can create an alias 'gpt-4o' that points to 'gpt-4o-mini-openai' model group."})]}),(0,s.jsx)("div",{className:"flex items-center",children:x?(0,s.jsx)(lz.Z,{className:"w-5 h-5 text-gray-500"}):(0,s.jsx)(lq.Z,{className:"w-5 h-5 text-gray-500"})})]}),x&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)(lG.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Alias Name"}),(0,s.jsx)("input",{type:"text",value:n.aliasName,onChange:e=>m({...n,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,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Target Model Group"}),(0,s.jsx)("input",{type:"text",value:n.targetModelGroup,onChange:e=>m({...n,targetModelGroup:e.target.value}),placeholder:"e.g., gpt-4o-mini-openai",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,s.jsx)("div",{className:"flex items-end",children:(0,s.jsxs)("button",{onClick:f,disabled:!n.aliasName||!n.targetModelGroup,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(n.aliasName&&n.targetModelGroup?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,s.jsx)(lB.Z,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,s.jsx)(lG.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,s.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(lG.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,s.jsx)(lG.ss,{children:(0,s.jsxs)(lG.SC,{children:[(0,s.jsx)(lG.xs,{className:"py-1 h-8",children:"Alias Name"}),(0,s.jsx)(lG.xs,{className:"py-1 h-8",children:"Target Model Group"}),(0,s.jsx)(lG.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,s.jsxs)(lG.RM,{children:[r.map(e=>(0,s.jsx)(lG.SC,{className:"h-8",children:u&&u.id===e.id?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lG.pj,{className:"py-0.5",children:(0,s.jsx)("input",{type:"text",value:u.aliasName,onChange:e=>h({...u,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,s.jsx)(lG.pj,{className:"py-0.5",children:(0,s.jsx)("input",{type:"text",value:u.targetModelGroup,onChange:e=>h({...u,targetModelGroup:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,s.jsx)(lG.pj,{className:"py-0.5 whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)("button",{onClick:v,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,s.jsx)("button",{onClick:_,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lG.pj,{className:"py-0.5 text-sm text-gray-900",children:e.aliasName}),(0,s.jsx)(lG.pj,{className:"py-0.5 text-sm text-gray-500",children:e.targetModelGroup}),(0,s.jsx)(lG.pj,{className:"py-0.5 whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)("button",{onClick:()=>j(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,s.jsx)(lU.Z,{className:"w-3 h-3"})}),(0,s.jsx)("button",{onClick:()=>b(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,s.jsx)(y.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===r.length&&(0,s.jsx)(lG.SC,{children:(0,s.jsx)(lG.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),(0,s.jsxs)(lG.Zb,{children:[(0,s.jsx)(lG.Dx,{className:"mb-4",children:"Configuration Example"}),(0,s.jsx)(lG.xv,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config.yaml:"}),(0,s.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,s.jsxs)("div",{className:"text-gray-700",children:["router_settings:",(0,s.jsx)("br",{}),"\xa0\xa0model_group_alias:",0===Object.keys(N).length?(0,s.jsxs)("span",{className:"text-gray-500",children:[(0,s.jsx)("br",{}),"\xa0\xa0\xa0\xa0# No aliases configured yet"]}):Object.entries(N).map(e=>{let[l,t]=e;return(0,s.jsxs)("span",{children:[(0,s.jsx)("br",{}),'\xa0\xa0\xa0\xa0"',l,'": "',t,'"']},l)})]})})]})]})]})},lK=t(27593),lJ=e=>{var l,t,u,x;let{accessToken:p,token:g,userRole:j,userID:_,modelData:y={data:[]},keys:b,setModelData:Z,premiumUser:w,teams:S}=e,[k]=N.Z.useForm(),[A,E]=(0,o.useState)(null),[M,I]=(0,o.useState)(""),[F,P]=(0,o.useState)([]),[L,T]=(0,o.useState)([]),[R,O]=(0,o.useState)(m.Cl.Anthropic),[V,D]=(0,o.useState)(!1),[z,q]=(0,o.useState)(null),[B,U]=(0,o.useState)([]),[G,H]=(0,o.useState)([]),[K,ea]=(0,o.useState)(null),[er,ei]=(0,o.useState)([]),[en,eo]=(0,o.useState)([]),[ed,ec]=(0,o.useState)([]),[em,eu]=(0,o.useState)([]),[eh,ex]=(0,o.useState)([]),[ep,eg]=(0,o.useState)([]),[ef,ej]=(0,o.useState)([]),[ev,e_]=(0,o.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[ey,eb]=(0,o.useState)(null),[eN,eZ]=(0,o.useState)(null),[ew,eC]=(0,o.useState)(0),[eS,ek]=(0,o.useState)({}),[eA,eE]=(0,o.useState)([]),[eM,eI]=(0,o.useState)(!1),[eF,eP]=(0,o.useState)(null),[eL,eT]=(0,o.useState)(null),[eR,eO]=(0,o.useState)([]),[eV,eD]=(0,o.useState)({}),[ez,eq]=(0,o.useState)(!1),[eB,eU]=(0,o.useState)(null),[eG,eH]=(0,o.useState)(!1),[eJ,eW]=(0,o.useState)(null),[eY,e$]=(0,o.useState)(null),[eQ,eX]=(0,o.useState)(!1),e0=(0,o.useRef)(null),[e1,e2]=(0,o.useState)(0),e4=(0,a.NL)(),{data:e5,isLoading:e6,refetch:e3}=v(p,_,j),{data:e7}=f(p),le=(null==e7?void 0:e7.credentials)||[],{data:ll}=(0,lP.L)(p||""),lt=j&&es.lo.includes(j)&&(null==ll?void 0:null===(l=ll.values)||void 0===l?void 0:l.disable_model_add_for_internal_users)===!0;(0,o.useEffect)(()=>{let e=e=>{e0.current&&!e0.current.contains(e.target)&&eX(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let ls={name:"file",accept:".json",pastable:!1,beforeUpload:e=>{if("application/json"===e.type){let l=new FileReader;l.onload=e=>{if(e.target){let l=e.target.result;k.setFieldsValue({vertex_credentials:l})}},l.readAsText(e)}return!1},onChange(e){"done"===e.file.status?d.Z.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&d.Z.fromBackend("".concat(e.file.name," file upload failed."))}},la=()=>{I(new Date().toLocaleString()),e4.invalidateQueries({queryKey:["models","list"]}),e3()},lr=async()=>{if(p)try{let e={router_settings:{}};"global"===K?(eN&&(e.router_settings.retry_policy=eN),d.Z.success("Global retry settings saved successfully")):(ey&&(e.router_settings.model_group_retry_policy=ey),d.Z.success("Retry settings saved successfully for ".concat(K))),await (0,c.setCallbacksCall)(p,e)}catch(e){d.Z.fromBackend("Failed to save retry settings")}};if((0,o.useEffect)(()=>{if(!p||!g||!j||!_||!e5)return;let e=async()=>{try{var e,l,t,s,a,r,i,n,o,d,m,u;Z(e5);let h=await (0,c.modelSettingsCall)(p);h&&T(h);let x=new Set;for(let e=0;e0&&(v=g[g.length-1]);let y=await (0,c.modelMetricsCall)(p,_,j,v,null===(e=ev.from)||void 0===e?void 0:e.toISOString(),null===(l=ev.to)||void 0===l?void 0:l.toISOString(),null==eF?void 0:eF.token,eL);ei(y.data),eo(y.all_api_bases);let b=await (0,c.streamingModelMetricsCall)(p,v,null===(t=ev.from)||void 0===t?void 0:t.toISOString(),null===(s=ev.to)||void 0===s?void 0:s.toISOString());ec(b.data),eu(b.all_api_bases);let N=await (0,c.modelExceptionsCall)(p,_,j,v,null===(a=ev.from)||void 0===a?void 0:a.toISOString(),null===(r=ev.to)||void 0===r?void 0:r.toISOString(),null==eF?void 0:eF.token,eL);ex(N.data),eg(N.exception_types);let w=await (0,c.modelMetricsSlowResponsesCall)(p,_,j,v,null===(i=ev.from)||void 0===i?void 0:i.toISOString(),null===(n=ev.to)||void 0===n?void 0:n.toISOString(),null==eF?void 0:eF.token,eL),C=await (0,c.adminGlobalActivityExceptions)(p,null===(o=ev.from)||void 0===o?void 0:o.toISOString().split("T")[0],null===(d=ev.to)||void 0===d?void 0:d.toISOString().split("T")[0],v);ek(C);let S=await (0,c.adminGlobalActivityExceptionsPerDeployment)(p,null===(m=ev.from)||void 0===m?void 0:m.toISOString().split("T")[0],null===(u=ev.to)||void 0===u?void 0:u.toISOString().split("T")[0],v);eE(S),ej(w);let k=await (0,c.allEndUsersCall)(p);eO(null==k?void 0:k.map(e=>e.user_id));let A=(await (0,c.getCallbacksCall)(p,_,j)).router_settings,E=A.model_group_retry_policy,M=A.num_retries;eb(E),eZ(A.retry_policy),eC(M);let I=A.model_group_alias||{};eD(I)}catch(e){console.error("Error fetching model data:",e)}};p&&g&&j&&_&&e5&&e();let l=async()=>{let e=await (0,c.modelCostMap)();console.log("received model cost map data: ".concat(Object.keys(e))),E(e)};null==A&&l()},[p,g,j,_,e5]),!y||e6||!p||!g||!j||!_)return(0,s.jsx)("div",{children:"Loading..."});let ln=[],lo=[];for(let e=0;enull!=A&&"object"==typeof A&&e in A?A[e].litellm_provider:"openai";if(s){let e=s.split("/"),l=e[0];(i=a)||(i=1===e.length?h(s):l)}else i="-";r&&(n=null==r?void 0:r.input_cost_per_token,o=null==r?void 0:r.output_cost_per_token,d=null==r?void 0:r.max_tokens,c=null==r?void 0:r.max_input_tokens),(null==l?void 0:l.litellm_params)&&(m=Object.fromEntries(Object.entries(null==l?void 0:l.litellm_params).filter(e=>{let[l]=e;return"model"!==l&&"api_base"!==l}))),y.data[e].provider=i,y.data[e].input_cost=n,y.data[e].output_cost=o,y.data[e].litellm_model_name=s,lo.push(i),y.data[e].input_cost&&(y.data[e].input_cost=(1e6*Number(y.data[e].input_cost)).toFixed(2)),y.data[e].output_cost&&(y.data[e].output_cost=(1e6*Number(y.data[e].output_cost)).toFixed(2)),y.data[e].max_tokens=d,y.data[e].max_input_tokens=c,y.data[e].api_base=null==l?void 0:null===(x=l.litellm_params)||void 0===x?void 0:x.api_base,y.data[e].cleanedLitellmParams=m,ln.push(l.model_name)}if(j&&"Admin Viewer"==j){let{Title:e,Paragraph:l}=C.default;return(0,s.jsxs)("div",{children:[(0,s.jsx)(e,{level:1,children:"Access Denied"}),(0,s.jsx)(l,{children:"Ask your proxy admin for access to view all models"})]})}return(Object.keys(m.Cl).find(e=>m.Cl[e]===R),eJ)?(0,s.jsx)("div",{className:"w-full h-full",children:(0,s.jsx)(e9.Z,{teamId:eJ,onClose:()=>eW(null),accessToken:p,is_team_admin:"Admin"===j,is_proxy_admin:"Proxy Admin"===j,userModels:ln,editTeam:!1,onUpdate:la})}):(0,s.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,s.jsx)(i.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,s.jsxs)(r.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Model Management"}),es.ZL.includes(j)?(0,s.jsx)("p",{className:"text-sm text-gray-600",children:"Add and manage models for the proxy"}):(0,s.jsx)("p",{className:"text-sm text-gray-600",children:"Add models for teams you are an admin for."})]})}),eB?(0,s.jsx)(e8,{modelId:eB,editModel:!0,onClose:()=>{eU(null),eH(!1)},modelData:y.data.find(e=>e.model_info.id===eB),accessToken:p,userID:_,userRole:j,setEditModalVisible:D,setSelectedModel:q,onModelUpdate:e=>{e.deleted?Z({...y,data:y.data.filter(l=>l.model_info.id!==e.model_info.id)}):Z({...y,data:y.data.map(l=>l.model_info.id===e.model_info.id?e:l)}),e4.invalidateQueries({queryKey:["models","list"]}),la()},modelAccessGroups:G}):(0,s.jsxs)(X.Z,{index:e1,onIndexChange:e2,className:"gap-2 h-[75vh] w-full ",children:[(0,s.jsxs)(ee.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,s.jsxs)("div",{className:"flex",children:[es.ZL.includes(j)?(0,s.jsx)(Q.Z,{children:"All Models"}):(0,s.jsx)(Q.Z,{children:"Your Models"}),!lt&&(0,s.jsx)(Q.Z,{children:"Add Model"}),es.ZL.includes(j)&&(0,s.jsx)(Q.Z,{children:"LLM Credentials"}),es.ZL.includes(j)&&(0,s.jsx)(Q.Z,{children:"Pass-Through Endpoints"}),es.ZL.includes(j)&&(0,s.jsx)(Q.Z,{children:"Health Status"}),es.ZL.includes(j)&&(0,s.jsx)(Q.Z,{children:"Model Analytics"}),es.ZL.includes(j)&&(0,s.jsx)(Q.Z,{children:"Model Retry Settings"}),es.ZL.includes(j)&&(0,s.jsx)(Q.Z,{children:"Model Group Alias"}),es.ZL.includes(j)&&(0,s.jsx)(Q.Z,{children:"Price Data Reload"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[M&&(0,s.jsxs)(n.Z,{children:["Last Refreshed: ",M]}),(0,s.jsx)($.Z,{icon:Y.Z,variant:"shadow",size:"xs",className:"self-center",onClick:la})]})]}),(0,s.jsxs)(et.Z,{children:[(0,s.jsx)(li,{selectedModelGroup:K,setSelectedModelGroup:ea,availableModelGroups:B,availableModelAccessGroups:G,setSelectedModelId:eU,setSelectedTeamId:eW,setEditModel:eH,modelData:y}),!lt&&(0,s.jsx)(el.Z,{className:"h-full",children:(0,s.jsx)(eK,{form:k,handleOk:()=>{k.validateFields().then(e=>{h(e,p,k,la)}).catch(e=>{var l;let t=(null===(l=e.errorFields)||void 0===l?void 0:l.map(e=>"".concat(e.name.join("."),": ").concat(e.errors.join(", "))).join(" | "))||"Unknown validation error";d.Z.fromBackend("Please fill in the following required fields: ".concat(t))})},selectedProvider:R,setSelectedProvider:O,providerModels:F,setProviderModelsFn:e=>{P((0,m.bK)(e,A))},getPlaceholder:m.ph,uploadProps:ls,showAdvancedSettings:ez,setShowAdvancedSettings:eq,teams:S,credentials:le,accessToken:p,userRole:j,premiumUser:w})}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(J,{uploadProps:ls})}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(lK.Z,{accessToken:p,userRole:j,userID:_,modelData:y,premiumUser:w})}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(lD,{accessToken:p,modelData:y,all_models_on_proxy:ln,getDisplayModelName:W,setSelectedModelId:eU})}),(0,s.jsx)(lb,{dateValue:ev,setDateValue:e_,selectedModelGroup:K,availableModelGroups:B,setShowAdvancedFilters:eI,modelMetrics:er,modelMetricsCategories:en,streamingModelMetrics:ed,streamingModelMetricsCategories:em,customTooltip:e=>{var l,t;let{payload:a,active:r}=e;if(!r||!a)return null;let i=null===(t=a[0])||void 0===t?void 0:null===(l=t.payload)||void 0===l?void 0:l.date,n=a.sort((e,l)=>l.value-e.value);if(n.length>5){let e=n.length-5;(n=n.slice(0,5)).push({dataKey:"".concat(e," other deployments"),value:a.slice(5).reduce((e,l)=>e+l.value,0),color:"gray"})}return(0,s.jsxs)("div",{className:"w-150 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[i&&(0,s.jsxs)("p",{className:"text-tremor-content-emphasis mb-2",children:["Date: ",i]}),n.map((e,l)=>{let t=parseFloat(e.value.toFixed(5)),a=0===t&&e.value>0?"<0.00001":t.toFixed(5);return(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 mt-1 rounded-full bg-".concat(e.color,"-500")}),(0,s.jsx)("p",{className:"text-tremor-content",children:e.dataKey})]}),(0,s.jsx)("p",{className:"font-medium text-tremor-content-emphasis text-righ ml-2",children:a})]},l)})]})},slowResponsesData:ef,modelExceptions:eh,globalExceptionData:eS,allExceptions:ep,globalExceptionPerDeployment:eA,allEndUsers:eR,keys:b,setSelectedAPIKey:eP,setSelectedCustomer:eT,teams:S,selectedAPIKey:eF,selectedCustomer:eL,selectedTeam:eY,setAllExceptions:eg,setGlobalExceptionData:ek,setGlobalExceptionPerDeployment:eE,setModelExceptions:ex,setModelMetrics:ei,setModelMetricsCategories:eo,setSelectedModelGroup:ea,setSlowResponsesData:ej,setStreamingModelMetrics:ec,setStreamingModelMetricsCategories:eu}),(0,s.jsx)(lZ,{selectedModelGroup:K,setSelectedModelGroup:ea,availableModelGroups:B,globalRetryPolicy:eN,setGlobalRetryPolicy:eZ,defaultRetry:ew,modelGroupRetryPolicy:ey,setModelGroupRetryPolicy:eb,handleSaveRetrySettings:lr}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(lH,{accessToken:p,initialModelGroupAlias:eV,onAliasUpdate:eD})}),(0,s.jsx)(lF,{setModelMap:E})]})]})]})})})}},27593:function(e,l,t){t.d(l,{Z:function(){return Y}});var s=t(57437),a=t(2265),r=t(78489),i=t(47323),n=t(84264),o=t(96761),d=t(19250),c=t(99981),m=t(33866),u=t(15731),h=t(53410),x=t(74998),p=t(59341),g=t(49566),f=t(12514),j=t(97765),v=t(37592),_=t(10032),y=t(22116),b=t(51653),N=t(24199),Z=t(12660),w=t(15424),C=t(58760),S=t(5545),k=t(45246),A=t(96473),E=t(31283),M=e=>{let{value:l={},onChange:t}=e,[r,i]=(0,a.useState)(Object.entries(l)),n=e=>{let l=r.filter((l,t)=>t!==e);i(l),null==t||t(Object.fromEntries(l))},o=(e,l,s)=>{let a=[...r];a[e]=[l,s],i(a),null==t||t(Object.fromEntries(a))};return(0,s.jsxs)("div",{children:[r.map((e,l)=>{let[t,a]=e;return(0,s.jsxs)(C.Z,{style:{display:"flex",marginBottom:8},align:"center",children:[(0,s.jsx)(E.o,{placeholder:"Header Name",value:t,onChange:e=>o(l,e.target.value,a)}),(0,s.jsx)(E.o,{placeholder:"Header Value",value:a,onChange:e=>o(l,t,e.target.value)}),(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,s.jsx)(k.Z,{onClick:()=>n(l),style:{cursor:"pointer"}})})]},l)}),(0,s.jsx)(S.ZP,{type:"dashed",onClick:()=>{i([...r,["",""]])},icon:(0,s.jsx)(A.Z,{}),children:"Add Header"})]})},I=t(77565),F=e=>{let{pathValue:l,targetValue:t,includeSubpath:a}=e,r=(0,d.getProxyBaseUrl)();return l&&t?(0,s.jsxs)(f.Z,{className:"p-5",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Preview"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-5",children:"How your requests will be routed"}),(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"Basic routing:"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint"}),(0,s.jsx)("code",{className:"font-mono text-sm text-gray-900",children:l?"".concat(r).concat(l):""})]}),(0,s.jsx)("div",{className:"text-gray-400",children:(0,s.jsx)(I.Z,{className:"text-lg"})}),(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,s.jsx)("code",{className:"font-mono text-sm text-gray-900",children:t})]})]})]}),a&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"With subpaths:"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint + subpath"}),(0,s.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[l&&"".concat(r).concat(l),(0,s.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]}),(0,s.jsx)("div",{className:"text-gray-400",children:(0,s.jsx)(I.Z,{className:"text-lg"})}),(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,s.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[t,(0,s.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]})]}),(0,s.jsxs)("div",{className:"mt-3 text-sm text-gray-600",children:["Any path after ",l," will be appended to the target URL"]})]})}),!a&&(0,s.jsx)("div",{className:"mt-4 p-3 bg-blue-50 rounded-md border border-blue-200",children:(0,s.jsxs)("div",{className:"flex items-start",children:[(0,s.jsx)(w.Z,{className:"text-blue-500 mt-0.5 mr-2 flex-shrink-0"}),(0,s.jsxs)("div",{className:"text-sm text-blue-700",children:[(0,s.jsx)("span",{className:"font-medium",children:"Not seeing the routing you wanted?"})," Try enabling - Include Subpaths - above - this allows subroutes like"," ",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded font-mono text-xs",children:"/api/v1/models"})," to be forwarded automatically."]})]})})]})]}):null},P=t(9114),L=t(63709),T=e=>{let{premiumUser:l,authEnabled:t,onAuthChange:a}=e;return(0,s.jsxs)(f.Z,{className:"p-6",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Security"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-4",children:"When enabled, requests to this endpoint will require a valid LiteLLM Virtual Key"}),l?(0,s.jsx)(_.Z.Item,{name:"auth",valuePropName:"checked",className:"mb-0",children:(0,s.jsx)(L.Z,{checked:t,onChange:e=>{a(e)}})}):(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center mb-3",children:[(0,s.jsx)(L.Z,{disabled:!0,checked:!1,style:{outline:"2px solid #d1d5db",outlineOffset:"2px"}}),(0,s.jsx)("span",{className:"ml-2 text-sm text-gray-400",children:"Authentication (Premium)"})]}),(0,s.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,s.jsxs)(n.Z,{className:"text-sm text-yellow-800",children:["Setting authentication for pass-through endpoints is a LiteLLM Enterprise feature. Get a trial key"," ",(0,s.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})]})},R=t(67479),O=e=>{let{accessToken:l,value:t={},onChange:r,disabled:i=!1}=e,[n,d]=(0,a.useState)(Object.keys(t)),[m,u]=(0,a.useState)(t);(0,a.useEffect)(()=>{u(t),d(Object.keys(t))},[t]);let h=(e,l,t)=>{var s,a;let i=m[e]||{},n={...m,[e]:{...i,[l]:t.length>0?t:void 0}};(null===(s=n[e])||void 0===s?void 0:s.request_fields)||(null===(a=n[e])||void 0===a?void 0:a.response_fields)||(n[e]=null),u(n),r&&r(n)};return(0,s.jsxs)(f.Z,{className:"p-6",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Guardrails"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-6",children:"Configure guardrails to enforce policies on requests and responses. Guardrails are opt-in for passthrough endpoints."}),(0,s.jsx)(b.Z,{message:(0,s.jsxs)("span",{children:["Field-Level Targeting"," ",(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/pass_through_guardrails#field-level-targeting",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"(Learn More)"})]}),description:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{children:"Optionally specify which fields to check. If left empty, the entire request/response is sent to the guardrail."}),(0,s.jsxs)("div",{className:"text-xs space-y-1 mt-2",children:[(0,s.jsx)("div",{className:"font-medium",children:"Common Examples:"}),(0,s.jsxs)("div",{children:["• ",(0,s.jsx)("code",{className:"bg-gray-100 px-1 rounded",children:"query"})," - Single field"]}),(0,s.jsxs)("div",{children:["• ",(0,s.jsx)("code",{className:"bg-gray-100 px-1 rounded",children:"documents[*].text"})," - All text in documents array"]}),(0,s.jsxs)("div",{children:["• ",(0,s.jsx)("code",{className:"bg-gray-100 px-1 rounded",children:"messages[*].content"})," - All message contents"]})]})]}),type:"info",showIcon:!0,className:"mb-4"}),(0,s.jsx)(_.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Select Guardrails",(0,s.jsx)(c.Z,{title:"Choose which guardrails should run on this endpoint. Org/team/key level guardrails will also be included.",children:(0,s.jsx)(w.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),children:(0,s.jsx)(R.Z,{accessToken:l,value:n,onChange:e=>{d(e);let l={};e.forEach(e=>{l[e]=m[e]||null}),u(l),r&&r(l)},disabled:i})}),n.length>0&&(0,s.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Field Targeting (Optional)"}),(0,s.jsx)("div",{className:"text-xs text-gray-500",children:"\uD83D\uDCA1 Tip: Leave empty to check entire payload"})]}),n.map(e=>{var l,t;return(0,s.jsxs)(f.Z,{className:"p-4 bg-gray-50",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-gray-900 mb-3",children:e}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,s.jsxs)("label",{className:"text-xs text-gray-600 flex items-center",children:["Request Fields (pre_call)",(0,s.jsx)(c.Z,{title:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium mb-1",children:"Specify which request fields to check"}),(0,s.jsxs)("div",{className:"text-xs space-y-1",children:[(0,s.jsx)("div",{children:"Examples:"}),(0,s.jsx)("div",{children:"• query"}),(0,s.jsx)("div",{children:"• documents[*].text"}),(0,s.jsx)("div",{children:"• messages[*].content"})]})]}),children:(0,s.jsx)(w.Z,{className:"ml-1 text-gray-400"})})]}),(0,s.jsxs)("div",{className:"flex gap-1",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{var l;let t=(null===(l=m[e])||void 0===l?void 0:l.request_fields)||[];h(e,"request_fields",[...t,"query"])},className:"text-xs px-2 py-1 bg-white border border-gray-300 rounded hover:bg-gray-50",disabled:i,children:"+ query"}),(0,s.jsx)("button",{type:"button",onClick:()=>{var l;let t=(null===(l=m[e])||void 0===l?void 0:l.request_fields)||[];h(e,"request_fields",[...t,"documents[*]"])},className:"text-xs px-2 py-1 bg-white border border-gray-300 rounded hover:bg-gray-50",disabled:i,children:"+ documents[*]"})]})]}),(0,s.jsx)(v.default,{mode:"tags",style:{width:"100%"},placeholder:"Type field name or use + buttons above (e.g., query, documents[*].text)",value:(null===(l=m[e])||void 0===l?void 0:l.request_fields)||[],onChange:l=>h(e,"request_fields",l),disabled:i,tokenSeparators:[","]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,s.jsxs)("label",{className:"text-xs text-gray-600 flex items-center",children:["Response Fields (post_call)",(0,s.jsx)(c.Z,{title:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium mb-1",children:"Specify which response fields to check"}),(0,s.jsxs)("div",{className:"text-xs space-y-1",children:[(0,s.jsx)("div",{children:"Examples:"}),(0,s.jsx)("div",{children:"• results[*].text"}),(0,s.jsx)("div",{children:"• choices[*].message.content"})]})]}),children:(0,s.jsx)(w.Z,{className:"ml-1 text-gray-400"})})]}),(0,s.jsx)("div",{className:"flex gap-1",children:(0,s.jsx)("button",{type:"button",onClick:()=>{var l;let t=(null===(l=m[e])||void 0===l?void 0:l.response_fields)||[];h(e,"response_fields",[...t,"results[*]"])},className:"text-xs px-2 py-1 bg-white border border-gray-300 rounded hover:bg-gray-50",disabled:i,children:"+ results[*]"})})]}),(0,s.jsx)(v.default,{mode:"tags",style:{width:"100%"},placeholder:"Type field name or use + buttons above (e.g., results[*].text)",value:(null===(t=m[e])||void 0===t?void 0:t.response_fields)||[],onChange:l=>h(e,"response_fields",l),disabled:i,tokenSeparators:[","]})]})]})]},e)})]})]})};let{Option:V}=v.default;var D=e=>{let{accessToken:l,setPassThroughItems:t,passThroughItems:i,premiumUser:n=!1}=e,[m]=_.Z.useForm(),[u,h]=(0,a.useState)(!1),[x,v]=(0,a.useState)(!1),[C,S]=(0,a.useState)(""),[k,A]=(0,a.useState)(""),[E,I]=(0,a.useState)(""),[L,R]=(0,a.useState)(!0),[V,D]=(0,a.useState)(!1),[z,q]=(0,a.useState)({}),B=()=>{m.resetFields(),A(""),I(""),R(!0),q({}),h(!1)},U=e=>{let l=e;e&&!e.startsWith("/")&&(l="/"+e),A(l),m.setFieldsValue({path:l})},G=async e=>{console.log("addPassThrough called with:",e),v(!0);try{!n&&"auth"in e&&delete e.auth,z&&Object.keys(z).length>0&&(e.guardrails=z),console.log("formValues: ".concat(JSON.stringify(e)));let s=(await (0,d.createPassThroughEndpoint)(l,e)).endpoints[0],a=[...i,s];t(a),P.Z.success("Pass-through endpoint created successfully"),m.resetFields(),A(""),I(""),R(!0),q({}),h(!1)}catch(e){P.Z.fromBackend("Error creating pass-through endpoint: "+e)}finally{v(!1)}};return(0,s.jsxs)("div",{children:[(0,s.jsx)(r.Z,{className:"mx-auto mb-4 mt-4",onClick:()=>h(!0),children:"+ Add Pass-Through Endpoint"}),(0,s.jsx)(y.Z,{title:(0,s.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,s.jsx)(Z.Z,{className:"text-xl text-blue-500"}),(0,s.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Pass-Through Endpoint"})]}),open:u,width:1e3,onCancel:B,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,s.jsxs)("div",{className:"mt-6",children:[(0,s.jsx)(b.Z,{message:"What is a Pass-Through Endpoint?",description:"Route requests from your LiteLLM proxy to any external API. Perfect for custom models, image generation APIs, or any service you want to proxy through LiteLLM.",type:"info",showIcon:!0,className:"mb-6"}),(0,s.jsxs)(_.Z,{form:m,onFinish:G,layout:"vertical",className:"space-y-6",initialValues:{include_subpath:!0,path:k,target:E},children:[(0,s.jsxs)(f.Z,{className:"p-5",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Configuration"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-5",children:"Configure how requests to your domain will be forwarded to the target API"}),(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsx)(_.Z.Item,{label:(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Path Prefix"}),name:"path",rules:[{required:!0,message:"Path is required",pattern:/^\//}],extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example: /bria, /adobe-photoshop, /elasticsearch"}),className:"mb-4",children:(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsx)(g.Z,{placeholder:"bria",value:k,onChange:e=>U(e.target.value),className:"flex-1"})})}),(0,s.jsx)(_.Z.Item,{label:(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Target URL"}),name:"target",rules:[{required:!0,message:"Target URL is required"},{type:"url",message:"Please enter a valid URL"}],extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example:https://engine.prod.bria-api.com"}),className:"mb-4",children:(0,s.jsx)(g.Z,{placeholder:"https://engine.prod.bria-api.com",value:E,onChange:e=>{I(e.target.value),m.setFieldsValue({target:e.target.value})}})}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Include Subpaths"}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Forward all subpaths to the target API (recommended for REST APIs)"})]}),(0,s.jsx)(_.Z.Item,{name:"include_subpath",valuePropName:"checked",className:"mb-0",children:(0,s.jsx)(p.Z,{checked:L,onChange:R})})]})]})]}),(0,s.jsx)(F,{pathValue:k,targetValue:E,includeSubpath:L}),(0,s.jsxs)(f.Z,{className:"p-6",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Headers"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-6",children:"Add headers that will be sent with every request to the target API"}),(0,s.jsx)(_.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Headers",(0,s.jsx)(c.Z,{title:"Authentication and other headers to forward with requests",children:(0,s.jsx)(w.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"headers",rules:[{required:!0,message:"Please configure the headers"}],extra:(0,s.jsxs)("div",{className:"text-xs text-gray-500 mt-2",children:[(0,s.jsx)("div",{className:"font-medium mb-1",children:"Add authentication tokens and other required headers"}),(0,s.jsx)("div",{children:"Common examples: auth_token, Authorization, x-api-key"})]}),children:(0,s.jsx)(M,{})})]}),(0,s.jsx)(T,{premiumUser:n,authEnabled:V,onAuthChange:e=>{D(e),m.setFieldsValue({auth:e})}}),(0,s.jsx)(O,{accessToken:l,value:z,onChange:q}),(0,s.jsxs)(f.Z,{className:"p-6",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Billing"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-6",children:"Optional cost tracking for this endpoint"}),(0,s.jsx)(_.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Cost Per Request (USD)",(0,s.jsx)(c.Z,{title:"Optional: Track costs for requests to this endpoint",children:(0,s.jsx)(w.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:"cost_per_request",extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-2",children:"The cost charged for each request through this endpoint"}),children:(0,s.jsx)(N.Z,{min:0,step:.001,precision:4,placeholder:"2.0000",size:"large"})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,s.jsx)(r.Z,{variant:"secondary",onClick:B,children:"Cancel"}),(0,s.jsx)(r.Z,{variant:"primary",loading:x,onClick:()=>{console.log("Submit button clicked"),m.submit()},children:x?"Creating...":"Add Pass-Through Endpoint"})]})]})]})})]})},z=t(30078),q=t(4260),B=t(19015),U=t(87769),G=t(42208);let H=e=>{let{value:l}=e,[t,r]=(0,a.useState)(!1),i=JSON.stringify(l,null,2);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("pre",{className:"font-mono text-xs bg-gray-50 p-2 rounded max-w-md overflow-auto",children:t?i:"••••••••"}),(0,s.jsx)("button",{onClick:()=>r(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,s.jsx)(U.Z,{className:"w-4 h-4 text-gray-500"}):(0,s.jsx)(G.Z,{className:"w-4 h-4 text-gray-500"})})]})};var K=e=>{let{endpointData:l,onClose:t,accessToken:r,isAdmin:i,premiumUser:n=!1,onEndpointUpdated:o}=e,[c,m]=(0,a.useState)(l),[u,h]=(0,a.useState)(!1),[x,p]=(0,a.useState)(!1),[g,f]=(0,a.useState)((null==l?void 0:l.auth)||!1),[j,v]=(0,a.useState)((null==l?void 0:l.guardrails)||{}),[y]=_.Z.useForm(),b=async e=>{try{if(!r||!(null==c?void 0:c.id))return;let l={};if(e.headers)try{l="string"==typeof e.headers?JSON.parse(e.headers):e.headers}catch(e){P.Z.fromBackend("Invalid JSON format for headers");return}let t={path:c.path,target:e.target,headers:l,include_subpath:e.include_subpath,cost_per_request:e.cost_per_request,auth:n?e.auth:void 0,guardrails:j&&Object.keys(j).length>0?j:void 0};await (0,d.updatePassThroughEndpoint)(r,c.id,t),m({...c,...t}),p(!1),o&&o()}catch(e){console.error("Error updating endpoint:",e),P.Z.fromBackend("Failed to update pass through endpoint")}},N=async()=>{try{if(!r||!(null==c?void 0:c.id))return;await (0,d.deletePassThroughEndpointsCall)(r,c.id),P.Z.success("Pass through endpoint deleted successfully"),t(),o&&o()}catch(e){console.error("Error deleting endpoint:",e),P.Z.fromBackend("Failed to delete pass through endpoint")}};return u?(0,s.jsx)("div",{className:"p-4",children:"Loading..."}):c?(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,s.jsxs)("div",{children:[(0,s.jsx)(S.ZP,{onClick:t,className:"mb-4",children:"← Back"}),(0,s.jsxs)(z.Dx,{children:["Pass Through Endpoint: ",c.path]}),(0,s.jsx)(z.xv,{className:"text-gray-500 font-mono",children:c.id})]})}),(0,s.jsxs)(z.v0,{children:[(0,s.jsxs)(z.td,{className:"mb-4",children:[(0,s.jsx)(z.OK,{children:"Overview"},"overview"),i?(0,s.jsx)(z.OK,{children:"Settings"},"settings"):(0,s.jsx)(s.Fragment,{})]}),(0,s.jsxs)(z.nP,{children:[(0,s.jsxs)(z.x4,{children:[(0,s.jsxs)(z.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,s.jsxs)(z.Zb,{children:[(0,s.jsx)(z.xv,{children:"Path"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(z.Dx,{className:"font-mono",children:c.path})})]}),(0,s.jsxs)(z.Zb,{children:[(0,s.jsx)(z.xv,{children:"Target"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(z.Dx,{children:c.target})})]}),(0,s.jsxs)(z.Zb,{children:[(0,s.jsx)(z.xv,{children:"Configuration"}),(0,s.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,s.jsx)("div",{children:(0,s.jsx)(z.Ct,{color:c.include_subpath?"green":"gray",children:c.include_subpath?"Include Subpath":"Exact Path"})}),(0,s.jsx)("div",{children:(0,s.jsx)(z.Ct,{color:c.auth?"blue":"gray",children:c.auth?"Auth Required":"No Auth"})}),void 0!==c.cost_per_request&&(0,s.jsx)("div",{children:(0,s.jsxs)(z.xv,{children:["Cost per request: $",c.cost_per_request]})})]})]})]}),(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(F,{pathValue:c.path,targetValue:c.target,includeSubpath:c.include_subpath||!1})}),c.headers&&Object.keys(c.headers).length>0&&(0,s.jsxs)(z.Zb,{className:"mt-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Headers"}),(0,s.jsxs)(z.Ct,{color:"blue",children:[Object.keys(c.headers).length," headers configured"]})]}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(H,{value:c.headers})})]}),c.guardrails&&Object.keys(c.guardrails).length>0&&(0,s.jsxs)(z.Zb,{className:"mt-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Guardrails"}),(0,s.jsxs)(z.Ct,{color:"purple",children:[Object.keys(c.guardrails).length," guardrails configured"]})]}),(0,s.jsx)("div",{className:"mt-4 space-y-2",children:Object.entries(c.guardrails).map(e=>{let[l,t]=e;return(0,s.jsxs)("div",{className:"p-3 bg-gray-50 rounded",children:[(0,s.jsx)("div",{className:"font-medium text-sm",children:l}),t&&(t.request_fields||t.response_fields)&&(0,s.jsxs)("div",{className:"mt-2 text-xs text-gray-600 space-y-1",children:[t.request_fields&&(0,s.jsxs)("div",{children:["Request fields: ",t.request_fields.join(", ")]}),t.response_fields&&(0,s.jsxs)("div",{children:["Response fields: ",t.response_fields.join(", ")]})]}),!t&&(0,s.jsx)("div",{className:"text-xs text-gray-600 mt-1",children:"Uses entire payload"})]},l)})})]})]}),i&&(0,s.jsx)(z.x4,{children:(0,s.jsxs)(z.Zb,{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(z.Dx,{children:"Pass Through Endpoint Settings"}),(0,s.jsx)("div",{className:"space-x-2",children:!x&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(z.zx,{onClick:()=>p(!0),children:"Edit Settings"}),(0,s.jsx)(z.zx,{onClick:N,variant:"secondary",color:"red",children:"Delete Endpoint"})]})})]}),x?(0,s.jsxs)(_.Z,{form:y,onFinish:b,initialValues:{target:c.target,headers:c.headers?JSON.stringify(c.headers,null,2):"",include_subpath:c.include_subpath||!1,cost_per_request:c.cost_per_request,auth:c.auth||!1},layout:"vertical",children:[(0,s.jsx)(_.Z.Item,{label:"Target URL",name:"target",rules:[{required:!0,message:"Please input a target URL"}],children:(0,s.jsx)(z.oi,{placeholder:"https://api.example.com"})}),(0,s.jsx)(_.Z.Item,{label:"Headers (JSON)",name:"headers",children:(0,s.jsx)(q.default.TextArea,{rows:5,placeholder:'{"Authorization": "Bearer your-token", "Content-Type": "application/json"}'})}),(0,s.jsx)(_.Z.Item,{label:"Include Subpath",name:"include_subpath",valuePropName:"checked",children:(0,s.jsx)(L.Z,{})}),(0,s.jsx)(_.Z.Item,{label:"Cost per Request",name:"cost_per_request",children:(0,s.jsx)(B.Z,{min:0,step:.01,precision:2,placeholder:"0.00",addonBefore:"$"})}),(0,s.jsx)(T,{premiumUser:n,authEnabled:g,onAuthChange:e=>{f(e),y.setFieldsValue({auth:e})}}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(O,{accessToken:r||"",value:j,onChange:v})}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,s.jsx)(S.ZP,{onClick:()=>p(!1),children:"Cancel"}),(0,s.jsx)(z.zx,{children:"Save Changes"})]})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Path"}),(0,s.jsx)("div",{className:"font-mono",children:c.path})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Target URL"}),(0,s.jsx)("div",{children:c.target})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Include Subpath"}),(0,s.jsx)(z.Ct,{color:c.include_subpath?"green":"gray",children:c.include_subpath?"Yes":"No"})]}),void 0!==c.cost_per_request&&(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Cost per Request"}),(0,s.jsxs)("div",{children:["$",c.cost_per_request]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Authentication Required"}),(0,s.jsx)(z.Ct,{color:c.auth?"green":"gray",children:c.auth?"Yes":"No"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Headers"}),c.headers&&Object.keys(c.headers).length>0?(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(H,{value:c.headers})}):(0,s.jsx)("div",{className:"text-gray-500",children:"No headers configured"})]})]})]})})]})]})]}):(0,s.jsx)("div",{className:"p-4",children:"Pass through endpoint not found"})},J=t(12322);let W=e=>{let{value:l}=e,[t,r]=(0,a.useState)(!1),i=JSON.stringify(l);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("span",{className:"font-mono text-xs",children:t?i:"••••••••"}),(0,s.jsx)("button",{onClick:()=>r(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,s.jsx)(U.Z,{className:"w-4 h-4 text-gray-500"}):(0,s.jsx)(G.Z,{className:"w-4 h-4 text-gray-500"})})]})};var Y=e=>{let{accessToken:l,userRole:t,userID:p,modelData:g,premiumUser:f}=e,[j,v]=(0,a.useState)([]),[_,y]=(0,a.useState)(null),[b,N]=(0,a.useState)(!1),[Z,w]=(0,a.useState)(null);(0,a.useEffect)(()=>{l&&t&&p&&(0,d.getPassThroughEndpointsCall)(l).then(e=>{v(e.endpoints)})},[l,t,p]);let C=async e=>{w(e),N(!0)},S=async()=>{if(null!=Z&&l){try{await (0,d.deletePassThroughEndpointsCall)(l,Z);let e=j.filter(e=>e.id!==Z);v(e),P.Z.success("Endpoint deleted successfully.")}catch(e){console.error("Error deleting the endpoint:",e),P.Z.fromBackend("Error deleting the endpoint: "+e)}N(!1),w(null)}},k=(e,l)=>{C(e)},A=[{header:"ID",accessorKey:"id",cell:e=>(0,s.jsx)(c.Z,{title:e.row.original.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>e.row.original.id&&y(e.row.original.id),children:e.row.original.id})})},{header:"Path",accessorKey:"path"},{header:"Target",accessorKey:"target",cell:e=>(0,s.jsx)(n.Z,{children:e.getValue()})},{header:()=>(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{children:"Authentication"}),(0,s.jsx)(c.Z,{title:"LiteLLM Virtual Key required to call endpoint",children:(0,s.jsx)(u.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),accessorKey:"auth",cell:e=>(0,s.jsx)(m.Z,{color:e.getValue()?"green":"gray",children:e.getValue()?"Yes":"No"})},{header:"Headers",accessorKey:"headers",cell:e=>(0,s.jsx)(W,{value:e.getValue()||{}})},{header:"Actions",id:"actions",cell:e=>{let{row:l}=e;return(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)(i.Z,{icon:h.Z,size:"sm",onClick:()=>l.original.id&&y(l.original.id),title:"Edit"}),(0,s.jsx)(i.Z,{icon:x.Z,size:"sm",onClick:()=>k(l.original.id,l.index),title:"Delete"})]})}}];if(!l)return null;if(_){console.log("selectedEndpointId",_),console.log("generalSettings",j);let e=j.find(e=>e.id===_);return e?(0,s.jsx)(K,{endpointData:e,onClose:()=>y(null),accessToken:l,isAdmin:"Admin"===t||"admin"===t,premiumUser:f,onEndpointUpdated:()=>{l&&(0,d.getPassThroughEndpointsCall)(l).then(e=>{v(e.endpoints)})}}):(0,s.jsx)("div",{children:"Endpoint not found"})}return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(o.Z,{children:"Pass Through Endpoints"}),(0,s.jsx)(n.Z,{className:"text-tremor-content",children:"Configure and manage your pass-through endpoints"})]}),(0,s.jsx)(D,{accessToken:l,setPassThroughItems:v,passThroughItems:j,premiumUser:f}),(0,s.jsx)(J.w,{data:j,columns:A,renderSubComponent:()=>(0,s.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:!1,noDataMessage:"No pass-through endpoints configured"}),b&&(0,s.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,s.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,s.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,s.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,s.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,s.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,s.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,s.jsx)("div",{className:"sm:flex sm:items-start",children:(0,s.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,s.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Pass-Through Endpoint"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this pass-through endpoint? This action cannot be undone."})})]})})}),(0,s.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,s.jsx)(r.Z,{onClick:S,color:"red",className:"ml-2",children:"Delete"}),(0,s.jsx)(r.Z,{onClick:()=>{N(!1),w(null)},children:"Cancel"})]})]})]})})]})}},39789:function(e,l,t){t.d(l,{Z:function(){return n}});var s=t(57437),a=t(2265),r=t(88237),i=t(84264),n=e=>{let{value:l,onValueChange:t,label:n="Select Time Range",className:o="",showTimeRange:d=!0}=e,[c,m]=(0,a.useState)(!1),u=(0,a.useRef)(null),h=(0,a.useCallback)(e=>{m(!0),setTimeout(()=>m(!1),1500),t(e),requestIdleCallback(()=>{if(e.from){let l;let s={...e},a=new Date(e.from);l=new Date(e.to?e.to:e.from),a.toDateString(),l.toDateString(),a.setHours(0,0,0,0),l.setHours(23,59,59,999),s.from=a,s.to=l,t(s)}},{timeout:100})},[t]),x=(0,a.useCallback)((e,l)=>{if(!e||!l)return"";let t=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==l.toDateString())return"".concat(t(e)," - ").concat(t(l));{let t=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),s=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),a=l.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(t,": ").concat(s," - ").concat(a)}},[]);return(0,s.jsxs)("div",{className:o,children:[n&&(0,s.jsx)(i.Z,{className:"mb-2",children:n}),(0,s.jsxs)("div",{className:"relative w-fit",children:[(0,s.jsx)("div",{ref:u,children:(0,s.jsx)(r.Z,{enableSelect:!0,value:l,onValueChange:h,placeholder:"Select date range",enableClear:!1,style:{zIndex:100}})}),c&&(0,s.jsx)("div",{className:"absolute top-1/2 animate-pulse",style:{left:"calc(100% + 8px)",transform:"translateY(-50%)",zIndex:110},children:(0,s.jsxs)("div",{className:"flex items-center gap-1 text-green-600 text-sm font-medium bg-white px-2 py-1 rounded-full border border-green-200 shadow-sm whitespace-nowrap",children:[(0,s.jsx)("div",{className:"w-3 h-3 bg-green-500 text-white rounded-full flex items-center justify-center text-xs",children:"✓"}),(0,s.jsx)("span",{className:"text-xs",children:"Selected"})]})})]}),d&&l.from&&l.to&&(0,s.jsx)(i.Z,{className:"mt-2 text-xs text-gray-500",children:x(l.from,l.to)})]})}},12322:function(e,l,t){t.d(l,{w:function(){return o}});var s=t(57437),a=t(2265),r=t(71594),i=t(24525),n=t(19130);function o(e){let{data:l=[],columns:t,getRowCanExpand:o,renderSubComponent:d,isLoading:c=!1,loadingMessage:m="\uD83D\uDE85 Loading logs...",noDataMessage:u="No logs found"}=e,h=(0,r.b7)({data:l,columns:t,getRowCanExpand:o,getRowId:(e,l)=>{var t;return null!==(t=null==e?void 0:e.request_id)&&void 0!==t?t:String(l)},getCoreRowModel:(0,i.sC)(),getExpandedRowModel:(0,i.rV)()});return(0,s.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,s.jsxs)(n.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,s.jsx)(n.ss,{children:h.getHeaderGroups().map(e=>(0,s.jsx)(n.SC,{children:e.headers.map(e=>(0,s.jsx)(n.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,r.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,s.jsx)(n.RM,{children:c?(0,s.jsx)(n.SC,{children:(0,s.jsx)(n.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:m})})})}):h.getRowModel().rows.length>0?h.getRowModel().rows.map(e=>(0,s.jsxs)(a.Fragment,{children:[(0,s.jsx)(n.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,s.jsx)(n.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,r.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,s.jsx)(n.SC,{children:(0,s.jsx)(n.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,s.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:d({row:e})})})})]},e.id)):(0,s.jsx)(n.SC,{children:(0,s.jsx)(n.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:u})})})})})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1200-64d099608f321062.js b/litellm/proxy/_experimental/out/_next/static/chunks/1200-64d099608f321062.js deleted file mode 100644 index 52904fccd5d..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1200-64d099608f321062.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1200],{90246:function(e,l,t){t.d(l,{n:function(){return s}});function s(e){let l=[e];return{all:l,lists:()=>[...l,"list"],list:e=>[...l,"list",{params:e}],details:()=>[...l,"detail"],detail:e=>[...l,"detail",e]}}},31200:function(e,l,t){t.d(l,{Z:function(){return lK}});var s=t(57437),a=t(29827),r=t(49804),i=t(67101),n=t(84264),o=t(2265),d=t(9114),c=t(19250),m=t(42673);let u=async(e,l,t)=>{try{var s,a;console.log("handling submit for formValues:",e);let l=e.model_mappings||[];if("model_mappings"in e&&delete e.model_mappings,e.model&&e.model.includes("all-wildcard")){let t=e.custom_llm_provider,a=(null!==(s=m.fK[t])&&void 0!==s?s:t.toLowerCase())+"/*";e.model_name=a,l.push({public_name:a,litellm_model:a}),e.model=a}let t=[];for(let s of l){let l={},r={},i=s.public_name;for(let[t,i]of(l.model=s.litellm_model,e.input_cost_per_token&&(e.input_cost_per_token=Number(e.input_cost_per_token)/1e6),e.output_cost_per_token&&(e.output_cost_per_token=Number(e.output_cost_per_token)/1e6),l.model=s.litellm_model,console.log("formValues add deployment:",e),Object.entries(e)))if(""!==i&&"custom_pricing"!==t&&"pricing_model"!==t&&"cache_control"!==t){if("model_name"==t)l.model=i;else if("custom_llm_provider"==t){console.log("custom_llm_provider:",i);let e=null!==(a=m.fK[i])&&void 0!==a?a:i.toLowerCase();l.custom_llm_provider=e,console.log("custom_llm_provider mappingResult:",e)}else if("model"==t)continue;else if("base_model"===t)r[t]=i;else if("team_id"===t)r.team_id=i;else if("model_access_group"===t)r.access_groups=i;else if("mode"==t)console.log("placing mode in modelInfo"),r.mode=i,delete l.mode;else if("custom_model_name"===t)l.model=i;else if("litellm_extra_params"==t){console.log("litellm_extra_params:",i);let e={};if(i&&void 0!=i){try{e=JSON.parse(i)}catch(e){throw d.Z.fromBackend("Failed to parse LiteLLM Extra Params: "+e),Error("Failed to parse litellm_extra_params: "+e)}for(let[t,s]of Object.entries(e))l[t]=s}}else if("model_info_params"==t){console.log("model_info_params:",i);let e={};if(i&&void 0!=i){try{e=JSON.parse(i)}catch(e){throw d.Z.fromBackend("Failed to parse LiteLLM Extra Params: "+e),Error("Failed to parse litellm_extra_params: "+e)}for(let[l,t]of Object.entries(e))r[l]=t}}else if("input_cost_per_token"===t||"output_cost_per_token"===t||"input_cost_per_second"===t){i&&(l[t]=Number(i));continue}else l[t]=i}t.push({litellmParamsObj:l,modelInfoObj:r,modelName:i})}return t}catch(e){d.Z.fromBackend("Failed to create model: "+e)}},h=async(e,l,t,s)=>{try{let a=await u(e,l,t);if(!a||0===a.length)return;for(let e of a){let{litellmParamsObj:t,modelInfoObj:s,modelName:a}=e,r={model_name:a,litellm_params:t,model_info:s},i=await (0,c.modelCreateCall)(l,r);console.log("response for model create call: ".concat(i.data))}s&&s(),t.resetFields()}catch(e){d.Z.fromBackend("Failed to add model: "+e)}};var x=t(11713),p=t(90246);let g=(0,p.n)("credentials"),f=e=>(0,x.a)({queryKey:g.list({}),queryFn:async()=>await (0,c.credentialListCall)(e),enabled:!!e}),j=(0,p.n)("models");(0,p.n)("modelHub");let v=(e,l,t)=>(0,x.a)({queryKey:j.list({filters:{...l&&{userID:l},...t&&{userRole:t}}}),queryFn:async()=>await (0,c.modelInfoCall)(e,l,t),enabled:!!(e&&l&&t)});var _=t(53410),y=t(74998),b=t(62490),N=t(10032),Z=t(21609),w=t(31283),C=t(57840),S=t(22116),k=t(37592),A=t(99981),E=t(5545);let M=(0,p.n)("providerFields"),I=()=>(0,x.a)({queryKey:M.list({}),queryFn:async()=>await (0,c.getProviderCreateMetadata)(),staleTime:864e5,gcTime:864e5});var F=t(3632),P=t(56522),L=t(47451),T=t(69410),R=t(65319),O=t(4260);let{Link:V}=C.default,D=e=>{var l,t,s,a,r;let i="password"===e.field_type?"password":"select"===e.field_type?"select":"upload"===e.field_type?"upload":"textarea"===e.field_type?"textarea":"text";return{key:e.key,label:e.label,placeholder:null!==(l=e.placeholder)&&void 0!==l?l:void 0,tooltip:null!==(t=e.tooltip)&&void 0!==t?t:void 0,required:null!==(s=e.required)&&void 0!==s&&s,type:i,options:null!==(a=e.options)&&void 0!==a?a:void 0,defaultValue:null!==(r=e.default_value)&&void 0!==r?r:void 0}},z={};var q=e=>{let{selectedProvider:l,uploadProps:t}=e,a=m.Cl[l],r=N.Z.useFormInstance(),{data:i,isLoading:n,error:d}=I(),c=o.useMemo(()=>{if(!i)return null;let e={};return i.forEach(l=>{let t=l.provider_display_name,s=l.credential_fields.map(D);e[t]=s,l.provider&&(e[l.provider]=s),l.litellm_provider&&(e[l.litellm_provider]=s)}),e},[i]);o.useEffect(()=>{c&&Object.assign(z,c)},[c]);let u=o.useMemo(()=>{var e;let t=null!==(e=z[a])&&void 0!==e?e:z[l];if(t)return t;if(!i)return[];let s=i.find(e=>e.provider_display_name===a||e.provider===l||e.litellm_provider===l);if(!s)return[];let r=s.credential_fields.map(D);return z[s.provider_display_name]=r,s.provider&&(z[s.provider]=r),s.litellm_provider&&(z[s.litellm_provider]=r),r},[a,l,i]),h={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let l=new FileReader;l.onload=e=>{if(e.target){let l=e.target.result;console.log("Setting field value from JSON, length: ".concat(l.length)),r.setFieldsValue({vertex_credentials:l}),console.log("Form values after setting:",r.getFieldsValue())}},l.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered in ProviderSpecificFields"),console.log("Current form values:",r.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList)}};return(0,s.jsxs)(s.Fragment,{children:[n&&0===u.length&&(0,s.jsx)(L.Z,{children:(0,s.jsx)(T.Z,{span:24,children:(0,s.jsx)(P.x,{className:"mb-2",children:"Loading provider fields..."})})}),d&&0===u.length&&(0,s.jsx)(L.Z,{children:(0,s.jsx)(T.Z,{span:24,children:(0,s.jsx)(P.x,{className:"mb-2 text-red-500",children:d instanceof Error?d.message:"Failed to load provider credential fields"})})}),u.map(e=>{var l;return(0,s.jsxs)(o.Fragment,{children:[(0,s.jsx)(N.Z.Item,{label:e.label,name:e.key,rules:e.required?[{required:!0,message:"Required"}]:void 0,tooltip:e.tooltip,className:"vertex_credentials"===e.key?"mb-0":void 0,children:"select"===e.type?(0,s.jsx)(k.default,{placeholder:e.placeholder,defaultValue:e.defaultValue,children:null===(l=e.options)||void 0===l?void 0:l.map(e=>(0,s.jsx)(k.default.Option,{value:e,children:e},e))}):"upload"===e.type?(0,s.jsx)(R.default,{...h,onChange:l=>{(null==t?void 0:t.onChange)&&t.onChange(l),setTimeout(()=>{let l=r.getFieldValue(e.key);console.log("".concat(e.key," value after upload:"),JSON.stringify(l))},500)},children:(0,s.jsx)(E.ZP,{icon:(0,s.jsx)(F.Z,{}),children:"Click to Upload"})}):"textarea"===e.type?(0,s.jsx)(O.default.TextArea,{placeholder:e.placeholder,defaultValue:e.defaultValue,rows:6,style:{fontFamily:"monospace",fontSize:"12px"}}):(0,s.jsx)(P.o,{placeholder:e.placeholder,type:"password"===e.type?"password":"text",defaultValue:e.defaultValue})}),"vertex_credentials"===e.key&&(0,s.jsx)(L.Z,{children:(0,s.jsx)(T.Z,{children:(0,s.jsx)(P.x,{className:"mb-3 mt-1",children:"Give a gcp service account(.json file)"})})}),"base_model"===e.key&&(0,s.jsxs)(L.Z,{children:[(0,s.jsx)(T.Z,{span:10}),(0,s.jsx)(T.Z,{span:10,children:(0,s.jsxs)(P.x,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,s.jsx)(V,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]},e.key)})]})};let{Link:B}=C.default;var U=e=>{let{open:l,onCancel:t,onAddCredential:a,uploadProps:r}=e,[i]=N.Z.useForm(),[n,d]=(0,o.useState)(m.Cl.OpenAI);return(0,s.jsx)(S.Z,{title:"Add New Credential",open:l,onCancel:()=>{t(),i.resetFields()},footer:null,width:600,children:(0,s.jsxs)(N.Z,{form:i,onFinish:e=>{a(Object.entries(e).reduce((e,l)=>{let[t,s]=l;return""!==s&&null!=s&&(e[t]=s),e},{})),i.resetFields()},layout:"vertical",children:[(0,s.jsx)(N.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],children:(0,s.jsx)(w.o,{placeholder:"Enter a friendly name for these credentials"})}),(0,s.jsx)(N.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"Helper to auto-populate provider specific fields",children:(0,s.jsx)(k.default,{showSearch:!0,onChange:e=>{d(e),i.setFieldValue("custom_llm_provider",e)},children:Object.entries(m.Cl).map(e=>{let[l,t]=e;return(0,s.jsx)(k.default.Option,{value:l,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("img",{src:m.cd[t],alt:"".concat(l," logo"),className:"w-5 h-5",onError:e=>{let l=e.target,s=l.parentElement;if(s){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),s.replaceChild(e,l)}}}),(0,s.jsx)("span",{children:t})]})},l)})})}),(0,s.jsx)(q,{selectedProvider:n,uploadProps:r}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(B,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(E.ZP,{onClick:()=>{t(),i.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(E.ZP,{htmlType:"submit",children:"Add Credential"})]})]})]})})};let{Link:G}=C.default;function H(e){let{open:l,onCancel:t,onUpdateCredential:a,uploadProps:r,existingCredential:i}=e,[n]=N.Z.useForm(),[d,c]=(0,o.useState)(m.Cl.Anthropic);return(0,o.useEffect)(()=>{if(i){let e=Object.entries(i.credential_values||{}).reduce((e,l)=>{let[t,s]=l;return e[t]=null!=s?s:null,e},{});n.setFieldsValue({credential_name:i.credential_name,custom_llm_provider:i.credential_info.custom_llm_provider,...e}),c(i.credential_info.custom_llm_provider)}},[i]),(0,s.jsx)(S.Z,{title:"Edit Credential",open:l,onCancel:()=>{t(),n.resetFields()},footer:null,width:600,destroyOnHidden:!0,children:(0,s.jsxs)(N.Z,{form:n,onFinish:e=>{a(Object.entries(e).reduce((e,l)=>{let[t,s]=l;return""!==s&&null!=s&&(e[t]=s),e},{})),n.resetFields()},layout:"vertical",children:[(0,s.jsx)(N.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==i?void 0:i.credential_name,children:(0,s.jsx)(w.o,{placeholder:"Enter a friendly name for these credentials",disabled:null!=i&&!!i.credential_name})}),(0,s.jsx)(N.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"Helper to auto-populate provider specific fields",children:(0,s.jsx)(k.default,{showSearch:!0,onChange:e=>{c(e),n.setFieldValue("custom_llm_provider",e)},children:Object.entries(m.Cl).map(e=>{let[l,t]=e;return(0,s.jsx)(k.default.Option,{value:l,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("img",{src:m.cd[t],alt:"".concat(l," logo"),className:"w-5 h-5",onError:e=>{let l=e.target,s=l.parentElement;if(s){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),s.replaceChild(e,l)}}}),(0,s.jsx)("span",{children:t})]})},l)})})}),(0,s.jsx)(q,{selectedProvider:d,uploadProps:r}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(G,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(E.ZP,{onClick:()=>{t(),n.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(E.ZP,{htmlType:"submit",children:"Update Credential"})]})]})]})})}var K=t(80443),J=e=>{var l;let{uploadProps:t}=e,{accessToken:a}=(0,K.Z)(),{data:r,refetch:i}=f(a),n=(null==r?void 0:r.credentials)||[],[m,u]=(0,o.useState)(!1),[h,x]=(0,o.useState)(!1),[p,g]=(0,o.useState)(null),[j,v]=(0,o.useState)(null),[w,C]=(0,o.useState)(!1),[S,k]=(0,o.useState)(!1),[A]=N.Z.useForm(),E=["credential_name","custom_llm_provider"],M=async e=>{if(!a)return;let l=Object.entries(e).filter(e=>{let[l]=e;return!E.includes(l)}).reduce((e,l)=>{let[t,s]=l;return{...e,[t]:s}},{}),t={credential_name:e.credential_name,credential_values:l,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,c.credentialUpdateCall)(a,e.credential_name,t),d.Z.success("Credential updated successfully"),x(!1),await i()},I=async e=>{if(!a)return;let l=Object.entries(e).filter(e=>{let[l]=e;return!E.includes(l)}).reduce((e,l)=>{let[t,s]=l;return{...e,[t]:s}},{}),t={credential_name:e.credential_name,credential_values:l,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,c.credentialCreateCall)(a,t),d.Z.success("Credential added successfully"),u(!1),await i()},F=e=>{let l={openai:"blue",azure:"indigo",anthropic:"purple",default:"gray"},t=l[e.toLowerCase()]||l.default;return(0,s.jsx)(b.Ct,{color:t,size:"xs",children:e})},P=async()=>{if(a&&j){k(!0);try{await (0,c.credentialDeleteCall)(a,j.credential_name),d.Z.success("Credential deleted successfully"),await i()}catch(e){d.Z.error("Failed to delete credential")}finally{v(null),C(!1),k(!1)}}},L=e=>{v(e),C(!0)};return(0,s.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto p-2",children:[(0,s.jsx)(b.zx,{onClick:()=>u(!0),children:"Add Credential"}),(0,s.jsx)("div",{className:"flex justify-between items-center mt-4 mb-4",children:(0,s.jsx)(b.xv,{children:"Configured credentials for different AI providers. Add and manage your API credentials."})}),(0,s.jsx)(b.Zb,{children:(0,s.jsxs)(b.iA,{children:[(0,s.jsx)(b.ss,{children:(0,s.jsxs)(b.SC,{children:[(0,s.jsx)(b.xs,{children:"Credential Name"}),(0,s.jsx)(b.xs,{children:"Provider"}),(0,s.jsx)(b.xs,{children:"Actions"})]})}),(0,s.jsx)(b.RM,{children:n&&0!==n.length?n.map((e,l)=>{var t;return(0,s.jsxs)(b.SC,{children:[(0,s.jsx)(b.pj,{children:e.credential_name}),(0,s.jsx)(b.pj,{children:F((null===(t=e.credential_info)||void 0===t?void 0:t.custom_llm_provider)||"-")}),(0,s.jsxs)(b.pj,{children:[(0,s.jsx)(b.zx,{icon:_.Z,variant:"light",size:"sm",onClick:()=>{g(e),x(!0)}}),(0,s.jsx)(b.zx,{icon:y.Z,variant:"light",size:"sm",onClick:()=>L(e),className:"ml-2"})]})]},l)}):(0,s.jsx)(b.SC,{children:(0,s.jsx)(b.pj,{colSpan:4,className:"text-center py-4 text-gray-500",children:"No credentials configured"})})})]})}),m&&(0,s.jsx)(U,{onAddCredential:I,open:m,onCancel:()=>u(!1),uploadProps:t}),h&&(0,s.jsx)(H,{open:h,existingCredential:p,onUpdateCredential:M,uploadProps:t,onCancel:()=>x(!1)}),(0,s.jsx)(Z.Z,{isOpen:w,onCancel:()=>{v(null),C(!1)},onOk:P,title:"Delete Credential?",message:"Are you sure you want to delete this credential? This action cannot be undone and may break existing integrations.",resourceInformationTitle:"Credential Information",resourceInformation:[{label:"Credential Name",value:null==j?void 0:j.credential_name},{label:"Provider",value:(null==j?void 0:null===(l=j.credential_info)||void 0===l?void 0:l.custom_llm_provider)||"-"}],confirmLoading:S,requiredConfirmation:null==j?void 0:j.credential_name})]})};let W=e=>{var l;return(null==e?void 0:null===(l=e.model_info)||void 0===l?void 0:l.team_public_model_name)?e.model_info.team_public_model_name:(null==e?void 0:e.model_name)||"-"};var Y=t(23628),$=t(47323),Q=t(12485),X=t(18135),ee=t(35242),el=t(29706),et=t(77991),es=t(20347),ea=t(59341),er=t(5945),ei=t(84376),en=t(29),eo=t.n(en),ed=t(23496),ec=t(35291),em=t(23639),eu=t(15424);let{Text:eh}=C.default;var ex=e=>{let{formValues:l,accessToken:t,testMode:a,modelName:r="this model",onClose:i,onTestComplete:n}=e,[m,h]=o.useState(null),[x,p]=o.useState(null),[g,f]=o.useState(null),[j,v]=o.useState(!0),[_,y]=o.useState(!1),[b,N]=o.useState(!1),Z=async()=>{v(!0),N(!1),h(null),p(null),f(null),y(!1),await new Promise(e=>setTimeout(e,100));try{console.log("Testing connection with form values:",l);let a=await u(l,t,null);if(!a){console.log("No result from prepareModelAddRequest"),h("Failed to prepare model data. Please check your form inputs."),y(!1),v(!1);return}console.log("Result from prepareModelAddRequest:",a);let{litellmParamsObj:r,modelInfoObj:i,modelName:n}=a[0],o=await (0,c.testConnectionRequest)(t,r,i,null==i?void 0:i.mode);if("success"===o.status)d.Z.success("Connection test successful!"),h(null),y(!0);else{var e,s;let l=(null===(e=o.result)||void 0===e?void 0:e.error)||o.message||"Unknown error";h(l),p(r),f(null===(s=o.result)||void 0===s?void 0:s.raw_request_typed_dict),y(!1)}}catch(e){console.error("Test connection error:",e),h(e instanceof Error?e.message:String(e)),y(!1)}finally{v(!1),n&&n()}};o.useEffect(()=>{let e=setTimeout(()=>{Z()},200);return()=>clearTimeout(e)},[]);let w=e=>e?e.split("stack trace:")[0].trim().replace(/^litellm\.(.*?)Error: /,""):"Unknown error",C="string"==typeof m?w(m):(null==m?void 0:m.message)?w(m.message):"Unknown error",S=g?((e,l,t)=>{let s=JSON.stringify(l,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[l,t]=e;return"-H '".concat(l,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(s,"\n }'")})(g.raw_request_api_base,g.raw_request_body,g.raw_request_headers||{}):"";return(0,s.jsxs)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:[j?(0,s.jsxs)("div",{style:{textAlign:"center",padding:"32px 20px"},className:"jsx-dc9a0e2d897fe63b",children:[(0,s.jsx)("div",{style:{marginBottom:"16px"},className:"jsx-dc9a0e2d897fe63b loading-spinner",children:(0,s.jsx)("div",{style:{border:"3px solid #f3f3f3",borderTop:"3px solid #1890ff",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite",margin:"0 auto"},className:"jsx-dc9a0e2d897fe63b"})}),(0,s.jsxs)(eh,{style:{fontSize:"16px"},children:["Testing connection to ",r,"..."]}),(0,s.jsx)(eo(),{id:"dc9a0e2d897fe63b",children:"@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}"})]}):_?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 20px"},children:[(0,s.jsx)("div",{style:{color:"#52c41a",fontSize:"24px",display:"flex",alignItems:"center"},children:(0,s.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})})}),(0,s.jsxs)(eh,{type:"success",style:{fontSize:"18px",fontWeight:500,marginLeft:"10px"},children:["Connection to ",r," successful!"]})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"20px"},children:[(0,s.jsx)(ec.Z,{style:{color:"#ff4d4f",fontSize:"24px",marginRight:"12px"}}),(0,s.jsxs)(eh,{type:"danger",style:{fontSize:"18px",fontWeight:500},children:["Connection to ",r," failed"]})]}),(0,s.jsxs)("div",{style:{backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"8px",padding:"16px",marginBottom:"20px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.03)"},children:[(0,s.jsxs)(eh,{strong:!0,style:{display:"block",marginBottom:"8px"},children:["Error:"," "]}),(0,s.jsx)(eh,{type:"danger",style:{fontSize:"14px",lineHeight:"1.5"},children:C}),m&&(0,s.jsx)("div",{style:{marginTop:"12px"},children:(0,s.jsx)(E.ZP,{type:"link",onClick:()=>N(!b),style:{paddingLeft:0,height:"auto"},children:b?"Hide Details":"Show Details"})})]}),b&&(0,s.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,s.jsx)(eh,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"Troubleshooting Details"}),(0,s.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"200px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:"string"==typeof m?m:JSON.stringify(m,null,2)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(eh,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"API Request"}),(0,s.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"250px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:S||"No request data available"}),(0,s.jsx)(E.ZP,{style:{marginTop:"8px"},icon:(0,s.jsx)(em.Z,{}),onClick:()=>{navigator.clipboard.writeText(S||""),d.Z.success("Copied to clipboard")},children:"Copy to Clipboard"})]})]})}),(0,s.jsx)(ed.Z,{style:{margin:"24px 0 16px"}}),(0,s.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,s.jsx)(E.ZP,{type:"link",href:"https://docs.litellm.ai/docs/providers",target:"_blank",icon:(0,s.jsx)(eu.Z,{}),children:"View Documentation"})})]})};let ep=async(e,l,t,s)=>{try{console.log("=== AUTO ROUTER SUBMIT HANDLER CALLED ==="),console.log("handling auto router submit for formValues:",e),console.log("Access token:",l?"Present":"Missing"),console.log("Form:",t?"Present":"Missing"),console.log("Callback:",s?"Present":"Missing");let a={model_name:e.auto_router_name,litellm_params:{model:"auto_router/".concat(e.auto_router_name),auto_router_config:JSON.stringify(e.auto_router_config),auto_router_default_model:e.auto_router_default_model},model_info:{}};e.auto_router_embedding_model&&"custom"!==e.auto_router_embedding_model?a.litellm_params.auto_router_embedding_model=e.auto_router_embedding_model:e.custom_embedding_model&&(a.litellm_params.auto_router_embedding_model=e.custom_embedding_model),e.team_id&&(a.model_info.team_id=e.team_id),e.model_access_group&&e.model_access_group.length>0&&(a.model_info.access_groups=e.model_access_group),console.log("Auto router configuration to be created:",a),console.log("Auto router config (stringified):",a.litellm_params.auto_router_config),console.log("Calling modelCreateCall with:",{accessToken:l?"Present":"Missing",config:a});let r=await (0,c.modelCreateCall)(l,a);console.log("response for auto router create call:",r),t.resetFields()}catch(e){console.error("Failed to add auto router:",e),d.Z.fromBackend("Failed to add auto router: "+e)}};var eg=t(10703),ef=t(44851),ej=t(19015),ev=t(96473),e_=t(70464),ey=t(26349),eb=t(92280);let{TextArea:eN}=O.default,{Panel:eZ}=ef.default;var ew=e=>{let{modelInfo:l,value:t,onChange:a}=e,[r,i]=(0,o.useState)([]),[n,d]=(0,o.useState)(!1),[c,m]=(0,o.useState)([]);(0,o.useEffect)(()=>{if(null==t?void 0:t.routes){let e=t.routes.map((e,l)=>({id:e.id||"route-".concat(l,"-").concat(Date.now()),model:e.name||e.model||"",utterances:e.utterances||[],description:e.description||"",score_threshold:e.score_threshold||.5}));i(e),m(e.map(e=>e.id))}else i([]),m([])},[t]);let u=e=>{let l=r.filter(l=>l.id!==e);i(l),x(l),m(l=>l.filter(l=>l!==e))},h=(e,l,t)=>{let s=r.map(s=>s.id===e?{...s,[l]:t}:s);i(s),x(s)},x=e=>{let l={routes:e.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))};null==a||a(l)},p=l.map(e=>({value:e.model_group,label:e.model_group}));return(0,s.jsxs)("div",{className:"w-full max-w-none",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6 w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(eb.x,{className:"text-lg font-semibold",children:"Routes Configuration"}),(0,s.jsx)(A.Z,{title:"Configure routing logic to automatically select the best model based on user input patterns",children:(0,s.jsx)(eu.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(E.ZP,{type:"primary",icon:(0,s.jsx)(ev.Z,{}),onClick:()=>{let e="route-".concat(Date.now()),l=[...r,{id:e,model:"",utterances:[],description:"",score_threshold:.5}];i(l),x(l),m(l=>[...l,e])},className:"bg-blue-600 hover:bg-blue-700",children:"Add Route"})]}),0===r.length?(0,s.jsx)("div",{className:"text-center py-12 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed border-gray-200 mb-6",children:(0,s.jsx)(eb.x,{children:"No routes configured. Click “Add Route” to get started."})}):(0,s.jsx)("div",{className:"space-y-3 mb-6 w-full",children:r.map((e,l)=>(0,s.jsx)(er.Z,{className:"border border-gray-200 shadow-sm w-full",bodyStyle:{padding:0},children:(0,s.jsx)(ef.default,{ghost:!0,expandIcon:e=>{let{isActive:l}=e;return(0,s.jsx)(e_.Z,{rotate:l?180:0})},activeKey:c,onChange:e=>m(Array.isArray(e)?e:[e].filter(Boolean)),items:[{key:e.id,label:(0,s.jsxs)("div",{className:"flex justify-between items-center py-2",children:[(0,s.jsxs)(eb.x,{className:"font-medium text-base",children:["Route ",l+1,": ",e.model||"Unnamed"]}),(0,s.jsx)(E.ZP,{type:"text",danger:!0,icon:(0,s.jsx)(ey.Z,{}),onClick:l=>{l.stopPropagation(),u(e.id)},className:"mr-2"})]}),children:(0,s.jsxs)("div",{className:"px-6 pb-6 w-full",children:[(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsx)(eb.x,{className:"text-sm font-medium mb-2 block",children:"Model"}),(0,s.jsx)(k.default,{value:e.model,onChange:l=>h(e.id,"model",l),placeholder:"Select model",showSearch:!0,style:{width:"100%"},options:p})]}),(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsx)(eb.x,{className:"text-sm font-medium mb-2 block",children:"Description"}),(0,s.jsx)(eN,{value:e.description,onChange:l=>h(e.id,"description",l.target.value),placeholder:"Describe when this route should be used...",rows:2,style:{width:"100%"}})]}),(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(eb.x,{className:"text-sm font-medium",children:"Score Threshold"}),(0,s.jsx)(A.Z,{title:"Minimum similarity score to route to this model (0-1)",children:(0,s.jsx)(eu.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(ej.Z,{value:e.score_threshold,onChange:l=>h(e.id,"score_threshold",l||0),min:0,max:1,step:.1,style:{width:"100%"},placeholder:"0.5"})]}),(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(eb.x,{className:"text-sm font-medium",children:"Example Utterances"}),(0,s.jsx)(A.Z,{title:"Training examples for this route. Type an utterance and press Enter to add it.",children:(0,s.jsx)(eu.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(eb.x,{className:"text-xs text-gray-500 mb-2",children:"Type an utterance and press Enter to add it. You can also paste multiple lines."}),(0,s.jsx)(k.default,{mode:"tags",value:e.utterances,onChange:l=>h(e.id,"utterances",l),placeholder:"Type an utterance and press Enter...",style:{width:"100%"},tokenSeparators:["\n"],maxTagCount:"responsive",allowClear:!0})]})]})}]})},e.id))}),(0,s.jsxs)("div",{className:"border-t pt-6 w-full",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4 w-full",children:[(0,s.jsx)(eb.x,{className:"text-lg font-semibold",children:"JSON Preview"}),(0,s.jsx)(E.ZP,{type:"link",onClick:()=>d(!n),className:"text-blue-600 p-0",children:n?"Hide":"Show"})]}),n&&(0,s.jsx)(er.Z,{className:"bg-gray-50 w-full",children:(0,s.jsx)("pre",{className:"text-sm overflow-auto max-h-64 w-full",children:JSON.stringify({routes:r.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))},null,2)})})]})]})};let{Title:eC,Link:eS}=C.default;var ek=e=>{let{form:l,handleOk:t,accessToken:a,userRole:r}=e,[i,n]=(0,o.useState)(!1),[m,u]=(0,o.useState)(!1),[h,x]=(0,o.useState)(""),[p,g]=(0,o.useState)([]),[f,j]=(0,o.useState)([]),[v,_]=(0,o.useState)(!1),[y,b]=(0,o.useState)(!1),[Z,w]=(0,o.useState)(null);(0,o.useEffect)(()=>{(async()=>{g((await (0,c.modelAvailableCall)(a,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[a]),(0,o.useEffect)(()=>{(async()=>{try{let e=await (0,eg.p)(a);console.log("Fetched models for auto router:",e),j(e)}catch(e){console.error("Error fetching model info for auto router:",e)}})()},[a]);let M=es.ZL.includes(r),I=async()=>{u(!0),x("test-".concat(Date.now())),n(!0)},F=()=>{console.log("Auto router submit triggered!"),console.log("Router config:",Z);let e=l.getFieldsValue();if(console.log("Form values:",e),!e.auto_router_name){d.Z.fromBackend("Please enter an Auto Router Name");return}if(!e.auto_router_default_model){d.Z.fromBackend("Please select a Default Model");return}if(l.setFieldsValue({custom_llm_provider:"auto_router",model:e.auto_router_name,api_key:"not_required_for_auto_router"}),!Z||!Z.routes||0===Z.routes.length){d.Z.fromBackend("Please configure at least one route for the auto router");return}if(Z.routes.filter(e=>!e.name||!e.description||0===e.utterances.length).length>0){d.Z.fromBackend("Please ensure all routes have a target model, description, and at least one utterance");return}l.validateFields().then(e=>{console.log("Form validation passed, submitting with values:",e);let s={...e,auto_router_config:Z};console.log("Final submit values:",s),ep(s,a,l,t)}).catch(e=>{console.error("Validation failed:",e);let l=e.errorFields||[];if(l.length>0){let e=l.map(e=>{let l=e.name[0];return({auto_router_name:"Auto Router Name",auto_router_default_model:"Default Model",auto_router_embedding_model:"Embedding Model"})[l]||l});d.Z.fromBackend("Please fill in the following required fields: ".concat(e.join(", ")))}else d.Z.fromBackend("Please fill in all required fields")})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eC,{level:2,children:"Add Auto Router"}),(0,s.jsx)(P.x,{className:"text-gray-600 mb-6",children:"Create an auto router with intelligent routing logic that automatically selects the best model based on user input patterns and semantic matching."}),(0,s.jsx)(er.Z,{children:(0,s.jsxs)(N.Z,{form:l,onFinish:F,labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,s.jsx)(N.Z.Item,{rules:[{required:!0,message:"Auto router name is required"}],label:"Auto Router Name",name:"auto_router_name",tooltip:"Unique name for this auto router configuration",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(P.o,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,s.jsx)("div",{className:"w-full mb-4",children:(0,s.jsx)(ew,{modelInfo:f,value:Z,onChange:e=>{w(e),l.setFieldValue("auto_router_config",e)}})}),(0,s.jsx)(N.Z.Item,{rules:[{required:!0,message:"Default model is required"}],label:"Default Model",name:"auto_router_default_model",tooltip:"Fallback model to use when auto routing logic cannot determine the best model",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(k.default,{placeholder:"Select a default model",onChange:e=>{_("custom"===e)},options:[...Array.from(new Set(f.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0})}),(0,s.jsx)(N.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",tooltip:"Optional: Embedding model to use for semantic routing decisions",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(k.default,{value:l.getFieldValue("auto_router_embedding_model"),placeholder:"Select an embedding model (optional)",onChange:e=>{b("custom"===e),l.setFieldValue("auto_router_embedding_model",e)},options:[...Array.from(new Set(f.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0,allowClear:!0})}),(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Settings"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),M&&(0,s.jsx)(N.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to control who can access this auto router",children:(0,s.jsx)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:p.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})}),(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(C.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{className:"space-x-2",children:[(0,s.jsx)(E.ZP,{onClick:I,loading:m,children:"Test Connect"}),(0,s.jsx)(E.ZP,{onClick:()=>{console.log("Add Auto Router button clicked!"),console.log("Current router config:",Z),console.log("Current form values:",l.getFieldsValue()),F()},children:"Add Auto Router"})]})]})]})}),(0,s.jsx)(S.Z,{title:"Connection Test Results",open:i,onCancel:()=>{n(!1),u(!1)},footer:[(0,s.jsx)(E.ZP,{onClick:()=>{n(!1),u(!1)},children:"Close"},"close")],width:700,children:i&&(0,s.jsx)(ex,{formValues:l.getFieldsValue(),accessToken:a,testMode:"chat",modelName:l.getFieldValue("auto_router_name"),onClose:()=>{n(!1),u(!1)},onTestComplete:()=>u(!1)},h)})]})};let eA=[{value:"chat",label:"Chat - /chat/completions"},{value:"completion",label:"Completion - /completions"},{value:"embedding",label:"Embedding - /embeddings"},{value:"audio_speech",label:"Audio Speech - /audio/speech"},{value:"audio_transcription",label:"Audio Transcription - /audio/transcriptions"},{value:"image_generation",label:"Image Generation - /images/generations"},{value:"video_generation",label:"Video Generation - /videos"},{value:"rerank",label:"Rerank - /rerank"},{value:"realtime",label:"Realtime - /realtime"},{value:"batch",label:"Batch - /batch"},{value:"ocr",label:"OCR - /ocr"}];var eE=t(63709),eM=t(26210),eI=t(34766),eF=t(45246),eP=t(24199);let{Text:eL}=C.default;var eT=e=>{let{form:l,showCacheControl:t,onCacheControlChange:a}=e,r=e=>{let t=l.getFieldValue("litellm_extra_params");try{let s=t?JSON.parse(t):{};e.length>0?s.cache_control_injection_points=e:delete s.cache_control_injection_points,Object.keys(s).length>0?l.setFieldValue("litellm_extra_params",JSON.stringify(s,null,2)):l.setFieldValue("litellm_extra_params","")}catch(e){console.error("Error updating cache control points:",e)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.Z.Item,{label:"Cache Control Injection Points",name:"cache_control",valuePropName:"checked",className:"mb-4",tooltip:"Tell litellm where to inject cache control checkpoints. You can specify either by role (to apply to all messages of that role) or by specific message index.",children:(0,s.jsx)(eE.Z,{onChange:a,className:"bg-gray-600"})}),t&&(0,s.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,s.jsx)(eL,{className:"text-sm text-gray-500 block mb-4",children:"Providers like Anthropic, Bedrock API require users to specify where to inject cache control checkpoints, litellm can automatically add them for you as a cost saving feature."}),(0,s.jsx)(N.Z.List,{name:"cache_control_injection_points",initialValue:[{location:"message"}],children:(e,t)=>{let{add:a,remove:i}=t;return(0,s.jsxs)(s.Fragment,{children:[e.map((t,a)=>(0,s.jsxs)("div",{className:"flex items-center mb-4 gap-4",children:[(0,s.jsx)(N.Z.Item,{...t,label:"Type",name:[t.name,"location"],initialValue:"message",className:"mb-0",style:{width:"180px"},children:(0,s.jsx)(k.default,{disabled:!0,options:[{value:"message",label:"Message"}]})}),(0,s.jsx)(N.Z.Item,{...t,label:"Role",name:[t.name,"role"],className:"mb-0",style:{width:"180px"},tooltip:"LiteLLM will mark all messages of this role as cacheable",children:(0,s.jsx)(k.default,{placeholder:"Select a role",allowClear:!0,options:[{value:"user",label:"User"},{value:"system",label:"System"},{value:"assistant",label:"Assistant"}],onChange:()=>{r(l.getFieldValue("cache_control_points"))}})}),(0,s.jsx)(N.Z.Item,{...t,label:"Index",name:[t.name,"index"],className:"mb-0",style:{width:"180px"},tooltip:"(Optional) If set litellm will mark the message at this index as cacheable",children:(0,s.jsx)(eP.Z,{type:"number",placeholder:"Optional",step:1,onChange:()=>{r(l.getFieldValue("cache_control_points"))}})}),e.length>1&&(0,s.jsx)(eF.Z,{className:"text-red-500 cursor-pointer text-lg ml-12",onClick:()=>{i(t.name),setTimeout(()=>{r(l.getFieldValue("cache_control_points"))},0)}})]},t.key)),(0,s.jsx)(N.Z.Item,{children:(0,s.jsxs)("button",{type:"button",className:"flex items-center justify-center w-full border border-dashed border-gray-300 py-2 px-4 text-gray-600 hover:text-blue-600 hover:border-blue-300 transition-all rounded",onClick:()=>a(),children:[(0,s.jsx)(ev.Z,{className:"mr-2"}),"Add Injection Point"]})})]})}})]})]})},eR=t(9309);let{Link:eO}=C.default;var eV=e=>{let{showAdvancedSettings:l,setShowAdvancedSettings:t,teams:a,guardrailsList:r,tagsList:i}=e,[n]=N.Z.useForm(),[d,c]=o.useState(!1),[m,u]=o.useState("per_token"),[h,x]=o.useState(!1),p=(e,l)=>l&&(isNaN(Number(l))||0>Number(l))?Promise.reject("Please enter a valid positive number"):Promise.resolve();return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(eM.UQ,{className:"mt-2 mb-4",children:[(0,s.jsx)(eM._m,{children:(0,s.jsx)("b",{children:"Advanced Settings"})}),(0,s.jsx)(eM.X1,{children:(0,s.jsxs)("div",{className:"bg-white rounded-lg",children:[(0,s.jsx)(N.Z.Item,{label:"Custom Pricing",name:"custom_pricing",valuePropName:"checked",className:"mb-4",children:(0,s.jsx)(eE.Z,{onChange:e=>{c(e),e||n.setFieldsValue({input_cost_per_token:void 0,output_cost_per_token:void 0,input_cost_per_second:void 0})},className:"bg-gray-600"})}),(0,s.jsx)(N.Z.Item,{label:(0,s.jsxs)("span",{children:["Guardrails"," ",(0,s.jsx)(A.Z,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(eu.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:"Select existing guardrails. Go to 'Guardrails' tab to create new guardrails.",children:(0,s.jsx)(k.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:r.map(e=>({value:e,label:e}))})}),(0,s.jsx)(N.Z.Item,{label:"Tags",name:"tags",className:"mb-4",children:(0,s.jsx)(k.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter tags",options:Object.values(i).map(e=>({value:e.name,label:e.name,title:e.description||e.name}))})}),d&&(0,s.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,s.jsx)(N.Z.Item,{label:"Pricing Model",name:"pricing_model",className:"mb-4",children:(0,s.jsx)(k.default,{defaultValue:"per_token",onChange:e=>u(e),options:[{value:"per_token",label:"Per Million Tokens"},{value:"per_second",label:"Per Second"}]})}),"per_token"===m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.Z.Item,{label:"Input Cost (per 1M tokens)",name:"input_cost_per_token",rules:[{validator:p}],className:"mb-4",children:(0,s.jsx)(eM.oi,{})}),(0,s.jsx)(N.Z.Item,{label:"Output Cost (per 1M tokens)",name:"output_cost_per_token",rules:[{validator:p}],className:"mb-4",children:(0,s.jsx)(eM.oi,{})})]}):(0,s.jsx)(N.Z.Item,{label:"Cost Per Second",name:"input_cost_per_second",rules:[{validator:p}],className:"mb-4",children:(0,s.jsx)(eM.oi,{})})]}),(0,s.jsx)(N.Z.Item,{label:"Use in pass through routes",name:"use_in_pass_through",valuePropName:"checked",className:"mb-4 mt-4",tooltip:(0,s.jsxs)("span",{children:["Allow using these credentials in pass through routes."," ",(0,s.jsx)(eO,{href:"https://docs.litellm.ai/docs/pass_through/vertex_ai",target:"_blank",children:"Learn more"})]}),children:(0,s.jsx)(eE.Z,{onChange:e=>{let l=n.getFieldValue("litellm_extra_params");try{let t=l?JSON.parse(l):{};e?t.use_in_pass_through=!0:delete t.use_in_pass_through,Object.keys(t).length>0?n.setFieldValue("litellm_extra_params",JSON.stringify(t,null,2)):n.setFieldValue("litellm_extra_params","")}catch(l){e?n.setFieldValue("litellm_extra_params",JSON.stringify({use_in_pass_through:!0},null,2)):n.setFieldValue("litellm_extra_params","")}},className:"bg-gray-600"})}),(0,s.jsx)(eT,{form:n,showCacheControl:h,onCacheControlChange:e=>{if(x(e),!e){let e=n.getFieldValue("litellm_extra_params");try{let l=e?JSON.parse(e):{};delete l.cache_control_injection_points,Object.keys(l).length>0?n.setFieldValue("litellm_extra_params",JSON.stringify(l,null,2)):n.setFieldValue("litellm_extra_params","")}catch(e){n.setFieldValue("litellm_extra_params","")}}}}),(0,s.jsx)(N.Z.Item,{label:"LiteLLM Params",name:"litellm_extra_params",tooltip:"Optional litellm params used for making a litellm.completion() call.",className:"mb-4 mt-4",rules:[{validator:eR.Ac}],children:(0,s.jsx)(eI.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,s.jsxs)(L.Z,{className:"mb-4",children:[(0,s.jsx)(T.Z,{span:10}),(0,s.jsx)(T.Z,{span:10,children:(0,s.jsxs)(eM.xv,{className:"text-gray-600 text-sm",children:["Pass JSON of litellm supported params"," ",(0,s.jsx)(eO,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]}),(0,s.jsx)(N.Z.Item,{label:"Model Info",name:"model_info_params",tooltip:"Optional model info params. Returned when calling `/model/info` endpoint.",className:"mb-0",rules:[{validator:eR.Ac}],children:(0,s.jsx)(eI.Z,{rows:4,placeholder:'{ "mode": "chat" }'})})]})})]})})},eD=t(56609),ez=t(67187);let eq=e=>{let{content:l,children:t,width:a="auto",className:r=""}=e,[i,n]=(0,o.useState)(!1),[d,c]=(0,o.useState)("top"),m=(0,o.useRef)(null),u=()=>{if(m.current){let e=m.current.getBoundingClientRect(),l=e.top,t=window.innerHeight-e.bottom;l<300&&t>300?c("bottom"):c("top")}};return(0,s.jsxs)("div",{className:"relative inline-block",ref:m,children:[t||(0,s.jsx)(ez.Z,{className:"ml-1 text-gray-500 cursor-help",onMouseEnter:()=>{u(),n(!0)},onMouseLeave:()=>n(!1)}),i&&(0,s.jsxs)("div",{className:"absolute left-1/2 -translate-x-1/2 z-50 bg-black/90 text-white p-2 rounded-md text-sm font-normal shadow-lg ".concat(r),style:{["top"===d?"bottom":"top"]:"100%",width:a,marginBottom:"top"===d?"8px":"0",marginTop:"bottom"===d?"8px":"0"},children:[l,(0,s.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 w-0 h-0",style:{top:"top"===d?"100%":"auto",bottom:"bottom"===d?"100%":"auto",borderTop:"top"===d?"6px solid rgba(0, 0, 0, 0.9)":"6px solid transparent",borderBottom:"bottom"===d?"6px solid rgba(0, 0, 0, 0.9)":"6px solid transparent",borderLeft:"6px solid transparent",borderRight:"6px solid transparent"}})]})]})};var eB=()=>{let e=N.Z.useFormInstance(),[l,t]=(0,o.useState)(0),a=N.Z.useWatch("model",e)||[],r=Array.isArray(a)?a:[a],i=N.Z.useWatch("custom_model_name",e),n=!r.includes("all-wildcard"),d=N.Z.useWatch("custom_llm_provider",e);if((0,o.useEffect)(()=>{if(i&&r.includes("custom")){let l=(e.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?d===m.Cl.Azure?{public_name:i,litellm_model:"azure/".concat(i)}:{public_name:i,litellm_model:i}:e);e.setFieldValue("model_mappings",l),t(e=>e+1)}},[i,r,d,e]),(0,o.useEffect)(()=>{if(r.length>0&&!r.includes("all-wildcard")){let l=e.getFieldValue("model_mappings")||[];if(l.length!==r.length||!r.every(e=>l.some(l=>"custom"===e?"custom"===l.litellm_model||l.litellm_model===i:d===m.Cl.Azure?l.litellm_model==="azure/".concat(e):l.litellm_model===e))){let l=r.map(e=>"custom"===e&&i?d===m.Cl.Azure?{public_name:i,litellm_model:"azure/".concat(i)}:{public_name:i,litellm_model:i}:d===m.Cl.Azure?{public_name:e,litellm_model:"azure/".concat(e)}:{public_name:e,litellm_model:e});e.setFieldValue("model_mappings",l),t(e=>e+1)}}},[r,i,d,e]),!n)return null;let c=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-2 font-normal",children:"The name you specify in your API calls to LiteLLM Proxy"}),(0,s.jsxs)("div",{className:"mb-2 font-normal",children:[(0,s.jsx)("strong",{children:"Example:"})," If you name your public model"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"example-name"}),", and choose"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"openai/qwen-plus-latest"})," as the LiteLLM model"]}),(0,s.jsxs)("div",{className:"mb-2 font-normal",children:[(0,s.jsx)("strong",{children:"Usage:"})," You make an API call to the LiteLLM proxy with"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:'model = "example-name"'})]}),(0,s.jsxs)("div",{className:"font-normal",children:[(0,s.jsx)("strong",{children:"Result:"})," LiteLLM sends"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"qwen-plus-latest"})," to the provider"]})]}),u=(0,s.jsx)("div",{children:"The model name LiteLLM will send to the LLM API"}),h=[{title:(0,s.jsxs)("span",{className:"flex items-center",children:["Public Model Name",(0,s.jsx)(eq,{content:c,width:"500px"})]}),dataIndex:"public_name",key:"public_name",render:(l,t,a)=>(0,s.jsx)(w.o,{value:l,onChange:l=>{let t=[...e.getFieldValue("model_mappings")];t[a].public_name=l.target.value,e.setFieldValue("model_mappings",t)}})},{title:(0,s.jsxs)("span",{className:"flex items-center",children:["LiteLLM Model Name",(0,s.jsx)(eq,{content:u,width:"360px"})]}),dataIndex:"litellm_model",key:"litellm_model"}];return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(N.Z.Item,{label:"Model Mappings",name:"model_mappings",tooltip:"Map public model names to LiteLLM model names for load balancing",labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",rules:[{required:!0,validator:async(e,l)=>{if(!l||0===l.length)throw Error("At least one model mapping is required");if(l.filter(e=>!e.public_name||""===e.public_name.trim()).length>0)throw Error("All model mappings must have valid public names")}}],children:(0,s.jsx)(eD.Z,{dataSource:e.getFieldValue("model_mappings"),columns:h,pagination:!1,size:"small"},l)})})},eU=e=>{let{selectedProvider:l,providerModels:t,getPlaceholder:a}=e,r=N.Z.useFormInstance(),i=e=>{let t=e.target.value,s=(r.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?l===m.Cl.Azure?{public_name:t,litellm_model:"azure/".concat(t)}:{public_name:t,litellm_model:t}:e);r.setFieldsValue({model_mappings:s})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(N.Z.Item,{label:"LiteLLM Model Name(s)",tooltip:"The model name LiteLLM will send to the LLM API",className:"mb-0",children:[(0,s.jsx)(N.Z.Item,{name:"model",rules:[{required:!0,message:"Please enter ".concat(l===m.Cl.Azure?"a deployment name":"at least one model",".")}],noStyle:!0,children:l===m.Cl.Azure||l===m.Cl.OpenAI_Compatible||l===m.Cl.Ollama?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(P.o,{placeholder:a(l),onChange:l===m.Cl.Azure?e=>{let l=e.target.value,t=l?[{public_name:l,litellm_model:"azure/".concat(l)}]:[];r.setFieldsValue({model:l,model_mappings:t})}:void 0})}):t.length>0?(0,s.jsx)(k.default,{mode:"multiple",allowClear:!0,showSearch:!0,placeholder:"Select models",onChange:e=>{let t=Array.isArray(e)?e:[e];if(t.includes("all-wildcard"))r.setFieldsValue({model_name:void 0,model_mappings:[]});else if(JSON.stringify(r.getFieldValue("model"))!==JSON.stringify(t)){let e=t.map(e=>l===m.Cl.Azure?{public_name:e,litellm_model:"azure/".concat(e)}:{public_name:e,litellm_model:e});r.setFieldsValue({model:t,model_mappings:e})}},optionFilterProp:"children",filterOption:(e,l)=>{var t;return(null!==(t=null==l?void 0:l.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{label:"Custom Model Name (Enter below)",value:"custom"},{label:"All ".concat(l," Models (Wildcard)"),value:"all-wildcard"},...t.map(e=>({label:e,value:e}))],style:{width:"100%"}}):(0,s.jsx)(P.o,{placeholder:a(l)})}),(0,s.jsx)(N.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.model!==l.model,children:e=>{let{getFieldValue:t}=e,a=t("model")||[];return(Array.isArray(a)?a:[a]).includes("custom")&&(0,s.jsx)(N.Z.Item,{name:"custom_model_name",rules:[{required:!0,message:"Please enter a custom model name."}],className:"mt-2",children:(0,s.jsx)(P.o,{placeholder:l===m.Cl.Azure?"Enter Azure deployment name":"Enter custom model name",onChange:i})})}})]}),(0,s.jsxs)(L.Z,{children:[(0,s.jsx)(T.Z,{span:10}),(0,s.jsx)(T.Z,{span:14,children:(0,s.jsx)(P.x,{className:"mb-3 mt-1",children:l===m.Cl.Azure?"Your deployment name will be saved as the public model name, and LiteLLM will use 'azure/deployment-name' internally":"The model name LiteLLM will send to the LLM API"})})]})]})};let{Title:eG,Link:eH}=C.default;var eK=e=>{let{form:l,handleOk:t,selectedProvider:a,setSelectedProvider:r,providerModels:i,setProviderModelsFn:d,getPlaceholder:u,uploadProps:h,showAdvancedSettings:x,setShowAdvancedSettings:p,teams:g,credentials:f,accessToken:j,userRole:v,premiumUser:_}=e,[y]=N.Z.useForm(),[b,Z]=(0,o.useState)("chat"),[w,M]=(0,o.useState)(!1),[F,P]=(0,o.useState)(!1),[R,O]=(0,o.useState)([]),[V,D]=(0,o.useState)({}),[z,B]=(0,o.useState)(""),{data:U,isLoading:G,error:H}=I();(0,o.useEffect)(()=>{(async()=>{try{let e=(await (0,c.getGuardrailsList)(j)).guardrails.map(e=>e.guardrail_name);O(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[j]),(0,o.useEffect)(()=>{(async()=>{try{let e=await (0,c.tagListCall)(j);D(e)}catch(e){console.error("Failed to fetch tags:",e)}})()},[j]);let K=async()=>{P(!0),B("test-".concat(Date.now())),M(!0)},[J,W]=(0,o.useState)(!1),[Y,$]=(0,o.useState)([]);(0,o.useEffect)(()=>{(async()=>{$((await (0,c.modelAvailableCall)(j,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[j]);let en=(0,o.useMemo)(()=>U?[...U].sort((e,l)=>e.provider_display_name.localeCompare(l.provider_display_name)):[],[U]),eo=H?H instanceof Error?H.message:"Failed to load providers":null,ed=es.ZL.includes(v);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(X.Z,{className:"w-full",children:[(0,s.jsxs)(ee.Z,{className:"mb-4",children:[(0,s.jsx)(Q.Z,{children:"Add Model"}),(0,s.jsx)(Q.Z,{children:"Add Auto Router"})]}),(0,s.jsxs)(et.Z,{children:[(0,s.jsxs)(el.Z,{children:[(0,s.jsx)(eG,{level:2,children:"Add Model"}),(0,s.jsx)(er.Z,{children:(0,s.jsx)(N.Z,{form:l,onFinish:e=>{console.log("\uD83D\uDD25 Form onFinish triggered with values:",e),t()},onFinishFailed:e=>{console.log("\uD83D\uDCA5 Form onFinishFailed triggered:",e)},labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"E.g. OpenAI, Azure OpenAI, Anthropic, Bedrock, etc.",labelCol:{span:10},labelAlign:"left",children:(0,s.jsxs)(k.default,{showSearch:!0,loading:G,placeholder:G?"Loading providers...":"Select a provider",optionFilterProp:"data-label",onChange:e=>{r(e),d(e),l.setFieldsValue({custom_llm_provider:e}),l.setFieldsValue({model:[],model_name:void 0})},children:[eo&&0===en.length&&(0,s.jsx)(k.default.Option,{value:"",children:eo},"__error"),en.map(e=>{var l;let t=e.provider_display_name,a=e.provider,r=null!==(l=m.cd[t])&&void 0!==l?l:"";return(0,s.jsx)(k.default.Option,{value:a,"data-label":t,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[r?(0,s.jsx)("img",{src:r,alt:"".concat(t," logo"),className:"w-5 h-5",onError:e=>{let l=e.currentTarget,s=l.parentElement;if(s&&s.contains(l))try{let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),s.replaceChild(e,l)}catch(e){console.error("Failed to replace provider logo fallback:",e)}}}):(0,s.jsx)("div",{className:"w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:t.charAt(0)}),(0,s.jsx)("span",{children:t})]})},a)})]})}),(0,s.jsx)(eU,{selectedProvider:a,providerModels:i,getPlaceholder:u}),(0,s.jsx)(eB,{}),(0,s.jsx)(N.Z.Item,{label:"Mode",name:"mode",className:"mb-1",children:(0,s.jsx)(k.default,{style:{width:"100%"},value:b,onChange:e=>Z(e),options:eA})}),(0,s.jsxs)(L.Z,{children:[(0,s.jsx)(T.Z,{span:10}),(0,s.jsx)(T.Z,{span:10,children:(0,s.jsxs)(n.Z,{className:"mb-5 mt-1",children:[(0,s.jsx)("strong",{children:"Optional"})," - LiteLLM endpoint to use when health checking this model"," ",(0,s.jsx)(eH,{href:"https://docs.litellm.ai/docs/proxy/health#health",target:"_blank",children:"Learn more"})]})})]}),(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)(C.default.Text,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter new provider credentials below"})}),(0,s.jsx)(N.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",initialValue:null,children:(0,s.jsx)(k.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,l)=>{var t;return(null!==(t=null==l?void 0:l.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...f.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,s.jsx)(N.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.litellm_credential_name!==l.litellm_credential_name||e.provider!==l.provider,children:e=>{let{getFieldValue:l}=e,t=l("litellm_credential_name");return(console.log("\uD83D\uDD11 Credential Name Changed:",t),t)?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,s.jsx)(q,{selectedProvider:a,uploadProps:h})]})}}),(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Model Info Settings"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,s.jsx)(N.Z.Item,{label:"Team-BYOK Model",tooltip:"Only use this model + credential combination for this team. Useful when teams want to onboard their own OpenAI keys.",className:"mb-4",children:(0,s.jsx)(A.Z,{title:_?"":"This is an enterprise-only feature. Upgrade to premium to restrict model+credential combinations to a specific team.",placement:"top",children:(0,s.jsx)(ea.Z,{checked:J,onChange:e=>{W(e),e||l.setFieldValue("team_id",void 0)},disabled:!_})})}),J&&(0,s.jsx)(N.Z.Item,{label:"Select Team",name:"team_id",className:"mb-4",tooltip:"Only keys for this team will be able to call this model.",rules:[{required:J&&!ed,message:"Please select a team."}],children:(0,s.jsx)(ei.Z,{teams:g,disabled:!_})}),ed&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(N.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to give users access to select models, and add new ones to the group over time.",children:(0,s.jsx)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:Y.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})}),(0,s.jsx)(eV,{showAdvancedSettings:x,setShowAdvancedSettings:p,teams:g,guardrailsList:R,tagsList:V}),(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(C.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{className:"space-x-2",children:[(0,s.jsx)(E.ZP,{onClick:K,loading:F,children:"Test Connect"}),(0,s.jsx)(E.ZP,{htmlType:"submit",children:"Add Model"})]})]})]})})})]}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(ek,{form:y,handleOk:()=>{y.validateFields().then(e=>{ep(e,j,y,t)}).catch(e=>{console.error("Validation failed:",e)})},accessToken:j,userRole:v})})]})]}),(0,s.jsx)(S.Z,{title:"Connection Test Results",open:w,onCancel:()=>{M(!1),P(!1)},footer:[(0,s.jsx)(E.ZP,{onClick:()=>{M(!1),P(!1)},children:"Close"},"close")],width:700,children:w&&(0,s.jsx)(ex,{formValues:l.getFieldsValue(),accessToken:j,testMode:b,modelName:l.getFieldValue("model_name")||l.getFieldValue("model"),onClose:()=>{M(!1),P(!1)},onTestComplete:()=>P(!1)},z)})]})},eJ=t(10900),eW=t(45589),eY=t(78489),e$=t(12514),eQ=t(49566),eX=t(96761),e0=t(30401),e1=t(78867),e2=t(59872),e4=e=>{let{isVisible:l,onCancel:t,onSuccess:a,modelData:r,accessToken:i,userRole:n}=e,[m]=N.Z.useForm(),[u,h]=(0,o.useState)(!1),[x,p]=(0,o.useState)([]),[g,f]=(0,o.useState)([]),[j,v]=(0,o.useState)(!1),[_,y]=(0,o.useState)(!1),[b,Z]=(0,o.useState)(null);(0,o.useEffect)(()=>{l&&r&&w()},[l,r]),(0,o.useEffect)(()=>{let e=async()=>{if(i)try{let e=await (0,c.modelAvailableCall)(i,"","",!1,null,!0,!0);p(e.data.map(e=>e.id))}catch(e){console.error("Error fetching model access groups:",e)}},t=async()=>{if(i)try{let e=await (0,eg.p)(i);f(e)}catch(e){console.error("Error fetching model info:",e)}};l&&(e(),t())},[l,i]);let w=()=>{try{var e,l,t,s,a,i;let n=null;(null===(e=r.litellm_params)||void 0===e?void 0:e.auto_router_config)&&(n="string"==typeof r.litellm_params.auto_router_config?JSON.parse(r.litellm_params.auto_router_config):r.litellm_params.auto_router_config),Z(n),m.setFieldsValue({auto_router_name:r.model_name,auto_router_default_model:(null===(l=r.litellm_params)||void 0===l?void 0:l.auto_router_default_model)||"",auto_router_embedding_model:(null===(t=r.litellm_params)||void 0===t?void 0:t.auto_router_embedding_model)||"",model_access_group:(null===(s=r.model_info)||void 0===s?void 0:s.access_groups)||[]});let o=new Set(g.map(e=>e.model_group));v(!o.has(null===(a=r.litellm_params)||void 0===a?void 0:a.auto_router_default_model)),y(!o.has(null===(i=r.litellm_params)||void 0===i?void 0:i.auto_router_embedding_model))}catch(e){console.error("Error parsing auto router config:",e),d.Z.fromBackend("Error loading auto router configuration")}},C=async()=>{try{h(!0);let e=await m.validateFields(),l={...r.litellm_params,auto_router_config:JSON.stringify(b),auto_router_default_model:e.auto_router_default_model,auto_router_embedding_model:e.auto_router_embedding_model||void 0},s={...r.model_info,access_groups:e.model_access_group||[]},n={model_name:e.auto_router_name,litellm_params:l,model_info:s};await (0,c.modelPatchUpdateCall)(i,n,r.model_info.id);let o={...r,model_name:e.auto_router_name,litellm_params:l,model_info:s};d.Z.success("Auto router configuration updated successfully"),a(o),t()}catch(e){console.error("Error updating auto router:",e),d.Z.fromBackend("Failed to update auto router configuration")}finally{h(!1)}},A=g.map(e=>({value:e.model_group,label:e.model_group}));return(0,s.jsx)(S.Z,{title:"Edit Auto Router Configuration",open:l,onCancel:t,footer:[(0,s.jsx)(E.ZP,{onClick:t,children:"Cancel"},"cancel"),(0,s.jsx)(E.ZP,{loading:u,onClick:C,children:"Save Changes"},"submit")],width:1e3,destroyOnClose:!0,children:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)(P.x,{className:"text-gray-600",children:"Edit the auto router configuration including routing logic, default models, and access settings."}),(0,s.jsxs)(N.Z,{form:m,layout:"vertical",className:"space-y-4",children:[(0,s.jsx)(N.Z.Item,{label:"Auto Router Name",name:"auto_router_name",rules:[{required:!0,message:"Auto router name is required"}],children:(0,s.jsx)(P.o,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(ew,{modelInfo:g,value:b,onChange:e=>{Z(e)}})}),(0,s.jsx)(N.Z.Item,{label:"Default Model",name:"auto_router_default_model",rules:[{required:!0,message:"Default model is required"}],children:(0,s.jsx)(k.default,{placeholder:"Select a default model",onChange:e=>{v("custom"===e)},options:[...A,{value:"custom",label:"Enter custom model name"}],showSearch:!0})}),(0,s.jsx)(N.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",children:(0,s.jsx)(k.default,{placeholder:"Select an embedding model (optional)",onChange:e=>{y("custom"===e)},options:[...A,{value:"custom",label:"Enter custom model name"}],showSearch:!0,allowClear:!0})}),"Admin"===n&&(0,s.jsx)(N.Z.Item,{label:"Model Access Groups",name:"model_access_group",tooltip:"Control who can access this auto router",children:(0,s.jsx)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:x.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})]})]})})};let{Title:e5,Link:e6}=C.default;var e3=e=>{let{isVisible:l,onCancel:t,onAddCredential:a,existingCredential:r,setIsCredentialModalOpen:i}=e,[n]=N.Z.useForm();return console.log("existingCredential in add credentials tab: ".concat(JSON.stringify(r))),(0,s.jsx)(S.Z,{title:"Reuse Credentials",visible:l,onCancel:()=>{t(),n.resetFields()},footer:null,width:600,children:(0,s.jsxs)(N.Z,{form:n,onFinish:e=>{a(e),n.resetFields(),i(!1)},layout:"vertical",children:[(0,s.jsx)(N.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==r?void 0:r.credential_name,children:(0,s.jsx)(w.o,{placeholder:"Enter a friendly name for these credentials"})}),Object.entries((null==r?void 0:r.credential_values)||{}).map(e=>{let[l,t]=e;return(0,s.jsx)(N.Z.Item,{label:l,name:l,initialValue:t,children:(0,s.jsx)(w.o,{placeholder:"Enter ".concat(l),disabled:!0})},l)}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(e6,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(E.ZP,{onClick:()=>{t(),n.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(E.ZP,{htmlType:"submit",children:"Reuse Credentials"})]})]})]})})};function e8(e){var l,t,a,r,u,h,x,p,g,f,j,v,_,b,Z,w,C,M,I,F,P,L,T,R,V,D,z,q,B,U,G,H;let{modelId:K,onClose:J,modelData:$,accessToken:es,userID:ea,userRole:er,editModel:ei,setEditModalVisible:en,setSelectedModel:eo,onModelUpdate:ed,modelAccessGroups:ec}=e,[em]=N.Z.useForm(),[eh,ex]=(0,o.useState)(null),[ep,eg]=(0,o.useState)(!1),[ef,ej]=(0,o.useState)(!1),[ev,e_]=(0,o.useState)(!1),[ey,eb]=(0,o.useState)(!1),[eN,eZ]=(0,o.useState)(!1),[ew,eC]=(0,o.useState)(null),[eS,ek]=(0,o.useState)(!1),[eA,eE]=(0,o.useState)({}),[eM,eI]=(0,o.useState)(!1),[eF,eL]=(0,o.useState)([]),[eO,eV]=(0,o.useState)({}),eD=("Admin"===er||(null==$?void 0:null===(l=$.model_info)||void 0===l?void 0:l.created_by)===ea)&&(null==$?void 0:null===(t=$.model_info)||void 0===t?void 0:t.db_model),ez="Admin"===er,eq=(null==$?void 0:null===(a=$.litellm_params)||void 0===a?void 0:a.auto_router_config)!=null,eB=(null==$?void 0:null===(r=$.litellm_params)||void 0===r?void 0:r.litellm_credential_name)!=null&&(null==$?void 0:null===(u=$.litellm_params)||void 0===u?void 0:u.litellm_credential_name)!=void 0;console.log("usingExistingCredential, ",eB),console.log("modelData.litellm_params.litellm_credential_name, ",null==$?void 0:null===(h=$.litellm_params)||void 0===h?void 0:h.litellm_credential_name),console.log("tagsList, ",null===(x=$.litellm_params)||void 0===x?void 0:x.tags),(0,o.useEffect)(()=>{let e=async()=>{var e,l,t,s,a,r,i;if(!es)return;let n=await (0,c.modelInfoV1Call)(es,K);console.log("modelInfoResponse, ",n);let o=n.data[0];o&&!o.litellm_model_name&&(o={...o,litellm_model_name:null!==(i=null!==(r=null!==(a=null==o?void 0:null===(l=o.litellm_params)||void 0===l?void 0:l.litellm_model_name)&&void 0!==a?a:null==o?void 0:null===(t=o.litellm_params)||void 0===t?void 0:t.model)&&void 0!==r?r:null==o?void 0:null===(s=o.model_info)||void 0===s?void 0:s.key)&&void 0!==i?i:null}),ex(o),(null==o?void 0:null===(e=o.litellm_params)||void 0===e?void 0:e.cache_control_injection_points)&&ek(!0)},l=async()=>{if(es)try{let e=(await (0,c.getGuardrailsList)(es)).guardrails.map(e=>e.guardrail_name);eL(e)}catch(e){console.error("Failed to fetch guardrails:",e)}},t=async()=>{if(es)try{let e=await (0,c.tagListCall)(es);eV(e)}catch(e){console.error("Failed to fetch tags:",e)}};(async()=>{if(console.log("accessToken, ",es),!es||eB)return;let e=await (0,c.credentialGetCall)(es,null,K);console.log("existingCredentialResponse, ",e),eC({credential_name:e.credential_name,credential_values:e.credential_values,credential_info:e.credential_info})})(),e(),l(),t()},[es,K]);let eU=async e=>{var l;if(console.log("values, ",e),!es)return;let t={credential_name:e.credential_name,model_id:K,credential_info:{custom_llm_provider:null===(l=eh.litellm_params)||void 0===l?void 0:l.custom_llm_provider}};d.Z.info("Storing credential.."),console.log("credentialResponse, ",await (0,c.credentialCreateCall)(es,t)),d.Z.success("Credential stored successfully")},eG=async e=>{try{var l;let t;if(!es)return;eb(!0),console.log("values.model_name, ",e.model_name);let s={};try{s=e.litellm_extra_params?JSON.parse(e.litellm_extra_params):{}}catch(e){d.Z.fromBackend("Invalid JSON in LiteLLM Params"),eb(!1);return}let a={...e.litellm_params,...s,model:e.litellm_model_name,api_base:e.api_base,custom_llm_provider:e.custom_llm_provider,organization:e.organization,tpm:e.tpm,rpm:e.rpm,max_retries:e.max_retries,timeout:e.timeout,stream_timeout:e.stream_timeout,input_cost_per_token:e.input_cost/1e6,output_cost_per_token:e.output_cost/1e6,tags:e.tags};e.guardrails&&(a.guardrails=e.guardrails),e.cache_control&&(null===(l=e.cache_control_injection_points)||void 0===l?void 0:l.length)>0?a.cache_control_injection_points=e.cache_control_injection_points:delete a.cache_control_injection_points;try{t=e.model_info?JSON.parse(e.model_info):$.model_info,e.model_access_group&&(t={...t,access_groups:e.model_access_group})}catch(e){d.Z.fromBackend("Invalid JSON in Model Info");return}let r={model_name:e.model_name,litellm_params:a,model_info:t};await (0,c.modelPatchUpdateCall)(es,r,K);let i={...eh,model_name:e.model_name,litellm_model_name:e.litellm_model_name,litellm_params:a,model_info:t};ex(i),ed&&ed(i),d.Z.success("Model settings updated successfully"),e_(!1),eZ(!1)}catch(e){console.error("Error updating model:",e),d.Z.fromBackend("Failed to update model settings")}finally{eb(!1)}};if(!$)return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)(eY.Z,{icon:eJ.Z,variant:"light",onClick:J,className:"mb-4",children:"Back to Models"}),(0,s.jsx)(n.Z,{children:"Model not found"})]});let eH=async()=>{if(es)try{var e,l,t;d.Z.info("Testing connection...");let s=await (0,c.testConnectionRequest)(es,{custom_llm_provider:eh.litellm_params.custom_llm_provider,litellm_credential_name:eh.litellm_params.litellm_credential_name,model:eh.litellm_model_name},{mode:null===(e=eh.model_info)||void 0===e?void 0:e.mode},null===(l=eh.model_info)||void 0===l?void 0:l.mode);if("success"===s.status)d.Z.success("Connection test successful!");else throw Error((null==s?void 0:null===(t=s.result)||void 0===t?void 0:t.error)||(null==s?void 0:s.message)||"Unknown error")}catch(e){e instanceof Error?d.Z.error("Error testing connection: "+(0,eR.aS)(e.message,100)):d.Z.error("Error testing connection: "+String(e))}},eK=async()=>{try{if(!es)return;await (0,c.modelDeleteCall)(es,K),d.Z.success("Model deleted successfully"),ed&&ed({deleted:!0,model_info:{id:K}}),J()}catch(e){console.error("Error deleting the model:",e),d.Z.fromBackend("Failed to delete model")}},e5=async(e,l)=>{await (0,e2.vQ)(e)&&(eE(e=>({...e,[l]:!0})),setTimeout(()=>{eE(e=>({...e,[l]:!1}))},2e3))};return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(eY.Z,{icon:eJ.Z,variant:"light",onClick:J,className:"mb-4",children:"Back to Models"}),(0,s.jsxs)(eX.Z,{children:["Public Model Name: ",W($)]}),(0,s.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,s.jsx)(n.Z,{className:"text-gray-500 font-mono",children:$.model_info.id}),(0,s.jsx)(E.ZP,{type:"text",size:"small",icon:eA["model-id"]?(0,s.jsx)(e0.Z,{size:12}):(0,s.jsx)(e1.Z,{size:12}),onClick:()=>e5($.model_info.id,"model-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eA["model-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(eY.Z,{variant:"secondary",icon:Y.Z,onClick:eH,className:"flex items-center gap-2","data-testid":"test-connection-button",children:"Test Connection"}),(0,s.jsx)(eY.Z,{icon:eW.Z,variant:"secondary",onClick:()=>ej(!0),className:"flex items-center",disabled:!ez,"data-testid":"reuse-credentials-button",children:"Re-use Credentials"}),(0,s.jsx)(eY.Z,{icon:y.Z,variant:"secondary",onClick:()=>eg(!0),className:"flex items-center text-red-500 border-red-500 hover:text-red-700",disabled:!eD,"data-testid":"delete-model-button",children:"Delete Model"})]})]}),(0,s.jsxs)(X.Z,{children:[(0,s.jsxs)(ee.Z,{className:"mb-6",children:[(0,s.jsx)(Q.Z,{children:"Overview"}),(0,s.jsx)(Q.Z,{children:"Raw JSON"})]}),(0,s.jsxs)(et.Z,{children:[(0,s.jsxs)(el.Z,{children:[(0,s.jsxs)(i.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6 mb-6",children:[(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(n.Z,{children:"Provider"}),(0,s.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[$.provider&&(0,s.jsx)("img",{src:(0,m.dr)($.provider).logo,alt:"".concat($.provider," logo"),className:"w-4 h-4",onError:e=>{let l=e.currentTarget,t=l.parentElement;if(t&&t.contains(l))try{var s;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(s=$.provider)||void 0===s?void 0:s.charAt(0))||"-",t.replaceChild(e,l)}catch(e){console.error("Failed to replace provider logo fallback:",e)}}}),(0,s.jsx)(eX.Z,{children:$.provider||"Not Set"})]})]}),(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(n.Z,{children:"LiteLLM Model"}),(0,s.jsx)("div",{className:"mt-2 overflow-hidden",children:(0,s.jsx)(A.Z,{title:$.litellm_model_name||"Not Set",children:(0,s.jsx)("div",{className:"break-all text-sm font-medium leading-relaxed cursor-pointer",children:$.litellm_model_name||"Not Set"})})})]}),(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(n.Z,{children:"Pricing"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(n.Z,{children:["Input: $",$.input_cost,"/1M tokens"]}),(0,s.jsxs)(n.Z,{children:["Output: $",$.output_cost,"/1M tokens"]})]})]})]}),(0,s.jsxs)("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-x-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Created At"," ",$.model_info.created_at?new Date($.model_info.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"Not Set"]}),(0,s.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),"Created By ",$.model_info.created_by||"Not Set"]})]}),(0,s.jsxs)(e$.Z,{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(eX.Z,{children:"Model Settings"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[eq&&eD&&!eN&&(0,s.jsx)(eY.Z,{onClick:()=>eI(!0),className:"flex items-center",children:"Edit Auto Router"}),eD?!eN&&(0,s.jsx)(eY.Z,{onClick:()=>eZ(!0),className:"flex items-center",children:"Edit Settings"}):(0,s.jsx)(A.Z,{title:"Only DB models can be edited. You must be an admin or the creator of the model to edit it.",children:(0,s.jsx)(eu.Z,{})})]})]}),eh?(0,s.jsx)(N.Z,{form:em,onFinish:eG,initialValues:{model_name:eh.model_name,litellm_model_name:eh.litellm_model_name,api_base:eh.litellm_params.api_base,custom_llm_provider:eh.litellm_params.custom_llm_provider,organization:eh.litellm_params.organization,tpm:eh.litellm_params.tpm,rpm:eh.litellm_params.rpm,max_retries:eh.litellm_params.max_retries,timeout:eh.litellm_params.timeout,stream_timeout:eh.litellm_params.stream_timeout,input_cost:eh.litellm_params.input_cost_per_token?1e6*eh.litellm_params.input_cost_per_token:(null===(p=eh.model_info)||void 0===p?void 0:p.input_cost_per_token)*1e6||null,output_cost:(null===(g=eh.litellm_params)||void 0===g?void 0:g.output_cost_per_token)?1e6*eh.litellm_params.output_cost_per_token:(null===(f=eh.model_info)||void 0===f?void 0:f.output_cost_per_token)*1e6||null,cache_control:null!==(j=eh.litellm_params)&&void 0!==j&&!!j.cache_control_injection_points,cache_control_injection_points:(null===(v=eh.litellm_params)||void 0===v?void 0:v.cache_control_injection_points)||[],model_access_group:Array.isArray(null===(_=eh.model_info)||void 0===_?void 0:_.access_groups)?eh.model_info.access_groups:[],guardrails:Array.isArray(null===(b=eh.litellm_params)||void 0===b?void 0:b.guardrails)?eh.litellm_params.guardrails:[],tags:Array.isArray(null===(Z=eh.litellm_params)||void 0===Z?void 0:Z.tags)?eh.litellm_params.tags:[],litellm_extra_params:JSON.stringify(eh.litellm_params||{},null,2)},layout:"vertical",onValuesChange:()=>e_(!0),children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Model Name"}),eN?(0,s.jsx)(N.Z.Item,{name:"model_name",className:"mb-0",children:(0,s.jsx)(eQ.Z,{placeholder:"Enter model name"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:eh.model_name})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"LiteLLM Model Name"}),eN?(0,s.jsx)(N.Z.Item,{name:"litellm_model_name",className:"mb-0",children:(0,s.jsx)(eQ.Z,{placeholder:"Enter LiteLLM model name"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:eh.litellm_model_name})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Input Cost (per 1M tokens)"}),eN?(0,s.jsx)(N.Z.Item,{name:"input_cost",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter input cost"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==eh?void 0:null===(w=eh.litellm_params)||void 0===w?void 0:w.input_cost_per_token)?((null===(C=eh.litellm_params)||void 0===C?void 0:C.input_cost_per_token)*1e6).toFixed(4):(null==eh?void 0:null===(M=eh.model_info)||void 0===M?void 0:M.input_cost_per_token)?(1e6*eh.model_info.input_cost_per_token).toFixed(4):null})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Output Cost (per 1M tokens)"}),eN?(0,s.jsx)(N.Z.Item,{name:"output_cost",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter output cost"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==eh?void 0:null===(I=eh.litellm_params)||void 0===I?void 0:I.output_cost_per_token)?(1e6*eh.litellm_params.output_cost_per_token).toFixed(4):(null==eh?void 0:null===(F=eh.model_info)||void 0===F?void 0:F.output_cost_per_token)?(1e6*eh.model_info.output_cost_per_token).toFixed(4):null})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"API Base"}),eN?(0,s.jsx)(N.Z.Item,{name:"api_base",className:"mb-0",children:(0,s.jsx)(eQ.Z,{placeholder:"Enter API base"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(P=eh.litellm_params)||void 0===P?void 0:P.api_base)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Custom LLM Provider"}),eN?(0,s.jsx)(N.Z.Item,{name:"custom_llm_provider",className:"mb-0",children:(0,s.jsx)(eQ.Z,{placeholder:"Enter custom LLM provider"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(L=eh.litellm_params)||void 0===L?void 0:L.custom_llm_provider)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Organization"}),eN?(0,s.jsx)(N.Z.Item,{name:"organization",className:"mb-0",children:(0,s.jsx)(eQ.Z,{placeholder:"Enter organization"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(T=eh.litellm_params)||void 0===T?void 0:T.organization)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"TPM (Tokens per Minute)"}),eN?(0,s.jsx)(N.Z.Item,{name:"tpm",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter TPM"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(R=eh.litellm_params)||void 0===R?void 0:R.tpm)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"RPM (Requests per Minute)"}),eN?(0,s.jsx)(N.Z.Item,{name:"rpm",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter RPM"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(V=eh.litellm_params)||void 0===V?void 0:V.rpm)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Max Retries"}),eN?(0,s.jsx)(N.Z.Item,{name:"max_retries",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter max retries"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(D=eh.litellm_params)||void 0===D?void 0:D.max_retries)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Timeout (seconds)"}),eN?(0,s.jsx)(N.Z.Item,{name:"timeout",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter timeout"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(z=eh.litellm_params)||void 0===z?void 0:z.timeout)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Stream Timeout (seconds)"}),eN?(0,s.jsx)(N.Z.Item,{name:"stream_timeout",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter stream timeout"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(q=eh.litellm_params)||void 0===q?void 0:q.stream_timeout)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Model Access Groups"}),eN?(0,s.jsx)(N.Z.Item,{name:"model_access_group",className:"mb-0",children:(0,s.jsx)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:null==ec?void 0:ec.map(e=>({value:e,label:e}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(B=eh.model_info)||void 0===B?void 0:B.access_groups)?Array.isArray(eh.model_info.access_groups)?eh.model_info.access_groups.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:eh.model_info.access_groups.map((e,l)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:e},l))}):"No groups assigned":eh.model_info.access_groups:"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(n.Z,{className:"font-medium",children:["Guardrails",(0,s.jsx)(A.Z,{title:"Apply safety guardrails to this model to filter content or enforce policies",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(eu.Z,{style:{marginLeft:"4px"}})})})]}),eN?(0,s.jsx)(N.Z.Item,{name:"guardrails",className:"mb-0",children:(0,s.jsx)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing guardrails or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:eF.map(e=>({value:e,label:e}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(U=eh.litellm_params)||void 0===U?void 0:U.guardrails)?Array.isArray(eh.litellm_params.guardrails)?eh.litellm_params.guardrails.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:eh.litellm_params.guardrails.map((e,l)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:e},l))}):"No guardrails assigned":eh.litellm_params.guardrails:"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Tags"}),eN?(0,s.jsx)(N.Z.Item,{name:"tags",className:"mb-0",children:(0,s.jsx)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing tags or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:Object.values(eO).map(e=>({value:e.name,label:e.name,title:e.description||e.name}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(G=eh.litellm_params)||void 0===G?void 0:G.tags)?Array.isArray(eh.litellm_params.tags)?eh.litellm_params.tags.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:eh.litellm_params.tags.map((e,l)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-purple-100 text-purple-800",children:e},l))}):"No tags assigned":eh.litellm_params.tags:"Not Set"})]}),eN?(0,s.jsx)(eT,{form:em,showCacheControl:eS,onCacheControlChange:e=>ek(e)}):(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Cache Control"}),(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(H=eh.litellm_params)||void 0===H?void 0:H.cache_control_injection_points)?(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:"Enabled"}),(0,s.jsx)("div",{className:"mt-2",children:eh.litellm_params.cache_control_injection_points.map((e,l)=>(0,s.jsxs)("div",{className:"text-sm text-gray-600 mb-1",children:["Location: ",e.location,",",e.role&&(0,s.jsxs)("span",{children:[" Role: ",e.role]}),void 0!==e.index&&(0,s.jsxs)("span",{children:[" Index: ",e.index]})]},l))})]}):"Disabled"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Model Info"}),eN?(0,s.jsx)(N.Z.Item,{name:"model_info",className:"mb-0",children:(0,s.jsx)(O.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}',defaultValue:JSON.stringify($.model_info,null,2)})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(0,s.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(eh.model_info,null,2)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(n.Z,{className:"font-medium",children:["LiteLLM Params",(0,s.jsx)(A.Z,{title:"Optional litellm params used for making a litellm.completion() call. Some params are automatically added by LiteLLM.",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(eu.Z,{style:{marginLeft:"4px"}})})})]}),eN?(0,s.jsx)(N.Z.Item,{name:"litellm_extra_params",rules:[{validator:eR.Ac}],children:(0,s.jsx)(O.default.TextArea,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(0,s.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(eh.litellm_params,null,2)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Team ID"}),(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:$.model_info.team_id||"Not Set"})]})]}),eN&&(0,s.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,s.jsx)(eY.Z,{variant:"secondary",onClick:()=>{em.resetFields(),e_(!1),eZ(!1)},disabled:ey,children:"Cancel"}),(0,s.jsx)(eY.Z,{variant:"primary",onClick:()=>em.submit(),loading:ey,children:"Save Changes"})]})]})}):(0,s.jsx)(n.Z,{children:"Loading..."})]})]}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(e$.Z,{children:(0,s.jsx)("pre",{className:"bg-gray-100 p-4 rounded text-xs overflow-auto",children:JSON.stringify($,null,2)})})})]})]}),ep&&(0,s.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,s.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,s.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,s.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,s.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,s.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,s.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,s.jsx)("div",{className:"sm:flex sm:items-start",children:(0,s.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,s.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Model"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this model?"})})]})})}),(0,s.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,s.jsx)(E.ZP,{onClick:eK,className:"ml-2",danger:!0,children:"Delete"}),(0,s.jsx)(E.ZP,{onClick:()=>eg(!1),children:"Cancel"})]})]})]})}),ef&&!eB?(0,s.jsx)(e3,{isVisible:ef,onCancel:()=>ej(!1),onAddCredential:eU,existingCredential:ew,setIsCredentialModalOpen:ej}):(0,s.jsx)(S.Z,{open:ef,onCancel:()=>ej(!1),title:"Using Existing Credential",children:(0,s.jsx)(n.Z,{children:$.litellm_params.litellm_credential_name})}),(0,s.jsx)(e4,{isVisible:eM,onCancel:()=>eI(!1),onSuccess:e=>{ex(e),ed&&ed(e)},modelData:eh||$,accessToken:es||"",userRole:er||""})]})}var e9=t(33293),e7=t(11318),le=t(8048),ll=t(41649);let lt=e=>{let{provider:l,className:t="w-4 h-4"}=e,[a,r]=(0,o.useState)(!1),{logo:i}=(0,m.dr)(l);return a||!i?(0,s.jsx)("div",{className:"".concat(t," rounded-full bg-gray-200 flex items-center justify-center text-xs"),children:(null==l?void 0:l.charAt(0))||"-"}):(0,s.jsx)("img",{src:i,alt:"".concat(l," logo"),className:t,onError:()=>r(!0)})},ls=(e,l,t,a,r,i,n,o,d,c,m)=>[{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model ID"}),accessorKey:"model_info.id",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)(A.Z,{title:t.model_info.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>a(t.model_info.id),children:t.model_info.id})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model Information"}),accessorKey:"model_name",size:250,cell:e=>{let{row:l}=e,t=l.original,a=i(l.original)||"-",r=(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Provider:"})," ",t.provider||"-"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Public Model Name:"})," ",a]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"LiteLLM Model Name:"})," ",t.litellm_model_name||"-"]})]});return(0,s.jsx)(A.Z,{title:r,children:(0,s.jsxs)("div",{className:"flex items-start space-x-2 min-w-0 w-full max-w-[250px]",children:[(0,s.jsx)("div",{className:"flex-shrink-0 mt-0.5",children:t.provider?(0,s.jsx)(lt,{provider:t.provider}):(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:"-"})}),(0,s.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-gray-900 truncate max-w-[210px]",children:a}),(0,s.jsx)("div",{className:"text-xs text-gray-500 truncate mt-0.5 max-w-[210px]",children:t.litellm_model_name||"-"})]})]})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Credentials"}),accessorKey:"litellm_credential_name",size:180,cell:e=>{var l;let{row:t}=e,a=null===(l=t.original.litellm_params)||void 0===l?void 0:l.litellm_credential_name;return a?(0,s.jsx)(A.Z,{title:"Credential: ".concat(a),children:(0,s.jsxs)("div",{className:"flex items-center space-x-2 max-w-[180px]",children:[(0,s.jsx)(eW.Z,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}),(0,s.jsx)("span",{className:"text-xs truncate",title:a,children:a})]})}):(0,s.jsxs)("div",{className:"flex items-center space-x-2 max-w-[180px]",children:[(0,s.jsx)(eW.Z,{className:"w-4 h-4 text-gray-300 flex-shrink-0"}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"No credentials"})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Created By"}),accessorKey:"model_info.created_by",sortingFn:"datetime",size:160,cell:e=>{var l;let{row:t}=e,a=t.original,r=!(null===(l=a.model_info)||void 0===l?void 0:l.db_model),i=a.model_info.created_by,n=a.model_info.created_at?new Date(a.model_info.created_at).toLocaleDateString():null;return(0,s.jsxs)("div",{className:"flex flex-col min-w-0 max-w-[160px]",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-gray-900 truncate",title:r?"Defined in config":i||"Unknown",children:r?"Defined in config":i||"Unknown"}),(0,s.jsx)("div",{className:"text-xs text-gray-500 truncate mt-0.5",title:r?"Config file":n||"Unknown date",children:r?"-":n||"Unknown date"})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Updated At"}),accessorKey:"model_info.updated_at",sortingFn:"datetime",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)("span",{className:"text-xs",children:t.model_info.updated_at?new Date(t.model_info.updated_at).toLocaleDateString():"-"})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Costs"}),accessorKey:"input_cost",size:120,cell:e=>{let{row:l}=e,t=l.original,a=t.input_cost,r=t.output_cost;return a||r?(0,s.jsx)(A.Z,{title:"Cost per 1M tokens",children:(0,s.jsxs)("div",{className:"flex flex-col min-w-0 max-w-[120px]",children:[a&&(0,s.jsxs)("div",{className:"text-xs font-medium text-gray-900 truncate",children:["In: $",a]}),r&&(0,s.jsxs)("div",{className:"text-xs text-gray-500 truncate mt-0.5",children:["Out: $",r]})]})}):(0,s.jsx)("div",{className:"max-w-[120px]",children:(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"-"})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Team ID"}),accessorKey:"model_info.team_id",cell:e=>{let{row:l}=e,t=l.original;return t.model_info.team_id?(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(A.Z,{title:t.model_info.team_id,children:(0,s.jsxs)(eY.Z,{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:()=>r(t.model_info.team_id),children:[t.model_info.team_id.slice(0,7),"..."]})})}):"-"}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model Access Group"}),accessorKey:"model_info.model_access_group",enableSorting:!1,cell:e=>{let{row:l}=e,t=l.original,a=t.model_info.access_groups;if(!a||0===a.length)return"-";let r=t.model_info.id,i=c.has(r),n=a.length>1,o=()=>{let e=new Set(c);i?e.delete(r):e.add(r),m(e)};return(0,s.jsxs)("div",{className:"flex items-center gap-1 overflow-hidden",children:[(0,s.jsx)(ll.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:a[0]}),(i||!n&&2===a.length)&&a.slice(1).map((e,l)=>(0,s.jsx)(ll.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:e},l+1)),n&&(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),o()},className:"text-xs text-blue-600 hover:text-blue-800 px-1 py-0.5 rounded hover:bg-blue-50 h-5 leading-tight flex-shrink-0 whitespace-nowrap",children:i?"−":"+".concat(a.length-1)})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Status"}),accessorKey:"model_info.db_model",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)("div",{className:"\n inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium\n ".concat(t.model_info.db_model?"bg-blue-50 text-blue-600":"bg-gray-100 text-gray-600","\n "),children:t.model_info.db_model?"DB Model":"Config Model"})}},{id:"actions",header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Actions"}),cell:t=>{var r,i;let{row:n}=t,o=n.original,c="Admin"===e||(null===(r=o.model_info)||void 0===r?void 0:r.created_by)===l,m=!(null===(i=o.model_info)||void 0===i?void 0:i.db_model);return(0,s.jsx)("div",{className:"flex items-center justify-end gap-2 pr-4",children:m?(0,s.jsx)(A.Z,{title:"Config model cannot be deleted on the dashboard. Please delete it from the config file.",children:(0,s.jsx)($.Z,{icon:y.Z,size:"sm",className:"opacity-50 cursor-not-allowed"})}):(0,s.jsx)(A.Z,{title:"Delete model",children:(0,s.jsx)($.Z,{icon:y.Z,size:"sm",onClick:()=>{c&&(a(o.model_info.id),d(!1))},className:c?"cursor-pointer hover:text-red-600":"opacity-50 cursor-not-allowed"})})})}}];var la=t(27281),lr=t(57365),li=e=>{let{selectedModelGroup:l,setSelectedModelGroup:t,availableModelGroups:a,availableModelAccessGroups:r,setSelectedModelId:d,setSelectedTeamId:c,setEditModel:m,modelData:u}=e,{userId:h,userRole:x,premiumUser:p}=(0,K.Z)(),{teams:g}=(0,e7.Z)(),[f,j]=(0,o.useState)(""),[v,_]=(0,o.useState)("current_team"),[y,b]=(0,o.useState)("personal"),[N,Z]=(0,o.useState)(!1),[w,C]=(0,o.useState)(null),[S,k]=(0,o.useState)(new Set),[A,E]=(0,o.useState)({pageIndex:0,pageSize:50}),M=(0,o.useRef)(null),I=(0,o.useMemo)(()=>u&&u.data&&0!==u.data.length?u.data.filter(e=>{var t,s,a,r,i,n;let o=""===f||e.model_name.toLowerCase().includes(f.toLowerCase()),d="all"===l||e.model_name===l||!l||"wildcard"===l&&(null===(t=e.model_name)||void 0===t?void 0:t.includes("*")),c="all"===w||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(w))||!w,m=!0;if("current_team"===v){if("personal"===y)m=(null===(a=e.model_info)||void 0===a?void 0:a.direct_access)===!0;else{let l=(null===(i=e.model_info)||void 0===i?void 0:null===(r=i.access_via_team_ids)||void 0===r?void 0:r.includes(y.team_id))===!0,t=(null===(n=y.models)||void 0===n?void 0:n.some(l=>{var t,s;return null===(s=e.model_info)||void 0===s?void 0:null===(t=s.access_groups)||void 0===t?void 0:t.includes(l)}))===!0;m=l||t}}return o&&d&&c&&m}):[],[u,f,l,w,y,v]),F=(0,o.useMemo)(()=>{let e=A.pageIndex*A.pageSize,l=e+A.pageSize;return I.slice(e,l)},[I,A.pageIndex,A.pageSize]);return(0,o.useEffect)(()=>{E(e=>({...e,pageIndex:0}))},[f,l,w,y,v]),(0,s.jsx)(el.Z,{children:(0,s.jsx)(i.Z,{children:(0,s.jsx)("div",{className:"flex flex-col space-y-4",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,s.jsxs)("div",{className:"border-b px-6 py-4 bg-gray-50",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)(n.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,s.jsxs)(la.Z,{className:"w-80",defaultValue:"personal",value:"personal"===y?"personal":y.team_id,onValueChange:e=>{if("personal"===e)b("personal");else{let l=null==g?void 0:g.find(l=>l.team_id===e);l&&b(l)}},children:[(0,s.jsx)(lr.Z,{value:"personal",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"Personal"})]})}),null==g?void 0:g.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:e.team_alias?"".concat(e.team_alias.slice(0,30),"..."):"Team ".concat(e.team_id.slice(0,30),"...")})]})},e.team_id))]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)(n.Z,{className:"text-lg font-semibold text-gray-900",children:"View:"}),(0,s.jsxs)(la.Z,{className:"w-64",defaultValue:"current_team",value:v,onValueChange:e=>_(e),children:[(0,s.jsx)(lr.Z,{value:"current_team",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"Current Team Models"})]})}),(0,s.jsx)(lr.Z,{value:"all",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-gray-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"All Available Models"})]})})]})]})]}),"current_team"===v&&(0,s.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,s.jsx)(eu.Z,{className:"text-gray-400 mt-0.5 flex-shrink-0 text-xs"}),(0,s.jsx)("div",{className:"text-xs text-gray-500",children:"personal"===y?(0,s.jsxs)("span",{children:["To access these models: Create a Virtual Key without selecting a team on the"," ",(0,s.jsx)("a",{href:"/public?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]}):(0,s.jsxs)("span",{children:['To access these models: Create a Virtual Key and select Team as "',"string"!=typeof y?y.team_alias||y.team_id:"",'" on the'," ",(0,s.jsx)("a",{href:"/public?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]})})]})]}),(0,s.jsx)("div",{className:"border-b px-6 py-4",children:(0,s.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("div",{className:"relative w-64",children:[(0,s.jsx)("input",{type:"text",placeholder:"Search model names...",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:f,onChange:e=>j(e.target.value)}),(0,s.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,s.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,s.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(N?"bg-gray-100":""),onClick:()=>Z(!N),children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,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"})}),"Filters"]}),(0,s.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{j(""),t("all"),C(null),b("personal"),_("current_team"),E({pageIndex:0,pageSize:50})},children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),N&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,s.jsx)("div",{className:"w-64",children:(0,s.jsxs)(la.Z,{value:null!=l?l:"all",onValueChange:e=>t("all"===e?"all":e),placeholder:"Filter by Public Model Name",children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Models"}),(0,s.jsx)(lr.Z,{value:"wildcard",children:"Wildcard Models (*)"}),a.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,children:e},l))]})}),(0,s.jsx)("div",{className:"w-64",children:(0,s.jsxs)(la.Z,{value:null!=w?w:"all",onValueChange:e=>C("all"===e?null:e),placeholder:"Filter by Model Access Group",children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Model Access Groups"}),r.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,children:e},l))]})})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-sm text-gray-700",children:I.length>0?"Showing ".concat(A.pageIndex*A.pageSize+1," - ").concat(Math.min((A.pageIndex+1)*A.pageSize,I.length)," of ").concat(I.length," results"):"Showing 0 results"}),I.length>A.pageSize&&(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("button",{onClick:()=>E(e=>({...e,pageIndex:e.pageIndex-1})),disabled:0===A.pageIndex,className:"px-3 py-1 text-sm border rounded-md ".concat(0===A.pageIndex?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,s.jsx)("button",{onClick:()=>E(e=>({...e,pageIndex:e.pageIndex+1})),disabled:A.pageIndex>=Math.ceil(I.length/A.pageSize)-1,className:"px-3 py-1 text-sm border rounded-md ".concat(A.pageIndex>=Math.ceil(I.length/A.pageSize)-1?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})]})]})}),(0,s.jsx)(le.C,{columns:ls(x,h,p,d,c,W,()=>{},()=>{},m,S,k),data:F,isLoading:!1,table:M})]})})})})},ln=t(75105),lo=t(40278),ld=t(97765),lc=t(21626),lm=t(97214),lu=t(28241),lh=t(58834),lx=t(69552),lp=t(71876),lg=t(39789),lf=t(79326),lj=t(2356),lv=t(59664),l_=e=>{let{modelMetrics:l,modelMetricsCategories:t,customTooltip:a,premiumUser:r}=e;return(0,s.jsx)(lv.Z,{title:"Time to First token (s)",className:"h-72",data:l,index:"date",showLegend:!1,categories:t,colors:["indigo","rose"],connectNulls:!0,customTooltip:a})},ly=e=>{let{setSelectedAPIKey:l,keys:t,teams:a,setSelectedCustomer:r,allEndUsers:i}=e,{premiumUser:d}=(0,K.Z)(),[c,m]=(0,o.useState)(null);return(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"mb-1",children:"Select API Key Name"}),d?(0,s.jsxs)("div",{children:[(0,s.jsxs)(la.Z,{defaultValue:"all-keys",children:[(0,s.jsx)(lr.Z,{value:"all-keys",onClick:()=>{l(null)},children:"All Keys"},"all-keys"),null==t?void 0:t.map((e,t)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,s.jsx)(lr.Z,{value:String(t),onClick:()=>{l(e)},children:e.key_alias},t):null)]}),(0,s.jsx)(n.Z,{className:"mt-1",children:"Select Customer Name"}),(0,s.jsxs)(la.Z,{defaultValue:"all-customers",children:[(0,s.jsx)(lr.Z,{value:"all-customers",onClick:()=>{r(null)},children:"All Customers"},"all-customers"),null==i?void 0:i.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>{r(e)},children:e},l))]}),(0,s.jsx)(n.Z,{className:"mt-1",children:"Select Team"}),(0,s.jsxs)(la.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=c?c:"all",onValueChange:e=>m("all"===e?null:e),children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Teams"}),null==a?void 0:a.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"mt-1",children:"Select Team"}),(0,s.jsxs)(la.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=c?c:"all",onValueChange:e=>m("all"===e?null:e),children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Teams"}),null==a?void 0:a.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]})]})},lb=e=>{let{dateValue:l,setDateValue:t,selectedModelGroup:a,availableModelGroups:d,setShowAdvancedFilters:m,modelMetrics:u,modelMetricsCategories:h,streamingModelMetrics:x,streamingModelMetricsCategories:p,customTooltip:g,slowResponsesData:f,modelExceptions:j,globalExceptionData:v,allExceptions:_,globalExceptionPerDeployment:y,setSelectedAPIKey:b,keys:N,setSelectedCustomer:Z,teams:w,allEndUsers:C,selectedAPIKey:S,selectedCustomer:k,selectedTeam:A,setSelectedModelGroup:E,setModelMetrics:M,setModelMetricsCategories:I,setStreamingModelMetrics:F,setStreamingModelMetricsCategories:P,setSlowResponsesData:L,setModelExceptions:T,setAllExceptions:R,setGlobalExceptionData:O,setGlobalExceptionPerDeployment:V}=e,{accessToken:D,userId:z,userRole:q,premiumUser:B}=(0,K.Z)();(0,o.useEffect)(()=>{U(a,l.from,l.to)},[S,k,A]);let U=async(e,l,t)=>{if(console.log("Updating model metrics for group:",e),!D||!z||!q||!l||!t)return;console.log("inside updateModelMetrics - startTime:",l,"endTime:",t),E(e);let s=null==S?void 0:S.token;void 0===s&&(s=null);let a=k;void 0===a&&(a=null);try{let r=await (0,c.modelMetricsCall)(D,z,q,e,l.toISOString(),t.toISOString(),s,a);console.log("Model metrics response:",r),M(r.data),I(r.all_api_bases);let i=await (0,c.streamingModelMetricsCall)(D,e,l.toISOString(),t.toISOString());F(i.data),P(i.all_api_bases);let n=await (0,c.modelExceptionsCall)(D,z,q,e,l.toISOString(),t.toISOString(),s,a);console.log("Model exceptions response:",n),T(n.data),R(n.exception_types);let o=await (0,c.modelMetricsSlowResponsesCall)(D,z,q,e,l.toISOString(),t.toISOString(),s,a);if(console.log("slowResponses:",o),L(o),e){let s=await (0,c.adminGlobalActivityExceptions)(D,null==l?void 0:l.toISOString().split("T")[0],null==t?void 0:t.toISOString().split("T")[0],e);O(s);let a=await (0,c.adminGlobalActivityExceptionsPerDeployment)(D,null==l?void 0:l.toISOString().split("T")[0],null==t?void 0:t.toISOString().split("T")[0],e);V(a)}}catch(e){console.error("Failed to fetch model metrics",e)}};return(0,s.jsxs)(el.Z,{children:[(0,s.jsx)("div",{className:"mb-4 rounded-md border border-red-500 bg-red-50 p-4",children:(0,s.jsx)(n.Z,{className:"font-semibold text-red-700",children:"This page is deprecated and will be removed in the future. Some functionality may not work as expected."})}),(0,s.jsxs)(i.Z,{numItems:4,className:"mt-2 mb-2",children:[(0,s.jsx)(r.Z,{children:(0,s.jsx)(lg.Z,{value:l,className:"mr-2",onValueChange:e=>{t(e),U(a,e.from,e.to)}})}),(0,s.jsxs)(r.Z,{className:"ml-2",children:[(0,s.jsx)(n.Z,{children:"Select Model Group"}),(0,s.jsx)(la.Z,{defaultValue:a||d[0],value:a||d[0],children:d.map((e,t)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>U(e,l.from,l.to),children:e},t))})]}),(0,s.jsx)(r.Z,{children:(0,s.jsx)(lf.Z,{trigger:"click",content:(0,s.jsx)(ly,{allEndUsers:C,keys:N,setSelectedAPIKey:b,setSelectedCustomer:Z,teams:w}),overlayStyle:{width:"20vw"},children:(0,s.jsx)(eY.Z,{icon:lj.Z,size:"md",variant:"secondary",className:"mt-4 ml-2",style:{border:"none"},onClick:()=>m(!0)})})})]}),(0,s.jsxs)(i.Z,{numItems:2,children:[(0,s.jsx)(r.Z,{children:(0,s.jsx)(e$.Z,{className:"mr-2 max-h-[400px] min-h-[400px]",children:(0,s.jsxs)(X.Z,{children:[(0,s.jsxs)(ee.Z,{variant:"line",defaultValue:"1",children:[(0,s.jsx)(Q.Z,{value:"1",children:"Avg. Latency per Token"}),(0,s.jsx)(Q.Z,{value:"2",children:"Time to first token"})]}),(0,s.jsxs)(et.Z,{children:[(0,s.jsxs)(el.Z,{children:[(0,s.jsx)("p",{className:"text-gray-500 italic",children:" (seconds/token)"}),(0,s.jsx)(n.Z,{className:"text-gray-500 italic mt-1 mb-1",children:"average Latency for successfull requests divided by the total tokens"}),u&&h&&(0,s.jsx)(ln.Z,{title:"Model Latency",className:"h-72",data:u,showLegend:!1,index:"date",categories:h,connectNulls:!0,customTooltip:g})]}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(l_,{modelMetrics:x,modelMetricsCategories:p,customTooltip:g,premiumUser:B})})]})]})})}),(0,s.jsx)(r.Z,{children:(0,s.jsx)(e$.Z,{className:"ml-2 max-h-[400px] min-h-[400px] overflow-y-auto",children:(0,s.jsxs)(lc.Z,{children:[(0,s.jsx)(lh.Z,{children:(0,s.jsxs)(lp.Z,{children:[(0,s.jsx)(lx.Z,{children:"Deployment"}),(0,s.jsx)(lx.Z,{children:"Success Responses"}),(0,s.jsxs)(lx.Z,{children:["Slow Responses ",(0,s.jsx)("p",{children:"Success Responses taking 600+s"})]})]})}),(0,s.jsx)(lm.Z,{children:f.map((e,l)=>(0,s.jsxs)(lp.Z,{children:[(0,s.jsx)(lu.Z,{children:e.api_base}),(0,s.jsx)(lu.Z,{children:e.total_count}),(0,s.jsx)(lu.Z,{children:e.slow_count})]},l))})]})})})]}),(0,s.jsx)(i.Z,{numItems:1,className:"gap-2 w-full mt-2",children:(0,s.jsxs)(e$.Z,{children:[(0,s.jsxs)(eX.Z,{children:["All Exceptions for ",a]}),(0,s.jsx)(lo.Z,{className:"h-60",data:j,index:"model",categories:_,stack:!0,yAxisWidth:30})]})}),(0,s.jsxs)(i.Z,{numItems:1,className:"gap-2 w-full mt-2",children:[(0,s.jsxs)(e$.Z,{children:[(0,s.jsxs)(eX.Z,{children:["All Up Rate Limit Errors (429) for ",a]}),(0,s.jsxs)(i.Z,{numItems:1,children:[(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(ld.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors ",v.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lo.Z,{className:"h-40",data:v.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]}),(0,s.jsx)(r.Z,{})]})]}),B?(0,s.jsx)(s.Fragment,{children:y.map((e,l)=>(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(eX.Z,{children:e.api_base?e.api_base:"Unknown API Base"}),(0,s.jsx)(i.Z,{numItems:1,children:(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(ld.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors (429) ",e.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lo.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]},l))}):(0,s.jsx)(s.Fragment,{children:y&&y.length>0&&y.slice(0,1).map((e,l)=>(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(eX.Z,{children:"✨ Rate Limit Errors by Deployment"}),(0,s.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to see exceptions for all deployments"}),(0,s.jsx)(eY.Z,{variant:"primary",className:"mb-2",children:(0,s.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})}),(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(eX.Z,{children:e.api_base}),(0,s.jsx)(i.Z,{numItems:1,children:(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(ld.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors ",e.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lo.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]})]},l))})]})]})};let lN={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"};var lZ=e=>{let{selectedModelGroup:l,setSelectedModelGroup:t,availableModelGroups:a,globalRetryPolicy:r,setGlobalRetryPolicy:i,defaultRetry:o,modelGroupRetryPolicy:d,setModelGroupRetryPolicy:c,handleSaveRetrySettings:m}=e;return(0,s.jsxs)(el.Z,{children:[(0,s.jsx)("div",{className:"flex items-center gap-4 mb-6",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(n.Z,{children:"Retry Policy Scope:"}),(0,s.jsxs)(la.Z,{className:"ml-2 w-48",defaultValue:"global",value:"global"===l?"global":l||a[0],onValueChange:e=>t(e),children:[(0,s.jsx)(lr.Z,{value:"global",children:"Global Default"}),a.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>t(e),children:e},l))]})]})}),"global"===l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eX.Z,{children:"Global Retry Policy"}),(0,s.jsx)(n.Z,{className:"mb-6",children:"Default retry settings applied to all model groups unless overridden"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(eX.Z,{children:["Retry Policy for ",l]}),(0,s.jsx)(n.Z,{className:"mb-6",children:"Model-specific retry settings. Falls back to global defaults if not set."})]}),lN&&(0,s.jsx)("table",{children:(0,s.jsx)("tbody",{children:Object.entries(lN).map((e,t)=>{var a,m,u,h;let x,[p,g]=e;if("global"===l)x=null!==(a=null==r?void 0:r[g])&&void 0!==a?a:o;else{let e=null==d?void 0:null===(m=d[l])||void 0===m?void 0:m[g];x=null!=e?e:null!==(u=null==r?void 0:r[g])&&void 0!==u?u:o}return(0,s.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)(n.Z,{children:p}),"global"!==l&&(0,s.jsxs)(n.Z,{className:"text-xs text-gray-500 ml-2",children:["(Global: ",null!==(h=null==r?void 0:r[g])&&void 0!==h?h:o,")"]})]}),(0,s.jsx)("td",{children:(0,s.jsx)(ej.Z,{className:"ml-5",value:x,min:0,step:1,onChange:e=>{"global"===l?i(l=>null==e?l:{...null!=l?l:{},[g]:e}):c(t=>{var s;let a=null!==(s=null==t?void 0:t[l])&&void 0!==s?s:{};return{...null!=t?t:{},[l]:{...a,[g]:e}}})}})})]},t)})})}),(0,s.jsx)(eY.Z,{className:"mt-6 mr-8",onClick:m,children:"Save"})]})},lw=t(58760),lC=t(867),lS=t(3810),lk=t(89245),lA=t(5540),lE=t(8881);let{Text:lM}=C.default;var lI=e=>{let{accessToken:l,onReloadSuccess:t,buttonText:a="Reload Price Data",showIcon:r=!0,size:i="middle",type:n="primary",className:m=""}=e,[u,h]=(0,o.useState)(!1),[x,p]=(0,o.useState)(!1),[g,f]=(0,o.useState)(!1),[j,v]=(0,o.useState)(!1),[_,y]=(0,o.useState)(6),[b,N]=(0,o.useState)(null),[Z,w]=(0,o.useState)(!1);(0,o.useEffect)(()=>{C();let e=setInterval(()=>{C()},3e4);return()=>clearInterval(e)},[l]);let C=async()=>{if(l){w(!0);try{console.log("Fetching reload status...");let e=await (0,c.getModelCostMapReloadStatus)(l);console.log("Received status:",e),N(e)}catch(e){console.error("Failed to fetch reload status:",e),N({scheduled:!1,interval_hours:null,last_run:null,next_run:null})}finally{w(!1)}}},k=async()=>{if(!l){d.Z.fromBackend("No access token available");return}h(!0);try{let e=await (0,c.reloadModelCostMap)(l);"success"===e.status?(d.Z.success("Price data reloaded successfully! ".concat(e.models_count||0," models updated.")),null==t||t(),await C()):d.Z.fromBackend("Failed to reload price data")}catch(e){console.error("Error reloading price data:",e),d.Z.fromBackend("Failed to reload price data. Please try again.")}finally{h(!1)}},A=async()=>{if(!l){d.Z.fromBackend("No access token available");return}if(_<=0){d.Z.fromBackend("Hours must be greater than 0");return}p(!0);try{let e=await (0,c.scheduleModelCostMapReload)(l,_);"success"===e.status?(d.Z.success("Periodic reload scheduled for every ".concat(_," hours")),v(!1),await C()):d.Z.fromBackend("Failed to schedule periodic reload")}catch(e){console.error("Error scheduling reload:",e),d.Z.fromBackend("Failed to schedule periodic reload. Please try again.")}finally{p(!1)}},M=async()=>{if(!l){d.Z.fromBackend("No access token available");return}f(!0);try{let e=await (0,c.cancelModelCostMapReload)(l);"success"===e.status?(d.Z.success("Periodic reload cancelled successfully"),await C()):d.Z.fromBackend("Failed to cancel periodic reload")}catch(e){console.error("Error cancelling reload:",e),d.Z.fromBackend("Failed to cancel periodic reload. Please try again.")}finally{f(!1)}},I=e=>{if(!e)return"Never";try{return new Date(e).toLocaleString()}catch(l){return e}};return(0,s.jsxs)("div",{className:m,children:[(0,s.jsxs)(lw.Z,{direction:"horizontal",size:"middle",style:{marginBottom:16},children:[(0,s.jsx)(lC.Z,{title:"Hard Refresh Price Data",description:"This will immediately fetch the latest pricing information from the remote source. Continue?",onConfirm:k,okText:"Yes",cancelText:"No",okButtonProps:{style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem",transition:"all 0.2s ease-in-out"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#4f46e5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1"}},children:(0,s.jsx)(E.ZP,{type:n,size:i,loading:u,icon:r?(0,s.jsx)(lk.Z,{}):void 0,style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem",transition:"all 0.2s ease-in-out"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#4f46e5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1"},children:a})}),(null==b?void 0:b.scheduled)?(0,s.jsx)(E.ZP,{type:"default",size:i,danger:!0,icon:(0,s.jsx)(lE.Z,{}),loading:g,onClick:M,style:{borderColor:"#ff4d4f",color:"#ff4d4f",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem"},children:"Cancel Periodic Reload"}):(0,s.jsx)(E.ZP,{type:"default",size:i,icon:(0,s.jsx)(lA.Z,{}),onClick:()=>v(!0),style:{borderColor:"#d9d9d9",color:"#6366f1",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem"},children:"Set Up Periodic Reload"})]}),b&&(0,s.jsx)(er.Z,{size:"small",style:{backgroundColor:"#f8f9fa",border:"1px solid #e9ecef",borderRadius:8},children:(0,s.jsxs)(lw.Z,{direction:"vertical",size:"small",style:{width:"100%"},children:[b.scheduled?(0,s.jsx)("div",{children:(0,s.jsxs)(lS.Z,{color:"green",icon:(0,s.jsx)(lA.Z,{}),children:["Scheduled every ",b.interval_hours," hours"]})}):(0,s.jsx)(lM,{type:"secondary",children:"No periodic reload scheduled"}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lM,{type:"secondary",style:{fontSize:"12px"},children:"Last run:"}),(0,s.jsx)(lM,{style:{fontSize:"12px"},children:I(b.last_run)})]}),b.scheduled&&(0,s.jsxs)(s.Fragment,{children:[b.next_run&&(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lM,{type:"secondary",style:{fontSize:"12px"},children:"Next run:"}),(0,s.jsx)(lM,{style:{fontSize:"12px"},children:I(b.next_run)})]}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lM,{type:"secondary",style:{fontSize:"12px"},children:"Status:"}),(0,s.jsx)(lS.Z,{color:(null==b?void 0:b.scheduled)?b.last_run?"success":"processing":"default",children:(null==b?void 0:b.scheduled)?b.last_run?"Active":"Ready":"Not scheduled"})]})]})]})}),(0,s.jsxs)(S.Z,{title:"Set Up Periodic Reload",open:j,onOk:A,onCancel:()=>v(!1),confirmLoading:x,okText:"Schedule",cancelText:"Cancel",okButtonProps:{style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white"}},children:[(0,s.jsx)("div",{style:{marginBottom:16},children:(0,s.jsx)(lM,{children:"Set up automatic reload of price data every:"})}),(0,s.jsx)("div",{style:{marginBottom:16},children:(0,s.jsx)(ej.Z,{min:1,max:168,value:_,onChange:e=>y(e||6),addonAfter:"hours",style:{width:"100%"}})}),(0,s.jsx)("div",{children:(0,s.jsxs)(lM,{type:"secondary",children:["This will automatically fetch the latest pricing data from the remote source every ",_," hours."]})})]})]})},lF=e=>{let{setModelMap:l}=e,{accessToken:t}=(0,K.Z)();return(0,s.jsx)(el.Z,{children:(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)(eX.Z,{children:"Price Data Management"}),(0,s.jsx)(n.Z,{className:"text-tremor-content",children:"Manage model pricing data and configure automatic reload schedules"})]}),(0,s.jsx)(lI,{accessToken:t,onReloadSuccess:()=>{(async()=>{l(await (0,c.modelCostMap)(t))})()},buttonText:"Reload Price Data",size:"middle",type:"primary",className:"w-full"})]})})},lP=t(61994),lL=t(15731),lT=t(91126);let lR=(e,l,t,a,r,i,n,o,d,c,m)=>[{header:()=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(lP.Z,{checked:t,indeterminate:l.length>0&&!t,onChange:e=>r(e.target.checked),onClick:e=>e.stopPropagation()}),(0,s.jsx)("span",{children:"Model ID"})]}),accessorKey:"model_info.id",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:t}=e,r=t.original,i=r.model_name,n=l.includes(i);return(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(lP.Z,{checked:n,onChange:e=>a(i,e.target.checked),onClick:e=>e.stopPropagation()}),(0,s.jsx)(A.Z,{title:r.model_info.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>m&&m(r.model_info.id),children:r.model_info.id})})]})}},{header:"Model Name",accessorKey:"model_name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,t=l.original,a=o(t)||t.model_name;return(0,s.jsx)("div",{className:"font-medium text-sm",children:(0,s.jsx)(A.Z,{title:a,children:(0,s.jsx)("div",{className:"truncate max-w-[200px]",children:a})})})}},{header:"Health Status",accessorKey:"health_status",enableSorting:!0,sortingFn:(e,l,t)=>{var s,a;let r=e.getValue("health_status")||"unknown",i=l.getValue("health_status")||"unknown",n={healthy:0,checking:1,unknown:2,unhealthy:3};return(null!==(s=n[r])&&void 0!==s?s:4)-(null!==(a=n[i])&&void 0!==a?a:4)},cell:l=>{var t;let{row:a}=l,r=a.original,i={status:r.health_status,loading:r.health_loading,error:r.health_error};if(i.loading)return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse"}),(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}),(0,s.jsx)(eb.x,{className:"text-gray-600 text-sm",children:"Checking..."})]});let o=r.model_name,d="healthy"===i.status&&(null===(t=e[o])||void 0===t?void 0:t.successResponse);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[n(i.status),d&&c&&(0,s.jsx)(A.Z,{title:"View response details",placement:"top",children:(0,s.jsx)("button",{onClick:()=>{var l;return c(o,null===(l=e[o])||void 0===l?void 0:l.successResponse)},className:"p-1 text-green-600 hover:text-green-800 hover:bg-green-50 rounded cursor-pointer transition-colors",children:(0,s.jsx)(lL.Z,{className:"h-4 w-4"})})})]})}},{header:"Error Details",accessorKey:"health_error",enableSorting:!1,cell:l=>{let{row:t}=l,a=t.original.model_name,r=e[a];if(!(null==r?void 0:r.error))return(0,s.jsx)(eb.x,{className:"text-gray-400 text-sm",children:"No errors"});let i=r.error,n=r.fullError||r.error;return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"max-w-[200px]",children:(0,s.jsx)(A.Z,{title:i,placement:"top",children:(0,s.jsx)(eb.x,{className:"text-red-600 text-sm truncate",children:i})})}),d&&n!==i&&(0,s.jsx)(A.Z,{title:"View full error details",placement:"top",children:(0,s.jsx)("button",{onClick:()=>d(a,i,n),className:"p-1 text-red-600 hover:text-red-800 hover:bg-red-50 rounded cursor-pointer transition-colors",children:(0,s.jsx)(lL.Z,{className:"h-4 w-4"})})})]})}},{header:"Last Check",accessorKey:"last_check",enableSorting:!0,sortingFn:(e,l,t)=>{let s=e.getValue("last_check")||"Never checked",a=l.getValue("last_check")||"Never checked";if("Never checked"===s&&"Never checked"===a)return 0;if("Never checked"===s)return 1;if("Never checked"===a)return -1;if("Check in progress..."===s&&"Check in progress..."===a)return 0;if("Check in progress..."===s)return -1;if("Check in progress..."===a)return 1;let r=new Date(s),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)(eb.x,{className:"text-gray-600 text-sm",children:t.health_loading?"Check in progress...":t.last_check})}},{header:"Last Success",accessorKey:"last_success",enableSorting:!0,sortingFn:(e,l,t)=>{let s=e.getValue("last_success")||"Never succeeded",a=l.getValue("last_success")||"Never succeeded";if("Never succeeded"===s&&"Never succeeded"===a)return 0;if("Never succeeded"===s)return 1;if("Never succeeded"===a)return -1;if("None"===s&&"None"===a)return 0;if("None"===s)return 1;if("None"===a)return -1;let r=new Date(s),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:l=>{let{row:t}=l,a=e[t.original.model_name],r=(null==a?void 0:a.lastSuccess)||"None";return(0,s.jsx)(eb.x,{className:"text-gray-600 text-sm",children:r})}},{header:"Actions",id:"actions",cell:e=>{let{row:l}=e,t=l.original,a=t.model_name,r=t.health_status&&"none"!==t.health_status,n=t.health_loading?"Checking...":r?"Re-run Health Check":"Run Health Check";return(0,s.jsx)(A.Z,{title:n,placement:"top",children:(0,s.jsx)("button",{className:"p-2 rounded-md transition-colors ".concat(t.health_loading?"text-gray-400 cursor-not-allowed bg-gray-100":"text-indigo-600 hover:text-indigo-700 hover:bg-indigo-50"),onClick:()=>{t.health_loading||i(a)},disabled:t.health_loading,children:t.health_loading?(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse"}),(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}):r?(0,s.jsx)(Y.Z,{className:"h-4 w-4"}):(0,s.jsx)(lT.Z,{className:"h-4 w-4"})})})},enableSorting:!1}],lO=[{pattern:/Missing .* API Key/i,replacement:"Missing API Key"},{pattern:/Connection timeout/i,replacement:"Connection timeout"},{pattern:/Network.*not.*ok/i,replacement:"Network connection failed"},{pattern:/403.*Forbidden/i,replacement:"Access forbidden - check API key permissions"},{pattern:/401.*Unauthorized/i,replacement:"Unauthorized - invalid API key"},{pattern:/429.*rate limit/i,replacement:"Rate limit exceeded"},{pattern:/500.*Internal Server Error/i,replacement:"Provider internal server error"},{pattern:/litellm\.AuthenticationError/i,replacement:"Authentication failed"},{pattern:/litellm\.RateLimitError/i,replacement:"Rate limit exceeded"},{pattern:/litellm\.APIError/i,replacement:"API error"}];var lV=e=>{let{accessToken:l,modelData:t,all_models_on_proxy:a,getDisplayModelName:r,setSelectedModelId:i}=e,[d,m]=(0,o.useState)({}),[u,h]=(0,o.useState)([]),[x,p]=(0,o.useState)(!1),[g,f]=(0,o.useState)(!1),[j,v]=(0,o.useState)(null),[_,y]=(0,o.useState)(!1),[b,N]=(0,o.useState)(null),Z=(0,o.useRef)(null);(0,o.useEffect)(()=>{l&&(null==t?void 0:t.data)&&(async()=>{let e={};t.data.forEach(l=>{e[l.model_name]={status:"none",lastCheck:"None",lastSuccess:"None",loading:!1,error:void 0,fullError:void 0,successResponse:void 0}});try{let s=await (0,c.latestHealthChecksCall)(l);s&&s.latest_health_checks&&"object"==typeof s.latest_health_checks&&Object.entries(s.latest_health_checks).forEach(l=>{let[s,a]=l;if(!a)return;let r=null,i=t.data.find(e=>e.model_name===s);if(i)r=i.model_name;else{let e=t.data.find(e=>e.model_info&&e.model_info.id===s);if(e)r=e.model_name;else if(a.model_name){let e=t.data.find(e=>e.model_name===a.model_name);e&&(r=e.model_name)}}if(r){let l=a.error_message||void 0;e[r]={status:a.status||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():"None",loading:!1,error:l?w(l):void 0,fullError:l,successResponse:"healthy"===a.status?a:void 0}}})}catch(e){console.warn("Failed to load health check history (using default states):",e)}m(e)})()},[l,t]);let w=e=>{var l;if(!e)return"Health check failed";let t="string"==typeof e?e:JSON.stringify(e),s=t.match(/(\w+Error):\s*(\d{3})/i);if(s)return"".concat(s[1],": ").concat(s[2]);let a=t.match(/(AuthenticationError|RateLimitError|BadRequestError|InternalServerError|TimeoutError|NotFoundError|ForbiddenError|ServiceUnavailableError|BadGatewayError|ContentPolicyViolationError|\w+Error)/i),r=t.match(/\b(400|401|403|404|408|429|500|502|503|504)\b/);if(a&&r)return"".concat(a[1],": ").concat(r[1]);if(r){let e=r[1];return"".concat({400:"BadRequestError",401:"AuthenticationError",403:"ForbiddenError",404:"NotFoundError",408:"TimeoutError",429:"RateLimitError",500:"InternalServerError",502:"BadGatewayError",503:"ServiceUnavailableError",504:"GatewayTimeoutError"}[e],": ").concat(e)}if(a){let e=a[1],l={AuthenticationError:"401",RateLimitError:"429",BadRequestError:"400",InternalServerError:"500",TimeoutError:"408",NotFoundError:"404",ForbiddenError:"403",ServiceUnavailableError:"503",BadGatewayError:"502",GatewayTimeoutError:"504",ContentPolicyViolationError:"400"}[e];return l?"".concat(e,": ").concat(l):e}for(let{pattern:e,replacement:l}of lO)if(e.test(t))return l;if(/missing.*api.*key|invalid.*key|unauthorized/i.test(t))return"AuthenticationError: 401";if(/rate.*limit|too.*many.*requests/i.test(t))return"RateLimitError: 429";if(/timeout|timed.*out/i.test(t))return"TimeoutError: 408";if(/not.*found/i.test(t))return"NotFoundError: 404";if(/forbidden|access.*denied/i.test(t))return"ForbiddenError: 403";if(/internal.*server.*error/i.test(t))return"InternalServerError: 500";let i=t.replace(/[\n\r]+/g," ").replace(/\s+/g," ").trim(),n=null===(l=i.split(/[.!?]/)[0])||void 0===l?void 0:l.trim();return n&&n.length>0?n.length>100?n.substring(0,97)+"...":n:i.length>100?i.substring(0,97)+"...":i},C=async e=>{if(l){m(l=>({...l,[e]:{...l[e],loading:!0,status:"checking"}}));try{var s,a;let r=await (0,c.individualModelHealthCheckCall)(l,e),i=new Date().toLocaleString();if(r.unhealthy_count>0&&r.unhealthy_endpoints&&r.unhealthy_endpoints.length>0){let l=(null===(s=r.unhealthy_endpoints[0])||void 0===s?void 0:s.error)||"Health check failed",t=w(l);m(s=>{var a;return{...s,[e]:{status:"unhealthy",lastCheck:i,lastSuccess:(null===(a=s[e])||void 0===a?void 0:a.lastSuccess)||"None",loading:!1,error:t,fullError:l}}})}else m(l=>({...l,[e]:{status:"healthy",lastCheck:i,lastSuccess:i,loading:!1,successResponse:r}}));try{let s=await (0,c.latestHealthChecksCall)(l),r=t.data.find(l=>l.model_name===e);if(r){let l=r.model_info.id,t=null===(a=s.latest_health_checks)||void 0===a?void 0:a[l];if(t){let l=t.error_message||void 0;m(s=>{var a,r,i,n,o,d,c;return{...s,[e]:{status:t.status||(null===(a=s[e])||void 0===a?void 0:a.status)||"unknown",lastCheck:t.checked_at?new Date(t.checked_at).toLocaleString():(null===(r=s[e])||void 0===r?void 0:r.lastCheck)||"None",lastSuccess:"healthy"===t.status?t.checked_at?new Date(t.checked_at).toLocaleString():(null===(i=s[e])||void 0===i?void 0:i.lastSuccess)||"None":(null===(n=s[e])||void 0===n?void 0:n.lastSuccess)||"None",loading:!1,error:l?w(l):null===(o=s[e])||void 0===o?void 0:o.error,fullError:l||(null===(d=s[e])||void 0===d?void 0:d.fullError),successResponse:"healthy"===t.status?t:null===(c=s[e])||void 0===c?void 0:c.successResponse}}})}}}catch(e){console.debug("Could not fetch updated status from database (non-critical):",e)}}catch(a){let l=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),s=w(t);m(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:l,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:s,fullError:t}}})}}},k=async()=>{let e=u.length>0?u:a,s=e.reduce((e,l)=>(e[l]={...d[l],loading:!0,status:"checking"},e),{});m(e=>({...e,...s}));let r={},i=e.map(async e=>{if(l)try{let s=await (0,c.individualModelHealthCheckCall)(l,e);r[e]=s;let a=new Date().toLocaleString();if(s.unhealthy_count>0&&s.unhealthy_endpoints&&s.unhealthy_endpoints.length>0){var t;let l=(null===(t=s.unhealthy_endpoints[0])||void 0===t?void 0:t.error)||"Health check failed",r=w(l);m(t=>{var s;return{...t,[e]:{status:"unhealthy",lastCheck:a,lastSuccess:(null===(s=t[e])||void 0===s?void 0:s.lastSuccess)||"None",loading:!1,error:r,fullError:l}}})}else m(l=>({...l,[e]:{status:"healthy",lastCheck:a,lastSuccess:a,loading:!1,successResponse:s}}))}catch(a){console.error("Health check failed for ".concat(e,":"),a);let l=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),s=w(t);m(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:l,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:s,fullError:t}}})}});await Promise.allSettled(i);try{if(!l)return;let s=await (0,c.latestHealthChecksCall)(l);s.latest_health_checks&&Object.entries(s.latest_health_checks).forEach(l=>{let[s,a]=l,r=t.data.find(e=>e.model_info.id===s);if(r&&e.includes(r.model_name)&&a){let e=r.model_name,l=a.error_message||void 0;m(t=>{let s=t[e];return{...t,[e]:{status:a.status||(null==s?void 0:s.status)||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():(null==s?void 0:s.lastCheck)||"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():(null==s?void 0:s.lastSuccess)||"None",loading:!1,error:l?w(l):null==s?void 0:s.error,fullError:l||(null==s?void 0:s.fullError),successResponse:"healthy"===a.status?a:null==s?void 0:s.successResponse}}})}})}catch(e){console.warn("Failed to fetch updated health statuses from database (non-critical):",e)}},A=e=>{p(e),e?h(a):h([])},M=()=>{f(!1),v(null)},I=()=>{y(!1),N(null)};return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(eX.Z,{children:"Model Health Status"}),(0,s.jsx)(n.Z,{className:"text-gray-600 mt-1",children:"Run health checks on individual models to verify they are working correctly"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[u.length>0&&(0,s.jsx)(eY.Z,{size:"sm",variant:"light",onClick:()=>A(!1),className:"px-3 py-1 text-sm",children:"Clear Selection"}),(0,s.jsx)(eY.Z,{size:"sm",variant:"secondary",onClick:k,disabled:Object.values(d).some(e=>e.loading),className:"px-3 py-1 text-sm",children:u.length>0&&u.length{l?h(l=>[...l,e]):(h(l=>l.filter(l=>l!==e)),p(!1))},A,C,e=>{switch(e){case"healthy":return(0,s.jsx)(ll.Z,{color:"emerald",children:"healthy"});case"unhealthy":return(0,s.jsx)(ll.Z,{color:"red",children:"unhealthy"});case"checking":return(0,s.jsx)(ll.Z,{color:"blue",children:"checking"});case"none":return(0,s.jsx)(ll.Z,{color:"gray",children:"none"});default:return(0,s.jsx)(ll.Z,{color:"gray",children:"unknown"})}},r,(e,l,t)=>{v({modelName:e,cleanedError:l,fullError:t}),f(!0)},(e,l)=>{N({modelName:e,response:l}),y(!0)},i),data:t.data.map(e=>{let l=d[e.model_name]||{status:"none",lastCheck:"None",loading:!1};return{model_name:e.model_name,model_info:e.model_info,provider:e.provider,litellm_model_name:e.litellm_model_name,health_status:l.status,last_check:l.lastCheck,last_success:l.lastSuccess||"None",health_loading:l.loading,health_error:l.error,health_full_error:l.fullError}}),isLoading:!1,table:Z})}),(0,s.jsx)(S.Z,{title:j?"Health Check Error - ".concat(j.modelName):"Error Details",open:g,onCancel:M,footer:[(0,s.jsx)(E.ZP,{onClick:M,children:"Close"},"close")],width:800,children:j&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Error:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-red-50 border border-red-200 rounded-md",children:(0,s.jsx)(n.Z,{className:"text-red-800",children:j.cleanedError})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Full Error Details:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,s.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:j.fullError})})]})]})}),(0,s.jsx)(S.Z,{title:b?"Health Check Response - ".concat(b.modelName):"Response Details",open:_,onCancel:I,footer:[(0,s.jsx)(E.ZP,{onClick:I,children:"Close"},"close")],width:800,children:b&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Status:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-green-50 border border-green-200 rounded-md",children:(0,s.jsx)(n.Z,{className:"text-green-800",children:"Health check passed successfully"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Response Details:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,s.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:JSON.stringify(b.response,null,2)})})]})]})})]})},lD=t(86462),lz=t(47686),lq=t(77355),lB=t(93416),lU=t(95704),lG=e=>{let{accessToken:l,initialModelGroupAlias:t={},onAliasUpdate:a}=e,[r,i]=(0,o.useState)([]),[n,m]=(0,o.useState)({aliasName:"",targetModelGroup:""}),[u,h]=(0,o.useState)(null),[x,p]=(0,o.useState)(!0);(0,o.useEffect)(()=>{i(Object.entries(t).map((e,l)=>{var t;let[s,a]=e;return{id:"".concat(l,"-").concat(s),aliasName:s,targetModelGroup:"string"==typeof a?a:null!==(t=null==a?void 0:a.model)&&void 0!==t?t:""}}))},[t]);let g=async e=>{if(!l)return console.error("Access token is missing"),!1;try{let t={};return e.forEach(e=>{t[e.aliasName]=e.targetModelGroup}),console.log("Saving model group alias:",t),await (0,c.setCallbacksCall)(l,{router_settings:{model_group_alias:t}}),a&&a(t),!0}catch(e){return console.error("Failed to save model group alias settings:",e),d.Z.fromBackend("Failed to save model group alias settings"),!1}},f=async()=>{if(!n.aliasName||!n.targetModelGroup){d.Z.fromBackend("Please provide both alias name and target model group");return}if(r.some(e=>e.aliasName===n.aliasName)){d.Z.fromBackend("An alias with this name already exists");return}let e=[...r,{id:"".concat(Date.now(),"-").concat(n.aliasName),aliasName:n.aliasName,targetModelGroup:n.targetModelGroup}];await g(e)&&(i(e),m({aliasName:"",targetModelGroup:""}),d.Z.success("Alias added successfully"))},j=e=>{h({...e})},v=async()=>{if(!u)return;if(!u.aliasName||!u.targetModelGroup){d.Z.fromBackend("Please provide both alias name and target model group");return}if(r.some(e=>e.id!==u.id&&e.aliasName===u.aliasName)){d.Z.fromBackend("An alias with this name already exists");return}let e=r.map(e=>e.id===u.id?u:e);await g(e)&&(i(e),h(null),d.Z.success("Alias updated successfully"))},_=()=>{h(null)},b=async e=>{let l=r.filter(l=>l.id!==e);await g(l)&&(i(l),d.Z.success("Alias deleted successfully"))},N=r.reduce((e,l)=>(e[l.aliasName]=l.targetModelGroup,e),{});return(0,s.jsxs)(lU.Zb,{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>p(!x),children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)(lU.Dx,{className:"mb-0",children:"Model Group Alias Settings"}),(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Create aliases for your model groups to simplify API calls. For example, you can create an alias 'gpt-4o' that points to 'gpt-4o-mini-openai' model group."})]}),(0,s.jsx)("div",{className:"flex items-center",children:x?(0,s.jsx)(lD.Z,{className:"w-5 h-5 text-gray-500"}):(0,s.jsx)(lz.Z,{className:"w-5 h-5 text-gray-500"})})]}),x&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)(lU.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Alias Name"}),(0,s.jsx)("input",{type:"text",value:n.aliasName,onChange:e=>m({...n,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,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Target Model Group"}),(0,s.jsx)("input",{type:"text",value:n.targetModelGroup,onChange:e=>m({...n,targetModelGroup:e.target.value}),placeholder:"e.g., gpt-4o-mini-openai",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,s.jsx)("div",{className:"flex items-end",children:(0,s.jsxs)("button",{onClick:f,disabled:!n.aliasName||!n.targetModelGroup,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(n.aliasName&&n.targetModelGroup?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,s.jsx)(lq.Z,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,s.jsx)(lU.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,s.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(lU.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,s.jsx)(lU.ss,{children:(0,s.jsxs)(lU.SC,{children:[(0,s.jsx)(lU.xs,{className:"py-1 h-8",children:"Alias Name"}),(0,s.jsx)(lU.xs,{className:"py-1 h-8",children:"Target Model Group"}),(0,s.jsx)(lU.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,s.jsxs)(lU.RM,{children:[r.map(e=>(0,s.jsx)(lU.SC,{className:"h-8",children:u&&u.id===e.id?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lU.pj,{className:"py-0.5",children:(0,s.jsx)("input",{type:"text",value:u.aliasName,onChange:e=>h({...u,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,s.jsx)(lU.pj,{className:"py-0.5",children:(0,s.jsx)("input",{type:"text",value:u.targetModelGroup,onChange:e=>h({...u,targetModelGroup:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,s.jsx)(lU.pj,{className:"py-0.5 whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)("button",{onClick:v,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,s.jsx)("button",{onClick:_,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lU.pj,{className:"py-0.5 text-sm text-gray-900",children:e.aliasName}),(0,s.jsx)(lU.pj,{className:"py-0.5 text-sm text-gray-500",children:e.targetModelGroup}),(0,s.jsx)(lU.pj,{className:"py-0.5 whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)("button",{onClick:()=>j(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,s.jsx)(lB.Z,{className:"w-3 h-3"})}),(0,s.jsx)("button",{onClick:()=>b(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,s.jsx)(y.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===r.length&&(0,s.jsx)(lU.SC,{children:(0,s.jsx)(lU.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),(0,s.jsxs)(lU.Zb,{children:[(0,s.jsx)(lU.Dx,{className:"mb-4",children:"Configuration Example"}),(0,s.jsx)(lU.xv,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config.yaml:"}),(0,s.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,s.jsxs)("div",{className:"text-gray-700",children:["router_settings:",(0,s.jsx)("br",{}),"\xa0\xa0model_group_alias:",0===Object.keys(N).length?(0,s.jsxs)("span",{className:"text-gray-500",children:[(0,s.jsx)("br",{}),"\xa0\xa0\xa0\xa0# No aliases configured yet"]}):Object.entries(N).map(e=>{let[l,t]=e;return(0,s.jsxs)("span",{children:[(0,s.jsx)("br",{}),'\xa0\xa0\xa0\xa0"',l,'": "',t,'"']},l)})]})})]})]})]})},lH=t(27593),lK=e=>{let{accessToken:l,token:t,userRole:u,userID:x,modelData:p={data:[]},keys:g,setModelData:j,premiumUser:_,teams:y}=e,[b]=N.Z.useForm(),[Z,w]=(0,o.useState)(null),[S,k]=(0,o.useState)(""),[A,E]=(0,o.useState)([]),[M,I]=(0,o.useState)([]),[F,P]=(0,o.useState)(m.Cl.Anthropic),[L,T]=(0,o.useState)(!1),[R,O]=(0,o.useState)(null),[V,D]=(0,o.useState)([]),[z,q]=(0,o.useState)([]),[B,U]=(0,o.useState)(null),[G,H]=(0,o.useState)([]),[K,ea]=(0,o.useState)([]),[er,ei]=(0,o.useState)([]),[en,eo]=(0,o.useState)([]),[ed,ec]=(0,o.useState)([]),[em,eu]=(0,o.useState)([]),[eh,ex]=(0,o.useState)([]),[ep,eg]=(0,o.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[ef,ej]=(0,o.useState)(null),[ev,e_]=(0,o.useState)(null),[ey,eb]=(0,o.useState)(0),[eN,eZ]=(0,o.useState)({}),[ew,eC]=(0,o.useState)([]),[eS,ek]=(0,o.useState)(!1),[eA,eE]=(0,o.useState)(null),[eM,eI]=(0,o.useState)(null),[eF,eP]=(0,o.useState)([]),[eL,eT]=(0,o.useState)({}),[eR,eO]=(0,o.useState)(!1),[eV,eD]=(0,o.useState)(null),[ez,eq]=(0,o.useState)(!1),[eB,eU]=(0,o.useState)(null),[eG,eH]=(0,o.useState)(null),[eJ,eW]=(0,o.useState)(!1),eY=(0,o.useRef)(null),[e$,eQ]=(0,o.useState)(0),eX=(0,a.NL)(),{data:e0,isLoading:e1,refetch:e2}=v(l,x,u),{data:e4}=f(l),e5=(null==e4?void 0:e4.credentials)||[];(0,o.useEffect)(()=>{let e=e=>{eY.current&&!eY.current.contains(e.target)&&eW(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let e6={name:"file",accept:".json",pastable:!1,beforeUpload:e=>{if("application/json"===e.type){let l=new FileReader;l.onload=e=>{if(e.target){let l=e.target.result;b.setFieldsValue({vertex_credentials:l})}},l.readAsText(e)}return!1},onChange(e){"done"===e.file.status?d.Z.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&d.Z.fromBackend("".concat(e.file.name," file upload failed."))}},e3=()=>{k(new Date().toLocaleString()),eX.invalidateQueries({queryKey:["models","list"]}),e2()},e7=async()=>{if(l)try{let e={router_settings:{}};"global"===B?(ev&&(e.router_settings.retry_policy=ev),d.Z.success("Global retry settings saved successfully")):(ef&&(e.router_settings.model_group_retry_policy=ef),d.Z.success("Retry settings saved successfully for ".concat(B))),await (0,c.setCallbacksCall)(l,e)}catch(e){d.Z.fromBackend("Failed to save retry settings")}};if((0,o.useEffect)(()=>{if(!l||!t||!u||!x||!e0)return;let e=async()=>{try{var e,t,s,a,r,i,n,o,d,m,h,p;j(e0);let g=await (0,c.modelSettingsCall)(l);g&&I(g);let f=new Set;for(let e=0;e0&&(y=v[v.length-1]);let b=await (0,c.modelMetricsCall)(l,x,u,y,null===(e=ep.from)||void 0===e?void 0:e.toISOString(),null===(t=ep.to)||void 0===t?void 0:t.toISOString(),null==eA?void 0:eA.token,eM);H(b.data),ea(b.all_api_bases);let N=await (0,c.streamingModelMetricsCall)(l,y,null===(s=ep.from)||void 0===s?void 0:s.toISOString(),null===(a=ep.to)||void 0===a?void 0:a.toISOString());ei(N.data),eo(N.all_api_bases);let Z=await (0,c.modelExceptionsCall)(l,x,u,y,null===(r=ep.from)||void 0===r?void 0:r.toISOString(),null===(i=ep.to)||void 0===i?void 0:i.toISOString(),null==eA?void 0:eA.token,eM);ec(Z.data),eu(Z.exception_types);let w=await (0,c.modelMetricsSlowResponsesCall)(l,x,u,y,null===(n=ep.from)||void 0===n?void 0:n.toISOString(),null===(o=ep.to)||void 0===o?void 0:o.toISOString(),null==eA?void 0:eA.token,eM),C=await (0,c.adminGlobalActivityExceptions)(l,null===(d=ep.from)||void 0===d?void 0:d.toISOString().split("T")[0],null===(m=ep.to)||void 0===m?void 0:m.toISOString().split("T")[0],y);eZ(C);let S=await (0,c.adminGlobalActivityExceptionsPerDeployment)(l,null===(h=ep.from)||void 0===h?void 0:h.toISOString().split("T")[0],null===(p=ep.to)||void 0===p?void 0:p.toISOString().split("T")[0],y);eC(S),ex(w);let k=await (0,c.allEndUsersCall)(l);eP(null==k?void 0:k.map(e=>e.user_id));let A=(await (0,c.getCallbacksCall)(l,x,u)).router_settings,E=A.model_group_retry_policy,M=A.num_retries;ej(E),e_(A.retry_policy),eb(M);let F=A.model_group_alias||{};eT(F)}catch(e){console.error("Error fetching model data:",e)}};l&&t&&u&&x&&e0&&e();let s=async()=>{w(await (0,c.modelCostMap)(l))};null==Z&&s()},[l,t,u,x,e0]),!p||e1||!l||!t||!u||!x)return(0,s.jsx)("div",{children:"Loading..."});let le=[],ll=[];for(let e=0;enull!=Z&&"object"==typeof Z&&e in Z?Z[e].litellm_provider:"openai";if(t){let e=t.split("/"),l=e[0];(r=s)||(r=1===e.length?m(t):l)}else r="-";a&&(i=null==a?void 0:a.input_cost_per_token,n=null==a?void 0:a.output_cost_per_token,o=null==a?void 0:a.max_tokens,d=null==a?void 0:a.max_input_tokens),(null==l?void 0:l.litellm_params)&&(c=Object.fromEntries(Object.entries(null==l?void 0:l.litellm_params).filter(e=>{let[l]=e;return"model"!==l&&"api_base"!==l}))),p.data[e].provider=r,p.data[e].input_cost=i,p.data[e].output_cost=n,p.data[e].litellm_model_name=t,ll.push(r),p.data[e].input_cost&&(p.data[e].input_cost=(1e6*Number(p.data[e].input_cost)).toFixed(2)),p.data[e].output_cost&&(p.data[e].output_cost=(1e6*Number(p.data[e].output_cost)).toFixed(2)),p.data[e].max_tokens=o,p.data[e].max_input_tokens=d,p.data[e].api_base=null==l?void 0:null===(la=l.litellm_params)||void 0===la?void 0:la.api_base,p.data[e].cleanedLitellmParams=c,le.push(l.model_name)}if(u&&"Admin Viewer"==u){let{Title:e,Paragraph:l}=C.default;return(0,s.jsxs)("div",{children:[(0,s.jsx)(e,{level:1,children:"Access Denied"}),(0,s.jsx)(l,{children:"Ask your proxy admin for access to view all models"})]})}return(Object.keys(m.Cl).find(e=>m.Cl[e]===F),eB)?(0,s.jsx)("div",{className:"w-full h-full",children:(0,s.jsx)(e9.Z,{teamId:eB,onClose:()=>eU(null),accessToken:l,is_team_admin:"Admin"===u,is_proxy_admin:"Proxy Admin"===u,userModels:le,editTeam:!1,onUpdate:e3})}):(0,s.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,s.jsx)(i.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,s.jsxs)(r.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Model Management"}),es.ZL.includes(u)?(0,s.jsx)("p",{className:"text-sm text-gray-600",children:"Add and manage models for the proxy"}):(0,s.jsx)("p",{className:"text-sm text-gray-600",children:"Add models for teams you are an admin for."})]})}),eV?(0,s.jsx)(e8,{modelId:eV,editModel:!0,onClose:()=>{eD(null),eq(!1)},modelData:p.data.find(e=>e.model_info.id===eV),accessToken:l,userID:x,userRole:u,setEditModalVisible:T,setSelectedModel:O,onModelUpdate:e=>{e.deleted?j({...p,data:p.data.filter(l=>l.model_info.id!==e.model_info.id)}):j({...p,data:p.data.map(l=>l.model_info.id===e.model_info.id?e:l)}),eX.invalidateQueries({queryKey:["models","list"]}),e3()},modelAccessGroups:z}):(0,s.jsxs)(X.Z,{index:e$,onIndexChange:eQ,className:"gap-2 h-[75vh] w-full ",children:[(0,s.jsxs)(ee.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,s.jsxs)("div",{className:"flex",children:[es.ZL.includes(u)?(0,s.jsx)(Q.Z,{children:"All Models"}):(0,s.jsx)(Q.Z,{children:"Your Models"}),(0,s.jsx)(Q.Z,{children:"Add Model"}),es.ZL.includes(u)&&(0,s.jsx)(Q.Z,{children:"LLM Credentials"}),es.ZL.includes(u)&&(0,s.jsx)(Q.Z,{children:"Pass-Through Endpoints"}),es.ZL.includes(u)&&(0,s.jsx)(Q.Z,{children:"Health Status"}),es.ZL.includes(u)&&(0,s.jsx)(Q.Z,{children:"Model Analytics"}),es.ZL.includes(u)&&(0,s.jsx)(Q.Z,{children:"Model Retry Settings"}),es.ZL.includes(u)&&(0,s.jsx)(Q.Z,{children:"Model Group Alias"}),es.ZL.includes(u)&&(0,s.jsx)(Q.Z,{children:"Price Data Reload"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[S&&(0,s.jsxs)(n.Z,{children:["Last Refreshed: ",S]}),(0,s.jsx)($.Z,{icon:Y.Z,variant:"shadow",size:"xs",className:"self-center",onClick:e3})]})]}),(0,s.jsxs)(et.Z,{children:[(0,s.jsx)(li,{selectedModelGroup:B,setSelectedModelGroup:U,availableModelGroups:V,availableModelAccessGroups:z,setSelectedModelId:eD,setSelectedTeamId:eU,setEditModel:eq,modelData:p}),(0,s.jsx)(el.Z,{className:"h-full",children:(0,s.jsx)(eK,{form:b,handleOk:()=>{b.validateFields().then(e=>{h(e,l,b,e3)}).catch(e=>{var l;let t=(null===(l=e.errorFields)||void 0===l?void 0:l.map(e=>"".concat(e.name.join("."),": ").concat(e.errors.join(", "))).join(" | "))||"Unknown validation error";d.Z.fromBackend("Please fill in the following required fields: ".concat(t))})},selectedProvider:F,setSelectedProvider:P,providerModels:A,setProviderModelsFn:e=>{E((0,m.bK)(e,Z))},getPlaceholder:m.ph,uploadProps:e6,showAdvancedSettings:eR,setShowAdvancedSettings:eO,teams:y,credentials:e5,accessToken:l,userRole:u,premiumUser:_})}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(J,{uploadProps:e6})}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(lH.Z,{accessToken:l,userRole:u,userID:x,modelData:p,premiumUser:_})}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(lV,{accessToken:l,modelData:p,all_models_on_proxy:le,getDisplayModelName:W,setSelectedModelId:eD})}),(0,s.jsx)(lb,{dateValue:ep,setDateValue:eg,selectedModelGroup:B,availableModelGroups:V,setShowAdvancedFilters:ek,modelMetrics:G,modelMetricsCategories:K,streamingModelMetrics:er,streamingModelMetricsCategories:en,customTooltip:e=>{var l,t;let{payload:a,active:r}=e;if(!r||!a)return null;let i=null===(t=a[0])||void 0===t?void 0:null===(l=t.payload)||void 0===l?void 0:l.date,n=a.sort((e,l)=>l.value-e.value);if(n.length>5){let e=n.length-5;(n=n.slice(0,5)).push({dataKey:"".concat(e," other deployments"),value:a.slice(5).reduce((e,l)=>e+l.value,0),color:"gray"})}return(0,s.jsxs)("div",{className:"w-150 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[i&&(0,s.jsxs)("p",{className:"text-tremor-content-emphasis mb-2",children:["Date: ",i]}),n.map((e,l)=>{let t=parseFloat(e.value.toFixed(5)),a=0===t&&e.value>0?"<0.00001":t.toFixed(5);return(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 mt-1 rounded-full bg-".concat(e.color,"-500")}),(0,s.jsx)("p",{className:"text-tremor-content",children:e.dataKey})]}),(0,s.jsx)("p",{className:"font-medium text-tremor-content-emphasis text-righ ml-2",children:a})]},l)})]})},slowResponsesData:eh,modelExceptions:ed,globalExceptionData:eN,allExceptions:em,globalExceptionPerDeployment:ew,allEndUsers:eF,keys:g,setSelectedAPIKey:eE,setSelectedCustomer:eI,teams:y,selectedAPIKey:eA,selectedCustomer:eM,selectedTeam:eG,setAllExceptions:eu,setGlobalExceptionData:eZ,setGlobalExceptionPerDeployment:eC,setModelExceptions:ec,setModelMetrics:H,setModelMetricsCategories:ea,setSelectedModelGroup:U,setSlowResponsesData:ex,setStreamingModelMetrics:ei,setStreamingModelMetricsCategories:eo}),(0,s.jsx)(lZ,{selectedModelGroup:B,setSelectedModelGroup:U,availableModelGroups:V,globalRetryPolicy:ev,setGlobalRetryPolicy:e_,defaultRetry:ey,modelGroupRetryPolicy:ef,setModelGroupRetryPolicy:ej,handleSaveRetrySettings:e7}),(0,s.jsx)(el.Z,{children:(0,s.jsx)(lG,{accessToken:l,initialModelGroupAlias:eL,onAliasUpdate:eT})}),(0,s.jsx)(lF,{setModelMap:w})]})]})]})})})}},27593:function(e,l,t){t.d(l,{Z:function(){return Y}});var s=t(57437),a=t(2265),r=t(78489),i=t(47323),n=t(84264),o=t(96761),d=t(19250),c=t(99981),m=t(33866),u=t(15731),h=t(53410),x=t(74998),p=t(59341),g=t(49566),f=t(12514),j=t(97765),v=t(37592),_=t(10032),y=t(22116),b=t(51653),N=t(24199),Z=t(12660),w=t(15424),C=t(58760),S=t(5545),k=t(45246),A=t(96473),E=t(31283),M=e=>{let{value:l={},onChange:t}=e,[r,i]=(0,a.useState)(Object.entries(l)),n=e=>{let l=r.filter((l,t)=>t!==e);i(l),null==t||t(Object.fromEntries(l))},o=(e,l,s)=>{let a=[...r];a[e]=[l,s],i(a),null==t||t(Object.fromEntries(a))};return(0,s.jsxs)("div",{children:[r.map((e,l)=>{let[t,a]=e;return(0,s.jsxs)(C.Z,{style:{display:"flex",marginBottom:8},align:"center",children:[(0,s.jsx)(E.o,{placeholder:"Header Name",value:t,onChange:e=>o(l,e.target.value,a)}),(0,s.jsx)(E.o,{placeholder:"Header Value",value:a,onChange:e=>o(l,t,e.target.value)}),(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,s.jsx)(k.Z,{onClick:()=>n(l),style:{cursor:"pointer"}})})]},l)}),(0,s.jsx)(S.ZP,{type:"dashed",onClick:()=>{i([...r,["",""]])},icon:(0,s.jsx)(A.Z,{}),children:"Add Header"})]})},I=t(77565),F=e=>{let{pathValue:l,targetValue:t,includeSubpath:a}=e,r=(0,d.getProxyBaseUrl)();return l&&t?(0,s.jsxs)(f.Z,{className:"p-5",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Preview"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-5",children:"How your requests will be routed"}),(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"Basic routing:"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint"}),(0,s.jsx)("code",{className:"font-mono text-sm text-gray-900",children:l?"".concat(r).concat(l):""})]}),(0,s.jsx)("div",{className:"text-gray-400",children:(0,s.jsx)(I.Z,{className:"text-lg"})}),(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,s.jsx)("code",{className:"font-mono text-sm text-gray-900",children:t})]})]})]}),a&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"With subpaths:"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint + subpath"}),(0,s.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[l&&"".concat(r).concat(l),(0,s.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]}),(0,s.jsx)("div",{className:"text-gray-400",children:(0,s.jsx)(I.Z,{className:"text-lg"})}),(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,s.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[t,(0,s.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]})]}),(0,s.jsxs)("div",{className:"mt-3 text-sm text-gray-600",children:["Any path after ",l," will be appended to the target URL"]})]})}),!a&&(0,s.jsx)("div",{className:"mt-4 p-3 bg-blue-50 rounded-md border border-blue-200",children:(0,s.jsxs)("div",{className:"flex items-start",children:[(0,s.jsx)(w.Z,{className:"text-blue-500 mt-0.5 mr-2 flex-shrink-0"}),(0,s.jsxs)("div",{className:"text-sm text-blue-700",children:[(0,s.jsx)("span",{className:"font-medium",children:"Not seeing the routing you wanted?"})," Try enabling - Include Subpaths - above - this allows subroutes like"," ",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded font-mono text-xs",children:"/api/v1/models"})," to be forwarded automatically."]})]})})]})]}):null},P=t(9114),L=t(63709),T=e=>{let{premiumUser:l,authEnabled:t,onAuthChange:a}=e;return(0,s.jsxs)(f.Z,{className:"p-6",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Security"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-4",children:"When enabled, requests to this endpoint will require a valid LiteLLM Virtual Key"}),l?(0,s.jsx)(_.Z.Item,{name:"auth",valuePropName:"checked",className:"mb-0",children:(0,s.jsx)(L.Z,{checked:t,onChange:e=>{a(e)}})}):(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center mb-3",children:[(0,s.jsx)(L.Z,{disabled:!0,checked:!1,style:{outline:"2px solid #d1d5db",outlineOffset:"2px"}}),(0,s.jsx)("span",{className:"ml-2 text-sm text-gray-400",children:"Authentication (Premium)"})]}),(0,s.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,s.jsxs)(n.Z,{className:"text-sm text-yellow-800",children:["Setting authentication for pass-through endpoints is a LiteLLM Enterprise feature. Get a trial key"," ",(0,s.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})]})},R=t(67479),O=e=>{let{accessToken:l,value:t={},onChange:r,disabled:i=!1}=e,[n,d]=(0,a.useState)(Object.keys(t)),[m,u]=(0,a.useState)(t);(0,a.useEffect)(()=>{u(t),d(Object.keys(t))},[t]);let h=(e,l,t)=>{var s,a;let i=m[e]||{},n={...m,[e]:{...i,[l]:t.length>0?t:void 0}};(null===(s=n[e])||void 0===s?void 0:s.request_fields)||(null===(a=n[e])||void 0===a?void 0:a.response_fields)||(n[e]=null),u(n),r&&r(n)};return(0,s.jsxs)(f.Z,{className:"p-6",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Guardrails"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-6",children:"Configure guardrails to enforce policies on requests and responses. Guardrails are opt-in for passthrough endpoints."}),(0,s.jsx)(b.Z,{message:(0,s.jsxs)("span",{children:["Field-Level Targeting"," ",(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/pass_through_guardrails#field-level-targeting",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"(Learn More)"})]}),description:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{children:"Optionally specify which fields to check. If left empty, the entire request/response is sent to the guardrail."}),(0,s.jsxs)("div",{className:"text-xs space-y-1 mt-2",children:[(0,s.jsx)("div",{className:"font-medium",children:"Common Examples:"}),(0,s.jsxs)("div",{children:["• ",(0,s.jsx)("code",{className:"bg-gray-100 px-1 rounded",children:"query"})," - Single field"]}),(0,s.jsxs)("div",{children:["• ",(0,s.jsx)("code",{className:"bg-gray-100 px-1 rounded",children:"documents[*].text"})," - All text in documents array"]}),(0,s.jsxs)("div",{children:["• ",(0,s.jsx)("code",{className:"bg-gray-100 px-1 rounded",children:"messages[*].content"})," - All message contents"]})]})]}),type:"info",showIcon:!0,className:"mb-4"}),(0,s.jsx)(_.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Select Guardrails",(0,s.jsx)(c.Z,{title:"Choose which guardrails should run on this endpoint. Org/team/key level guardrails will also be included.",children:(0,s.jsx)(w.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),children:(0,s.jsx)(R.Z,{accessToken:l,value:n,onChange:e=>{d(e);let l={};e.forEach(e=>{l[e]=m[e]||null}),u(l),r&&r(l)},disabled:i})}),n.length>0&&(0,s.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Field Targeting (Optional)"}),(0,s.jsx)("div",{className:"text-xs text-gray-500",children:"\uD83D\uDCA1 Tip: Leave empty to check entire payload"})]}),n.map(e=>{var l,t;return(0,s.jsxs)(f.Z,{className:"p-4 bg-gray-50",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-gray-900 mb-3",children:e}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,s.jsxs)("label",{className:"text-xs text-gray-600 flex items-center",children:["Request Fields (pre_call)",(0,s.jsx)(c.Z,{title:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium mb-1",children:"Specify which request fields to check"}),(0,s.jsxs)("div",{className:"text-xs space-y-1",children:[(0,s.jsx)("div",{children:"Examples:"}),(0,s.jsx)("div",{children:"• query"}),(0,s.jsx)("div",{children:"• documents[*].text"}),(0,s.jsx)("div",{children:"• messages[*].content"})]})]}),children:(0,s.jsx)(w.Z,{className:"ml-1 text-gray-400"})})]}),(0,s.jsxs)("div",{className:"flex gap-1",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{var l;let t=(null===(l=m[e])||void 0===l?void 0:l.request_fields)||[];h(e,"request_fields",[...t,"query"])},className:"text-xs px-2 py-1 bg-white border border-gray-300 rounded hover:bg-gray-50",disabled:i,children:"+ query"}),(0,s.jsx)("button",{type:"button",onClick:()=>{var l;let t=(null===(l=m[e])||void 0===l?void 0:l.request_fields)||[];h(e,"request_fields",[...t,"documents[*]"])},className:"text-xs px-2 py-1 bg-white border border-gray-300 rounded hover:bg-gray-50",disabled:i,children:"+ documents[*]"})]})]}),(0,s.jsx)(v.default,{mode:"tags",style:{width:"100%"},placeholder:"Type field name or use + buttons above (e.g., query, documents[*].text)",value:(null===(l=m[e])||void 0===l?void 0:l.request_fields)||[],onChange:l=>h(e,"request_fields",l),disabled:i,tokenSeparators:[","]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,s.jsxs)("label",{className:"text-xs text-gray-600 flex items-center",children:["Response Fields (post_call)",(0,s.jsx)(c.Z,{title:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium mb-1",children:"Specify which response fields to check"}),(0,s.jsxs)("div",{className:"text-xs space-y-1",children:[(0,s.jsx)("div",{children:"Examples:"}),(0,s.jsx)("div",{children:"• results[*].text"}),(0,s.jsx)("div",{children:"• choices[*].message.content"})]})]}),children:(0,s.jsx)(w.Z,{className:"ml-1 text-gray-400"})})]}),(0,s.jsx)("div",{className:"flex gap-1",children:(0,s.jsx)("button",{type:"button",onClick:()=>{var l;let t=(null===(l=m[e])||void 0===l?void 0:l.response_fields)||[];h(e,"response_fields",[...t,"results[*]"])},className:"text-xs px-2 py-1 bg-white border border-gray-300 rounded hover:bg-gray-50",disabled:i,children:"+ results[*]"})})]}),(0,s.jsx)(v.default,{mode:"tags",style:{width:"100%"},placeholder:"Type field name or use + buttons above (e.g., results[*].text)",value:(null===(t=m[e])||void 0===t?void 0:t.response_fields)||[],onChange:l=>h(e,"response_fields",l),disabled:i,tokenSeparators:[","]})]})]})]},e)})]})]})};let{Option:V}=v.default;var D=e=>{let{accessToken:l,setPassThroughItems:t,passThroughItems:i,premiumUser:n=!1}=e,[m]=_.Z.useForm(),[u,h]=(0,a.useState)(!1),[x,v]=(0,a.useState)(!1),[C,S]=(0,a.useState)(""),[k,A]=(0,a.useState)(""),[E,I]=(0,a.useState)(""),[L,R]=(0,a.useState)(!0),[V,D]=(0,a.useState)(!1),[z,q]=(0,a.useState)({}),B=()=>{m.resetFields(),A(""),I(""),R(!0),q({}),h(!1)},U=e=>{let l=e;e&&!e.startsWith("/")&&(l="/"+e),A(l),m.setFieldsValue({path:l})},G=async e=>{console.log("addPassThrough called with:",e),v(!0);try{!n&&"auth"in e&&delete e.auth,z&&Object.keys(z).length>0&&(e.guardrails=z),console.log("formValues: ".concat(JSON.stringify(e)));let s=(await (0,d.createPassThroughEndpoint)(l,e)).endpoints[0],a=[...i,s];t(a),P.Z.success("Pass-through endpoint created successfully"),m.resetFields(),A(""),I(""),R(!0),q({}),h(!1)}catch(e){P.Z.fromBackend("Error creating pass-through endpoint: "+e)}finally{v(!1)}};return(0,s.jsxs)("div",{children:[(0,s.jsx)(r.Z,{className:"mx-auto mb-4 mt-4",onClick:()=>h(!0),children:"+ Add Pass-Through Endpoint"}),(0,s.jsx)(y.Z,{title:(0,s.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,s.jsx)(Z.Z,{className:"text-xl text-blue-500"}),(0,s.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Pass-Through Endpoint"})]}),open:u,width:1e3,onCancel:B,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,s.jsxs)("div",{className:"mt-6",children:[(0,s.jsx)(b.Z,{message:"What is a Pass-Through Endpoint?",description:"Route requests from your LiteLLM proxy to any external API. Perfect for custom models, image generation APIs, or any service you want to proxy through LiteLLM.",type:"info",showIcon:!0,className:"mb-6"}),(0,s.jsxs)(_.Z,{form:m,onFinish:G,layout:"vertical",className:"space-y-6",initialValues:{include_subpath:!0,path:k,target:E},children:[(0,s.jsxs)(f.Z,{className:"p-5",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Configuration"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-5",children:"Configure how requests to your domain will be forwarded to the target API"}),(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsx)(_.Z.Item,{label:(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Path Prefix"}),name:"path",rules:[{required:!0,message:"Path is required",pattern:/^\//}],extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example: /bria, /adobe-photoshop, /elasticsearch"}),className:"mb-4",children:(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsx)(g.Z,{placeholder:"bria",value:k,onChange:e=>U(e.target.value),className:"flex-1"})})}),(0,s.jsx)(_.Z.Item,{label:(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Target URL"}),name:"target",rules:[{required:!0,message:"Target URL is required"},{type:"url",message:"Please enter a valid URL"}],extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example:https://engine.prod.bria-api.com"}),className:"mb-4",children:(0,s.jsx)(g.Z,{placeholder:"https://engine.prod.bria-api.com",value:E,onChange:e=>{I(e.target.value),m.setFieldsValue({target:e.target.value})}})}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Include Subpaths"}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Forward all subpaths to the target API (recommended for REST APIs)"})]}),(0,s.jsx)(_.Z.Item,{name:"include_subpath",valuePropName:"checked",className:"mb-0",children:(0,s.jsx)(p.Z,{checked:L,onChange:R})})]})]})]}),(0,s.jsx)(F,{pathValue:k,targetValue:E,includeSubpath:L}),(0,s.jsxs)(f.Z,{className:"p-6",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Headers"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-6",children:"Add headers that will be sent with every request to the target API"}),(0,s.jsx)(_.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Headers",(0,s.jsx)(c.Z,{title:"Authentication and other headers to forward with requests",children:(0,s.jsx)(w.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"headers",rules:[{required:!0,message:"Please configure the headers"}],extra:(0,s.jsxs)("div",{className:"text-xs text-gray-500 mt-2",children:[(0,s.jsx)("div",{className:"font-medium mb-1",children:"Add authentication tokens and other required headers"}),(0,s.jsx)("div",{children:"Common examples: auth_token, Authorization, x-api-key"})]}),children:(0,s.jsx)(M,{})})]}),(0,s.jsx)(T,{premiumUser:n,authEnabled:V,onAuthChange:e=>{D(e),m.setFieldsValue({auth:e})}}),(0,s.jsx)(O,{accessToken:l,value:z,onChange:q}),(0,s.jsxs)(f.Z,{className:"p-6",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Billing"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-6",children:"Optional cost tracking for this endpoint"}),(0,s.jsx)(_.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Cost Per Request (USD)",(0,s.jsx)(c.Z,{title:"Optional: Track costs for requests to this endpoint",children:(0,s.jsx)(w.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:"cost_per_request",extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-2",children:"The cost charged for each request through this endpoint"}),children:(0,s.jsx)(N.Z,{min:0,step:.001,precision:4,placeholder:"2.0000",size:"large"})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,s.jsx)(r.Z,{variant:"secondary",onClick:B,children:"Cancel"}),(0,s.jsx)(r.Z,{variant:"primary",loading:x,onClick:()=>{console.log("Submit button clicked"),m.submit()},children:x?"Creating...":"Add Pass-Through Endpoint"})]})]})]})})]})},z=t(30078),q=t(4260),B=t(19015),U=t(87769),G=t(42208);let H=e=>{let{value:l}=e,[t,r]=(0,a.useState)(!1),i=JSON.stringify(l,null,2);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("pre",{className:"font-mono text-xs bg-gray-50 p-2 rounded max-w-md overflow-auto",children:t?i:"••••••••"}),(0,s.jsx)("button",{onClick:()=>r(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,s.jsx)(U.Z,{className:"w-4 h-4 text-gray-500"}):(0,s.jsx)(G.Z,{className:"w-4 h-4 text-gray-500"})})]})};var K=e=>{let{endpointData:l,onClose:t,accessToken:r,isAdmin:i,premiumUser:n=!1,onEndpointUpdated:o}=e,[c,m]=(0,a.useState)(l),[u,h]=(0,a.useState)(!1),[x,p]=(0,a.useState)(!1),[g,f]=(0,a.useState)((null==l?void 0:l.auth)||!1),[j,v]=(0,a.useState)((null==l?void 0:l.guardrails)||{}),[y]=_.Z.useForm(),b=async e=>{try{if(!r||!(null==c?void 0:c.id))return;let l={};if(e.headers)try{l="string"==typeof e.headers?JSON.parse(e.headers):e.headers}catch(e){P.Z.fromBackend("Invalid JSON format for headers");return}let t={path:c.path,target:e.target,headers:l,include_subpath:e.include_subpath,cost_per_request:e.cost_per_request,auth:n?e.auth:void 0,guardrails:j&&Object.keys(j).length>0?j:void 0};await (0,d.updatePassThroughEndpoint)(r,c.id,t),m({...c,...t}),p(!1),o&&o()}catch(e){console.error("Error updating endpoint:",e),P.Z.fromBackend("Failed to update pass through endpoint")}},N=async()=>{try{if(!r||!(null==c?void 0:c.id))return;await (0,d.deletePassThroughEndpointsCall)(r,c.id),P.Z.success("Pass through endpoint deleted successfully"),t(),o&&o()}catch(e){console.error("Error deleting endpoint:",e),P.Z.fromBackend("Failed to delete pass through endpoint")}};return u?(0,s.jsx)("div",{className:"p-4",children:"Loading..."}):c?(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,s.jsxs)("div",{children:[(0,s.jsx)(S.ZP,{onClick:t,className:"mb-4",children:"← Back"}),(0,s.jsxs)(z.Dx,{children:["Pass Through Endpoint: ",c.path]}),(0,s.jsx)(z.xv,{className:"text-gray-500 font-mono",children:c.id})]})}),(0,s.jsxs)(z.v0,{children:[(0,s.jsxs)(z.td,{className:"mb-4",children:[(0,s.jsx)(z.OK,{children:"Overview"},"overview"),i?(0,s.jsx)(z.OK,{children:"Settings"},"settings"):(0,s.jsx)(s.Fragment,{})]}),(0,s.jsxs)(z.nP,{children:[(0,s.jsxs)(z.x4,{children:[(0,s.jsxs)(z.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,s.jsxs)(z.Zb,{children:[(0,s.jsx)(z.xv,{children:"Path"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(z.Dx,{className:"font-mono",children:c.path})})]}),(0,s.jsxs)(z.Zb,{children:[(0,s.jsx)(z.xv,{children:"Target"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(z.Dx,{children:c.target})})]}),(0,s.jsxs)(z.Zb,{children:[(0,s.jsx)(z.xv,{children:"Configuration"}),(0,s.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,s.jsx)("div",{children:(0,s.jsx)(z.Ct,{color:c.include_subpath?"green":"gray",children:c.include_subpath?"Include Subpath":"Exact Path"})}),(0,s.jsx)("div",{children:(0,s.jsx)(z.Ct,{color:c.auth?"blue":"gray",children:c.auth?"Auth Required":"No Auth"})}),void 0!==c.cost_per_request&&(0,s.jsx)("div",{children:(0,s.jsxs)(z.xv,{children:["Cost per request: $",c.cost_per_request]})})]})]})]}),(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(F,{pathValue:c.path,targetValue:c.target,includeSubpath:c.include_subpath||!1})}),c.headers&&Object.keys(c.headers).length>0&&(0,s.jsxs)(z.Zb,{className:"mt-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Headers"}),(0,s.jsxs)(z.Ct,{color:"blue",children:[Object.keys(c.headers).length," headers configured"]})]}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(H,{value:c.headers})})]}),c.guardrails&&Object.keys(c.guardrails).length>0&&(0,s.jsxs)(z.Zb,{className:"mt-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Guardrails"}),(0,s.jsxs)(z.Ct,{color:"purple",children:[Object.keys(c.guardrails).length," guardrails configured"]})]}),(0,s.jsx)("div",{className:"mt-4 space-y-2",children:Object.entries(c.guardrails).map(e=>{let[l,t]=e;return(0,s.jsxs)("div",{className:"p-3 bg-gray-50 rounded",children:[(0,s.jsx)("div",{className:"font-medium text-sm",children:l}),t&&(t.request_fields||t.response_fields)&&(0,s.jsxs)("div",{className:"mt-2 text-xs text-gray-600 space-y-1",children:[t.request_fields&&(0,s.jsxs)("div",{children:["Request fields: ",t.request_fields.join(", ")]}),t.response_fields&&(0,s.jsxs)("div",{children:["Response fields: ",t.response_fields.join(", ")]})]}),!t&&(0,s.jsx)("div",{className:"text-xs text-gray-600 mt-1",children:"Uses entire payload"})]},l)})})]})]}),i&&(0,s.jsx)(z.x4,{children:(0,s.jsxs)(z.Zb,{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(z.Dx,{children:"Pass Through Endpoint Settings"}),(0,s.jsx)("div",{className:"space-x-2",children:!x&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(z.zx,{onClick:()=>p(!0),children:"Edit Settings"}),(0,s.jsx)(z.zx,{onClick:N,variant:"secondary",color:"red",children:"Delete Endpoint"})]})})]}),x?(0,s.jsxs)(_.Z,{form:y,onFinish:b,initialValues:{target:c.target,headers:c.headers?JSON.stringify(c.headers,null,2):"",include_subpath:c.include_subpath||!1,cost_per_request:c.cost_per_request,auth:c.auth||!1},layout:"vertical",children:[(0,s.jsx)(_.Z.Item,{label:"Target URL",name:"target",rules:[{required:!0,message:"Please input a target URL"}],children:(0,s.jsx)(z.oi,{placeholder:"https://api.example.com"})}),(0,s.jsx)(_.Z.Item,{label:"Headers (JSON)",name:"headers",children:(0,s.jsx)(q.default.TextArea,{rows:5,placeholder:'{"Authorization": "Bearer your-token", "Content-Type": "application/json"}'})}),(0,s.jsx)(_.Z.Item,{label:"Include Subpath",name:"include_subpath",valuePropName:"checked",children:(0,s.jsx)(L.Z,{})}),(0,s.jsx)(_.Z.Item,{label:"Cost per Request",name:"cost_per_request",children:(0,s.jsx)(B.Z,{min:0,step:.01,precision:2,placeholder:"0.00",addonBefore:"$"})}),(0,s.jsx)(T,{premiumUser:n,authEnabled:g,onAuthChange:e=>{f(e),y.setFieldsValue({auth:e})}}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(O,{accessToken:r||"",value:j,onChange:v})}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,s.jsx)(S.ZP,{onClick:()=>p(!1),children:"Cancel"}),(0,s.jsx)(z.zx,{children:"Save Changes"})]})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Path"}),(0,s.jsx)("div",{className:"font-mono",children:c.path})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Target URL"}),(0,s.jsx)("div",{children:c.target})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Include Subpath"}),(0,s.jsx)(z.Ct,{color:c.include_subpath?"green":"gray",children:c.include_subpath?"Yes":"No"})]}),void 0!==c.cost_per_request&&(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Cost per Request"}),(0,s.jsxs)("div",{children:["$",c.cost_per_request]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Authentication Required"}),(0,s.jsx)(z.Ct,{color:c.auth?"green":"gray",children:c.auth?"Yes":"No"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Headers"}),c.headers&&Object.keys(c.headers).length>0?(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(H,{value:c.headers})}):(0,s.jsx)("div",{className:"text-gray-500",children:"No headers configured"})]})]})]})})]})]})]}):(0,s.jsx)("div",{className:"p-4",children:"Pass through endpoint not found"})},J=t(12322);let W=e=>{let{value:l}=e,[t,r]=(0,a.useState)(!1),i=JSON.stringify(l);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("span",{className:"font-mono text-xs",children:t?i:"••••••••"}),(0,s.jsx)("button",{onClick:()=>r(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,s.jsx)(U.Z,{className:"w-4 h-4 text-gray-500"}):(0,s.jsx)(G.Z,{className:"w-4 h-4 text-gray-500"})})]})};var Y=e=>{let{accessToken:l,userRole:t,userID:p,modelData:g,premiumUser:f}=e,[j,v]=(0,a.useState)([]),[_,y]=(0,a.useState)(null),[b,N]=(0,a.useState)(!1),[Z,w]=(0,a.useState)(null);(0,a.useEffect)(()=>{l&&t&&p&&(0,d.getPassThroughEndpointsCall)(l).then(e=>{v(e.endpoints)})},[l,t,p]);let C=async e=>{w(e),N(!0)},S=async()=>{if(null!=Z&&l){try{await (0,d.deletePassThroughEndpointsCall)(l,Z);let e=j.filter(e=>e.id!==Z);v(e),P.Z.success("Endpoint deleted successfully.")}catch(e){console.error("Error deleting the endpoint:",e),P.Z.fromBackend("Error deleting the endpoint: "+e)}N(!1),w(null)}},k=(e,l)=>{C(e)},A=[{header:"ID",accessorKey:"id",cell:e=>(0,s.jsx)(c.Z,{title:e.row.original.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>e.row.original.id&&y(e.row.original.id),children:e.row.original.id})})},{header:"Path",accessorKey:"path"},{header:"Target",accessorKey:"target",cell:e=>(0,s.jsx)(n.Z,{children:e.getValue()})},{header:()=>(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{children:"Authentication"}),(0,s.jsx)(c.Z,{title:"LiteLLM Virtual Key required to call endpoint",children:(0,s.jsx)(u.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),accessorKey:"auth",cell:e=>(0,s.jsx)(m.Z,{color:e.getValue()?"green":"gray",children:e.getValue()?"Yes":"No"})},{header:"Headers",accessorKey:"headers",cell:e=>(0,s.jsx)(W,{value:e.getValue()||{}})},{header:"Actions",id:"actions",cell:e=>{let{row:l}=e;return(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)(i.Z,{icon:h.Z,size:"sm",onClick:()=>l.original.id&&y(l.original.id),title:"Edit"}),(0,s.jsx)(i.Z,{icon:x.Z,size:"sm",onClick:()=>k(l.original.id,l.index),title:"Delete"})]})}}];if(!l)return null;if(_){console.log("selectedEndpointId",_),console.log("generalSettings",j);let e=j.find(e=>e.id===_);return e?(0,s.jsx)(K,{endpointData:e,onClose:()=>y(null),accessToken:l,isAdmin:"Admin"===t||"admin"===t,premiumUser:f,onEndpointUpdated:()=>{l&&(0,d.getPassThroughEndpointsCall)(l).then(e=>{v(e.endpoints)})}}):(0,s.jsx)("div",{children:"Endpoint not found"})}return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(o.Z,{children:"Pass Through Endpoints"}),(0,s.jsx)(n.Z,{className:"text-tremor-content",children:"Configure and manage your pass-through endpoints"})]}),(0,s.jsx)(D,{accessToken:l,setPassThroughItems:v,passThroughItems:j,premiumUser:f}),(0,s.jsx)(J.w,{data:j,columns:A,renderSubComponent:()=>(0,s.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:!1,noDataMessage:"No pass-through endpoints configured"}),b&&(0,s.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,s.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,s.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,s.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,s.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,s.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,s.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,s.jsx)("div",{className:"sm:flex sm:items-start",children:(0,s.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,s.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Pass-Through Endpoint"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this pass-through endpoint? This action cannot be undone."})})]})})}),(0,s.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,s.jsx)(r.Z,{onClick:S,color:"red",className:"ml-2",children:"Delete"}),(0,s.jsx)(r.Z,{onClick:()=>{N(!1),w(null)},children:"Cancel"})]})]})]})})]})}},39789:function(e,l,t){t.d(l,{Z:function(){return n}});var s=t(57437),a=t(2265),r=t(88237),i=t(84264),n=e=>{let{value:l,onValueChange:t,label:n="Select Time Range",className:o="",showTimeRange:d=!0}=e,[c,m]=(0,a.useState)(!1),u=(0,a.useRef)(null),h=(0,a.useCallback)(e=>{m(!0),setTimeout(()=>m(!1),1500),t(e),requestIdleCallback(()=>{if(e.from){let l;let s={...e},a=new Date(e.from);l=new Date(e.to?e.to:e.from),a.toDateString(),l.toDateString(),a.setHours(0,0,0,0),l.setHours(23,59,59,999),s.from=a,s.to=l,t(s)}},{timeout:100})},[t]),x=(0,a.useCallback)((e,l)=>{if(!e||!l)return"";let t=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==l.toDateString())return"".concat(t(e)," - ").concat(t(l));{let t=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),s=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),a=l.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(t,": ").concat(s," - ").concat(a)}},[]);return(0,s.jsxs)("div",{className:o,children:[n&&(0,s.jsx)(i.Z,{className:"mb-2",children:n}),(0,s.jsxs)("div",{className:"relative w-fit",children:[(0,s.jsx)("div",{ref:u,children:(0,s.jsx)(r.Z,{enableSelect:!0,value:l,onValueChange:h,placeholder:"Select date range",enableClear:!1,style:{zIndex:100}})}),c&&(0,s.jsx)("div",{className:"absolute top-1/2 animate-pulse",style:{left:"calc(100% + 8px)",transform:"translateY(-50%)",zIndex:110},children:(0,s.jsxs)("div",{className:"flex items-center gap-1 text-green-600 text-sm font-medium bg-white px-2 py-1 rounded-full border border-green-200 shadow-sm whitespace-nowrap",children:[(0,s.jsx)("div",{className:"w-3 h-3 bg-green-500 text-white rounded-full flex items-center justify-center text-xs",children:"✓"}),(0,s.jsx)("span",{className:"text-xs",children:"Selected"})]})})]}),d&&l.from&&l.to&&(0,s.jsx)(i.Z,{className:"mt-2 text-xs text-gray-500",children:x(l.from,l.to)})]})}},12322:function(e,l,t){t.d(l,{w:function(){return o}});var s=t(57437),a=t(2265),r=t(71594),i=t(24525),n=t(19130);function o(e){let{data:l=[],columns:t,getRowCanExpand:o,renderSubComponent:d,isLoading:c=!1,loadingMessage:m="\uD83D\uDE85 Loading logs...",noDataMessage:u="No logs found"}=e,h=(0,r.b7)({data:l,columns:t,getRowCanExpand:o,getRowId:(e,l)=>{var t;return null!==(t=null==e?void 0:e.request_id)&&void 0!==t?t:String(l)},getCoreRowModel:(0,i.sC)(),getExpandedRowModel:(0,i.rV)()});return(0,s.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,s.jsxs)(n.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,s.jsx)(n.ss,{children:h.getHeaderGroups().map(e=>(0,s.jsx)(n.SC,{children:e.headers.map(e=>(0,s.jsx)(n.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,r.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,s.jsx)(n.RM,{children:c?(0,s.jsx)(n.SC,{children:(0,s.jsx)(n.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:m})})})}):h.getRowModel().rows.length>0?h.getRowModel().rows.map(e=>(0,s.jsxs)(a.Fragment,{children:[(0,s.jsx)(n.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,s.jsx)(n.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,r.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,s.jsx)(n.SC,{children:(0,s.jsx)(n.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,s.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:d({row:e})})})})]},e.id)):(0,s.jsx)(n.SC,{children:(0,s.jsx)(n.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:u})})})})})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1250-85d99b7c90e56c2a.js b/litellm/proxy/_experimental/out/_next/static/chunks/1250-85d99b7c90e56c2a.js new file mode 100644 index 00000000000..64b0f5f1eb2 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1250-85d99b7c90e56c2a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1250],{83669:function(t,e,n){n.d(e,{Z:function(){return c}});var r=n(1119),a=n(2265),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"},o=n(55015),c=a.forwardRef(function(t,e){return a.createElement(o.Z,(0,r.Z)({},t,{ref:e,icon:s}))})},62670:function(t,e,n){n.d(e,{Z:function(){return c}});var r=n(1119),a=n(2265),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"},o=n(55015),c=a.forwardRef(function(t,e){return a.createElement(o.Z,(0,r.Z)({},t,{ref:e,icon:s}))})},29271:function(t,e,n){n.d(e,{Z:function(){return c}});var r=n(1119),a=n(2265),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:"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"},o=n(55015),c=a.forwardRef(function(t,e){return a.createElement(o.Z,(0,r.Z)({},t,{ref:e,icon:s}))})},45246:function(t,e,n){n.d(e,{Z:function(){return c}});var r=n(1119),a=n(2265),s={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"},o=n(55015),c=a.forwardRef(function(t,e){return a.createElement(o.Z,(0,r.Z)({},t,{ref:e,icon:s}))})},89245:function(t,e,n){n.d(e,{Z:function(){return c}});var r=n(1119),a=n(2265),s={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"},o=n(55015),c=a.forwardRef(function(t,e){return a.createElement(o.Z,(0,r.Z)({},t,{ref:e,icon:s}))})},69993:function(t,e,n){n.d(e,{Z:function(){return c}});var r=n(1119),a=n(2265),s={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"},o=n(55015),c=a.forwardRef(function(t,e){return a.createElement(o.Z,(0,r.Z)({},t,{ref:e,icon:s}))})},58630:function(t,e,n){n.d(e,{Z:function(){return c}});var r=n(1119),a=n(2265),s={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"},o=n(55015),c=a.forwardRef(function(t,e){return a.createElement(o.Z,(0,r.Z)({},t,{ref:e,icon:s}))})},67101:function(t,e,n){n.d(e,{Z:function(){return d}});var r=n(5853),a=n(13241),s=n(1153),o=n(2265),c=n(9496);let i=(0,s.fn)("Grid"),l=(t,e)=>t&&Object.keys(e).includes(String(t))?e[t]:"",d=o.forwardRef((t,e)=>{let{numItems:n=1,numItemsSm:s,numItemsMd:d,numItemsLg:u,children:m,className:p}=t,g=(0,r._T)(t,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),h=l(n,c._m),f=l(s,c.LH),v=l(d,c.l5),y=l(u,c.N4),w=(0,a.q)(h,f,v,y);return o.createElement("div",Object.assign({ref:e,className:(0,a.q)(i("root"),"grid",w,p)},g),m)});d.displayName="Grid"},9496:function(t,e,n){n.d(e,{LH:function(){return a},N4:function(){return o},PT:function(){return c},SP:function(){return i},VS:function(){return l},_m:function(){return r},_w:function(){return d},l5:function(){return s}});let r={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"},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"},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"},i={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"},l={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"},d={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"}},58760:function(t,e,n){n.d(e,{Z:function(){return z}});var r=n(2265),a=n(36760),s=n.n(a),o=n(45287);function c(t){return["small","middle","large"].includes(t)}function i(t){return!!t&&"number"==typeof t&&!Number.isNaN(t)}var l=n(71744),d=n(77685),u=n(17691),m=n(99320);let p=t=>{let{componentCls:e,borderRadius:n,paddingSM:r,colorBorder:a,paddingXS:s,fontSizeLG:o,fontSizeSM:c,borderRadiusLG:i,borderRadiusSM:l,colorBgContainerDisabled:d,lineWidth:m}=t;return{[e]:[{display:"inline-flex",alignItems:"center",gap:0,paddingInline:r,margin:0,background:d,borderWidth:m,borderStyle:"solid",borderColor:a,borderRadius:n,"&-large":{fontSize:o,borderRadius:i},"&-small":{paddingInline:s,borderRadius:l,fontSize:c},"&-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,u.c)(t,{focus:!1})]}};var g=(0,m.I$)(["Space","Addon"],t=>[p(t)]),h=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(t);ae.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n};let f=r.forwardRef((t,e)=>{let{className:n,children:a,style:o,prefixCls:c}=t,i=h(t,["className","children","style","prefixCls"]),{getPrefixCls:u,direction:m}=r.useContext(l.E_),p=u("space-addon",c),[f,v,y]=g(p),{compactItemClassnames:w,compactSize:b}=(0,d.ri)(p,m),k=s()(p,v,w,y,{["".concat(p,"-").concat(b)]:b},n);return f(r.createElement("div",Object.assign({ref:e,className:k,style:o},i),a))}),v=r.createContext({latestIndex:0}),y=v.Provider;var w=t=>{let{className:e,index:n,children:a,split:s,style:o}=t,{latestIndex:c}=r.useContext(v);return null==a?null:r.createElement(r.Fragment,null,r.createElement("div",{className:e,style:o},a),n{let{componentCls:e,antCls:n}=t;return{[e]:{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"}},["".concat(e,"-item:empty")]:{display:"none"},["".concat(e,"-item > ").concat(n,"-badge-not-a-wrapper:only-child")]:{display:"block"}}}},x=t=>{let{componentCls:e}=t;return{[e]:{"&-gap-row-small":{rowGap:t.spaceGapSmallSize},"&-gap-row-middle":{rowGap:t.spaceGapMiddleSize},"&-gap-row-large":{rowGap:t.spaceGapLargeSize},"&-gap-col-small":{columnGap:t.spaceGapSmallSize},"&-gap-col-middle":{columnGap:t.spaceGapMiddleSize},"&-gap-col-large":{columnGap:t.spaceGapLargeSize}}}};var M=(0,m.I$)("Space",t=>{let e=(0,b.IX)(t,{spaceGapSmallSize:t.paddingXS,spaceGapMiddleSize:t.padding,spaceGapLargeSize:t.paddingLG});return[k(e),x(e)]},()=>({}),{resetStyle:!1}),Z=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(t);ae.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n};let O=r.forwardRef((t,e)=>{var n;let{getPrefixCls:a,direction:d,size:u,className:m,style:p,classNames:g,styles:h}=(0,l.dj)("space"),{size:f=null!=u?u:"small",align:v,className:b,rootClassName:k,children:x,direction:O="horizontal",prefixCls:z,split:E,style:S,wrap:C=!1,classNames:L,styles:R}=t,j=Z(t,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[N,I]=Array.isArray(f)?f:[f,f],G=c(I),A=c(N),V=i(I),B=i(N),H=(0,o.Z)(x,{keepEmpty:!0}),P=void 0===v&&"horizontal"===O?"center":v,W=a("space",z),[_,q,K]=M(W),U=s()(W,m,q,"".concat(W,"-").concat(O),{["".concat(W,"-rtl")]:"rtl"===d,["".concat(W,"-align-").concat(P)]:P,["".concat(W,"-gap-row-").concat(I)]:G,["".concat(W,"-gap-col-").concat(N)]:A},b,k,K),$=s()("".concat(W,"-item"),null!==(n=null==L?void 0:L.item)&&void 0!==n?n:g.item),D=Object.assign(Object.assign({},h.item),null==R?void 0:R.item),T=H.map((t,e)=>{let n=(null==t?void 0:t.key)||"".concat($,"-").concat(e);return r.createElement(w,{className:$,key:n,index:e,split:E,style:D},t)}),X=r.useMemo(()=>({latestIndex:H.reduce((t,e,n)=>null!=e?n:t,0)}),[H]);if(0===H.length)return null;let Y={};return C&&(Y.flexWrap="wrap"),!A&&B&&(Y.columnGap=N),!G&&V&&(Y.rowGap=I),_(r.createElement("div",Object.assign({ref:e,className:U,style:Object.assign(Object.assign(Object.assign({},Y),p),S)},j),r.createElement(y,{value:X},T)))});O.Compact=d.ZP,O.Addon=f;var z=O},79205:function(t,e,n){n.d(e,{Z:function(){return u}});var r=n(2265);let a=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),s=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,e,n)=>n?n.toUpperCase():e.toLowerCase()),o=t=>{let e=s(t);return e.charAt(0).toUpperCase()+e.slice(1)},c=function(){for(var t=arguments.length,e=Array(t),n=0;n!!t&&""!==t.trim()&&n.indexOf(t)===e).join(" ").trim()},i=t=>{for(let e in t)if(e.startsWith("aria-")||"role"===e||"title"===e)return!0};var l={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 d=(0,r.forwardRef)((t,e)=>{let{color:n="currentColor",size:a=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:d="",children:u,iconNode:m,...p}=t;return(0,r.createElement)("svg",{ref:e,...l,width:a,height:a,stroke:n,strokeWidth:o?24*Number(s)/Number(a):s,className:c("lucide",d),...!u&&!i(p)&&{"aria-hidden":"true"},...p},[...m.map(t=>{let[e,n]=t;return(0,r.createElement)(e,n)}),...Array.isArray(u)?u:[u]])}),u=(t,e)=>{let n=(0,r.forwardRef)((n,s)=>{let{className:i,...l}=n;return(0,r.createElement)(d,{ref:s,iconNode:e,className:c("lucide-".concat(a(o(t))),"lucide-".concat(t),i),...l})});return n.displayName=o(t),n}},30401:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},64935:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]])},78867:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},96362:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("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"}]])},29202:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},54001:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("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"}]])},96137:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("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"}]])},80221:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},11239:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},10900:function(t,e,n){var r=n(2265);let a=r.forwardRef(function(t,e){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:e},t),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});e.Z=a},71437:function(t,e,n){var r=n(2265);let a=r.forwardRef(function(t,e){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:e},t),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),r.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.Z=a},82376:function(t,e,n){var r=n(2265);let a=r.forwardRef(function(t,e){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:e},t),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}))});e.Z=a},53410:function(t,e,n){var r=n(2265);let a=r.forwardRef(function(t,e){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:e},t),r.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.Z=a},74998:function(t,e,n){var r=n(2265);let a=r.forwardRef(function(t,e){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:e},t),r.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.Z=a},21770:function(t,e,n){n.d(e,{D:function(){return d}});var r=n(2265),a=n(2894),s=n(18238),o=n(24112),c=n(45345),i=class extends o.l{#t;#e=void 0;#n;#r;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#t.defaultMutationOptions(t),(0,c.VS)(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,c.Ym)(e.mutationKey)!==(0,c.Ym)(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#s(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#s()}mutate(t,e){return this.#r=e,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#a(){let t=this.#n?.state??(0,a.R)();this.#e={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#s(t){s.Vr.batch(()=>{if(this.#r&&this.hasListeners()){let e=this.#e.variables,n=this.#e.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#r.onSuccess?.(t.data,e,n,r),this.#r.onSettled?.(t.data,null,e,n,r)):t?.type==="error"&&(this.#r.onError?.(t.error,e,n,r),this.#r.onSettled?.(void 0,t.error,e,n,r))}this.listeners.forEach(t=>{t(this.#e)})})}},l=n(29827);function d(t,e){let n=(0,l.NL)(e),[a]=r.useState(()=>new i(n,t));r.useEffect(()=>{a.setOptions(t)},[a,t]);let o=r.useSyncExternalStore(r.useCallback(t=>a.subscribe(s.Vr.batchCalls(t)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),d=r.useCallback((t,e)=>{a.mutate(t,e).catch(c.ZT)},[a]);if(o.error&&(0,c.L3)(a.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:d,mutateAsync:o.mutate}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1253-cba71f6091ef4f5e.js b/litellm/proxy/_experimental/out/_next/static/chunks/1253-cba71f6091ef4f5e.js new file mode 100644 index 00000000000..d9fb7a7b5dc --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1253-cba71f6091ef4f5e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1253],{19046:function(e,t,s){s.d(t,{Dx:function(){return l.Z},Zb:function(){return r.Z},oi:function(){return o.Z},xv:function(){return n.Z},zx:function(){return a.Z}});var a=s(78489),r=s(12514),n=s(84264),o=s(49566),l=s(96761)},88712:function(e,t,s){var a=s(57437);s(2265);var r=s(33145),n=s(66830),o=s(50010);t.Z=e=>{let{message:t}=e;if(!(0,n.br)(t))return null;let s="string"==typeof t.content&&t.content.includes("[PDF attached]");return(0,a.jsx)("div",{className:"mb-2",children:s?(0,a.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,a.jsx)(o.Z,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,a.jsx)(r.default,{src:t.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"}})})}},27930:function(e,t,s){var a=s(57437);s(2265);var r=s(65319),n=s(99981),o=s(53508);let{Dragger:l}=r.default;t.Z=e=>{let{chatUploadedImage:t,chatImagePreviewUrl:s,onImageUpload:r,onRemoveImage:i}=e;return(0,a.jsx)(a.Fragment,{children:!t&&(0,a.jsx)(l,{beforeUpload:r,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,a.jsx)(n.Z,{title:"Attach image or PDF",children:(0,a.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,a.jsx)(o.Z,{style:{fontSize:"16px"}})})})})})}},66830:function(e,t,s){s.d(t,{Hk:function(){return n},Sn:function(){return r},br:function(){return o}});let a=e=>new Promise((t,s)=>{let a=new FileReader;a.onload=()=>{t(a.result)},a.onerror=s,a.readAsDataURL(e)}),r=async(e,t)=>({role:"user",content:[{type:"text",text:e},{type:"image_url",image_url:{url:await a(t)}}]}),n=(e,t,s,a)=>{let r="";t&&a&&(r=a.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?"".concat(e," ").concat(r):e};return t&&s&&(n.imagePreviewUrl=s),n},o=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl},71253:function(e,t,s){s.d(t,{Z:function(){return e5}});var a=s(57437),r=s(61935),n=s(92403),o=s(12660),l=s(25980),i=s(69993),c=s(55322),d=s(71891),m=s(58630),u=s(15424),x=s(44625),g=s(57400),p=s(26430),h=s(11894),f=s(15883),v=s(99890),b=s(26349),y=s(50010),j=s(79276),N=s(19046),w=s(4260),S=s(65319),k=s(57840),C=s(37592),P=s(79326),A=s(5545),Z=s(99981),_=s(10353),E=s(22116),I=s(2265),T=s(62831),R=s(17906),L=s(94263),O=s(93837),U=s(9309),M=s(67479),K=s(9114),D=s(99020),z=s(97415),B=s(92280),F=s(4156),H=s(19015),G=s(85847),W=e=>{let{temperature:t=1,maxTokens:s=2048,useAdvancedParams:r,onTemperatureChange:n,onMaxTokensChange:o,onUseAdvancedParamsChange:l}=e,[i,c]=(0,I.useState)(!1),d=void 0!==r?r:i,[m,x]=(0,I.useState)(t),[g,p]=(0,I.useState)(s);(0,I.useEffect)(()=>{x(t)},[t]),(0,I.useEffect)(()=>{p(s)},[s]);let h=e=>{let t=null!=e?e:1;x(t),null==n||n(t)},f=e=>{let t=null!=e?e:1e3;p(t),null==o||o(t)},v=d?"text-gray-700":"text-gray-400",b=e=>{l?l(e):c(e)};return(0,a.jsxs)("div",{className:"space-y-4 p-4 w-80",children:[(0,a.jsx)(F.Z,{checked:d,onChange:e=>b(e.target.checked),children:(0,a.jsx)("span",{className:"font-medium",children:"Use Advanced Parameters"})}),(0,a.jsxs)("div",{className:"space-y-4 transition-opacity duration-200",style:{opacity:d?1:.4},children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(B.x,{className:"text-sm ".concat(v),children:"Temperature"}),(0,a.jsx)(Z.Z,{title:"Controls randomness. Lower values make output more deterministic, higher values more creative.",children:(0,a.jsx)(u.Z,{className:"text-xs ".concat(v," cursor-help")})})]}),(0,a.jsx)(H.Z,{min:0,max:2,step:.1,value:m,onChange:h,disabled:!d,precision:1,className:"w-20"})]}),(0,a.jsx)(G.Z,{min:0,max:2,step:.1,value:m,onChange:h,disabled:!d,marks:{0:"0",1:"1.0",2:"2.0"}})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(B.x,{className:"text-sm ".concat(v),children:"Max Tokens"}),(0,a.jsx)(Z.Z,{title:"Maximum number of tokens to generate in the response.",children:(0,a.jsx)(u.Z,{className:"text-xs ".concat(v," cursor-help")})})]}),(0,a.jsx)(H.Z,{min:1,max:32768,step:1,value:g,onChange:f,disabled:!d})]}),(0,a.jsx)(G.Z,{min:1,max:32768,step:1,value:g,onChange:f,disabled:!d,marks:{1:"1",32768:"32768"}})]})]})]})},q=e=>{let{message:t}=e;return t.isAudio&&"string"==typeof t.content?(0,a.jsx)("div",{className:"mb-2",children:(0,a.jsx)("audio",{controls:!0,src:t.content,className:"max-w-full",style:{maxWidth:"500px"},children:"Your browser does not support the audio element."})}):null},J=s(8443);let V={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"},Y=Object.entries({ALLOY:"alloy",ASH:"ash",BALAD:"ballad",CORAL:"coral",ECHO:"echo",FABLE:"fable",NOVA:"nova",ONYX:"onyx",SAGE:"sage",SHIMMER:"shimmer"}).map(e=>{let[t,s]=e;return{value:s,label:V[t]}}),X=[{value:J.KP.CHAT,label:"/v1/chat/completions"},{value:J.KP.RESPONSES,label:"/v1/responses"},{value:J.KP.ANTHROPIC_MESSAGES,label:"/v1/messages"},{value:J.KP.IMAGE,label:"/v1/images/generations"},{value:J.KP.IMAGE_EDITS,label:"/v1/images/edits"},{value:J.KP.EMBEDDINGS,label:"/v1/embeddings"},{value:J.KP.SPEECH,label:"/v1/audio/speech"},{value:J.KP.TRANSCRIPTION,label:"/v1/audio/transcriptions"},{value:J.KP.A2A_AGENTS,label:"/v1/a2a/message/send"}];var $=s(88712),Q=s(27930),ee=s(66830),et=s(82971),es=e=>{let{endpointType:t,onEndpointChange:s,className:r}=e;return(0,a.jsx)("div",{className:r,children:(0,a.jsx)(C.default,{showSearch:!0,value:t,style:{width:"100%"},onChange:s,options:X,className:"rounded-md",filterOption:(e,t)=>{var s,a;return(null!==(s=null==t?void 0:t.label)&&void 0!==s?s:"").toLowerCase().includes(e.toLowerCase())||(null!==(a=null==t?void 0:t.value)&&void 0!==a?a:"").toLowerCase().includes(e.toLowerCase())}})})},ea=s(85498),er=s(19250);async function en(e,t,s,a){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],n=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,i=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0;if(!a)throw Error("Virtual Key is required");console.log=function(){};let x=(0,er.getProxyBaseUrl)(),g={};r&&r.length>0&&(g["x-litellm-tags"]=r.join(","));let p=new ea.ZP({apiKey:a,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:g});try{let r=Date.now(),g=!1,h=u&&u.length>0?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",allowed_tools:u,headers:{"x-litellm-api-key":"Bearer ".concat(a)}}]:void 0,f={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&&(f.vector_store_ids=d),m&&(f.guardrails=m),h&&(f.tools=h,f.tool_choice="auto"),p.messages.stream(f,{signal:n}))){if(console.log("Stream event:",e),"content_block_delta"===e.type){let a=e.delta;if(!g){g=!0;let e=Date.now()-r;console.log("First token received! Time:",e,"ms"),l&&l(e)}"text_delta"===a.type?t("assistant",a.text,s):"reasoning_delta"===a.type&&o&&o(a.text)}if("message_delta"===e.type&&e.usage&&i){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};i(s)}}}catch(e){throw(null==n?void 0:n.aborted)?console.log("Anthropic messages request was cancelled"):K.Z.fromBackend("Error occurred while generating model response. Please try again. Error: ".concat(e)),e}}var eo=s(7271);async function el(e,t,s,a,r,n,o,l,i){console.log=function(){},console.log("isLocal:",!1);let c=(0,er.getProxyBaseUrl)(),d=new eo.ZP.OpenAI({apiKey:r,baseURL:c,dangerouslyAllowBrowser:!0,defaultHeaders:n&&n.length>0?{"x-litellm-tags":n.join(",")}:void 0});try{let r=await d.audio.speech.create({model:a,input:e,voice:t,...l?{response_format:l}:{},...i?{speed:i}:{}},{signal:o}),n=await r.blob(),c=URL.createObjectURL(n);s(c,a)}catch(e){throw(null==o?void 0:o.aborted)?console.log("Audio speech request was cancelled"):K.Z.fromBackend("Error occurred while generating speech. Please try again. Error: ".concat(e)),e}}async function ei(e,t,s,a,r,n,o,l,i,c){console.log=function(){},console.log("isLocal:",!1);let d=(0,er.getProxyBaseUrl)(),m=new eo.ZP.OpenAI({apiKey:a,baseURL:d,dangerouslyAllowBrowser:!0,defaultHeaders:r&&r.length>0?{"x-litellm-tags":r.join(",")}:void 0});try{console.log("Processing audio file for transcription:",e.name);let a=await m.audio.transcriptions.create({model:s,file:e,...o?{language:o}:{},...l?{prompt:l}:{},...i?{response_format:i}:{},...void 0!==c?{temperature:c}:{}},{signal:n});if(console.log("Transcription response:",a),a&&a.text)t(a.text,s),K.Z.success("Audio transcribed successfully");else throw Error("No transcription text in response")}catch(e){if(console.error("Error making audio transcription request:",e),null==n?void 0:n.aborted)console.log("Audio transcription request was cancelled");else{var u;let t="Failed to transcribe audio";(null==e?void 0:null===(u=e.error)||void 0===u?void 0:u.message)?t=e.error.message:(null==e?void 0:e.message)&&(t=e.message),K.Z.fromBackend("Audio transcription failed: ".concat(t))}throw e}}var ec=s(95459);async function ed(e,t,s,a,r){if(!a)throw Error("Virtual Key is required");console.log=function(){};let n=(0,er.getProxyBaseUrl)(),o={};r&&r.length>0&&(o["x-litellm-tags"]=r.join(","));try{var l,i,c;let r=n.endsWith("/")?n.slice(0,-1):n,d=await fetch("".concat(r,"/embeddings"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a),...o},body:JSON.stringify({model:s,input:e})});if(!d.ok){let e=await d.text();throw Error(e||"Request failed with status ".concat(d.status))}let m=await d.json(),u=null==m?void 0:null===(i=m.data)||void 0===i?void 0:null===(l=i[0])||void 0===l?void 0:l.embedding;if(!u)throw Error("No embedding returned from server");t(JSON.stringify(u),null!==(c=null==m?void 0:m.model)&&void 0!==c?c:s)}catch(e){throw K.Z.fromBackend("Error occurred while making embeddings request. Please try again. Error: ".concat(e)),e}}async function em(e){try{return(await (0,er.mcpToolsCall)(e)).tools||[]}catch(e){return console.error("Error fetching MCP tools:",e),[]}}var eu=s(10703);async function ex(e,t,s,a,r,n,o){console.log=function(){},console.log("isLocal:",!1);let l=(0,er.getProxyBaseUrl)(),i=new eo.ZP.OpenAI({apiKey:r,baseURL:l,dangerouslyAllowBrowser:!0,defaultHeaders:n&&n.length>0?{"x-litellm-tags":n.join(",")}:void 0});try{let r=Array.isArray(e)?e:[e],n=[];for(let e=0;e1&&K.Z.success("Successfully processed ".concat(n.length," images"))}catch(e){if(console.error("Error making image edit request:",e),null==o?void 0:o.aborted)console.log("Image edits request was cancelled");else{var c;let t="Failed to edit image(s)";(null==e?void 0:null===(c=e.error)||void 0===c?void 0:c.message)?t=e.error.message:(null==e?void 0:e.message)&&(t=e.message),K.Z.fromBackend("Image edit failed: ".concat(t))}throw e}}async function eg(e,t,s,a,r,n){console.log=function(){},console.log("isLocal:",!1);let o=(0,er.getProxyBaseUrl)(),l=new eo.ZP.OpenAI({apiKey:a,baseURL:o,dangerouslyAllowBrowser:!0,defaultHeaders:r&&r.length>0?{"x-litellm-tags":r.join(",")}:void 0});try{let a=await l.images.generate({model:s,prompt:e},{signal:n});if(console.log(a.data),a.data&&a.data[0]){if(a.data[0].url)t(a.data[0].url,s);else if(a.data[0].b64_json){let e=a.data[0].b64_json;t("data:image/png;base64,".concat(e),s)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==n?void 0:n.aborted)?console.log("Image generation request was cancelled"):K.Z.fromBackend("Error occurred while generating image. Please try again. Error: ".concat(e)),e}}async function ep(e,t,s,a){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],n=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,i=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0,x=arguments.length>13?arguments[13]:void 0,g=arguments.length>14?arguments[14]:void 0,p=arguments.length>15?arguments[15]:void 0,h=arguments.length>16?arguments[16]:void 0,f=arguments.length>17?arguments[17]:void 0;if(!a)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 v=(0,er.getProxyBaseUrl)(),b={};r&&r.length>0&&(b["x-litellm-tags"]=r.join(","));let y=new eo.ZP.OpenAI({apiKey:a,baseURL:v,dangerouslyAllowBrowser:!0,defaultHeaders:b});try{let a=Date.now(),r=!1,v=e.map(e=>(Array.isArray(e.content),{role:e.role,content:e.content,type:"message"})),b=[];u&&u.length>0&&b.push({type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never",allowed_tools:u}),h&&b.push({type:"code_interpreter",container:{type:"auto"}});let A=await y.responses.create({model:s,input:v,stream:!0,litellm_trace_id:c,...x?{previous_response_id:x}:{},...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},...b.length>0?{tools:b,tool_choice:"auto"}:{}},{signal:n}),Z="",_={code:"",containerId:""};for await(let e of A)if(console.log("Response event:",e),"object"==typeof e&&null!==e){var j,N,w,S,k,C,P;if(((null===(j=e.type)||void 0===j?void 0:j.startsWith("response.mcp_"))||"response.output_item.done"===e.type&&((null===(N=e.item)||void 0===N?void 0:N.type)==="mcp_list_tools"||(null===(w=e.item)||void 0===w?void 0:w.type)==="mcp_call"))&&(console.log("MCP event received:",e),p)){let t={type:e.type,sequence_number:e.sequence_number,output_index:e.output_index,item_id:e.item_id||(null===(C=e.item)||void 0===C?void 0:C.id),item:e.item,delta:e.delta,arguments:e.arguments,timestamp:Date.now()};p(t)}if("response.output_item.done"===e.type&&(null===(S=e.item)||void 0===S?void 0:S.type)==="mcp_call"&&(null===(k=e.item)||void 0===k?void 0:k.name)&&(Z=e.item.name,console.log("MCP tool used:",Z)),_=function(e,t){var s;return"response.output_item.done"===e.type&&(null===(s=e.item)||void 0===s?void 0:s.type)==="code_interpreter_call"?(console.log("Code interpreter call completed:",e.item),{code:e.item.code||"",containerId:e.item.container_id||""}):t}(e,_),!function(e,t,s){var a,r;if("response.output_item.done"===e.type&&(null===(a=e.item)||void 0===a?void 0:a.type)==="message"&&(null===(r=e.item)||void 0===r?void 0:r.content)&&s){for(let a of e.item.content)if("output_text"===a.type&&a.annotations){let e=a.annotations.filter(e=>"container_file_citation"===e.type);(e.length>0||t.code)&&s({code:t.code,containerId:t.containerId,annotations:e})}}}(e,_,f),"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.trim().length>0&&(t("assistant",n,s),!r)){r=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),l&&l(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let t=e.delta;"string"==typeof t&&o&&o(t)}if("response.completed"===e.type&&"response"in e){let t=e.response,s=t.usage;if(console.log("Usage data:",s),console.log("Response completed event:",t),t.id&&g&&(console.log("Response ID for session management:",t.id),g(t.id)),s&&i){console.log("Usage data:",s);let e={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.total_tokens};(null===(P=s.completion_tokens_details)||void 0===P?void 0:P.reasoning_tokens)&&(e.reasoningTokens=s.completion_tokens_details.reasoning_tokens),i(e,Z)}}}return A}catch(e){throw(null==n?void 0:n.aborted)?console.log("Responses API request was cancelled"):K.Z.fromBackend("Error occurred while generating model response. Please try again. Error: ".concat(e)),e}}var eh=s(44851),ef=s(41589),ev=s(73879),eb=s(38434),ey=e=>{let{code:t,containerId:s,annotations:n=[],accessToken:o}=e,[l,i]=(0,I.useState)({}),[c,d]=(0,I.useState)({}),m=(0,er.getProxyBaseUrl)();(0,I.useEffect)(()=>{let e=async()=>{for(let r of n){var e,t,s,a;if(((null===(e=r.filename)||void 0===e?void 0:e.toLowerCase().endsWith(".png"))||(null===(t=r.filename)||void 0===t?void 0:t.toLowerCase().endsWith(".jpg"))||(null===(s=r.filename)||void 0===s?void 0:s.toLowerCase().endsWith(".jpeg"))||(null===(a=r.filename)||void 0===a?void 0:a.toLowerCase().endsWith(".gif")))&&r.container_id&&r.file_id){d(e=>({...e,[r.file_id]:!0}));try{let e=await fetch("".concat(m,"/v1/containers/").concat(r.container_id,"/files/").concat(r.file_id,"/content"),{headers:{Authorization:"Bearer ".concat(o)}});if(e.ok){let t=await e.blob(),s=URL.createObjectURL(t);i(e=>({...e,[r.file_id]:s}))}}catch(e){console.error("Error fetching image:",e)}finally{d(e=>({...e,[r.file_id]:!1}))}}}};return n.length>0&&o&&e(),()=>{Object.values(l).forEach(e=>URL.revokeObjectURL(e))}},[n,o,m]);let u=async e=>{try{let t=await fetch("".concat(m,"/v1/containers/").concat(e.container_id,"/files/").concat(e.file_id,"/content"),{headers:{Authorization:"Bearer ".concat(o)}});if(t.ok){let s=await t.blob(),a=URL.createObjectURL(s),r=document.createElement("a");r.href=a,r.download=e.filename||"file_".concat(e.file_id),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a)}}catch(e){console.error("Error downloading file:",e)}},x=n.filter(e=>{var t,s,a,r;return(null===(t=e.filename)||void 0===t?void 0:t.toLowerCase().endsWith(".png"))||(null===(s=e.filename)||void 0===s?void 0:s.toLowerCase().endsWith(".jpg"))||(null===(a=e.filename)||void 0===a?void 0:a.toLowerCase().endsWith(".jpeg"))||(null===(r=e.filename)||void 0===r?void 0:r.toLowerCase().endsWith(".gif"))}),g=n.filter(e=>{var t,s,a,r;return!(null===(t=e.filename)||void 0===t?void 0:t.toLowerCase().endsWith(".png"))&&!(null===(s=e.filename)||void 0===s?void 0:s.toLowerCase().endsWith(".jpg"))&&!(null===(a=e.filename)||void 0===a?void 0:a.toLowerCase().endsWith(".jpeg"))&&!(null===(r=e.filename)||void 0===r?void 0:r.toLowerCase().endsWith(".gif"))});return t||0!==n.length?(0,a.jsxs)("div",{className:"mt-3 space-y-3",children:[t&&(0,a.jsx)(eh.default,{size:"small",items:[{key:"code",label:(0,a.jsxs)("span",{className:"flex items-center gap-2 text-sm text-gray-600",children:[(0,a.jsx)(h.Z,{})," Python Code Executed"]}),children:(0,a.jsx)(R.Z,{language:"python",style:L.Z,customStyle:{margin:0,borderRadius:"6px",fontSize:"12px",maxHeight:"300px",overflow:"auto"},children:t})}]}),x.map(e=>(0,a.jsx)("div",{className:"rounded-lg border border-gray-200 overflow-hidden",children:c[e.file_id]?(0,a.jsxs)("div",{className:"flex items-center justify-center p-8 bg-gray-50",children:[(0,a.jsx)(_.Z,{indicator:(0,a.jsx)(r.Z,{spin:!0})}),(0,a.jsx)("span",{className:"ml-2 text-sm text-gray-500",children:"Loading image..."})]}):l[e.file_id]?(0,a.jsxs)("div",{children:[(0,a.jsx)("img",{src:l[e.file_id],alt:e.filename||"Generated chart",className:"max-w-full",style:{maxHeight:"400px"}}),(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-50 border-t border-gray-200",children:[(0,a.jsxs)("span",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,a.jsx)(ef.Z,{})," ",e.filename]}),(0,a.jsxs)("button",{onClick:()=>u(e),className:"text-xs text-blue-500 hover:text-blue-700 flex items-center gap-1",children:[(0,a.jsx)(ev.Z,{})," Download"]})]})]}):(0,a.jsx)("div",{className:"flex items-center justify-center p-4 bg-gray-50",children:(0,a.jsx)("span",{className:"text-sm text-gray-400",children:"Image not available"})})},e.file_id)),g.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:g.map(e=>(0,a.jsxs)("button",{onClick:()=>u(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,a.jsx)(eb.Z,{className:"text-blue-500"}),(0,a.jsx)("span",{className:"text-sm",children:e.filename}),(0,a.jsx)(ev.Z,{className:"text-gray-400"})]},e.file_id))})]}):null},ej=s(91643),eN=s(26832),ew=s(83669),eS=s(29271),ek=s(5540),eC=s(23639),eP=s(62272),eA=s(70464),eZ=s(77565);let e_=e=>{switch(e){case"completed":return(0,a.jsx)(ew.Z,{className:"text-green-500"});case"working":case"submitted":return(0,a.jsx)(r.Z,{className:"text-blue-500"});case"failed":case"canceled":return(0,a.jsx)(eS.Z,{className:"text-red-500"});default:return(0,a.jsx)(ek.Z,{className:"text-gray-500"})}},eE=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"}},eI=e=>{if(!e)return null;try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return e}},eT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.length>t?"".concat(e.substring(0,t),"…"):e:null},eR=e=>{navigator.clipboard.writeText(e)};var eL=e=>{let{a2aMetadata:t,timeToFirstToken:s,totalLatency:r}=e,[n,o]=(0,I.useState)(!1);if(!t&&!s&&!r)return null;let{taskId:l,contextId:c,status:d,metadata:m}=t||{},u=eI(null==d?void 0:d.timestamp);return(0,a.jsxs)("div",{className:"a2a-metrics mt-3 pt-2 border-t border-gray-200 text-xs",children:[(0,a.jsxs)("div",{className:"flex items-center mb-2 text-gray-600",children:[(0,a.jsx)(i.Z,{className:"mr-1.5 text-blue-500"}),(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"A2A Metadata"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-gray-500 ml-4",children:[(null==d?void 0:d.state)&&(0,a.jsxs)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ".concat(eE(d.state)),children:[e_(d.state),(0,a.jsx)("span",{className:"ml-1 capitalize",children:d.state})]}),u&&(0,a.jsx)(Z.Z,{title:null==d?void 0:d.timestamp,children:(0,a.jsxs)("span",{className:"flex items-center",children:[(0,a.jsx)(ek.Z,{className:"mr-1"}),u]})}),void 0!==r&&(0,a.jsx)(Z.Z,{title:"Total latency",children:(0,a.jsxs)("span",{className:"flex items-center text-blue-600",children:[(0,a.jsx)(ek.Z,{className:"mr-1"}),(r/1e3).toFixed(2),"s"]})}),void 0!==s&&(0,a.jsx)(Z.Z,{title:"Time to first token",children:(0,a.jsxs)("span",{className:"flex items-center text-green-600",children:["TTFT: ",(s/1e3).toFixed(2),"s"]})})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-gray-500 ml-4 mt-1.5",children:[l&&(0,a.jsx)(Z.Z,{title:"Click to copy: ".concat(l),children:(0,a.jsxs)("span",{className:"flex items-center cursor-pointer hover:text-gray-700",onClick:()=>eR(l),children:[(0,a.jsx)(eb.Z,{className:"mr-1"}),"Task: ",eT(l),(0,a.jsx)(eC.Z,{className:"ml-1 text-gray-400 hover:text-gray-600"})]})}),c&&(0,a.jsx)(Z.Z,{title:"Click to copy: ".concat(c),children:(0,a.jsxs)("span",{className:"flex items-center cursor-pointer hover:text-gray-700",onClick:()=>eR(c),children:[(0,a.jsx)(eP.Z,{className:"mr-1"}),"Session: ",eT(c),(0,a.jsx)(eC.Z,{className:"ml-1 text-gray-400 hover:text-gray-600"})]})}),(m||(null==d?void 0:d.message))&&(0,a.jsxs)(A.ZP,{type:"text",size:"small",className:"text-xs text-blue-500 hover:text-blue-700 p-0 h-auto",onClick:()=>o(!n),children:[n?(0,a.jsx)(eA.Z,{}):(0,a.jsx)(eZ.Z,{}),(0,a.jsx)("span",{className:"ml-1",children:"Details"})]})]}),n&&(0,a.jsxs)("div",{className:"mt-2 ml-4 p-3 bg-gray-50 rounded-md text-gray-600 border border-gray-200",children:[(null==d?void 0:d.message)&&(0,a.jsxs)("div",{className:"mb-2",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"Status Message:"}),(0,a.jsx)("span",{className:"ml-2",children:d.message})]}),l&&(0,a.jsxs)("div",{className:"mb-1.5 flex items-center",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700 w-24",children:"Task ID:"}),(0,a.jsx)("code",{className:"ml-2 px-2 py-1 bg-white border border-gray-200 rounded text-xs font-mono",children:l}),(0,a.jsx)(eC.Z,{className:"ml-2 cursor-pointer text-gray-400 hover:text-blue-500",onClick:()=>eR(l)})]}),c&&(0,a.jsxs)("div",{className:"mb-1.5 flex items-center",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700 w-24",children:"Session ID:"}),(0,a.jsx)("code",{className:"ml-2 px-2 py-1 bg-white border border-gray-200 rounded text-xs font-mono",children:c}),(0,a.jsx)(eC.Z,{className:"ml-2 cursor-pointer text-gray-400 hover:text-blue-500",onClick:()=>eR(c)})]}),m&&Object.keys(m).length>0&&(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"Custom Metadata:"}),(0,a.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(m,null,2)})]})]})]})},eO=s(29),eU=s.n(eO);let{Text:eM}=k.default,{Panel:eK}=eh.default;var eD=e=>{var t,s;let{events:r,className:n}=e;if(console.log("MCPEventsDisplay: Received events:",r),!r||0===r.length)return console.log("MCPEventsDisplay: No events, returning null"),null;let o=r.find(e=>{var t;return"response.output_item.done"===e.type&&(null===(t=e.item)||void 0===t?void 0:t.type)==="mcp_list_tools"&&e.item.tools&&e.item.tools.length>0}),l=r.filter(e=>{var t;return"response.output_item.done"===e.type&&(null===(t=e.item)||void 0===t?void 0:t.type)==="mcp_call"});return(console.log("MCPEventsDisplay: toolsEvent:",o),console.log("MCPEventsDisplay: mcpCallEvents:",l),o||0!==l.length)?(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac "+"mcp-events-display ".concat(n||""),children:[(0,a.jsx)(eU(),{id:"32b14b04f420f3ac",children:'.openai-mcp-tools.jsx-32b14b04f420f3ac{position:relative;margin:0;padding:0}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse.jsx-32b14b04f420f3ac{background:transparent!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-item.jsx-32b14b04f420f3ac{border:none!important;background:transparent!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac{padding:0 0 0 20px!important;background:transparent!important;border:none!important;font-size:14px!important;color:#9ca3af!important;font-weight:400!important;line-height:20px!important;min-height:20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac:hover{background:transparent!important;color:#6b7280!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content.jsx-32b14b04f420f3ac{border:none!important;background:transparent!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{position:absolute!important;left:2px!important;top:2px!important;color:#9ca3af!important;font-size:10px!important;width:16px!important;height:16px!important;display:-webkit-box!important;display:-webkit-flex!important;display:-moz-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center!important;-webkit-align-items:center!important;-moz-box-align:center!important;-ms-flex-align:center!important;align-items:center!important;-webkit-box-pack:center!important;-webkit-justify-content:center!important;-moz-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac:hover{color:#6b7280!important}.openai-vertical-line.jsx-32b14b04f420f3ac{position:absolute;left:9px;top:18px;bottom:0;width:.5px;background-color:#f3f4f6;opacity:.8}.tool-item.jsx-32b14b04f420f3ac{font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:13px;color:#4b5563;line-height:18px;padding:0;margin:0;background:white;position:relative;z-index:1}.mcp-section.jsx-32b14b04f420f3ac{margin-bottom:12px;background:white;position:relative;z-index:1}.mcp-section.jsx-32b14b04f420f3ac:last-child{margin-bottom:0}.mcp-section-header.jsx-32b14b04f420f3ac{font-size:13px;color:#6b7280;font-weight:500;margin-bottom:4px}.mcp-code-block.jsx-32b14b04f420f3ac{background:#f9fafb;border:1px solid#f3f4f6;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;padding:8px;font-size:12px}.mcp-json.jsx-32b14b04f420f3ac{font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace;color:#374151;margin:0;white-space:pre-wrap;word-wrap:break-word}.mcp-approved.jsx-32b14b04f420f3ac{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;color:#6b7280}.mcp-checkmark.jsx-32b14b04f420f3ac{color:#10b981;margin-right:6px;font-weight:bold}.mcp-response-content.jsx-32b14b04f420f3ac{font-size:13px;color:#374151;line-height:1.5;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace}'}),(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac openai-mcp-tools",children:[(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac openai-vertical-line"}),(0,a.jsxs)(eh.default,{ghost:!0,size:"small",expandIconPosition:"start",defaultActiveKey:o?["list-tools"]:l.map((e,t)=>"mcp-call-".concat(t)),children:[o&&(0,a.jsx)(eK,{header:"List tools",children:(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac",children:null===(s=o.item)||void 0===s?void 0:null===(t=s.tools)||void 0===t?void 0:t.map((e,t)=>(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac tool-item",children:e.name},t))})},"list-tools"),l.map((e,t)=>{var s,r,n;return(0,a.jsx)(eK,{header:(null===(s=e.item)||void 0===s?void 0:s.name)||"Tool call",children:(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac",children:[(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Request"}),(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-code-block",children:(null===(r=e.item)||void 0===r?void 0:r.arguments)&&(0,a.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,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-approved",children:[(0,a.jsx)("span",{className:"jsx-32b14b04f420f3ac mcp-checkmark",children:"✓"})," Approved"]})}),(null===(n=e.item)||void 0===n?void 0:n.output)&&(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Response"}),(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-response-content",children:e.item.output})]})]})},"mcp-call-".concat(t))})]})]})]}):(console.log("MCPEventsDisplay: No valid events found, returning null"),null)},ez=s(94331),eB=s(38398);let eF=e=>new Promise((t,s)=>{let a=new FileReader;a.onload=()=>{t(a.result.split(",")[1])},a.onerror=s,a.readAsDataURL(e)}),eH=async(e,t)=>{let s=await eF(t),a=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:".concat(a,";base64,").concat(s)}]}},eG=(e,t,s,a)=>{let r="";t&&a&&(r=a.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?"".concat(e," ").concat(r):e};return t&&s&&(n.imagePreviewUrl=s),n},eW=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl;var eq=e=>{let{message:t}=e;if(!eW(t))return null;let s="string"==typeof t.content&&t.content.includes("[PDF attached]");return(0,a.jsx)("div",{className:"mb-2",children:s?(0,a.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,a.jsx)(y.Z,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,a.jsx)("img",{src:t.imagePreviewUrl,alt:"User uploaded image",className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px"}})})},eJ=s(53508);let{Dragger:eV}=S.default;var eY=e=>{let{responsesUploadedImage:t,responsesImagePreviewUrl:s,onImageUpload:r,onRemoveImage:n}=e;return(0,a.jsx)(a.Fragment,{children:!t&&(0,a.jsx)(eV,{beforeUpload:r,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,a.jsx)(Z.Z,{title:"Attach image or PDF",children:(0,a.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,a.jsx)(eJ.Z,{style:{fontSize:"16px"}})})})})})},eX=s(33152),e$=s(63709),eQ=e=>{let{endpointType:t,responsesSessionId:s,useApiSessionManagement:r,onToggleSessionManagement:n}=e;return t!==J.KP.RESPONSES?null:(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Session Management"}),(0,a.jsx)(Z.Z,{title:"Choose between LiteLLM API session management (using previous_response_id) or UI-based session management (using chat history)",children:(0,a.jsx)(u.Z,{className:"text-gray-400",style:{fontSize:"12px"}})})]}),(0,a.jsx)(e$.Z,{checked:r,onChange:n,checkedChildren:"API",unCheckedChildren:"UI",size:"small"})]}),(0,a.jsxs)("div",{className:"text-xs p-2 rounded-md ".concat(s?"bg-green-50 text-green-700 border border-green-200":"bg-blue-50 text-blue-700 border border-blue-200"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(u.Z,{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"".concat(e,": ").concat(t,"...")})()]}),s&&(0,a.jsx)(Z.Z,{title:(0,a.jsxs)("div",{className:"text-xs",children:[(0,a.jsx)("div",{className:"mb-1",children:"Copy response ID to continue session:"}),(0,a.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" \\\n -H "Authorization: Bearer your-api-key" \\\n -H "Content-Type: application/json" \\\n -d \'{\n "model": "your-model",\n "input": [{"role": "user", "content": "your message", "type": "message"}],\n "previous_response_id": "'.concat(s,'",\n "stream": true\n }\'')})]}),overlayStyle:{maxWidth:"500px"},children:(0,a.jsx)("button",{onClick:()=>{s&&(navigator.clipboard.writeText(s),K.Z.success("Response ID copied to clipboard!"))},className:"ml-2 p-1 hover:bg-green-100 rounded transition-colors",children:(0,a.jsx)(eC.Z,{style:{fontSize:"12px"}})})})]}),(0,a.jsx)("div",{className:"text-xs opacity-75 mt-1",children:s?r?"LiteLLM API session active - context maintained server-side":"UI session active - context maintained client-side":r?"LiteLLM will manage session using previous_response_id":"UI will manage session using chat history"})]})]})},e0=s(42264);let e1=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")};var e2=e=>{let{enabled:t,onEnabledChange:s,selectedModel:r,disabled:n=!1}=e,o=e1(r);return(0,a.jsxs)("div",{className:"border border-gray-200 rounded-lg p-3 bg-gradient-to-r from-blue-50 to-purple-50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(h.Z,{className:"text-blue-500"}),(0,a.jsx)(B.x,{className:"font-medium text-gray-700",children:"Code Interpreter"}),(0,a.jsx)(Z.Z,{title:"Run Python code to generate files, charts, and analyze data. Container is created automatically.",children:(0,a.jsx)(u.Z,{className:"text-gray-400 text-xs"})})]}),(0,a.jsx)(e$.Z,{checked:t&&o,onChange:e=>{if(e&&!o){e0.ZP.warning("Code Interpreter is only available for OpenAI models");return}s(e)},disabled:n||!o,size:"small",className:t&&o?"bg-blue-500":""})]}),!o&&(0,a.jsx)("div",{className:"mt-2 pt-2 border-t border-gray-200",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(eS.Z,{className:"text-amber-500 mt-0.5"}),(0,a.jsxs)("div",{className:"text-xs text-gray-600",children:[(0,a.jsx)("span",{children:"Code Interpreter is currently only supported for OpenAI models. "}),(0,a.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"})]})]})})]})};let{TextArea:e4}=w.default,{Dragger:e3}=S.default;var e5=e=>{let{accessToken:t,token:s,userRole:w,userID:S,disabledPersonalKeyCreation:B,proxySettings:F}=e,[H,G]=(0,I.useState)(!1),[V,X]=(0,I.useState)([]),[ea,er]=(0,I.useState)(()=>{let e=sessionStorage.getItem("selectedMCPTools");try{let t=e?JSON.parse(e):[];return Array.isArray(t)?t:t?[t]:[]}catch(e){return console.error("Error parsing selectedMCPTools from sessionStorage",e),[]}}),[eo,eh]=(0,I.useState)(!1),[ef,ev]=(0,I.useState)(()=>{let e=sessionStorage.getItem("apiKeySource");if(e)try{return JSON.parse(e)}catch(e){console.error("Error parsing apiKeySource from sessionStorage",e)}return B?"custom":"session"}),[eb,ew]=(0,I.useState)(()=>sessionStorage.getItem("apiKey")||""),[eS,ek]=(0,I.useState)(""),[eC,eP]=(0,I.useState)(()=>{try{let e=sessionStorage.getItem("chatHistory");return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing chatHistory from sessionStorage",e),[]}}),[eA,eZ]=(0,I.useState)(void 0),[e_,eE]=(0,I.useState)(!1),[eI,eT]=(0,I.useState)([]),[eR,eO]=(0,I.useState)([]),[eU,eM]=(0,I.useState)(void 0),eK=(0,I.useRef)(null),[eF,eW]=(0,I.useState)(()=>sessionStorage.getItem("endpointType")||J.KP.CHAT),[eJ,eV]=(0,I.useState)(!1),e$=(0,I.useRef)(null),[e0,e1]=(0,I.useState)(()=>{let e=sessionStorage.getItem("selectedTags");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedTags from sessionStorage",e),[]}}),[e5,e6]=(0,I.useState)(()=>{let e=sessionStorage.getItem("selectedVoice");if(!e)return"alloy";try{return JSON.parse(e)}catch(t){return e}}),[e7,e8]=(0,I.useState)(()=>{let e=sessionStorage.getItem("selectedVectorStores");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedVectorStores from sessionStorage",e),[]}}),[e9,te]=(0,I.useState)(()=>{let e=sessionStorage.getItem("selectedGuardrails");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedGuardrails from sessionStorage",e),[]}}),[tt,ts]=(0,I.useState)(()=>sessionStorage.getItem("messageTraceId")||null),[ta,tr]=(0,I.useState)(()=>sessionStorage.getItem("responsesSessionId")||null),[tn,to]=(0,I.useState)(()=>{let e=sessionStorage.getItem("useApiSessionManagement");return!e||JSON.parse(e)}),[tl,ti]=(0,I.useState)([]),[tc,td]=(0,I.useState)([]),[tm,tu]=(0,I.useState)(null),[tx,tg]=(0,I.useState)(null),[tp,th]=(0,I.useState)(null),[tf,tv]=(0,I.useState)(null),[tb,ty]=(0,I.useState)(null),[tj,tN]=(0,I.useState)(!1),[tw,tS]=(0,I.useState)(""),[tk,tC]=(0,I.useState)("openai"),[tP,tA]=(0,I.useState)([]),[tZ,t_]=(0,I.useState)(1),[tE,tI]=(0,I.useState)(2048),[tT,tR]=(0,I.useState)(!1),tL=function(){let[e,t]=(0,I.useState)(()=>{let e=sessionStorage.getItem("codeInterpreterEnabled");return!!e&&JSON.parse(e)}),[s,a]=(0,I.useState)(null),r=(0,I.useCallback)(e=>{t(e),sessionStorage.setItem("codeInterpreterEnabled",JSON.stringify(e))},[]),n=(0,I.useCallback)(()=>{a(null)},[]),o=(0,I.useCallback)(()=>{r(!e)},[e,r]);return{enabled:e,result:s,setEnabled:r,setResult:a,clearResult:n,toggle:o}}(),tO=(0,I.useRef)(null),tU=async()=>{let e="session"===ef?t:eb;if(e){eh(!0);try{let t=await em(e);X(t)}catch(e){console.error("Error fetching MCP tools:",e)}finally{eh(!1)}}};(0,I.useEffect)(()=>{H&&tU()},[H,t,eb,ef]),(0,I.useEffect)(()=>{tj&&tS((0,et.L)({apiKeySource:ef,accessToken:t,apiKey:eb,inputMessage:eS,chatHistory:eC,selectedTags:e0,selectedVectorStores:e7,selectedGuardrails:e9,selectedMCPTools:ea,endpointType:eF,selectedModel:eA,selectedSdk:tk,selectedVoice:e5,proxySettings:F}))},[tj,tk,ef,t,eb,eS,eC,e0,e7,e9,ea,eF,eA,F]),(0,I.useEffect)(()=>{let e=setTimeout(()=>{sessionStorage.setItem("chatHistory",JSON.stringify(eC))},500);return()=>{clearTimeout(e)}},[eC]),(0,I.useEffect)(()=>{sessionStorage.setItem("apiKeySource",JSON.stringify(ef)),sessionStorage.setItem("apiKey",eb),sessionStorage.setItem("endpointType",eF),sessionStorage.setItem("selectedTags",JSON.stringify(e0)),sessionStorage.setItem("selectedVectorStores",JSON.stringify(e7)),sessionStorage.setItem("selectedGuardrails",JSON.stringify(e9)),sessionStorage.setItem("selectedMCPTools",JSON.stringify(ea)),sessionStorage.setItem("selectedVoice",e5),eA?sessionStorage.setItem("selectedModel",eA):sessionStorage.removeItem("selectedModel"),tt?sessionStorage.setItem("messageTraceId",tt):sessionStorage.removeItem("messageTraceId"),ta?sessionStorage.setItem("responsesSessionId",ta):sessionStorage.removeItem("responsesSessionId"),sessionStorage.setItem("useApiSessionManagement",JSON.stringify(tn))},[ef,eb,eA,eF,e0,e7,e9,tt,ta,tn,ea,e5]),(0,I.useEffect)(()=>{let e="session"===ef?t:eb;if(!e||!s||!w||!S){console.log("userApiKey or token or userRole or userID is missing = ",e,s,w,S);return}(async()=>{try{if(!e){console.log("userApiKey is missing");return}let t=await (0,eu.p)(e);console.log("Fetched models:",t),eT(t);let s=t.some(e=>e.model_group===eA);t.length&&s||eZ(void 0)}catch(e){console.error("Error fetching model info:",e)}})(),tU()},[t,S,w,ef,eb,s]),(0,I.useEffect)(()=>{let e="session"===ef?t:eb;e&&eF===J.KP.A2A_AGENTS&&(async()=>{try{let t=await (0,ej.o)(e);eO(t),eU&&!t.some(e=>e.agent_name===eU)&&eM(void 0)}catch(e){console.error("Error fetching agents:",e)}})()},[t,ef,eb,eF]),(0,I.useEffect)(()=>{tO.current&&setTimeout(()=>{var e;null===(e=tO.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},100)},[eC]);let tM=(e,t,s)=>{console.log("updateTextUI called with:",e,t,s),eP(a=>{let r=a[a.length-1];if(!r||r.role!==e||r.isImage||r.isAudio)return[...a,{role:e,content:t,model:s}];{var n;let e={...r,content:r.content+t,model:null!==(n=r.model)&&void 0!==n?n:s};return[...a.slice(0,-1),e]}})},tK=e=>{eP(t=>{let s=t[t.length-1];return!s||"assistant"!==s.role||s.isImage||s.isAudio?t.length>0&&"user"===t[t.length-1].role?[...t,{role:"assistant",content:"",reasoningContent:e}]:t:[...t.slice(0,t.length-1),{...s,reasoningContent:(s.reasoningContent||"")+e}]})},tD=e=>{console.log("updateTimingData called with:",e),eP(t=>{let s=t[t.length-1];if(console.log("Current last message:",s),s&&"assistant"===s.role){console.log("Updating assistant message with timeToFirstToken:",e);let a=[...t.slice(0,t.length-1),{...s,timeToFirstToken:e}];return console.log("Updated chat history:",a),a}return s&&"user"===s.role?(console.log("Creating new assistant message with timeToFirstToken:",e),[...t,{role:"assistant",content:"",timeToFirstToken:e}]):(console.log("No appropriate message found to update timing"),t)})},tz=(e,t)=>{console.log("Received usage data:",e),eP(s=>{let a=s[s.length-1];if(a&&"assistant"===a.role){console.log("Updating message with usage data:",e);let r={...a,usage:e,toolName:t};return console.log("Updated message:",r),[...s.slice(0,s.length-1),r]}return s})},tB=e=>{console.log("Received A2A metadata:",e),eP(t=>{let s=t[t.length-1];if(s&&"assistant"===s.role){let a={...s,a2aMetadata:e};return[...t.slice(0,t.length-1),a]}return t})},tF=e=>{eP(t=>{let s=t[t.length-1];return s&&"assistant"===s.role?[...t.slice(0,t.length-1),{...s,totalLatency:e}]:t})},tH=e=>{console.log("Received search results:",e),eP(t=>{let s=t[t.length-1];if(s&&"assistant"===s.role){console.log("Updating message with search results");let a={...s,searchResults:e};return[...t.slice(0,t.length-1),a]}return t})},tG=e=>{console.log("Received response ID for session management:",e),tn&&tr(e)},tW=e=>{console.log("ChatUI: Received MCP event:",e),tA(t=>{if(t.some(t=>t.item_id===e.item_id&&t.type===e.type&&t.sequence_number===e.sequence_number))return console.log("ChatUI: Duplicate MCP event, skipping"),t;let s=[...t,e];return console.log("ChatUI: Updated MCP events:",s),s})},tq=(e,t)=>{eP(s=>[...s,{role:"assistant",content:e,model:t,isImage:!0}])},tJ=(e,t)=>{eP(s=>[...s,{role:"assistant",content:(0,U.aS)(e,100),model:t,isEmbeddings:!0}])},tV=(e,t)=>{eP(s=>[...s,{role:"assistant",content:e,model:t,isAudio:!0}])},tY=(e,t)=>{eP(s=>{let a=s[s.length-1];if(!a||"assistant"!==a.role||a.isImage||a.isAudio)return[...s,{role:"assistant",content:"",model:t,image:{url:e,detail:"auto"}}];{var r;let n={...a,image:{url:e,detail:"auto"},model:null!==(r=a.model)&&void 0!==r?r:t};return[...s.slice(0,-1),n]}})},tX=e=>{ti(t=>[...t,e]);let t=URL.createObjectURL(e);return td(e=>[...e,t]),!1},t$=e=>{tc[e]&&URL.revokeObjectURL(tc[e]),ti(t=>t.filter((t,s)=>s!==e)),td(t=>t.filter((t,s)=>s!==e))},tQ=()=>{tc.forEach(e=>{URL.revokeObjectURL(e)}),ti([]),td([])},t0=()=>{tx&&URL.revokeObjectURL(tx),tu(null),tg(null)},t1=()=>{tf&&URL.revokeObjectURL(tf),th(null),tv(null)},t2=()=>{ty(null)},t4=async()=>{let e;if(""===eS.trim()&&eF!==J.KP.TRANSCRIPTION)return;if(eF===J.KP.IMAGE_EDITS&&0===tl.length){K.Z.fromBackend("Please upload at least one image for editing");return}if(eF===J.KP.TRANSCRIPTION&&!tb){K.Z.fromBackend("Please upload an audio file for transcription");return}if(eF===J.KP.A2A_AGENTS&&!eU){K.Z.fromBackend("Please select an agent to send a message");return}if(eF===J.KP.RESPONSES&&!eA){K.Z.fromBackend("Please select a model before sending a request");return}if(!s||!w||!S)return;let a="session"===ef?t:eb;if(!a){K.Z.fromBackend("Please provide a Virtual Key or select Current UI Session");return}e$.current=new AbortController;let r=e$.current.signal;if(eF===J.KP.RESPONSES&&tm)try{e=await eH(eS,tm)}catch(e){K.Z.fromBackend("Failed to process image. Please try again.");return}else if(eF===J.KP.CHAT&&tp)try{e=await (0,ee.Sn)(eS,tp)}catch(e){K.Z.fromBackend("Failed to process image. Please try again.");return}else e={role:"user",content:eS};let n=tt||(0,O.Z)();tt||ts(n),eP([...eC,eF===J.KP.RESPONSES&&tm?eG(eS,!0,tx||void 0,tm.name):eF===J.KP.CHAT&&tp?(0,ee.Hk)(eS,!0,tf||void 0,tp.name):eF===J.KP.TRANSCRIPTION&&tb?eG(eS?"\uD83C\uDFB5 Audio file: ".concat(tb.name,"\nPrompt: ").concat(eS):"\uD83C\uDFB5 Audio file: ".concat(tb.name),!1):eG(eS,!1)]),tA([]),tL.clearResult(),eV(!0);try{if(eA){if(eF===J.KP.CHAT){let t=[...eC.filter(e=>!e.isImage&&!e.isAudio).map(e=>{let{role:t,content:s}=e;return{role:t,content:"string"==typeof s?s:""}}),e];await (0,ec.n)(t,(e,t)=>tM("assistant",e,t),eA,a,e0,r,tK,tD,tz,n,e7.length>0?e7:void 0,e9.length>0?e9:void 0,ea,tY,tH,tT?tZ:void 0,tT?tE:void 0,tF)}else if(eF===J.KP.IMAGE)await eg(eS,(e,t)=>tq(e,t),eA,a,e0,r);else if(eF===J.KP.SPEECH)await el(eS,e5,(e,t)=>tV(e,t),eA||"",a,e0,r);else if(eF===J.KP.IMAGE_EDITS)tl.length>0&&await ex(1===tl.length?tl[0]:tl,eS,(e,t)=>tq(e,t),eA,a,e0,r);else if(eF===J.KP.RESPONSES){let t;t=tn&&ta?[e]:[...eC.filter(e=>!e.isImage&&!e.isAudio).map(e=>{let{role:t,content:s}=e;return{role:t,content:s}}),e],await ep(t,(e,t,s)=>tM(e,t,s),eA,a,e0,r,tK,tD,tz,n,e7.length>0?e7:void 0,e9.length>0?e9:void 0,ea,tn?ta:null,tG,tW,tL.enabled,tL.setResult)}else if(eF===J.KP.ANTHROPIC_MESSAGES){let t=[...eC.filter(e=>!e.isImage&&!e.isAudio).map(e=>{let{role:t,content:s}=e;return{role:t,content:s}}),e];await en(t,(e,t,s)=>tM(e,t,s),eA,a,e0,r,tK,tD,tz,n,e7.length>0?e7:void 0,e9.length>0?e9:void 0,ea)}else eF===J.KP.EMBEDDINGS?await ed(eS,(e,t)=>tJ(e,t),eA,a,e0):eF===J.KP.TRANSCRIPTION&&tb&&await ei(tb,(e,t)=>tM("assistant",e,t),eA,a,e0,r)}eF===J.KP.A2A_AGENTS&&eU&&await (0,eN.m)(eU,eS,(e,t)=>tM("assistant",e,t),a,r,tD,tF,tB)}catch(e){r.aborted?console.log("Request was cancelled"):(console.error("Error fetching response",e),tM("assistant","Error fetching response:"+e))}finally{eV(!1),e$.current=null,eF===J.KP.IMAGE_EDITS&&tQ(),eF===J.KP.RESPONSES&&tm&&t0(),eF===J.KP.CHAT&&tp&&t1(),eF===J.KP.TRANSCRIPTION&&tb&&t2()}ek("")};if(w&&"Admin Viewer"===w){let{Title:e,Paragraph:t}=k.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(t,{children:"Ask your proxy admin for access to test models"})]})}let t3=(0,a.jsx)(r.Z,{style:{fontSize:24},spin:!0});return(0,a.jsxs)("div",{className:"w-full p-4 pb-0 bg-white",children:[(0,a.jsx)(N.Zb,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,a.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,a.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 overflow-y-auto",children:[(0,a.jsx)(N.Dx,{className:"text-xl font-semibold mb-6 mt-2",children:"Configurations"}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(n.Z,{className:"mr-2"})," Virtual Key Source"]}),(0,a.jsx)(C.default,{disabled:B,value:ef,style:{width:"100%"},onChange:e=>{ev(e)},options:[{value:"session",label:"Current UI Session"},{value:"custom",label:"Virtual Key"}],className:"rounded-md"}),"custom"===ef&&(0,a.jsx)(N.oi,{className:"mt-2",placeholder:"Enter custom Virtual Key",type:"password",onValueChange:ew,value:eb,icon:n.Z})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(o.Z,{className:"mr-2"})," Endpoint Type"]}),(0,a.jsx)(es,{endpointType:eF,onEndpointChange:e=>{eW(e),eZ(void 0),eM(void 0),eE(!1);try{sessionStorage.removeItem("selectedModel"),sessionStorage.removeItem("selectedAgent")}catch(e){}},className:"mb-4"}),eF===J.KP.SPEECH&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(l.Z,{className:"mr-2"}),"Voice"]}),(0,a.jsx)(C.default,{value:e5,onChange:e=>{e6(e),sessionStorage.setItem("selectedVoice",e)},style:{width:"100%"},className:"rounded-md",options:Y})]}),(0,a.jsx)(eQ,{endpointType:eF,responsesSessionId:ta,useApiSessionManagement:tn,onToggleSessionManagement:e=>{to(e),e||tr(null)}})]}),eF!==J.KP.A2A_AGENTS&&(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center justify-between",children:[(0,a.jsxs)("span",{className:"flex items-center",children:[(0,a.jsx)(i.Z,{className:"mr-2"})," Select Model"]}),(()=>{if(!eA||"custom"===eA)return!1;let e=eI.find(e=>e.model_group===eA);return!!e&&(!e.mode||"chat"===e.mode)})()?(0,a.jsx)(P.Z,{content:(0,a.jsx)(W,{temperature:tZ,maxTokens:tE,useAdvancedParams:tT,onTemperatureChange:t_,onMaxTokensChange:tI,onUseAdvancedParamsChange:tR}),title:"Model Settings",trigger:"click",placement:"right",children:(0,a.jsx)(A.ZP,{type:"text",size:"small",icon:(0,a.jsx)(c.Z,{}),className:"text-gray-500 hover:text-gray-700"})}):(0,a.jsx)(Z.Z,{title:"Advanced parameters are only supported for chat models currently",children:(0,a.jsx)(A.ZP,{type:"text",size:"small",icon:(0,a.jsx)(c.Z,{}),className:"text-gray-300 cursor-not-allowed",disabled:!0})})]}),(0,a.jsx)(C.default,{value:eA,placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),eZ(e),eE("custom"===e)},options:[{value:"custom",label:"Enter custom model",key:"custom"},...Array.from(new Set(eI.filter(e=>{if(!e.mode)return!0;let t=(0,J.vf)(e.mode);return eF===J.KP.RESPONSES||eF===J.KP.ANTHROPIC_MESSAGES?t===eF||t===J.KP.CHAT:eF===J.KP.IMAGE_EDITS?t===eF||t===J.KP.IMAGE:t===eF}).map(e=>e.model_group))).map((e,t)=>({value:e,label:e,key:t}))],style:{width:"100%"},showSearch:!0,className:"rounded-md"}),e_&&(0,a.jsx)(N.oi,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{eK.current&&clearTimeout(eK.current),eK.current=setTimeout(()=>{eZ(e)},500)}})]}),eF===J.KP.A2A_AGENTS&&(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(i.Z,{className:"mr-2"})," Select Agent"]}),(0,a.jsx)(C.default,{value:eU,placeholder:"Select an Agent",onChange:e=>eM(e),options:eR.map(e=>({value:e.agent_name,label:e.agent_name||e.agent_id,key:e.agent_id})),style:{width:"100%"},showSearch:!0,className:"rounded-md",optionLabelProp:"label",children:eR.map(e=>{var t;return(0,a.jsx)(C.default.Option,{value:e.agent_name,label:e.agent_name||e.agent_id,children:(0,a.jsxs)("div",{className:"flex flex-col py-1",children:[(0,a.jsx)("span",{className:"font-medium",children:e.agent_name||e.agent_id}),(null===(t=e.agent_card_params)||void 0===t?void 0:t.description)&&(0,a.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.agent_card_params.description})]})},e.agent_id)})}),0===eR.length&&(0,a.jsx)(N.xv,{className:"text-xs text-gray-500 mt-2 block",children:"No agents found. Create agents via /v1/agents endpoint."})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(d.Z,{className:"mr-2"})," Tags"]}),(0,a.jsx)(D.Z,{value:e0,onChange:e1,className:"mb-4",accessToken:t||""})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(m.Z,{className:"mr-2"})," MCP Tool",(0,a.jsx)(Z.Z,{className:"ml-1",title:"Select MCP tools to use in your conversation, only available for /v1/responses endpoint",children:(0,a.jsx)(u.Z,{})})]}),(0,a.jsx)(C.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select MCP tools",value:ea,onChange:e=>er(e),loading:eo,className:"mb-4",allowClear:!0,optionLabelProp:"label",disabled:eF!==J.KP.RESPONSES,maxTagCount:"responsive",children:Array.isArray(V)&&V.map(e=>(0,a.jsx)(C.default.Option,{value:e.name,label:(0,a.jsx)("div",{className:"font-medium",children:e.name}),children:(0,a.jsxs)("div",{className:"flex flex-col py-1",children:[(0,a.jsx)("span",{className:"font-medium",children:e.name}),(0,a.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(x.Z,{className:"mr-2"})," Vector Store",(0,a.jsx)(Z.Z,{className:"ml-1",title:(0,a.jsxs)("span",{children:["Select vector store(s) to use for this LLM API call. You can set up your vector store"," ",(0,a.jsx)("a",{href:"?page=vector-stores",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,a.jsx)(u.Z,{})})]}),(0,a.jsx)(z.Z,{value:e7,onChange:e8,className:"mb-4",accessToken:t||""})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(g.Z,{className:"mr-2"})," Guardrails",(0,a.jsx)(Z.Z,{className:"ml-1",title:(0,a.jsxs)("span",{children:["Select guardrail(s) to use for this LLM API call. You can set up your guardrails"," ",(0,a.jsx)("a",{href:"?page=guardrails",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,a.jsx)(u.Z,{})})]}),(0,a.jsx)(M.Z,{value:e9,onChange:te,className:"mb-4",accessToken:t||""})]}),eF===J.KP.RESPONSES&&(0,a.jsx)("div",{children:(0,a.jsx)(e2,{accessToken:"session"===ef?t||"":eb,enabled:tL.enabled,onEnabledChange:tL.setEnabled,selectedContainerId:null,onContainerChange:()=>{},selectedModel:eA||""})})]})]}),(0,a.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,a.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,a.jsx)(N.Dx,{className:"text-xl font-semibold mb-0",children:"Test Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(N.zx,{onClick:()=>{eC.forEach(e=>{e.isAudio&&"string"==typeof e.content&&URL.revokeObjectURL(e.content)}),eP([]),ts(null),tr(null),tA([]),tQ(),t0(),t1(),t2(),sessionStorage.removeItem("chatHistory"),sessionStorage.removeItem("messageTraceId"),sessionStorage.removeItem("responsesSessionId"),K.Z.success("Chat history cleared.")},className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:p.Z,children:"Clear Chat"}),(0,a.jsx)(N.zx,{onClick:()=>tN(!0),className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:h.Z,children:"Get Code"})]})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===eC.length&&(0,a.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,a.jsx)(i.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,a.jsx)(N.xv,{children:"Start a conversation, generate an image, or handle audio"})]}),eC.map((e,s)=>(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"mb-4 ".concat("user"===e.role?"text-right":"text-left"),children:(0,a.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===e.role?"#f0f8ff":"#ffffff",border:"user"===e.role?"1px solid #e6f0fa":"1px solid #f0f0f0",textAlign:"left"},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===e.role?"#e6f0fa":"#f5f5f5"},children:"user"===e.role?(0,a.jsx)(f.Z,{style:{fontSize:"12px",color:"#2563eb"}}):(0,a.jsx)(i.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,a.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,a.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,a.jsx)(ez.Z,{reasoningContent:e.reasoningContent}),"assistant"===e.role&&s===eC.length-1&&tP.length>0&&eF===J.KP.RESPONSES&&(0,a.jsx)("div",{className:"mb-3",children:(0,a.jsx)(eD,{events:tP})}),"assistant"===e.role&&e.searchResults&&(0,a.jsx)(eX.J,{searchResults:e.searchResults}),"assistant"===e.role&&s===eC.length-1&&tL.result&&eF===J.KP.RESPONSES&&(0,a.jsx)(ey,{code:tL.result.code,containerId:tL.result.containerId,annotations:tL.result.annotations,accessToken:"session"===ef?t||"":eb}),(0,a.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,a.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,a.jsx)(q,{message:e}):(0,a.jsxs)(a.Fragment,{children:[eF===J.KP.RESPONSES&&(0,a.jsx)(eq,{message:e}),eF===J.KP.CHAT&&(0,a.jsx)($.Z,{message:e}),(0,a.jsx)(T.UG,{components:{code(e){let{node:t,inline:s,className:r,children:n,...o}=e,l=/language-(\w+)/.exec(r||"");return!s&&l?(0,a.jsx)(R.Z,{style:L.Z,language:l[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...o,children:String(n).replace(/\n$/,"")}):(0,a.jsx)("code",{className:"".concat(r," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),style:{wordBreak:"break-word"},...o,children:n})},pre:e=>{let{node:t,...s}=e;return(0,a.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...s})}},children:"string"==typeof e.content?e.content:""}),e.image&&(0,a.jsx)("div",{className:"mt-3",children:(0,a.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,a.jsx)(eB.Z,{timeToFirstToken:e.timeToFirstToken,totalLatency:e.totalLatency,usage:e.usage,toolName:e.toolName}),"assistant"===e.role&&e.a2aMetadata&&(0,a.jsx)(eL,{a2aMetadata:e.a2aMetadata,timeToFirstToken:e.timeToFirstToken,totalLatency:e.totalLatency})]})]})})},s)),eJ&&tP.length>0&&eF===J.KP.RESPONSES&&eC.length>0&&"user"===eC[eC.length-1].role&&(0,a.jsx)("div",{className:"text-left mb-4",children:(0,a.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"#ffffff",border:"1px solid #f0f0f0",textAlign:"left"},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"#f5f5f5"},children:(0,a.jsx)(i.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,a.jsx)("strong",{className:"text-sm capitalize",children:"Assistant"})]}),(0,a.jsx)(eD,{events:tP})]})}),eJ&&(0,a.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,a.jsx)(_.Z,{indicator:t3})}),(0,a.jsx)("div",{ref:tO,style:{height:"1px"}})]}),(0,a.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[eF===J.KP.IMAGE_EDITS&&(0,a.jsx)("div",{className:"mb-4",children:0===tl.length?(0,a.jsxs)(e3,{beforeUpload:tX,accept:"image/*",showUploadList:!1,children:[(0,a.jsx)("p",{className:"ant-upload-drag-icon",children:(0,a.jsx)(v.Z,{style:{fontSize:"24px",color:"#666"}})}),(0,a.jsx)("p",{className:"ant-upload-text text-sm",children:"Click or drag images to upload"}),(0,a.jsx)("p",{className:"ant-upload-hint text-xs text-gray-500",children:"Support for PNG, JPG, JPEG formats. Multiple images supported."})]}):(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[tl.map((e,t)=>(0,a.jsxs)("div",{className:"relative inline-block",children:[(0,a.jsx)("img",{src:tc[t]||"",alt:"Upload preview ".concat(t+1),className:"max-w-32 max-h-32 rounded-md border border-gray-200 object-cover"}),(0,a.jsx)("button",{className:"absolute top-1 right-1 bg-white shadow-sm border border-gray-200 rounded px-1 py-1 text-red-500 hover:bg-red-50 text-xs",onClick:()=>t$(t),children:(0,a.jsx)(b.Z,{})})]},t)),(0,a.jsxs)("div",{className:"flex items-center justify-center w-32 h-32 border-2 border-dashed border-gray-300 rounded-md hover:border-gray-400 cursor-pointer",onClick:()=>{var e;return null===(e=document.getElementById("additional-image-upload"))||void 0===e?void 0:e.click()},children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(v.Z,{style:{fontSize:"24px",color:"#666"}}),(0,a.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Add more"})]}),(0,a.jsx)("input",{id:"additional-image-upload",type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:e=>{Array.from(e.target.files||[]).forEach(e=>tX(e))}})]})]})}),eF===J.KP.TRANSCRIPTION&&(0,a.jsx)("div",{className:"mb-4",children:tb?(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-1",children:[(0,a.jsx)(l.Z,{style:{fontSize:"20px",color:"#666"}}),(0,a.jsx)("span",{className:"text-sm font-medium",children:tb.name}),(0,a.jsxs)("span",{className:"text-xs text-gray-500",children:["(",(tb.size/1024/1024).toFixed(2)," MB)"]})]}),(0,a.jsxs)("button",{className:"bg-white shadow-sm border border-gray-200 rounded px-2 py-1 text-red-500 hover:bg-red-50 text-xs",onClick:t2,children:[(0,a.jsx)(b.Z,{})," Remove"]})]}):(0,a.jsxs)(e3,{beforeUpload:e=>(ty(e),!1),accept:"audio/*,.mp3,.mp4,.mpeg,.mpga,.m4a,.wav,.webm",showUploadList:!1,children:[(0,a.jsx)("p",{className:"ant-upload-drag-icon",children:(0,a.jsx)(l.Z,{style:{fontSize:"24px",color:"#666"}})}),(0,a.jsx)("p",{className:"ant-upload-text text-sm",children:"Click or drag audio file to upload"}),(0,a.jsx)("p",{className:"ant-upload-hint text-xs text-gray-500",children:"Support for MP3, MP4, MPEG, MPGA, M4A, WAV, WEBM formats. Max file size: 25 MB."})]})}),eF===J.KP.RESPONSES&&tm&&(0,a.jsx)("div",{className:"mb-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,a.jsx)("div",{className:"relative inline-block",children:tm.name.toLowerCase().endsWith(".pdf")?(0,a.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,a.jsx)(y.Z,{style:{fontSize:"16px",color:"white"}})}):(0,a.jsx)("img",{src:tx||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:tm.name}),(0,a.jsx)("div",{className:"text-xs text-gray-500",children:tm.name.toLowerCase().endsWith(".pdf")?"PDF":"Image"})]}),(0,a.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:t0,children:(0,a.jsx)(b.Z,{style:{fontSize:"12px"}})})]})}),eF===J.KP.CHAT&&tp&&(0,a.jsx)("div",{className:"mb-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,a.jsx)("div",{className:"relative inline-block",children:tp.name.toLowerCase().endsWith(".pdf")?(0,a.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,a.jsx)(y.Z,{style:{fontSize:"16px",color:"white"}})}):(0,a.jsx)("img",{src:tf||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:tp.name}),(0,a.jsx)("div",{className:"text-xs text-gray-500",children:tp.name.toLowerCase().endsWith(".pdf")?"PDF":"Image"})]}),(0,a.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:t1,children:(0,a.jsx)(b.Z,{style:{fontSize:"12px"}})})]})}),eF===J.KP.RESPONSES&&tL.enabled&&(0,a.jsxs)("div",{className:"mb-2 space-y-2",children:[(0,a.jsxs)("div",{className:"px-3 py-2 bg-gradient-to-r from-blue-50 to-purple-50 rounded-lg border border-blue-200 flex items-center justify-between",children:[(0,a.jsx)("div",{className:"flex items-center gap-2",children:eJ?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.Z,{className:"text-blue-500",spin:!0}),(0,a.jsx)("span",{className:"text-sm text-blue-700 font-medium",children:"Running Python code..."})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Z,{className:"text-blue-500"}),(0,a.jsx)("span",{className:"text-sm text-blue-700 font-medium",children:"Code Interpreter Active"})]})}),(0,a.jsx)("button",{className:"text-xs text-blue-500 hover:text-blue-700",onClick:()=>tL.setEnabled(!1),children:"Disable"})]}),!eJ&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:["Generate sample sales data CSV and create a chart","Create a PNG bar chart comparing AI gateway providers including LiteLLM","Generate a CSV of LLM pricing data and visualize it as a line chart"].map((e,t)=>(0,a.jsx)("button",{className:"text-xs px-3 py-1.5 bg-white border border-gray-200 rounded-full hover:bg-blue-50 hover:border-blue-300 hover:text-blue-600 transition-colors",onClick:()=>ek(e),children:e},t))})]}),0===eC.length&&!eJ&&(0,a.jsx)("div",{className:"flex items-center gap-2 mb-3 overflow-x-auto",children:(eF===J.KP.A2A_AGENTS?["What can you help me with?","Tell me about yourself","What tasks can you perform?"]:["Write me a poem","Explain quantum computing","Draft a polite email requesting a meeting"]).map(e=>(0,a.jsx)("button",{type:"button",className:"shrink-0 rounded-full border border-gray-200 px-3 py-1 text-xs font-medium text-gray-600 transition-colors hover:bg-blue-50 hover:border-blue-300 hover:text-blue-600 cursor-pointer",onClick:()=>ek(e),children:e},e))}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[(0,a.jsxs)("div",{className:"flex-shrink-0 mr-2 flex items-center gap-1",children:[eF===J.KP.RESPONSES&&!tm&&(0,a.jsx)(eY,{responsesUploadedImage:tm,responsesImagePreviewUrl:tx,onImageUpload:e=>(tu(e),tg(URL.createObjectURL(e)),!1),onRemoveImage:t0}),eF===J.KP.CHAT&&!tp&&(0,a.jsx)(Q.Z,{chatUploadedImage:tp,chatImagePreviewUrl:tf,onImageUpload:e=>(th(e),tv(URL.createObjectURL(e)),!1),onRemoveImage:t1}),eF===J.KP.RESPONSES&&(0,a.jsx)(Z.Z,{title:tL.enabled?"Code Interpreter enabled (click to disable)":"Enable Code Interpreter",children:(0,a.jsx)("button",{className:"p-1.5 rounded-md transition-colors ".concat(tL.enabled?"bg-blue-100 text-blue-600":"text-gray-400 hover:text-gray-600 hover:bg-gray-100"),onClick:()=>{tL.toggle(),tL.enabled||K.Z.success("Code Interpreter enabled!")},children:(0,a.jsx)(h.Z,{style:{fontSize:"16px"}})})})]}),(0,a.jsx)(e4,{value:eS,onChange:e=>ek(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),t4())},placeholder:eF===J.KP.CHAT||eF===J.KP.EMBEDDINGS||eF===J.KP.RESPONSES||eF===J.KP.ANTHROPIC_MESSAGES?"Type your message... (Shift+Enter for new line)":eF===J.KP.A2A_AGENTS?"Send a message to the A2A agent...":eF===J.KP.IMAGE_EDITS?"Describe how you want to edit the image...":eF===J.KP.SPEECH?"Enter text to convert to speech...":eF===J.KP.TRANSCRIPTION?"Optional: Add context or prompt for transcription...":"Describe the image you want to generate...",disabled:eJ,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,a.jsx)(N.zx,{onClick:t4,disabled:eJ||(eF===J.KP.TRANSCRIPTION?!tb:!eS.trim()),className:"flex-shrink-0 ml-2 !w-8 !h-8 !min-w-8 !p-0 !rounded-full !bg-blue-600 hover:!bg-blue-700 disabled:!bg-gray-300 !border-none !text-white disabled:!text-gray-500 !flex !items-center !justify-center",children:(0,a.jsx)(j.Z,{style:{fontSize:"14px"}})})]}),eJ&&(0,a.jsx)(N.zx,{onClick:()=>{e$.current&&(e$.current.abort(),e$.current=null,eV(!1),K.Z.info("Request cancelled"))},className:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200",icon:b.Z,children:"Cancel"})]})]})]})]})}),(0,a.jsxs)(E.Z,{title:"Generated Code",visible:tj,onCancel:()=>tN(!1),footer:null,width:800,children:[(0,a.jsxs)("div",{className:"flex justify-between items-end my-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(N.xv,{className:"font-medium block mb-1 text-gray-700",children:"SDK Type"}),(0,a.jsx)(C.default,{value:tk,onChange:e=>tC(e),style:{width:150},options:[{value:"openai",label:"OpenAI SDK"},{value:"azure",label:"Azure SDK"}]})]}),(0,a.jsx)(A.ZP,{onClick:()=>{navigator.clipboard.writeText(tw),K.Z.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,a.jsx)(R.Z,{language:"python",style:L.Z,wrapLines:!0,wrapLongLines:!0,className:"rounded-md",customStyle:{maxHeight:"60vh",overflowY:"auto"},children:tw})]}),"custom"===ef&&(0,a.jsx)(E.Z,{title:"Select MCP Tool",visible:H,onCancel:()=>G(!1),onOk:()=>{G(!1),K.Z.success("MCP tool selection updated")},width:800,children:eo?(0,a.jsx)("div",{className:"flex justify-center items-center py-8",children:(0,a.jsx)(_.Z,{indicator:(0,a.jsx)(r.Z,{style:{fontSize:24},spin:!0})})}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(N.xv,{className:"text-gray-600 block mb-4",children:"Select the MCP tools you want to use in your conversation."}),(0,a.jsx)(C.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select MCP tools",value:ea,onChange:e=>er(e),optionLabelProp:"label",allowClear:!0,maxTagCount:"responsive",children:V.map(e=>(0,a.jsx)(C.default.Option,{value:e.name,label:(0,a.jsx)("div",{className:"font-medium",children:e.name}),children:(0,a.jsxs)("div",{className:"flex flex-col py-1",children:[(0,a.jsx)("span",{className:"font-medium",children:e.name}),(0,a.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]})})]})}},94331:function(e,t,s){var a=s(57437),r=s(2265),n=s(5545),o=s(62831),l=s(17906),i=s(94263),c=s(83322),d=s(70464),m=s(77565);t.Z=e=>{let{reasoningContent:t}=e,[s,u]=(0,r.useState)(!0);return t?(0,a.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,a.jsxs)(n.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>u(!s),icon:(0,a.jsx)(c.Z,{}),children:[s?"Hide reasoning":"Show reasoning",s?(0,a.jsx)(d.Z,{className:"ml-1"}):(0,a.jsx)(m.Z,{className:"ml-1"})]}),s&&(0,a.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,a.jsx)(o.UG,{components:{code(e){let{node:t,inline:s,className:r,children:n,...o}=e,c=/language-(\w+)/.exec(r||"");return!s&&c?(0,a.jsx)(l.Z,{style:i.Z,language:c[1],PreTag:"div",className:"rounded-md my-2",...o,children:String(n).replace(/\n$/,"")}):(0,a.jsx)("code",{className:"".concat(r," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),...o,children:n})}},children:t})})]}):null}},38398:function(e,t,s){var a=s(57437);s(2265);var r=s(99981),n=s(5540),o=s(71282),l=s(11741),i=s(83322),c=s(16601),d=s(62670),m=s(58630);t.Z=e=>{let{timeToFirstToken:t,totalLatency:s,usage:u,toolName:x}=e;return t||s||u?(0,a.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!==t&&(0,a.jsx)(r.Z,{title:"Time to first token",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(n.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["TTFT: ",(t/1e3).toFixed(2),"s"]})]})}),void 0!==s&&(0,a.jsx)(r.Z,{title:"Total latency",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(n.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Total Latency: ",(s/1e3).toFixed(2),"s"]})]})}),(null==u?void 0:u.promptTokens)!==void 0&&(0,a.jsx)(r.Z,{title:"Prompt tokens",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(o.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["In: ",u.promptTokens]})]})}),(null==u?void 0:u.completionTokens)!==void 0&&(0,a.jsx)(r.Z,{title:"Completion tokens",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(l.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Out: ",u.completionTokens]})]})}),(null==u?void 0:u.reasoningTokens)!==void 0&&(0,a.jsx)(r.Z,{title:"Reasoning tokens",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(i.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Reasoning: ",u.reasoningTokens]})]})}),(null==u?void 0:u.totalTokens)!==void 0&&(0,a.jsx)(r.Z,{title:"Total tokens",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(c.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Total: ",u.totalTokens]})]})}),(null==u?void 0:u.cost)!==void 0&&(0,a.jsx)(r.Z,{title:"Cost",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(d.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["$",u.cost.toFixed(6)]})]})}),x&&(0,a.jsx)(r.Z,{title:"Tool used",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(m.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Tool: ",x]})]})})]}):null}},33152:function(e,t,s){s.d(t,{J:function(){return d}});var a=s(57437),r=s(2265),n=s(5545),o=s(44625),l=s(70464),i=s(77565),c=s(38434);function d(e){let{searchResults:t}=e,[s,d]=(0,r.useState)(!0),[m,u]=(0,r.useState)({});if(!t||0===t.length)return null;let x=(e,t)=>{let s="".concat(e,"-").concat(t);u(e=>({...e,[s]:!e[s]}))},g=t.reduce((e,t)=>e+t.data.length,0);return(0,a.jsxs)("div",{className:"search-results-content mt-1 mb-2",children:[(0,a.jsxs)(n.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>d(!s),icon:(0,a.jsx)(o.Z,{}),children:[s?"Hide sources":"Show sources (".concat(g,")"),s?(0,a.jsx)(l.Z,{className:"ml-1"}):(0,a.jsx)(i.Z,{className:"ml-1"})]}),s&&(0,a.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm",children:(0,a.jsx)("div",{className:"space-y-3",children:t.map((e,t)=>(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"text-xs text-gray-600 mb-2 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium",children:"Query:"}),(0,a.jsxs)("span",{className:"italic",children:['"',e.search_query,'"']}),(0,a.jsx)("span",{className:"text-gray-400",children:"•"}),(0,a.jsxs)("span",{className:"text-gray-500",children:[e.data.length," result",1!==e.data.length?"s":""]})]}),(0,a.jsx)("div",{className:"space-y-2",children:e.data.map((e,s)=>{let r=m["".concat(t,"-").concat(s)]||!1;return(0,a.jsxs)("div",{className:"border border-gray-200 rounded-md overflow-hidden bg-white",children:[(0,a.jsx)("div",{className:"flex items-center justify-between p-2 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>x(t,s),children:(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,a.jsx)("svg",{className:"w-4 h-4 text-gray-400 transition-transform flex-shrink-0 ".concat(r?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,a.jsx)(c.Z,{className:"text-gray-400 flex-shrink-0",style:{fontSize:"12px"}}),(0,a.jsx)("span",{className:"text-xs font-medium text-gray-700 truncate",children:e.filename||e.file_id||"Result ".concat(s+1)}),(0,a.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)})]})}),r&&(0,a.jsx)("div",{className:"border-t border-gray-200 bg-white",children:(0,a.jsxs)("div",{className:"p-3 space-y-2",children:[e.content.map((e,t)=>(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"text-xs font-mono bg-gray-50 p-2 rounded text-gray-800 whitespace-pre-wrap break-words",children:e.text})},t)),e.attributes&&Object.keys(e.attributes).length>0&&(0,a.jsxs)("div",{className:"mt-2 pt-2 border-t border-gray-100",children:[(0,a.jsx)("div",{className:"text-xs text-gray-500 mb-1 font-medium",children:"Metadata:"}),(0,a.jsx)("div",{className:"space-y-1",children:Object.entries(e.attributes).map(e=>{let[t,s]=e;return(0,a.jsxs)("div",{className:"text-xs flex gap-2",children:[(0,a.jsxs)("span",{className:"text-gray-500 font-medium",children:[t,":"]}),(0,a.jsx)("span",{className:"text-gray-700 font-mono break-all",children:String(s)})]},t)})})]})]})})]},s)})})]},t))})})]})}},26832:function(e,t,s){s.d(t,{m:function(){return o}});var a=s(93837),r=s(19250);let n=e=>{if(!e)return;let t={};if(e.id&&(t.taskId=e.id),e.contextId&&(t.contextId=e.contextId),e.status){var s;if(t.status={state:e.status.state,timestamp:e.status.timestamp},null===(s=e.status.message)||void 0===s?void 0:s.parts){let s=e.status.message.parts.filter(e=>"text"===e.kind&&e.text).map(e=>e.text).join(" ");s&&(t.status.message=s)}}return e.metadata&&"object"==typeof e.metadata&&(t.metadata=e.metadata),Object.keys(t).length>0?t:void 0},o=async(e,t,s,o,l,i,c,d)=>{let m;let u=(0,r.getProxyBaseUrl)(),x=u?"".concat(u,"/a2a/").concat(e):"/a2a/".concat(e),g=(0,a.Z)(),p=(0,a.Z)().replace(/-/g,""),h=performance.now(),f=!1,v="";try{var b,y;let a=await fetch(x,{method:"POST",headers:{Authorization:"Bearer ".concat(o),"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:g,method:"message/stream",params:{message:{kind:"message",messageId:p,role:"user",parts:[{kind:"text",text:t}]}}}),signal:l});if(!a.ok){let e=await a.json();throw Error((null===(y=e.error)||void 0===y?void 0:y.message)||e.detail||"HTTP ".concat(a.status))}let r=null===(b=a.body)||void 0===b?void 0:b.getReader();if(!r)throw Error("No response body");let u=new TextDecoder,j="",N=!1;for(;!N;){let t=await r.read();N=t.done;let a=t.value;if(N)break;let o=(j+=u.decode(a,{stream:!0})).split("\n");for(let t of(j=o.pop()||"",o))if(t.trim())try{let a=JSON.parse(t);if(!f){f=!0;let e=performance.now()-h;i&&i(e)}let r=a.result;if(r){let t=n(r);t&&(m={...m,...t});let a=r.kind;if("artifact-update"===a&&r.artifact){let t=r.artifact;if(t.parts&&Array.isArray(t.parts))for(let a of t.parts)"text"===a.kind&&a.text&&(v+=a.text,s(v,"a2a_agent/".concat(e)))}else if(r.artifacts&&Array.isArray(r.artifacts)){for(let t of r.artifacts)if(t.parts&&Array.isArray(t.parts))for(let a of t.parts)"text"===a.kind&&a.text&&(v+=a.text,s(v,"a2a_agent/".concat(e)))}else if("status-update"===a);else if(r.parts&&Array.isArray(r.parts))for(let t of r.parts)"text"===t.kind&&t.text&&(v+=t.text,s(v,"a2a_agent/".concat(e)))}if(a.error){let e=a.error.message||"Unknown A2A error";throw Error(e)}}catch(e){if(e instanceof Error&&e.message&&!e.message.includes("JSON"))throw e;t.trim().length>0&&console.warn("Failed to parse A2A streaming chunk:",t,e)}}let w=performance.now()-h;c&&c(w),m&&d&&d(m)}catch(e){if(null==l?void 0:l.aborted){console.log("A2A streaming request was cancelled");return}throw console.error("A2A stream message error:",e),e}}},95459:function(e,t,s){s.d(t,{n:function(){return n}});var a=s(7271),r=s(19250);async function n(e,t,s,n,o,l,i,c,d,m,u,x,g,p,h,f,v,b){console.log=function(){},console.log("isLocal:",!1);let y=(0,r.getProxyBaseUrl)(),j={};o&&o.length>0&&(j["x-litellm-tags"]=o.join(","));let N=new a.ZP.OpenAI({apiKey:n,baseURL:y,dangerouslyAllowBrowser:!0,defaultHeaders:j});try{let a;let r=Date.now(),o=!1,j=g&&g.length>0?[{type:"mcp",server_label:"litellm",server_url:"".concat(y,"/mcp"),require_approval:"never",allowed_tools:g,headers:{"x-litellm-api-key":"Bearer ".concat(n)}}]:void 0;for await(let n of(await N.chat.completions.create({model:s,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:m,messages:e,...u?{vector_store_ids:u}:{},...x?{guardrails:x}:{},...j?{tools:j,tool_choice:"auto"}:{},...void 0!==f?{temperature:f}:{},...void 0!==v?{max_tokens:v}:{}},{signal:l}))){var w,S,k,C,P,A,Z,_,E;console.log("Stream chunk:",n);let e=null===(w=n.choices[0])||void 0===w?void 0:w.delta;if(console.log("Delta content:",null===(k=n.choices[0])||void 0===k?void 0:null===(S=k.delta)||void 0===S?void 0:S.content),console.log("Delta reasoning content:",null==e?void 0:e.reasoning_content),!o&&((null===(P=n.choices[0])||void 0===P?void 0:null===(C=P.delta)||void 0===C?void 0:C.content)||e&&e.reasoning_content)&&(o=!0,a=Date.now()-r,console.log("First token received! Time:",a,"ms"),c?(console.log("Calling onTimingData with:",a),c(a)):console.log("onTimingData callback is not defined!")),null===(Z=n.choices[0])||void 0===Z?void 0:null===(A=Z.delta)||void 0===A?void 0:A.content){let e=n.choices[0].delta.content;t(e,n.model)}if(e&&e.image&&p&&(console.log("Image generated:",e.image),p(e.image.url,n.model)),e&&e.reasoning_content){let t=e.reasoning_content;i&&i(t)}if(e&&(null===(_=e.provider_specific_fields)||void 0===_?void 0:_.search_results)&&h&&(console.log("Search results found:",e.provider_specific_fields.search_results),h(e.provider_specific_fields.search_results)),n.usage&&d){console.log("Usage data found:",n.usage);let e={completionTokens:n.usage.completion_tokens,promptTokens:n.usage.prompt_tokens,totalTokens:n.usage.total_tokens};(null===(E=n.usage.completion_tokens_details)||void 0===E?void 0:E.reasoning_tokens)&&(e.reasoningTokens=n.usage.completion_tokens_details.reasoning_tokens),void 0!==n.usage.cost&&null!==n.usage.cost&&(e.cost=parseFloat(n.usage.cost)),d(e)}}let I=Date.now();b&&b(I-r)}catch(e){throw(null==l?void 0:l.aborted)&&console.log("Chat completion request was cancelled"),e}}},91643:function(e,t,s){s.d(t,{o:function(){return r}});var a=s(19250);let r=async e=>{try{let t=(0,a.getProxyBaseUrl)(),s=await fetch(t?"".concat(t,"/v1/agents"):"/v1/agents",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.json();throw Error(e.detail||"Failed to fetch agents")}let r=await s.json();return console.log("Fetched agents:",r),r.sort((e,t)=>{let s=e.agent_name||e.agent_id,a=t.agent_name||t.agent_id;return s.localeCompare(a)}),r}catch(e){throw console.error("Error fetching agents:",e),e}}},99020:function(e,t,s){var a=s(57437),r=s(2265),n=s(37592),o=s(19250);t.Z=e=>{let{onChange:t,value:s,className:l,accessToken:i}=e,[c,d]=(0,r.useState)([]),[m,u]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(i)try{let e=await (0,o.tagListCall)(i);console.log("List tags response:",e),d(Object.values(e))}catch(e){console.error("Error fetching tags:",e)}finally{u(!1)}})()},[i]),(0,a.jsx)(n.default,{mode:"tags",showSearch:!0,placeholder:"Select or create tags",onChange:t,value:s,loading:m,className:l,options:c.map(e=>({label:e.name,value:e.name,title:e.description||e.name})),optionFilterProp:"label",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"}})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1301-1fba10f78d668785.js b/litellm/proxy/_experimental/out/_next/static/chunks/1301-1fba10f78d668785.js new file mode 100644 index 00000000000..8d1c7806480 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1301-1fba10f78d668785.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1301,1623],{69993:function(e,t,r){r.d(t,{Z:function(){return s}});var n=r(1119),a=r(2265),i={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"},o=r(55015),s=a.forwardRef(function(e,t){return a.createElement(o.Z,(0,n.Z)({},e,{ref:t,icon:i}))})},58747:function(e,t,r){r.d(t,{Z:function(){return i}});var n=r(5853),a=r(2265);let i=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}},4537:function(e,t,r){r.d(t,{Z:function(){return i}});var n=r(5853),a=r(2265);let i=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.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"}))}},47323:function(e,t,r){r.d(t,{Z:function(){return p}});var n=r(5853),a=r(2265),i=r(47187),o=r(7084),s=r(13241),l=r(1153),u=r(26898);let d={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"}},c={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"}},h={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:""}},f=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,l.bM)(t,u.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,l.bM)(t,u.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,l.bM)(t,u.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,l.bM)(t,u.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,l.bM)(t,u.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,l.bM)(t,u.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,s.q)((0,l.bM)(t,u.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,l.bM)(t,u.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,l.bM)(t,u.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,l.bM)(t,u.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,s.q)((0,l.bM)(t,u.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},m=(0,l.fn)("Icon"),p=a.forwardRef((e,t)=>{let{icon:r,variant:u="simple",tooltip:p,size:g=o.u8.SM,color:b,className:v}=e,w=(0,n._T)(e,["icon","variant","tooltip","size","color","className"]),y=f(u,b),{tooltipProps:k,getReferenceProps:C}=(0,i.l)();return a.createElement("span",Object.assign({ref:(0,l.lq)([t,k.refs.setReference]),className:(0,s.q)(m("root"),"inline-flex shrink-0 items-center justify-center",y.bgColor,y.textColor,y.borderColor,y.ringColor,h[u].rounded,h[u].border,h[u].shadow,h[u].ring,d[g].paddingX,d[g].paddingY,v)},C,w),a.createElement(i.Z,Object.assign({text:p},k)),a.createElement(r,{className:(0,s.q)(m("icon"),"shrink-0",c[g].height,c[g].width)}))});p.displayName="Icon"},27281:function(e,t,r){r.d(t,{Z:function(){return m}});var n=r(5853),a=r(58747),i=r(2265),o=r(4537),s=r(13241),l=r(1153),u=r(96398),d=r(51975),c=r(85238),h=r(44140);let f=(0,l.fn)("Select"),m=i.forwardRef((e,t)=>{let{defaultValue:r="",value:l,onValueChange:m,placeholder:p="Select...",disabled:g=!1,icon:b,enableClear:v=!1,required:w,children:y,name:k,error:C=!1,errorMessage:x,className:E,id:M}=e,q=(0,n._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),O=(0,i.useRef)(null),L=i.Children.toArray(y),[N,P]=(0,h.Z)(r,l),R=(0,i.useMemo)(()=>{let e=i.Children.toArray(y).filter(i.isValidElement);return(0,u.sl)(e)},[y]);return i.createElement("div",{className:(0,s.q)("w-full min-w-[10rem] text-tremor-default",E)},i.createElement("div",{className:"relative"},i.createElement("select",{title:"select-hidden",required:w,className:(0,s.q)("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:N,onChange:e=>{e.preventDefault()},name:k,disabled:g,id:M,onFocus:()=>{let e=O.current;e&&e.focus()}},i.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},p),L.map(e=>{let t=e.props.value,r=e.props.children;return i.createElement("option",{className:"hidden",key:t,value:t},r)})),i.createElement(d.Ri,Object.assign({as:"div",ref:t,defaultValue:N,value:N,onChange:e=>{null==m||m(e),P(e)},disabled:g,id:M},q),e=>{var t;let{value:r}=e;return i.createElement(i.Fragment,null,i.createElement(d.Y4,{ref:O,className:(0,s.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",b?"pl-10":"pl-3",(0,u.um)((0,u.Uh)(r),g,C))},b&&i.createElement("span",{className:(0,s.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},i.createElement(b,{className:(0,s.q)(f("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),i.createElement("span",{className:"w-[90%] block truncate"},r&&null!==(t=R.get(r))&&void 0!==t?t:p),i.createElement("span",{className:(0,s.q)("absolute inset-y-0 right-0 flex items-center mr-3")},i.createElement(a.Z,{className:(0,s.q)(f("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),v&&N?i.createElement("button",{type:"button",className:(0,s.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),P(""),null==m||m("")}},i.createElement(o.Z,{className:(0,s.q)(f("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,i.createElement(c.u,{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"},i.createElement(d.O_,{anchor:"bottom start",className:(0,s.q)("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")},y)))})),C&&x?i.createElement("p",{className:(0,s.q)("errorMessage","text-sm text-rose-500 mt-1")},x):null)});m.displayName="Select"},94789:function(e,t,r){r.d(t,{Z:function(){return u}});var n=r(5853),a=r(2265),i=r(26898),o=r(13241),s=r(1153);let l=(0,s.fn)("Callout"),u=a.forwardRef((e,t)=>{let{title:r,icon:u,color:d,className:c,children:h}=e,f=(0,n._T)(e,["title","icon","color","className","children"]);return a.createElement("div",Object.assign({ref:t,className:(0,o.q)(l("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",d?(0,o.q)((0,s.bM)(d,i.K.background).bgColor,(0,s.bM)(d,i.K.darkBorder).borderColor,(0,s.bM)(d,i.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,o.q)("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"),c)},f),a.createElement("div",{className:(0,o.q)(l("header"),"flex items-start")},u?a.createElement(u,{className:(0,o.q)(l("icon"),"flex-none h-5 w-5 mr-1.5")}):null,a.createElement("h4",{className:(0,o.q)(l("title"),"font-semibold")},r)),a.createElement("p",{className:(0,o.q)(l("body"),"overflow-y-auto",h?"mt-2":"")},h))});u.displayName="Callout"},44140:function(e,t,r){r.d(t,{Z:function(){return a}});var n=r(2265);let a=(e,t)=>{let r=void 0!==t,[a,i]=(0,n.useState)(e);return[r?t:a,e=>{r||i(e)}]}},32489:function(e,t,r){r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},10900:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});t.Z=a},91777:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},47686:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))});t.Z=a},44633:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=a},58710:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=a},82182:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))});t.Z=a},79814:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},2356:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},93416:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},77355:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=a},22452:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});t.Z=a},25327:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},49084:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=a},3497:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},2894:function(e,t,r){r.d(t,{R:function(){return s},m:function(){return o}});var n=r(18238),a=r(7989),i=r(11255),o=class extends a.F{#e;#t;#r;#n;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||s(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#a({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,i.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#a({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#a({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});let n="pending"===this.state.status,a=!this.#n.canStart();try{if(n)t();else{this.#a({type:"pending",variables:e,isPaused:a}),await this.#r.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:a})}let i=await this.#n.start();return await this.#r.config.onSuccess?.(i,e,this.state.context,this,r),await this.options.onSuccess?.(i,e,this.state.context,r),await this.#r.config.onSettled?.(i,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(i,null,e,this.state.context,r),this.#a({type:"success",data:i}),i}catch(t){try{throw await this.#r.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#r.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#a({type:"error",error:t})}}finally{this.#r.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.Vr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function s(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21623:function(e,t,r){r.d(t,{S:function(){return p}});var n=r(45345),a=r(21733),i=r(18238),o=r(24112),s=class extends o.l{constructor(e={}){super(),this.config=e,this.#i=new Map}#i;build(e,t,r){let i=t.queryKey,o=t.queryHash??(0,n.Rm)(i,t),s=this.get(o);return s||(s=new a.A({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){this.#i.has(e.queryHash)||(this.#i.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#i.get(e.queryHash);t&&(e.destroy(),t===e&&this.#i.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){i.Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#i.get(e)}getAll(){return[...this.#i.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n._x)(e,t)):t}notify(e){i.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){i.Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){i.Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},l=r(2894),u=class extends o.l{constructor(e={}){super(),this.config=e,this.#o=new Set,this.#s=new Map,this.#l=0}#o;#s;#l;build(e,t,r){let n=new l.m({client:e,mutationCache:this,mutationId:++this.#l,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#o.add(e);let t=d(e);if("string"==typeof t){let r=this.#s.get(t);r?r.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#o.delete(e)){let t=d(e);if("string"==typeof t){let r=this.#s.get(t);if(r){if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#s.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=d(e);if("string"!=typeof t)return!0;{let r=this.#s.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=d(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){i.Vr.batch(()=>{this.#o.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#o.clear(),this.#s.clear()})}getAll(){return Array.from(this.#o)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.X7)(e,t))}notify(e){i.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return i.Vr.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.ZT))))}};function d(e){return e.options.scope?.id}var c=r(87045),h=r(57853);function f(e){return{onFetch:(t,r)=>{let a=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],s=t.state.data?.pageParams||[],l={pages:[],pageParams:[]},u=0,d=async()=>{let r=!1,d=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)})},c=(0,n.cG)(t.options,t.fetchOptions),h=async(e,a,i)=>{if(r)return Promise.reject();if(null==a&&e.pages.length)return Promise.resolve(e);let o=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:a,direction:i?"backward":"forward",meta:t.options.meta};return d(e),e})(),s=await c(o),{maxPages:l}=t.options,u=i?n.Ht:n.VX;return{pages:u(e.pages,s,l),pageParams:u(e.pageParams,a,l)}};if(i&&o.length){let e="backward"===i,t={pages:o,pageParams:s},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:m)(a,t);l=await h(t,r,e)}else{let t=e??o.length;do{let e=0===u?s[0]??a.initialPageParam:m(a,l);if(u>0&&null==e)break;l=await h(l,e),u++}while(ut.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=d}}}function m(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var p=class{#u;#r;#d;#c;#h;#f;#m;#p;constructor(e={}){this.#u=e.queryCache||new s,this.#r=e.mutationCache||new u,this.#d=e.defaultOptions||{},this.#c=new Map,this.#h=new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#m=c.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onFocus())}),this.#p=h.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#m?.(),this.#m=void 0,this.#p?.(),this.#p=void 0)}isFetching(e){return this.#u.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#r.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#u.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#u.build(this,t),a=r.state.data;return void 0===a?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,n.KC)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#u.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let a=this.defaultQueryOptions({queryKey:e}),i=this.#u.get(a.queryHash),o=i?.state.data,s=(0,n.SE)(t,o);if(void 0!==s)return this.#u.build(this,a).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return i.Vr.batch(()=>this.#u.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#u.get(t.queryHash)?.state}removeQueries(e){let t=this.#u;i.Vr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#u;return i.Vr.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(i.Vr.batch(()=>this.#u.findAll(e).map(e=>e.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e,t={}){return i.Vr.batch(()=>(this.#u.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(i.Vr.batch(()=>this.#u.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(n.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#u.build(this,t);return r.isStaleByTime((0,n.KC)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.ZT).catch(n.ZT)}fetchInfiniteQuery(e){return e.behavior=f(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(e){return e.behavior=f(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return h.N.isOnline()?this.#r.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#u}getMutationCache(){return this.#r}getDefaultOptions(){return this.#d}setDefaultOptions(e){this.#d=e}setQueryDefaults(e,t){this.#c.set((0,n.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#c.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#h.set((0,n.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#h.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#d.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#d.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#u.clear(),this.#r.clear()}}},85238:function(e,t,r){let n;r.d(t,{u:function(){return L}});var a=r(2265),i=r(59456),o=r(93980),s=r(25289),l=r(73389),u=r(43507),d=r(180),c=r(67561),h=r(98218),f=r(28294),m=r(95504),p=r(72468),g=r(38929);function b(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||(null!=(t=e.as)?t:x)!==a.Fragment||1===a.Children.count(e.children)}let v=(0,a.createContext)(null);v.displayName="TransitionContext";var w=((n=w||{}).Visible="visible",n.Hidden="hidden",n);let y=(0,a.createContext)(null);function k(e){return"children"in e?k(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function C(e,t){let r=(0,u.E)(e),n=(0,a.useRef)([]),l=(0,s.t)(),d=(0,i.G)(),c=(0,o.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.l4.Hidden,a=n.current.findIndex(t=>{let{el:r}=t;return r===e});-1!==a&&((0,p.E)(t,{[g.l4.Unmount](){n.current.splice(a,1)},[g.l4.Hidden](){n.current[a].state="hidden"}}),d.microTask(()=>{var e;!k(n)&&l.current&&(null==(e=r.current)||e.call(r))}))}),h=(0,o.z)(e=>{let t=n.current.find(t=>{let{el:r}=t;return r===e});return t?"visible"!==t.state&&(t.state="visible"):n.current.push({el:e,state:"visible"}),()=>c(e,g.l4.Unmount)}),f=(0,a.useRef)([]),m=(0,a.useRef)(Promise.resolve()),b=(0,a.useRef)({enter:[],leave:[]}),v=(0,o.z)((e,r,n)=>{f.current.splice(0),t&&(t.chains.current[r]=t.chains.current[r].filter(t=>{let[r]=t;return r!==e})),null==t||t.chains.current[r].push([e,new Promise(e=>{f.current.push(e)})]),null==t||t.chains.current[r].push([e,new Promise(e=>{Promise.all(b.current[r].map(e=>{let[t,r]=e;return r})).then(()=>e())})]),"enter"===r?m.current=m.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),w=(0,o.z)((e,t,r)=>{Promise.all(b.current[t].splice(0).map(e=>{let[t,r]=e;return r})).then(()=>{var e;null==(e=f.current.shift())||e()}).then(()=>r(t))});return(0,a.useMemo)(()=>({children:n,register:h,unregister:c,onStart:v,onStop:w,wait:m,chains:b}),[h,c,n,v,w,b,m])}y.displayName="NestingContext";let x=a.Fragment,E=g.VN.RenderStrategy,M=(0,g.yV)(function(e,t){let{show:r,appear:n=!1,unmount:i=!0,...s}=e,u=(0,a.useRef)(null),h=b(e),m=(0,c.T)(...h?[u,t]:null===t?[]:[t]);(0,d.H)();let p=(0,f.oJ)();if(void 0===r&&null!==p&&(r=(p&f.ZM.Open)===f.ZM.Open),void 0===r)throw Error("A is used but it is missing a `show={true | false}` prop.");let[w,x]=(0,a.useState)(r?"visible":"hidden"),M=C(()=>{r||x("hidden")}),[O,L]=(0,a.useState)(!0),N=(0,a.useRef)([r]);(0,l.e)(()=>{!1!==O&&N.current[N.current.length-1]!==r&&(N.current.push(r),L(!1))},[N,r]);let P=(0,a.useMemo)(()=>({show:r,appear:n,initial:O}),[r,n,O]);(0,l.e)(()=>{r?x("visible"):k(M)||null===u.current||x("hidden")},[r,M]);let R={unmount:i},j=(0,o.z)(()=>{var t;O&&L(!1),null==(t=e.beforeEnter)||t.call(e)}),T=(0,o.z)(()=>{var t;O&&L(!1),null==(t=e.beforeLeave)||t.call(e)}),Z=(0,g.L6)();return a.createElement(y.Provider,{value:M},a.createElement(v.Provider,{value:P},Z({ourProps:{...R,as:a.Fragment,children:a.createElement(q,{ref:m,...R,...s,beforeEnter:j,beforeLeave:T})},theirProps:{},defaultTag:a.Fragment,features:E,visible:"visible"===w,name:"Transition"})))}),q=(0,g.yV)(function(e,t){var r,n;let{transition:i=!0,beforeEnter:s,afterEnter:u,beforeLeave:w,afterLeave:M,enter:q,enterFrom:O,enterTo:L,entered:N,leave:P,leaveFrom:R,leaveTo:j,...T}=e,[Z,D]=(0,a.useState)(null),Q=(0,a.useRef)(null),A=b(e),S=(0,c.T)(...A?[Q,t,D]:null===t?[]:[t]),V=null==(r=T.unmount)||r?g.l4.Unmount:g.l4.Hidden,{show:F,appear:z,initial:K}=function(){let e=(0,a.useContext)(v);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),[H,B]=(0,a.useState)(F?"visible":"hidden"),I=function(){let e=(0,a.useContext)(y);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),{register:_,unregister:W}=I;(0,l.e)(()=>_(Q),[_,Q]),(0,l.e)(()=>{if(V===g.l4.Hidden&&Q.current){if(F&&"visible"!==H){B("visible");return}return(0,p.E)(H,{hidden:()=>W(Q),visible:()=>_(Q)})}},[H,Q,_,W,F,V]);let Y=(0,d.H)();(0,l.e)(()=>{if(A&&Y&&"visible"===H&&null===Q.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[Q,H,Y,A]);let X=K&&!z,G=z&&F&&K,U=(0,a.useRef)(!1),J=C(()=>{U.current||(B("hidden"),W(Q))},I),$=(0,o.z)(e=>{U.current=!0,J.onStart(Q,e?"enter":"leave",e=>{"enter"===e?null==s||s():"leave"===e&&(null==w||w())})}),ee=(0,o.z)(e=>{let t=e?"enter":"leave";U.current=!1,J.onStop(Q,t,e=>{"enter"===e?null==u||u():"leave"===e&&(null==M||M())}),"leave"!==t||k(J)||(B("hidden"),W(Q))});(0,a.useEffect)(()=>{A&&i||($(F),ee(F))},[F,A,i]);let et=!(!i||!A||!Y||X),[,er]=(0,h.Y)(et,Z,F,{start:$,end:ee}),en=(0,g.oA)({ref:S,className:(null==(n=(0,m.A)(T.className,G&&q,G&&O,er.enter&&q,er.enter&&er.closed&&O,er.enter&&!er.closed&&L,er.leave&&P,er.leave&&!er.closed&&R,er.leave&&er.closed&&j,!er.transition&&F&&N))?void 0:n.trim())||void 0,...(0,h.X)(er)}),ea=0;"visible"===H&&(ea|=f.ZM.Open),"hidden"===H&&(ea|=f.ZM.Closed),er.enter&&(ea|=f.ZM.Opening),er.leave&&(ea|=f.ZM.Closing);let ei=(0,g.L6)();return a.createElement(y.Provider,{value:J},a.createElement(f.up,{value:ea},ei({ourProps:en,theirProps:T,defaultTag:x,features:E,visible:"visible"===H,name:"Transition.Child"})))}),O=(0,g.yV)(function(e,t){let r=null!==(0,a.useContext)(v),n=null!==(0,f.oJ)();return a.createElement(a.Fragment,null,!r&&n?a.createElement(M,{ref:t,...e}):a.createElement(q,{ref:t,...e}))}),L=Object.assign(M,{Child:O,Root:M})},92668:function(e,t,r){r.d(t,{I:function(){return s}});var n=r(59121),a=r(31091),i=r(63497),o=r(99649);function s(e,t){let{years:r=0,months:s=0,weeks:l=0,days:u=0,hours:d=0,minutes:c=0,seconds:h=0}=t,f=(0,o.Q)(e),m=s||r?(0,a.z)(f,s+12*r):f,p=u||l?(0,n.E)(m,u+7*l):m;return(0,i.L)(e,p.getTime()+1e3*(h+60*(c+60*d)))}},59121:function(e,t,r){r.d(t,{E:function(){return i}});var n=r(99649),a=r(63497);function i(e,t){let r=(0,n.Q)(e);return isNaN(t)?(0,a.L)(e,NaN):(t&&r.setDate(r.getDate()+t),r)}},31091:function(e,t,r){r.d(t,{z:function(){return i}});var n=r(99649),a=r(63497);function i(e,t){let r=(0,n.Q)(e);if(isNaN(t))return(0,a.L)(e,NaN);if(!t)return r;let i=r.getDate(),o=(0,a.L)(e,r.getTime());return(o.setMonth(r.getMonth()+t+1,0),i>=o.getDate())?o:(r.setFullYear(o.getFullYear(),o.getMonth(),i),r)}},63497:function(e,t,r){r.d(t,{L:function(){return n}});function n(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}},99649:function(e,t,r){r.d(t,{Q:function(){return n}});function n(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)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1301-c5ca003a7988f6b1.js b/litellm/proxy/_experimental/out/_next/static/chunks/1301-c5ca003a7988f6b1.js deleted file mode 100644 index d2d3d8018e6..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1301-c5ca003a7988f6b1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1301],{69993:function(e,t,r){r.d(t,{Z:function(){return s}});var n=r(1119),a=r(2265),i={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"},o=r(55015),s=a.forwardRef(function(e,t){return a.createElement(o.Z,(0,n.Z)({},e,{ref:t,icon:i}))})},58747:function(e,t,r){r.d(t,{Z:function(){return i}});var n=r(5853),a=r(2265);let i=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}},4537:function(e,t,r){r.d(t,{Z:function(){return i}});var n=r(5853),a=r(2265);let i=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.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"}))}},47323:function(e,t,r){r.d(t,{Z:function(){return p}});var n=r(5853),a=r(2265),i=r(47187),o=r(7084),s=r(13241),l=r(1153),u=r(26898);let d={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"}},c={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"}},h={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:""}},f=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,l.bM)(t,u.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,l.bM)(t,u.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,l.bM)(t,u.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,l.bM)(t,u.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,l.bM)(t,u.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,l.bM)(t,u.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,s.q)((0,l.bM)(t,u.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,l.bM)(t,u.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,l.bM)(t,u.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,l.bM)(t,u.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,s.q)((0,l.bM)(t,u.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},m=(0,l.fn)("Icon"),p=a.forwardRef((e,t)=>{let{icon:r,variant:u="simple",tooltip:p,size:g=o.u8.SM,color:b,className:v}=e,w=(0,n._T)(e,["icon","variant","tooltip","size","color","className"]),y=f(u,b),{tooltipProps:k,getReferenceProps:C}=(0,i.l)();return a.createElement("span",Object.assign({ref:(0,l.lq)([t,k.refs.setReference]),className:(0,s.q)(m("root"),"inline-flex shrink-0 items-center justify-center",y.bgColor,y.textColor,y.borderColor,y.ringColor,h[u].rounded,h[u].border,h[u].shadow,h[u].ring,d[g].paddingX,d[g].paddingY,v)},C,w),a.createElement(i.Z,Object.assign({text:p},k)),a.createElement(r,{className:(0,s.q)(m("icon"),"shrink-0",c[g].height,c[g].width)}))});p.displayName="Icon"},27281:function(e,t,r){r.d(t,{Z:function(){return m}});var n=r(5853),a=r(58747),i=r(2265),o=r(4537),s=r(13241),l=r(1153),u=r(96398),d=r(51975),c=r(85238),h=r(44140);let f=(0,l.fn)("Select"),m=i.forwardRef((e,t)=>{let{defaultValue:r="",value:l,onValueChange:m,placeholder:p="Select...",disabled:g=!1,icon:b,enableClear:v=!1,required:w,children:y,name:k,error:C=!1,errorMessage:x,className:E,id:M}=e,q=(0,n._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),O=(0,i.useRef)(null),L=i.Children.toArray(y),[N,P]=(0,h.Z)(r,l),R=(0,i.useMemo)(()=>{let e=i.Children.toArray(y).filter(i.isValidElement);return(0,u.sl)(e)},[y]);return i.createElement("div",{className:(0,s.q)("w-full min-w-[10rem] text-tremor-default",E)},i.createElement("div",{className:"relative"},i.createElement("select",{title:"select-hidden",required:w,className:(0,s.q)("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:N,onChange:e=>{e.preventDefault()},name:k,disabled:g,id:M,onFocus:()=>{let e=O.current;e&&e.focus()}},i.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},p),L.map(e=>{let t=e.props.value,r=e.props.children;return i.createElement("option",{className:"hidden",key:t,value:t},r)})),i.createElement(d.Ri,Object.assign({as:"div",ref:t,defaultValue:N,value:N,onChange:e=>{null==m||m(e),P(e)},disabled:g,id:M},q),e=>{var t;let{value:r}=e;return i.createElement(i.Fragment,null,i.createElement(d.Y4,{ref:O,className:(0,s.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",b?"pl-10":"pl-3",(0,u.um)((0,u.Uh)(r),g,C))},b&&i.createElement("span",{className:(0,s.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},i.createElement(b,{className:(0,s.q)(f("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),i.createElement("span",{className:"w-[90%] block truncate"},r&&null!==(t=R.get(r))&&void 0!==t?t:p),i.createElement("span",{className:(0,s.q)("absolute inset-y-0 right-0 flex items-center mr-3")},i.createElement(a.Z,{className:(0,s.q)(f("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),v&&N?i.createElement("button",{type:"button",className:(0,s.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),P(""),null==m||m("")}},i.createElement(o.Z,{className:(0,s.q)(f("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,i.createElement(c.u,{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"},i.createElement(d.O_,{anchor:"bottom start",className:(0,s.q)("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")},y)))})),C&&x?i.createElement("p",{className:(0,s.q)("errorMessage","text-sm text-rose-500 mt-1")},x):null)});m.displayName="Select"},94789:function(e,t,r){r.d(t,{Z:function(){return u}});var n=r(5853),a=r(2265),i=r(26898),o=r(13241),s=r(1153);let l=(0,s.fn)("Callout"),u=a.forwardRef((e,t)=>{let{title:r,icon:u,color:d,className:c,children:h}=e,f=(0,n._T)(e,["title","icon","color","className","children"]);return a.createElement("div",Object.assign({ref:t,className:(0,o.q)(l("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",d?(0,o.q)((0,s.bM)(d,i.K.background).bgColor,(0,s.bM)(d,i.K.darkBorder).borderColor,(0,s.bM)(d,i.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,o.q)("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"),c)},f),a.createElement("div",{className:(0,o.q)(l("header"),"flex items-start")},u?a.createElement(u,{className:(0,o.q)(l("icon"),"flex-none h-5 w-5 mr-1.5")}):null,a.createElement("h4",{className:(0,o.q)(l("title"),"font-semibold")},r)),a.createElement("p",{className:(0,o.q)(l("body"),"overflow-y-auto",h?"mt-2":"")},h))});u.displayName="Callout"},44140:function(e,t,r){r.d(t,{Z:function(){return a}});var n=r(2265);let a=(e,t)=>{let r=void 0!==t,[a,i]=(0,n.useState)(e);return[r?t:a,e=>{r||i(e)}]}},32489:function(e,t,r){r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},10900:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});t.Z=a},91777:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},47686:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))});t.Z=a},44633:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=a},58710:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=a},82182:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))});t.Z=a},79814:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},2356:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},93416:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},77355:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=a},22452:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});t.Z=a},25327:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},49084:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=a},3497:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},2894:function(e,t,r){r.d(t,{R:function(){return s},m:function(){return o}});var n=r(18238),a=r(7989),i=r(11255),o=class extends a.F{#e;#t;#r;#n;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||s(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#a({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,i.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#a({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#a({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});let n="pending"===this.state.status,a=!this.#n.canStart();try{if(n)t();else{this.#a({type:"pending",variables:e,isPaused:a}),await this.#r.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:a})}let i=await this.#n.start();return await this.#r.config.onSuccess?.(i,e,this.state.context,this,r),await this.options.onSuccess?.(i,e,this.state.context,r),await this.#r.config.onSettled?.(i,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(i,null,e,this.state.context,r),this.#a({type:"success",data:i}),i}catch(t){try{throw await this.#r.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#r.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#a({type:"error",error:t})}}finally{this.#r.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.Vr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function s(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21623:function(e,t,r){r.d(t,{S:function(){return p}});var n=r(45345),a=r(21733),i=r(18238),o=r(24112),s=class extends o.l{constructor(e={}){super(),this.config=e,this.#i=new Map}#i;build(e,t,r){let i=t.queryKey,o=t.queryHash??(0,n.Rm)(i,t),s=this.get(o);return s||(s=new a.A({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){this.#i.has(e.queryHash)||(this.#i.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#i.get(e.queryHash);t&&(e.destroy(),t===e&&this.#i.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){i.Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#i.get(e)}getAll(){return[...this.#i.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n._x)(e,t)):t}notify(e){i.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){i.Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){i.Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},l=r(2894),u=class extends o.l{constructor(e={}){super(),this.config=e,this.#o=new Set,this.#s=new Map,this.#l=0}#o;#s;#l;build(e,t,r){let n=new l.m({client:e,mutationCache:this,mutationId:++this.#l,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#o.add(e);let t=d(e);if("string"==typeof t){let r=this.#s.get(t);r?r.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#o.delete(e)){let t=d(e);if("string"==typeof t){let r=this.#s.get(t);if(r){if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#s.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=d(e);if("string"!=typeof t)return!0;{let r=this.#s.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=d(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){i.Vr.batch(()=>{this.#o.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#o.clear(),this.#s.clear()})}getAll(){return Array.from(this.#o)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.X7)(e,t))}notify(e){i.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return i.Vr.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.ZT))))}};function d(e){return e.options.scope?.id}var c=r(87045),h=r(57853);function f(e){return{onFetch:(t,r)=>{let a=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],s=t.state.data?.pageParams||[],l={pages:[],pageParams:[]},u=0,d=async()=>{let r=!1,d=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)})},c=(0,n.cG)(t.options,t.fetchOptions),h=async(e,a,i)=>{if(r)return Promise.reject();if(null==a&&e.pages.length)return Promise.resolve(e);let o=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:a,direction:i?"backward":"forward",meta:t.options.meta};return d(e),e})(),s=await c(o),{maxPages:l}=t.options,u=i?n.Ht:n.VX;return{pages:u(e.pages,s,l),pageParams:u(e.pageParams,a,l)}};if(i&&o.length){let e="backward"===i,t={pages:o,pageParams:s},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:m)(a,t);l=await h(t,r,e)}else{let t=e??o.length;do{let e=0===u?s[0]??a.initialPageParam:m(a,l);if(u>0&&null==e)break;l=await h(l,e),u++}while(ut.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=d}}}function m(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var p=class{#u;#r;#d;#c;#h;#f;#m;#p;constructor(e={}){this.#u=e.queryCache||new s,this.#r=e.mutationCache||new u,this.#d=e.defaultOptions||{},this.#c=new Map,this.#h=new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#m=c.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onFocus())}),this.#p=h.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#m?.(),this.#m=void 0,this.#p?.(),this.#p=void 0)}isFetching(e){return this.#u.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#r.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#u.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#u.build(this,t),a=r.state.data;return void 0===a?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,n.KC)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#u.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let a=this.defaultQueryOptions({queryKey:e}),i=this.#u.get(a.queryHash),o=i?.state.data,s=(0,n.SE)(t,o);if(void 0!==s)return this.#u.build(this,a).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return i.Vr.batch(()=>this.#u.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#u.get(t.queryHash)?.state}removeQueries(e){let t=this.#u;i.Vr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#u;return i.Vr.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(i.Vr.batch(()=>this.#u.findAll(e).map(e=>e.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e,t={}){return i.Vr.batch(()=>(this.#u.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(i.Vr.batch(()=>this.#u.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(n.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#u.build(this,t);return r.isStaleByTime((0,n.KC)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.ZT).catch(n.ZT)}fetchInfiniteQuery(e){return e.behavior=f(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(e){return e.behavior=f(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return h.N.isOnline()?this.#r.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#u}getMutationCache(){return this.#r}getDefaultOptions(){return this.#d}setDefaultOptions(e){this.#d=e}setQueryDefaults(e,t){this.#c.set((0,n.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#c.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#h.set((0,n.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#h.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#d.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#d.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#u.clear(),this.#r.clear()}}},85238:function(e,t,r){let n;r.d(t,{u:function(){return L}});var a=r(2265),i=r(59456),o=r(93980),s=r(25289),l=r(73389),u=r(43507),d=r(180),c=r(67561),h=r(98218),f=r(28294),m=r(95504),p=r(72468),g=r(38929);function b(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||(null!=(t=e.as)?t:x)!==a.Fragment||1===a.Children.count(e.children)}let v=(0,a.createContext)(null);v.displayName="TransitionContext";var w=((n=w||{}).Visible="visible",n.Hidden="hidden",n);let y=(0,a.createContext)(null);function k(e){return"children"in e?k(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function C(e,t){let r=(0,u.E)(e),n=(0,a.useRef)([]),l=(0,s.t)(),d=(0,i.G)(),c=(0,o.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.l4.Hidden,a=n.current.findIndex(t=>{let{el:r}=t;return r===e});-1!==a&&((0,p.E)(t,{[g.l4.Unmount](){n.current.splice(a,1)},[g.l4.Hidden](){n.current[a].state="hidden"}}),d.microTask(()=>{var e;!k(n)&&l.current&&(null==(e=r.current)||e.call(r))}))}),h=(0,o.z)(e=>{let t=n.current.find(t=>{let{el:r}=t;return r===e});return t?"visible"!==t.state&&(t.state="visible"):n.current.push({el:e,state:"visible"}),()=>c(e,g.l4.Unmount)}),f=(0,a.useRef)([]),m=(0,a.useRef)(Promise.resolve()),b=(0,a.useRef)({enter:[],leave:[]}),v=(0,o.z)((e,r,n)=>{f.current.splice(0),t&&(t.chains.current[r]=t.chains.current[r].filter(t=>{let[r]=t;return r!==e})),null==t||t.chains.current[r].push([e,new Promise(e=>{f.current.push(e)})]),null==t||t.chains.current[r].push([e,new Promise(e=>{Promise.all(b.current[r].map(e=>{let[t,r]=e;return r})).then(()=>e())})]),"enter"===r?m.current=m.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),w=(0,o.z)((e,t,r)=>{Promise.all(b.current[t].splice(0).map(e=>{let[t,r]=e;return r})).then(()=>{var e;null==(e=f.current.shift())||e()}).then(()=>r(t))});return(0,a.useMemo)(()=>({children:n,register:h,unregister:c,onStart:v,onStop:w,wait:m,chains:b}),[h,c,n,v,w,b,m])}y.displayName="NestingContext";let x=a.Fragment,E=g.VN.RenderStrategy,M=(0,g.yV)(function(e,t){let{show:r,appear:n=!1,unmount:i=!0,...s}=e,u=(0,a.useRef)(null),h=b(e),m=(0,c.T)(...h?[u,t]:null===t?[]:[t]);(0,d.H)();let p=(0,f.oJ)();if(void 0===r&&null!==p&&(r=(p&f.ZM.Open)===f.ZM.Open),void 0===r)throw Error("A is used but it is missing a `show={true | false}` prop.");let[w,x]=(0,a.useState)(r?"visible":"hidden"),M=C(()=>{r||x("hidden")}),[O,L]=(0,a.useState)(!0),N=(0,a.useRef)([r]);(0,l.e)(()=>{!1!==O&&N.current[N.current.length-1]!==r&&(N.current.push(r),L(!1))},[N,r]);let P=(0,a.useMemo)(()=>({show:r,appear:n,initial:O}),[r,n,O]);(0,l.e)(()=>{r?x("visible"):k(M)||null===u.current||x("hidden")},[r,M]);let R={unmount:i},j=(0,o.z)(()=>{var t;O&&L(!1),null==(t=e.beforeEnter)||t.call(e)}),T=(0,o.z)(()=>{var t;O&&L(!1),null==(t=e.beforeLeave)||t.call(e)}),Z=(0,g.L6)();return a.createElement(y.Provider,{value:M},a.createElement(v.Provider,{value:P},Z({ourProps:{...R,as:a.Fragment,children:a.createElement(q,{ref:m,...R,...s,beforeEnter:j,beforeLeave:T})},theirProps:{},defaultTag:a.Fragment,features:E,visible:"visible"===w,name:"Transition"})))}),q=(0,g.yV)(function(e,t){var r,n;let{transition:i=!0,beforeEnter:s,afterEnter:u,beforeLeave:w,afterLeave:M,enter:q,enterFrom:O,enterTo:L,entered:N,leave:P,leaveFrom:R,leaveTo:j,...T}=e,[Z,D]=(0,a.useState)(null),Q=(0,a.useRef)(null),A=b(e),S=(0,c.T)(...A?[Q,t,D]:null===t?[]:[t]),V=null==(r=T.unmount)||r?g.l4.Unmount:g.l4.Hidden,{show:F,appear:z,initial:K}=function(){let e=(0,a.useContext)(v);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),[H,B]=(0,a.useState)(F?"visible":"hidden"),I=function(){let e=(0,a.useContext)(y);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),{register:_,unregister:W}=I;(0,l.e)(()=>_(Q),[_,Q]),(0,l.e)(()=>{if(V===g.l4.Hidden&&Q.current){if(F&&"visible"!==H){B("visible");return}return(0,p.E)(H,{hidden:()=>W(Q),visible:()=>_(Q)})}},[H,Q,_,W,F,V]);let Y=(0,d.H)();(0,l.e)(()=>{if(A&&Y&&"visible"===H&&null===Q.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[Q,H,Y,A]);let X=K&&!z,G=z&&F&&K,U=(0,a.useRef)(!1),J=C(()=>{U.current||(B("hidden"),W(Q))},I),$=(0,o.z)(e=>{U.current=!0,J.onStart(Q,e?"enter":"leave",e=>{"enter"===e?null==s||s():"leave"===e&&(null==w||w())})}),ee=(0,o.z)(e=>{let t=e?"enter":"leave";U.current=!1,J.onStop(Q,t,e=>{"enter"===e?null==u||u():"leave"===e&&(null==M||M())}),"leave"!==t||k(J)||(B("hidden"),W(Q))});(0,a.useEffect)(()=>{A&&i||($(F),ee(F))},[F,A,i]);let et=!(!i||!A||!Y||X),[,er]=(0,h.Y)(et,Z,F,{start:$,end:ee}),en=(0,g.oA)({ref:S,className:(null==(n=(0,m.A)(T.className,G&&q,G&&O,er.enter&&q,er.enter&&er.closed&&O,er.enter&&!er.closed&&L,er.leave&&P,er.leave&&!er.closed&&R,er.leave&&er.closed&&j,!er.transition&&F&&N))?void 0:n.trim())||void 0,...(0,h.X)(er)}),ea=0;"visible"===H&&(ea|=f.ZM.Open),"hidden"===H&&(ea|=f.ZM.Closed),er.enter&&(ea|=f.ZM.Opening),er.leave&&(ea|=f.ZM.Closing);let ei=(0,g.L6)();return a.createElement(y.Provider,{value:J},a.createElement(f.up,{value:ea},ei({ourProps:en,theirProps:T,defaultTag:x,features:E,visible:"visible"===H,name:"Transition.Child"})))}),O=(0,g.yV)(function(e,t){let r=null!==(0,a.useContext)(v),n=null!==(0,f.oJ)();return a.createElement(a.Fragment,null,!r&&n?a.createElement(M,{ref:t,...e}):a.createElement(q,{ref:t,...e}))}),L=Object.assign(M,{Child:O,Root:M})},92668:function(e,t,r){r.d(t,{I:function(){return s}});var n=r(59121),a=r(31091),i=r(63497),o=r(99649);function s(e,t){let{years:r=0,months:s=0,weeks:l=0,days:u=0,hours:d=0,minutes:c=0,seconds:h=0}=t,f=(0,o.Q)(e),m=s||r?(0,a.z)(f,s+12*r):f,p=u||l?(0,n.E)(m,u+7*l):m;return(0,i.L)(e,p.getTime()+1e3*(h+60*(c+60*d)))}},59121:function(e,t,r){r.d(t,{E:function(){return i}});var n=r(99649),a=r(63497);function i(e,t){let r=(0,n.Q)(e);return isNaN(t)?(0,a.L)(e,NaN):(t&&r.setDate(r.getDate()+t),r)}},31091:function(e,t,r){r.d(t,{z:function(){return i}});var n=r(99649),a=r(63497);function i(e,t){let r=(0,n.Q)(e);if(isNaN(t))return(0,a.L)(e,NaN);if(!t)return r;let i=r.getDate(),o=(0,a.L)(e,r.getTime());return(o.setMonth(r.getMonth()+t+1,0),i>=o.getDate())?o:(r.setFullYear(o.getFullYear(),o.getMonth(),i),r)}},63497:function(e,t,r){r.d(t,{L:function(){return n}});function n(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}},99649:function(e,t,r){r.d(t,{Q:function(){return n}});function n(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)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1345-7e09c10108e98f45.js b/litellm/proxy/_experimental/out/_next/static/chunks/1345-7e09c10108e98f45.js new file mode 100644 index 00000000000..991d3fe29cf --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1345-7e09c10108e98f45.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1345,4546,7996],{88009:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},37527:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M894 462c30.9 0 43.8-39.7 18.7-58L530.8 126.2a31.81 31.81 0 00-37.6 0L111.3 404c-25.1 18.2-12.2 58 18.8 58H192v374h-72c-4.4 0-8 3.6-8 8v52c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-52c0-4.4-3.6-8-8-8h-72V462h62zM512 196.7l271.1 197.2H240.9L512 196.7zM264 462h117v374H264V462zm189 0h117v374H453V462zm307 374H642V462h118v374z"}}]},name:"bank",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},9775:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-600-80h56c4.4 0 8-3.6 8-8V560c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V384c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v320c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V462c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v242c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v400c0 4.4 3.6 8 8 8z"}}]},name:"bar-chart",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},11429:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={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"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},68208:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M856 376H648V168c0-8.8-7.2-16-16-16H168c-8.8 0-16 7.2-16 16v464c0 8.8 7.2 16 16 16h208v208c0 8.8 7.2 16 16 16h464c8.8 0 16-7.2 16-16V392c0-8.8-7.2-16-16-16zm-480 16v188H220V220h360v156H392c-8.8 0-16 7.2-16 16zm204 52v136H444V444h136zm224 360H444V648h188c8.8 0 16-7.2 16-16V444h156v360z"}}]},name:"block",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},49634:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},99458:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-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"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},41169:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z"}}]},name:"experiment",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},10798:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},64739:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={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"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},48231:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM305.8 637.7c3.1 3.1 8.1 3.1 11.3 0l138.3-137.6L583 628.5c3.1 3.1 8.2 3.1 11.3 0l275.4-275.3c3.1-3.1 3.1-8.2 0-11.3l-39.6-39.6a8.03 8.03 0 00-11.3 0l-230 229.9L461.4 404a8.03 8.03 0 00-11.3 0L266.3 586.7a8.03 8.03 0 000 11.3l39.5 39.7z"}}]},name:"line-chart",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},28595:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"}}]},name:"play-circle",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},34419:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},23907:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},40312:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M922.9 701.9H327.4l29.9-60.9 496.8-.9c16.8 0 31.2-12 34.2-28.6l68.8-385.1c1.8-10.1-.9-20.5-7.5-28.4a34.99 34.99 0 00-26.6-12.5l-632-2.1-5.4-25.4c-3.4-16.2-18-28-34.6-28H96.5a35.3 35.3 0 100 70.6h125.9L246 312.8l58.1 281.3-74.8 122.1a34.96 34.96 0 00-3 36.8c6 11.9 18.1 19.4 31.5 19.4h62.8a102.43 102.43 0 00-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7h161.1a102.43 102.43 0 00-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7H923c19.4 0 35.3-15.8 35.3-35.3a35.42 35.42 0 00-35.4-35.2zM305.7 253l575.8 1.9-56.4 315.8-452.3.8L305.7 253zm96.9 612.7c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 01-31.6 31.6zm325.1 0c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 01-31.6 31.6z"}}]},name:"shopping-cart",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},41361:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M824.2 699.9a301.55 301.55 0 00-86.4-60.4C783.1 602.8 812 546.8 812 484c0-110.8-92.4-201.7-203.2-200-109.1 1.7-197 90.6-197 200 0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C345 754.6 314 826.8 312 903.8a8 8 0 008 8.2h56c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5A226.62 226.62 0 01612 684c60.9 0 118.2 23.7 161.3 66.8C814.5 792 838 846.3 840 904.3c.1 4.3 3.7 7.7 8 7.7h56a8 8 0 008-8.2c-2-77-33-149.2-87.8-203.9zM612 612c-34.2 0-66.4-13.3-90.5-37.5a126.86 126.86 0 01-37.5-91.8c.3-32.8 13.4-64.5 36.3-88 24-24.6 56.1-38.3 90.4-38.7 33.9-.3 66.8 12.9 91 36.6 24.8 24.3 38.4 56.8 38.4 91.4 0 34.2-13.3 66.3-37.5 90.5A127.3 127.3 0 01612 612zM361.5 510.4c-.9-8.7-1.4-17.5-1.4-26.4 0-15.9 1.5-31.4 4.3-46.5.7-3.6-1.2-7.3-4.5-8.8-13.6-6.1-26.1-14.5-36.9-25.1a127.54 127.54 0 01-38.7-95.4c.9-32.1 13.8-62.6 36.3-85.6 24.7-25.3 57.9-39.1 93.2-38.7 31.9.3 62.7 12.6 86 34.4 7.9 7.4 14.7 15.6 20.4 24.4 2 3.1 5.9 4.4 9.3 3.2 17.6-6.1 36.2-10.4 55.3-12.4 5.6-.6 8.8-6.6 6.3-11.6-32.5-64.3-98.9-108.7-175.7-109.9-110.9-1.7-203.3 89.2-203.3 199.9 0 62.8 28.9 118.8 74.2 155.5-31.8 14.7-61.1 35-86.5 60.4-54.8 54.7-85.8 126.9-87.8 204a8 8 0 008 8.2h56.1c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5 29.4-29.4 65.4-49.8 104.7-59.7 3.9-1 6.5-4.7 6-8.7z"}}]},name:"team",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},47323:function(e,t,r){"use strict";r.d(t,{Z:function(){return f}});var n=r(5853),o=r(2265),a=r(47187),l=r(7084),c=r(13241),i=r(1153),s=r(26898);let d={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"}},u={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"}},m={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},p=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,i.bM)(t,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,i.bM)(t,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,c.q)((0,i.bM)(t,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,i.bM)(t,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,c.q)((0,i.bM)(t,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,i.bM)(t,s.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,c.q)((0,i.bM)(t,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,i.bM)(t,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,c.q)((0,i.bM)(t,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,i.bM)(t,s.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,c.q)((0,i.bM)(t,s.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},h=(0,i.fn)("Icon"),f=o.forwardRef((e,t)=>{let{icon:r,variant:s="simple",tooltip:f,size:b=l.u8.SM,color:g,className:v}=e,k=(0,n._T)(e,["icon","variant","tooltip","size","color","className"]),x=p(s,g),{tooltipProps:y,getReferenceProps:w}=(0,a.l)();return o.createElement("span",Object.assign({ref:(0,i.lq)([t,y.refs.setReference]),className:(0,c.q)(h("root"),"inline-flex shrink-0 items-center justify-center",x.bgColor,x.textColor,x.borderColor,x.ringColor,m[s].rounded,m[s].border,m[s].shadow,m[s].ring,d[b].paddingX,d[b].paddingY,v)},w,k),o.createElement(a.Z,Object.assign({text:f},y)),o.createElement(r,{className:(0,c.q)(h("icon"),"shrink-0",u[b].height,u[b].width)}))});f.displayName="Icon"},92414:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var n=r(5853),o=r(2265);r(42698),r(64016),r(8710);var a=r(33232),l=r(44140),c=r(58747);let i=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))};var s=r(4537);let d=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),o.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))};var u=r(13241),m=r(1153),p=r(96398),h=r(51975),f=r(85238);let b=(0,m.fn)("MultiSelect"),g=o.forwardRef((e,t)=>{let{defaultValue:r=[],value:m,onValueChange:g,placeholder:v="Select...",placeholderSearch:k="Search",disabled:x=!1,icon:y,children:w,className:E,required:C,name:O,error:M=!1,errorMessage:j,id:N}=e,S=(0,n._T)(e,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className","required","name","error","errorMessage","id"]),Z=(0,o.useRef)(null),[z,H]=(0,l.Z)(r,m),{reactElementChildren:L,optionsAvailable:R}=(0,o.useMemo)(()=>{let e=o.Children.toArray(w).filter(o.isValidElement);return{reactElementChildren:e,optionsAvailable:(0,p.n0)("",e)}},[w]),[I,q]=(0,o.useState)(""),V=(null!=z?z:[]).length>0,T=(0,o.useMemo)(()=>I?(0,p.n0)(I,L):R,[I,L,R]),P=()=>{q("")};return o.createElement("div",{className:(0,u.q)("w-full min-w-[10rem] text-tremor-default",E)},o.createElement("div",{className:"relative"},o.createElement("select",{title:"multi-select-hidden",required:C,className:(0,u.q)("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:z,onChange:e=>{e.preventDefault()},name:O,disabled:x,multiple:!0,id:N,onFocus:()=>{let e=Z.current;e&&e.focus()}},o.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},v),T.map(e=>{let t=e.props.value,r=e.props.children;return o.createElement("option",{className:"hidden",key:t,value:t},r)})),o.createElement(h.Ri,Object.assign({as:"div",ref:t,defaultValue:z,value:z,onChange:e=>{null==g||g(e),H(e)},disabled:x,id:N,multiple:!0},S),e=>{let{value:t}=e;return o.createElement(o.Fragment,null,o.createElement(h.Y4,{className:(0,u.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",y?"pl-11 -ml-0.5":"pl-3",(0,p.um)(t.length>0,x,M)),ref:Z},y&&o.createElement("span",{className:(0,u.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(y,{className:(0,u.q)(b("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("div",{className:"h-6 flex items-center"},t.length>0?o.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},R.filter(e=>t.includes(e.props.value)).map((e,r)=>{var n;return o.createElement("div",{key:r,className:(0,u.q)("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},o.createElement("div",{className:"text-xs truncate "},null!==(n=e.props.children)&&void 0!==n?n:e.props.value),o.createElement("div",{onClick:r=>{r.preventDefault();let n=t.filter(t=>t!==e.props.value);null==g||g(n),H(n)}},o.createElement(d,{className:(0,u.q)(b("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))})):o.createElement("span",null,v)),o.createElement("span",{className:(0,u.q)("absolute inset-y-0 right-0 flex items-center mr-2.5")},o.createElement(c.Z,{className:(0,u.q)(b("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),V&&!x?o.createElement("button",{type:"button",className:(0,u.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),H([]),null==g||g([])}},o.createElement(s.Z,{className:(0,u.q)(b("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(f.u,{enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(h.O_,{anchor:"bottom start",className:(0,u.q)("z-10 divide-y w-[var(--button-width)] 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.createElement("div",{className:(0,u.q)("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},o.createElement("span",null,o.createElement(i,{className:(0,u.q)("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:k,className:(0,u.q)("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-subtle"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>q(e.target.value),value:I})),o.createElement(a.Z.Provider,Object.assign({},{onBlur:{handleResetSearch:P}},{value:{selectedValue:t}}),T))))})),M&&j?o.createElement("p",{className:(0,u.q)("errorMessage","text-sm text-rose-500 mt-1")},j):null)});g.displayName="MultiSelect"},46030:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(5853);r(42698),r(64016),r(8710);var o=r(33232),a=r(2265),l=r(13241),c=r(1153),i=r(51975);let s=(0,c.fn)("MultiSelectItem"),d=a.forwardRef((e,t)=>{let{value:r,className:d,children:u}=e,m=(0,n._T)(e,["value","className","children"]),{selectedValue:p}=(0,a.useContext)(o.Z),h=(0,c.NZ)(r,p);return a.createElement(i.wt,Object.assign({className:(0,l.q)(s("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","data-[focus]:bg-tremor-background-muted data-[focus]:text-tremor-content-strong data-[select]ed:text-tremor-content-strong text-tremor-content-emphasis","dark:data-[focus]:bg-dark-tremor-background-muted dark:data-[focus]:text-dark-tremor-content-strong dark:data-[select]ed:text-dark-tremor-content-strong dark:data-[select]ed:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",d),ref:t,key:r,value:r},m),a.createElement("input",{type:"checkbox",className:(0,l.q)(s("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:h,readOnly:!0}),a.createElement("span",{className:"whitespace-nowrap truncate"},null!=u?u:r))});d.displayName="MultiSelectItem"},30150:function(e,t,r){"use strict";r.d(t,{Z:function(){return m}});var n=r(5853),o=r(2265);let a=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M12 4v16m8-8H4"}))},l=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M20 12H4"}))};var c=r(13241),i=r(1153),s=r(69262);let d="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",m=o.forwardRef((e,t)=>{let{onSubmit:r,enableStepper:m=!0,disabled:p,onValueChange:h,onChange:f}=e,b=(0,n._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),g=(0,o.useRef)(null),[v,k]=o.useState(!1),x=o.useCallback(()=>{k(!0)},[]),y=o.useCallback(()=>{k(!1)},[]),[w,E]=o.useState(!1),C=o.useCallback(()=>{E(!0)},[]),O=o.useCallback(()=>{E(!1)},[]);return o.createElement(s.Z,Object.assign({type:"number",ref:(0,i.lq)([g,t]),disabled:p,makeInputClassName:(0,i.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=g.current)||void 0===t?void 0:t.value;null==r||r(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&C()},onKeyUp:e=>{"ArrowDown"===e.key&&y(),"ArrowUp"===e.key&&O()},onChange:e=>{p||(null==h||h(parseFloat(e.target.value)),null==f||f(e))},stepper:m?o.createElement("div",{className:(0,c.q)("flex justify-center align-middle")},o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=g.current)||void 0===e||e.stepDown(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,c.q)(!p&&u,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(l,{"data-testid":"step-down",className:(v?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=g.current)||void 0===e||e.stepUp(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,c.q)(!p&&u,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(a,{"data-testid":"step-up",className:(w?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},b))});m.displayName="NumberInput"},16853:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(5853),o=r(96398),a=r(44140),l=r(2265),c=r(13241),i=r(1153);let s=(0,i.fn)("Textarea"),d=l.forwardRef((e,t)=>{let{value:r,defaultValue:d="",placeholder:u="Type...",error:m=!1,errorMessage:p,disabled:h=!1,className:f,onChange:b,onValueChange:g,autoHeight:v=!1}=e,k=(0,n._T)(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange","autoHeight"]),[x,y]=(0,a.Z)(d,r),w=(0,l.useRef)(null),E=(0,o.Uh)(x);return(0,l.useEffect)(()=>{let e=w.current;if(v&&e){e.style.height="60px";let t=e.scrollHeight;e.style.height=t+"px"}},[v,w,x]),l.createElement(l.Fragment,null,l.createElement("textarea",Object.assign({ref:(0,i.lq)([w,t]),value:x,placeholder:u,disabled:h,className:(0,c.q)(s("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",(0,o.um)(E,h,m),h?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",f),"data-testid":"text-area",onChange:e=>{null==b||b(e),y(e.target.value),null==g||g(e.target.value)}},k)),m&&p?l.createElement("p",{className:(0,c.q)(s("errorMessage"),"text-sm text-red-500 mt-1")},p):null)});d.displayName="Textarea"},87452:function(e,t,r){"use strict";r.d(t,{Z:function(){return u},r:function(){return d}});var n=r(5853),o=r(91054);r(42698),r(64016);var a=r(8710);r(33232);var l=r(13241),c=r(1153),i=r(2265);let s=(0,c.fn)("Accordion"),d=(0,i.createContext)({isOpen:!1}),u=i.forwardRef((e,t)=>{var r;let{defaultOpen:c=!1,children:u,className:m}=e,p=(0,n._T)(e,["defaultOpen","children","className"]),h=null!==(r=(0,i.useContext)(a.Z))&&void 0!==r?r:(0,l.q)("rounded-tremor-default border");return i.createElement(o.pJ,Object.assign({as:"div",ref:t,className:(0,l.q)(s("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",h,m),defaultOpen:c},p),e=>{let{open:t}=e;return i.createElement(d.Provider,{value:{isOpen:t}},u)})});u.displayName="Accordion"},88829:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(5853),o=r(2265),a=r(91054),l=r(13241);let c=(0,r(1153).fn)("AccordionBody"),i=o.forwardRef((e,t)=>{let{children:r,className:i}=e,s=(0,n._T)(e,["children","className"]);return o.createElement(a.pJ.Panel,Object.assign({ref:t,className:(0,l.q)(c("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",i)},s),r)});i.displayName="AccordionBody"},72208:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(5853),o=r(2265),a=r(91054);let l=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var c=r(87452),i=r(13241);let s=(0,r(1153).fn)("AccordionHeader"),d=o.forwardRef((e,t)=>{let{children:r,className:d}=e,u=(0,n._T)(e,["children","className"]),{isOpen:m}=(0,o.useContext)(c.r);return o.createElement(a.pJ.Button,Object.assign({ref:t,className:(0,i.q)(s("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",d)},u),o.createElement("div",{className:(0,i.q)(s("children"),"flex flex-1 text-inherit mr-4")},r),o.createElement("div",null,o.createElement(l,{className:(0,i.q)(s("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",m?"transition-all":"transition-all -rotate-180")})))});d.displayName="AccordionHeader"},67982:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(5853),o=r(13241),a=r(1153),l=r(2265);let c=(0,a.fn)("Divider"),i=l.forwardRef((e,t)=>{let{className:r,children:a}=e,i=(0,n._T)(e,["className","children"]);return l.createElement("div",Object.assign({ref:t,className:(0,o.q)(c("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",r)},i),a?l.createElement(l.Fragment,null,l.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),l.createElement("div",{className:(0,o.q)("text-inherit whitespace-nowrap")},a),l.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):l.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});i.displayName="Divider"},49804:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(5853),o=r(13241),a=r(1153),l=r(2265),c=r(9496);let i=(0,a.fn)("Col"),s=l.forwardRef((e,t)=>{let{numColSpan:r=1,numColSpanSm:a,numColSpanMd:s,numColSpanLg:d,children:u,className:m}=e,p=(0,n._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),h=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return l.createElement("div",Object.assign({ref:t,className:(0,o.q)(i("root"),(()=>{let e=h(r,c.PT),t=h(a,c.SP),n=h(s,c.VS),l=h(d,c._w);return(0,o.q)(e,t,n,l)})(),m)},p),u)});s.displayName="Col"},94789:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(5853),o=r(2265),a=r(26898),l=r(13241),c=r(1153);let i=(0,c.fn)("Callout"),s=o.forwardRef((e,t)=>{let{title:r,icon:s,color:d,className:u,children:m}=e,p=(0,n._T)(e,["title","icon","color","className","children"]);return o.createElement("div",Object.assign({ref:t,className:(0,l.q)(i("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",d?(0,l.q)((0,c.bM)(d,a.K.background).bgColor,(0,c.bM)(d,a.K.darkBorder).borderColor,(0,c.bM)(d,a.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,l.q)("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"),u)},p),o.createElement("div",{className:(0,l.q)(i("header"),"flex items-start")},s?o.createElement(s,{className:(0,l.q)(i("icon"),"flex-none h-5 w-5 mr-1.5")}):null,o.createElement("h4",{className:(0,l.q)(i("title"),"font-semibold")},r)),o.createElement("p",{className:(0,l.q)(i("body"),"overflow-y-auto",m?"mt-2":"")},m))});s.displayName="Callout"},96889:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(5853),o=r(2265),a=r(26898),l=r(13241),c=r(1153);let i=(0,c.fn)("BarList");function s(e,t){let{data:r=[],color:s,valueFormatter:d=c.Cj,showAnimation:u=!1,onValueChange:m,sortOrder:p="descending",className:h}=e,f=(0,n._T)(e,["data","color","valueFormatter","showAnimation","onValueChange","sortOrder","className"]),b=m?"button":"div",g=o.useMemo(()=>"none"===p?r:[...r].sort((e,t)=>"ascending"===p?e.value-t.value:t.value-e.value),[r,p]),v=o.useMemo(()=>{let e=Math.max(...g.map(e=>e.value),0);return g.map(t=>0===t.value?0:Math.max(t.value/e*100,2))},[g]);return o.createElement("div",Object.assign({ref:t,className:(0,l.q)(i("root"),"flex justify-between space-x-6",h),"aria-sort":p},f),o.createElement("div",{className:(0,l.q)(i("bars"),"relative w-full space-y-1.5")},g.map((e,t)=>{var r,n,d;let p=e.icon;return o.createElement(b,{key:null!==(r=e.key)&&void 0!==r?r:t,onClick:()=>{null==m||m(e)},className:(0,l.q)(i("bar"),"group w-full flex items-center rounded-tremor-small",m?["cursor-pointer","hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-subtle/40"]:"")},o.createElement("div",{className:(0,l.q)("flex items-center rounded transition-all bg-opacity-40","h-8",e.color||s?[(0,c.bM)(null!==(n=e.color)&&void 0!==n?n:s,a.K.background).bgColor,m?"group-hover:bg-opacity-30":""]:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle/60",!m||e.color||s?"":"group-hover:bg-tremor-brand-subtle/30 group-hover:dark:bg-dark-tremor-brand-subtle/70",t===g.length-1?"mb-0":"",u?"duration-500":""),style:{width:"".concat(v[t],"%"),transition:u?"all 1s":""}},o.createElement("div",{className:(0,l.q)("absolute left-2 pr-4 flex max-w-full")},p?o.createElement(p,{className:(0,l.q)(i("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?o.createElement("a",{href:e.href,target:null!==(d=e.target)&&void 0!==d?d:"_blank",rel:"noreferrer",className:(0,l.q)(i("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default",m?"cursor-pointer":"","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onClick:e=>e.stopPropagation()},e.name):o.createElement("p",{className:(0,l.q)(i("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name))))})),o.createElement("div",{className:i("labels")},g.map((e,t)=>{var r;return o.createElement("div",{key:null!==(r=e.key)&&void 0!==r?r:t,className:(0,l.q)(i("labelWrapper"),"flex justify-end items-center","h-8",t===g.length-1?"mb-0":"mb-1.5")},o.createElement("p",{className:(0,l.q)(i("labelText"),"whitespace-nowrap leading-none truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},d(e.value)))})))}s.displayName="BarList";let d=o.forwardRef(s)},51653:function(e,t,r){"use strict";r.d(t,{Z:function(){return q}});var n=r(2265),o=r(8900),a=r(39725),l=r(49638),c=r(54537),i=r(55726),s=r(36760),d=r.n(s),u=r(66632),m=r(18242),p=r(28791),h=r(19722),f=r(71744),b=r(93463),g=r(12918),v=r(99320);let k=(e,t,r,n,o)=>({background:e,border:"".concat((0,b.bf)(n.lineWidth)," ").concat(n.lineType," ").concat(t),["".concat(o,"-icon")]:{color:r}}),x=e=>{let{componentCls:t,motionDurationSlow:r,marginXS:n,marginSM:o,fontSize:a,fontSizeLG:l,lineHeight:c,borderRadiusLG:i,motionEaseInOutCirc:s,withDescriptionIconSize:d,colorText:u,colorTextHeading:m,withDescriptionPadding:p,defaultPadding:h}=e;return{[t]:Object.assign(Object.assign({},(0,g.Wf)(e)),{position:"relative",display:"flex",alignItems:"center",padding:h,wordWrap:"break-word",borderRadius:i,["&".concat(t,"-rtl")]:{direction:"rtl"},["".concat(t,"-content")]:{flex:1,minWidth:0},["".concat(t,"-icon")]:{marginInlineEnd:n,lineHeight:0},"&-description":{display:"none",fontSize:a,lineHeight:c},"&-message":{color:m},["&".concat(t,"-motion-leave")]:{overflow:"hidden",opacity:1,transition:"max-height ".concat(r," ").concat(s,", opacity ").concat(r," ").concat(s,",\n padding-top ").concat(r," ").concat(s,", padding-bottom ").concat(r," ").concat(s,",\n margin-bottom ").concat(r," ").concat(s)},["&".concat(t,"-motion-leave-active")]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),["".concat(t,"-with-description")]:{alignItems:"flex-start",padding:p,["".concat(t,"-icon")]:{marginInlineEnd:o,fontSize:d,lineHeight:0},["".concat(t,"-message")]:{display:"block",marginBottom:n,color:m,fontSize:l},["".concat(t,"-description")]:{display:"block",color:u}},["".concat(t,"-banner")]:{marginBottom:0,border:"0 !important",borderRadius:0}}},y=e=>{let{componentCls:t,colorSuccess:r,colorSuccessBorder:n,colorSuccessBg:o,colorWarning:a,colorWarningBorder:l,colorWarningBg:c,colorError:i,colorErrorBorder:s,colorErrorBg:d,colorInfo:u,colorInfoBorder:m,colorInfoBg:p}=e;return{[t]:{"&-success":k(o,n,r,e,t),"&-info":k(p,m,u,e,t),"&-warning":k(c,l,a,e,t),"&-error":Object.assign(Object.assign({},k(d,s,i,e,t)),{["".concat(t,"-description > pre")]:{margin:0,padding:0}})}}},w=e=>{let{componentCls:t,iconCls:r,motionDurationMid:n,marginXS:o,fontSizeIcon:a,colorIcon:l,colorIconHover:c}=e;return{[t]:{"&-action":{marginInlineStart:o},["".concat(t,"-close-icon")]:{marginInlineStart:o,padding:0,overflow:"hidden",fontSize:a,lineHeight:(0,b.bf)(a),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",["".concat(r,"-close")]:{color:l,transition:"color ".concat(n),"&:hover":{color:c}}},"&-close-text":{color:l,transition:"color ".concat(n),"&:hover":{color:c}}}}};var E=(0,v.I$)("Alert",e=>[x(e),y(e),w(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:"".concat(e.paddingContentVerticalSM,"px ").concat(12,"px"),withDescriptionPadding:"".concat(e.paddingMD,"px ").concat(e.paddingContentHorizontalLG,"px")})),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 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 O={success:o.Z,info:i.Z,error:a.Z,warning:c.Z},M=e=>{let{icon:t,prefixCls:r,type:o}=e,a=O[o]||null;return t?(0,h.wm)(t,n.createElement("span",{className:"".concat(r,"-icon")},t),()=>({className:d()("".concat(r,"-icon"),t.props.className)})):n.createElement(a,{className:"".concat(r,"-icon")})},j=e=>{let{isClosable:t,prefixCls:r,closeIcon:o,handleClose:a,ariaProps:c}=e,i=!0===o||void 0===o?n.createElement(l.Z,null):o;return t?n.createElement("button",Object.assign({type:"button",onClick:a,className:"".concat(r,"-close-icon"),tabIndex:0},c),i):null},N=n.forwardRef((e,t)=>{let{description:r,prefixCls:o,message:a,banner:l,className:c,rootClassName:i,style:s,onMouseEnter:h,onMouseLeave:b,onClick:g,afterClose:v,showIcon:k,closable:x,closeText:y,closeIcon:w,action:O,id:N}=e,S=C(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[Z,z]=n.useState(!1),H=n.useRef(null);n.useImperativeHandle(t,()=>({nativeElement:H.current}));let{getPrefixCls:L,direction:R,closable:I,closeIcon:q,className:V,style:T}=(0,f.dj)("alert"),P=L("alert",o),[B,_,D]=E(P),A=t=>{var r;z(!0),null===(r=e.onClose)||void 0===r||r.call(e,t)},F=n.useMemo(()=>void 0!==e.type?e.type:l?"warning":"info",[e.type,l]),K=n.useMemo(()=>"object"==typeof x&&!!x.closeIcon||!!y||("boolean"==typeof x?x:!1!==w&&null!=w||!!I),[y,w,x,I]),W=!!l&&void 0===k||k,X=d()(P,"".concat(P,"-").concat(F),{["".concat(P,"-with-description")]:!!r,["".concat(P,"-no-icon")]:!W,["".concat(P,"-banner")]:!!l,["".concat(P,"-rtl")]:"rtl"===R},V,c,i,D,_),G=(0,m.Z)(S,{aria:!0,data:!0}),U=n.useMemo(()=>"object"==typeof x&&x.closeIcon?x.closeIcon:y||(void 0!==w?w:"object"==typeof I&&I.closeIcon?I.closeIcon:q),[w,x,I,y,q]),Y=n.useMemo(()=>{let e=null!=x?x:I;if("object"==typeof e){let{closeIcon:t}=e;return C(e,["closeIcon"])}return{}},[x,I]);return B(n.createElement(u.ZP,{visible:!Z,motionName:"".concat(P,"-motion"),motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:v},(t,o)=>{let{className:l,style:c}=t;return n.createElement("div",Object.assign({id:N,ref:(0,p.sQ)(H,o),"data-show":!Z,className:d()(X,l),style:Object.assign(Object.assign(Object.assign({},T),s),c),onMouseEnter:h,onMouseLeave:b,onClick:g,role:"alert"},G),W?n.createElement(M,{description:r,icon:e.icon,prefixCls:P,type:F}):null,n.createElement("div",{className:"".concat(P,"-content")},a?n.createElement("div",{className:"".concat(P,"-message")},a):null,r?n.createElement("div",{className:"".concat(P,"-description")},r):null),O?n.createElement("div",{className:"".concat(P,"-action")},O):null,n.createElement(j,{isClosable:K,prefixCls:P,closeIcon:U,handleClose:A,ariaProps:Y}))}))});var S=r(76405),Z=r(25049),z=r(24995),H=r(63929),L=r(37977),R=r(41690);let I=function(e){function t(){var e,r,n;return(0,S.Z)(this,t),r=t,n=arguments,r=(0,z.Z)(r),(e=(0,L.Z)(this,(0,H.Z)()?Reflect.construct(r,n||[],(0,z.Z)(this).constructor):r.apply(this,n))).state={error:void 0,info:{componentStack:""}},e}return(0,R.Z)(t,e),(0,Z.Z)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,description:t,id:r,children:o}=this.props,{error:a,info:l}=this.state,c=(null==l?void 0:l.componentStack)||null,i=void 0===e?(a||"").toString():e;return a?n.createElement(N,{id:r,type:"error",message:i,description:n.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},void 0===t?c:t)}):o}}])}(n.Component);N.ErrorBoundary=I;var q=N},76188:function(e,t,r){"use strict";r.d(t,{Z:function(){return Z}});var n=r(2265),o=r(36760),a=r.n(o),l=r(6543),c=r(71744),i=r(33759),s=r(28617),d={xxl:3,xl:3,lg:3,md:3,sm:2,xs:1};let u=n.createContext({});var m=r(45287),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 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 h=e=>(0,m.Z)(e).map(e=>Object.assign(Object.assign({},null==e?void 0:e.props),{key:e.key}));var f=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},b=(e,t)=>{let[r,o]=(0,n.useMemo)(()=>{let r,n,o,a;return r=[],n=[],o=!1,a=0,t.filter(e=>e).forEach(t=>{let{filled:l}=t,c=f(t,["filled"]);if(l){n.push(c),r.push(n),n=[],a=0;return}let i=e-a;(a+=t.span||1)>=e?(a>e?(o=!0,n.push(Object.assign(Object.assign({},c),{span:i}))):n.push(c),r.push(n),n=[],a=0):n.push(c)}),n.length>0&&r.push(n),[r=r.map(t=>{let r=t.reduce((e,t)=>e+(t.span||1),0);if(rnull!=e;var v=e=>{let{itemPrefixCls:t,component:r,span:o,className:l,style:c,labelStyle:i,contentStyle:s,bordered:d,label:m,content:p,colon:h,type:f,styles:b}=e,{classNames:v}=n.useContext(u),k=Object.assign(Object.assign({},i),null==b?void 0:b.label),x=Object.assign(Object.assign({},s),null==b?void 0:b.content);return d?n.createElement(r,{colSpan:o,style:c,className:a()(l,{["".concat(t,"-item-").concat(f)]:"label"===f||"content"===f,[null==v?void 0:v.label]:(null==v?void 0:v.label)&&"label"===f,[null==v?void 0:v.content]:(null==v?void 0:v.content)&&"content"===f})},g(m)&&n.createElement("span",{style:k},m),g(p)&&n.createElement("span",{style:x},p)):n.createElement(r,{colSpan:o,style:c,className:a()("".concat(t,"-item"),l)},n.createElement("div",{className:"".concat(t,"-item-container")},g(m)&&n.createElement("span",{style:k,className:a()("".concat(t,"-item-label"),null==v?void 0:v.label,{["".concat(t,"-item-no-colon")]:!h})},m),g(p)&&n.createElement("span",{style:x,className:a()("".concat(t,"-item-content"),null==v?void 0:v.content)},p)))};function k(e,t,r){let{colon:o,prefixCls:a,bordered:l}=t,{component:c,type:i,showLabel:s,showContent:d,labelStyle:u,contentStyle:m,styles:p}=r;return e.map((e,t)=>{let{label:r,children:h,prefixCls:f=a,className:b,style:g,labelStyle:k,contentStyle:x,span:y=1,key:w,styles:E}=e;return"string"==typeof c?n.createElement(v,{key:"".concat(i,"-").concat(w||t),className:b,style:g,styles:{label:Object.assign(Object.assign(Object.assign(Object.assign({},u),null==p?void 0:p.label),k),null==E?void 0:E.label),content:Object.assign(Object.assign(Object.assign(Object.assign({},m),null==p?void 0:p.content),x),null==E?void 0:E.content)},span:y,colon:o,component:c,itemPrefixCls:f,bordered:l,label:s?r:null,content:d?h:null,type:i}):[n.createElement(v,{key:"label-".concat(w||t),className:b,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u),null==p?void 0:p.label),g),k),null==E?void 0:E.label),span:1,colon:o,component:c[0],itemPrefixCls:f,bordered:l,label:r,type:"label"}),n.createElement(v,{key:"content-".concat(w||t),className:b,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},m),null==p?void 0:p.content),g),x),null==E?void 0:E.content),span:2*y-1,component:c[1],itemPrefixCls:f,bordered:l,content:h,type:"content"})]})}var x=e=>{let t=n.useContext(u),{prefixCls:r,vertical:o,row:a,index:l,bordered:c}=e;return o?n.createElement(n.Fragment,null,n.createElement("tr",{key:"label-".concat(l),className:"".concat(r,"-row")},k(a,e,Object.assign({component:"th",type:"label",showLabel:!0},t))),n.createElement("tr",{key:"content-".concat(l),className:"".concat(r,"-row")},k(a,e,Object.assign({component:"td",type:"content",showContent:!0},t)))):n.createElement("tr",{key:l,className:"".concat(r,"-row")},k(a,e,Object.assign({component:c?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0},t)))},y=r(93463),w=r(12918),E=r(99320),C=r(71140);let O=e=>{let{componentCls:t,labelBg:r}=e;return{["&".concat(t,"-bordered")]:{["> ".concat(t,"-view")]:{border:"".concat((0,y.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit),"> table":{tableLayout:"auto"},["".concat(t,"-row")]:{borderBottom:"".concat((0,y.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(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}},["> ".concat(t,"-item-label, > ").concat(t,"-item-content")]:{padding:"".concat((0,y.bf)(e.padding)," ").concat((0,y.bf)(e.paddingLG)),borderInlineEnd:"".concat((0,y.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit),"&:last-child":{borderInlineEnd:"none"}},["> ".concat(t,"-item-label")]:{color:e.colorTextSecondary,backgroundColor:r,"&::after":{display:"none"}}}},["&".concat(t,"-middle")]:{["".concat(t,"-row")]:{["> ".concat(t,"-item-label, > ").concat(t,"-item-content")]:{padding:"".concat((0,y.bf)(e.paddingSM)," ").concat((0,y.bf)(e.paddingLG))}}},["&".concat(t,"-small")]:{["".concat(t,"-row")]:{["> ".concat(t,"-item-label, > ").concat(t,"-item-content")]:{padding:"".concat((0,y.bf)(e.paddingXS)," ").concat((0,y.bf)(e.padding))}}}}}},M=e=>{let{componentCls:t,extraColor:r,itemPaddingBottom:n,itemPaddingEnd:o,colonMarginRight:a,colonMarginLeft:l,titleMarginBottom:c}=e;return{[t]:Object.assign(Object.assign(Object.assign({},(0,w.Wf)(e)),O(e)),{"&-rtl":{direction:"rtl"},["".concat(t,"-header")]:{display:"flex",alignItems:"center",marginBottom:c},["".concat(t,"-title")]:Object.assign(Object.assign({},w.vS),{flex:"auto",color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}),["".concat(t,"-extra")]:{marginInlineStart:"auto",color:r,fontSize:e.fontSize},["".concat(t,"-view")]:{width:"100%",borderRadius:e.borderRadiusLG,table:{width:"100%",tableLayout:"fixed",borderCollapse:"collapse"}},["".concat(t,"-row")]:{"> th, > td":{paddingBottom:n,paddingInlineEnd:o},"> th:last-child, > td:last-child":{paddingInlineEnd:0},"&:last-child":{borderBottom:"none","> th, > td":{paddingBottom:0}}},["".concat(t,"-item-label")]:{color:e.labelColor,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start","&::after":{content:'":"',position:"relative",top:-.5,marginInline:"".concat((0,y.bf)(l)," ").concat((0,y.bf)(a))},["&".concat(t,"-item-no-colon::after")]:{content:'""'}},["".concat(t,"-item-no-label")]:{"&::after":{margin:0,content:'""'}},["".concat(t,"-item-content")]:{display:"table-cell",flex:1,color:e.contentColor,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:"break-word",overflowWrap:"break-word"},["".concat(t,"-item")]:{paddingBottom:0,verticalAlign:"top","&-container":{display:"flex",["".concat(t,"-item-label")]:{display:"inline-flex",alignItems:"baseline"},["".concat(t,"-item-content")]:{display:"inline-flex",alignItems:"baseline",minWidth:"1em"}}},"&-middle":{["".concat(t,"-row")]:{"> th, > td":{paddingBottom:e.paddingSM}}},"&-small":{["".concat(t,"-row")]:{"> th, > td":{paddingBottom:e.paddingXS}}}})}};var j=(0,E.I$)("Descriptions",e=>M((0,C.IX)(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})),N=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=e=>{let{prefixCls:t,title:r,extra:o,column:m,colon:f=!0,bordered:g,layout:v,children:k,className:y,rootClassName:w,style:E,size:C,labelStyle:O,contentStyle:M,styles:S,items:Z,classNames:z}=e,H=N(e,["prefixCls","title","extra","column","colon","bordered","layout","children","className","rootClassName","style","size","labelStyle","contentStyle","styles","items","classNames"]),{getPrefixCls:L,direction:R,className:I,style:q,classNames:V,styles:T}=(0,c.dj)("descriptions"),P=L("descriptions",t),B=(0,s.Z)(),_=n.useMemo(()=>{var e;return"number"==typeof m?m:null!==(e=(0,l.m9)(B,Object.assign(Object.assign({},d),m)))&&void 0!==e?e:3},[B,m]),D=function(e,t,r){let o=n.useMemo(()=>t||h(r),[t,r]);return n.useMemo(()=>o.map(t=>{var{span:r}=t,n=p(t,["span"]);return"filled"===r?Object.assign(Object.assign({},n),{filled:!0}):Object.assign(Object.assign({},n),{span:"number"==typeof r?r:(0,l.m9)(e,r)})}),[o,e])}(B,Z,k),A=(0,i.Z)(C),F=b(_,D),[K,W,X]=j(P),G=n.useMemo(()=>({labelStyle:O,contentStyle:M,styles:{content:Object.assign(Object.assign({},T.content),null==S?void 0:S.content),label:Object.assign(Object.assign({},T.label),null==S?void 0:S.label)},classNames:{label:a()(V.label,null==z?void 0:z.label),content:a()(V.content,null==z?void 0:z.content)}}),[O,M,S,z,V,T]);return K(n.createElement(u.Provider,{value:G},n.createElement("div",Object.assign({className:a()(P,I,V.root,null==z?void 0:z.root,{["".concat(P,"-").concat(A)]:A&&"default"!==A,["".concat(P,"-bordered")]:!!g,["".concat(P,"-rtl")]:"rtl"===R},y,w,W,X),style:Object.assign(Object.assign(Object.assign(Object.assign({},q),T.root),null==S?void 0:S.root),E)},H),(r||o)&&n.createElement("div",{className:a()("".concat(P,"-header"),V.header,null==z?void 0:z.header),style:Object.assign(Object.assign({},T.header),null==S?void 0:S.header)},r&&n.createElement("div",{className:a()("".concat(P,"-title"),V.title,null==z?void 0:z.title),style:Object.assign(Object.assign({},T.title),null==S?void 0:S.title)},r),o&&n.createElement("div",{className:a()("".concat(P,"-extra"),V.extra,null==z?void 0:z.extra),style:Object.assign(Object.assign({},T.extra),null==S?void 0:S.extra)},o)),n.createElement("div",{className:"".concat(P,"-view")},n.createElement("table",null,n.createElement("tbody",null,F.map((e,t)=>n.createElement(x,{key:t,index:t,colon:f,prefixCls:P,vertical:"vertical"===v,bordered:g,row:e}))))))))};S.Item=e=>{let{children:t}=e;return t};var Z=S},13817:function(e,t,r){"use strict";r.d(t,{default:function(){return y}});var n=r(83145),o=r(2265),a=r(36760),l=r.n(a),c=r(18694),i=r(71744),s=r(80856),d=r(45287),u=r(32186),m=r(25437),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 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};function h(e){let{suffixCls:t,tagName:r,displayName:n}=e;return e=>o.forwardRef((n,a)=>o.createElement(e,Object.assign({ref:a,suffixCls:t,tagName:r},n)))}let f=o.forwardRef((e,t)=>{let{prefixCls:r,suffixCls:n,className:a,tagName:c}=e,s=p(e,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:d}=o.useContext(i.E_),u=d("layout",r),[h,f,b]=(0,m.ZP)(u),g=n?"".concat(u,"-").concat(n):u;return h(o.createElement(c,Object.assign({className:l()(r||g,a,f,b),ref:t},s)))}),b=o.forwardRef((e,t)=>{let{direction:r}=o.useContext(i.E_),[a,h]=o.useState([]),{prefixCls:f,className:b,rootClassName:g,children:v,hasSider:k,tagName:x,style:y}=e,w=p(e,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),E=(0,c.Z)(w,["suffixCls"]),{getPrefixCls:C,className:O,style:M}=(0,i.dj)("layout"),j=C("layout",f),N="boolean"==typeof k?k:!!a.length||(0,d.Z)(v).some(e=>e.type===u.Z),[S,Z,z]=(0,m.ZP)(j),H=l()(j,{["".concat(j,"-has-sider")]:N,["".concat(j,"-rtl")]:"rtl"===r},O,b,g,Z,z),L=o.useMemo(()=>({siderHook:{addSider:e=>{h(t=>[].concat((0,n.Z)(t),[e]))},removeSider:e=>{h(t=>t.filter(t=>t!==e))}}}),[]);return S(o.createElement(s.V.Provider,{value:L},o.createElement(x,Object.assign({ref:t,className:H,style:Object.assign(Object.assign({},M),y)},E),v)))}),g=h({tagName:"div",displayName:"Layout"})(b),v=h({suffixCls:"header",tagName:"header",displayName:"Header"})(f),k=h({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(f),x=h({suffixCls:"content",tagName:"main",displayName:"Content"})(f);g.Header=v,g.Footer=k,g.Content=x,g.Sider=u.Z,g._InternalSiderContext=u.D;var y=g},23910:function(e,t,r){var n=r(74288).Symbol;e.exports=n},54506:function(e,t,r){var n=r(23910),o=r(4479),a=r(80910),l=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":l&&l in Object(e)?o(e):a(e)}},55041:function(e,t,r){var n=r(5035),o=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(o,""):e}},17071:function(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},4479:function(e,t,r){var n=r(23910),o=Object.prototype,a=o.hasOwnProperty,l=o.toString,c=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),r=e[c];try{e[c]=void 0;var n=!0}catch(e){}var o=l.call(e);return n&&(t?e[c]=r:delete e[c]),o}},80910:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},74288:function(e,t,r){var n=r(17071),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},5035:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},7310:function(e,t,r){var n=r(28302),o=r(11121),a=r(6660),l=Math.max,c=Math.min;e.exports=function(e,t,r){var i,s,d,u,m,p,h=0,f=!1,b=!1,g=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(t){var r=i,n=s;return i=s=void 0,h=t,u=e.apply(n,r)}function k(e){var r=e-p,n=e-h;return void 0===p||r>=t||r<0||b&&n>=d}function x(){var e,r,n,a=o();if(k(a))return y(a);m=setTimeout(x,(e=a-p,r=a-h,n=t-e,b?c(n,d-r):n))}function y(e){return(m=void 0,g&&i)?v(e):(i=s=void 0,u)}function w(){var e,r=o(),n=k(r);if(i=arguments,s=this,p=r,n){if(void 0===m)return h=e=p,m=setTimeout(x,t),f?v(e):u;if(b)return clearTimeout(m),m=setTimeout(x,t),v(p)}return void 0===m&&(m=setTimeout(x,t)),u}return t=a(t)||0,n(r)&&(f=!!r.leading,d=(b="maxWait"in r)?l(a(r.maxWait)||0,t):d,g="trailing"in r?!!r.trailing:g),w.cancel=function(){void 0!==m&&clearTimeout(m),h=0,i=p=s=m=void 0},w.flush=function(){return void 0===m?u:y(o())},w}},28302:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},10303:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},78371:function(e,t,r){var n=r(54506),o=r(10303);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},11121:function(e,t,r){var n=r(74288);e.exports=function(){return n.Date.now()}},6660:function(e,t,r){var n=r(55041),o=r(28302),a=r(78371),l=0/0,c=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,d=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return l;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=i.test(e);return r||s.test(e)?d(e.slice(2),r?2:8):c.test(e)?l:+e}},82222:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},40875:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},22135:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},5136:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("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"}]])},64935:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]])},96362:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("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"}]])},29202:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},33245:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},54001:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("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"}]])},51817:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},21047:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},96137:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("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"}]])},80221:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},70525:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]])},76865:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("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"}]])},49663:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("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"}]])},79862:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]])},95805:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("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"}]])},11239:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},1479:function(e,t){"use strict";t.Z={'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%)"}}},82422:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}))});t.Z=o},51853:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=o},3477:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))});t.Z=o},71437:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),n.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"}))});t.Z=o},82376:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}))});t.Z=o},23628:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=o},17732:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"}))});t.Z=o},3837:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))});t.Z=o},19616:function(e,t,r){"use strict";r.d(t,{G:function(){return l}});var n=r(2265);let o={enabled:!0,leading:!1,trailing:!0,wait:0,onExecute:()=>{}};class a{constructor(e,t){this.fn=e,this._canLeadingExecute=!0,this._isPending=!1,this._executionCount=0,this._options={...o,...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[r,o]=(0,n.useState)(e),l=function(e,t){let[r]=(0,n.useState)(()=>{var r;return Object.getOwnPropertyNames(Object.getPrototypeOf(r=new a(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 r.setOptions(t),r}(o,t);return[r,l.maybeExecute,l]}},21770:function(e,t,r){"use strict";r.d(t,{D:function(){return d}});var n=r(2265),o=r(2894),a=r(18238),l=r(24112),c=r(45345),i=class extends l.l{#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,c.VS)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,c.Ym)(t.mutationKey)!==(0,c.Ym)(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,o.R)();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){a.Vr.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};e?.type==="success"?(this.#n.onSuccess?.(e.data,t,r,n),this.#n.onSettled?.(e.data,null,t,r,n)):e?.type==="error"&&(this.#n.onError?.(e.error,t,r,n),this.#n.onSettled?.(void 0,e.error,t,r,n))}this.listeners.forEach(e=>{e(this.#t)})})}},s=r(29827);function d(e,t){let r=(0,s.NL)(t),[o]=n.useState(()=>new i(r,e));n.useEffect(()=>{o.setOptions(e)},[o,e]);let l=n.useSyncExternalStore(n.useCallback(e=>o.subscribe(a.Vr.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),d=n.useCallback((e,t)=>{o.mutate(e,t).catch(c.ZT)},[o]);if(l.error&&(0,c.L3)(o.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:d,mutateAsync:l.mutate}}},91054:function(e,t,r){"use strict";let n,o;r.d(t,{pJ:function(){return H}});var a,l=r(71049),c=r(11323),i=r(2265),s=r(66797),d=r(93980),u=r(65573),m=r(67561),p=r(98218),h=r(33443),f=r(28294),b=r(31370),g=r(72468),v=r(5664),k=r(38929);let x=null!=(a=i.startTransition)?a:function(e){e()};var y=r(52724),w=((n=w||{})[n.Open=0]="Open",n[n.Closed=1]="Closed",n),E=((o=E||{})[o.ToggleDisclosure=0]="ToggleDisclosure",o[o.CloseDisclosure=1]="CloseDisclosure",o[o.SetButtonId=2]="SetButtonId",o[o.SetPanelId=3]="SetPanelId",o[o.SetButtonElement=4]="SetButtonElement",o[o.SetPanelElement=5]="SetPanelElement",o);let C={0:e=>({...e,disclosureState:(0,g.E)(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}},O=(0,i.createContext)(null);function M(e){let t=(0,i.useContext)(O);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,M),t}return t}O.displayName="DisclosureContext";let j=(0,i.createContext)(null);j.displayName="DisclosureAPIContext";let N=(0,i.createContext)(null);function S(e,t){return(0,g.E)(t.type,C,e,t)}N.displayName="DisclosurePanelContext";let Z=i.Fragment,z=k.VN.RenderStrategy|k.VN.Static,H=Object.assign((0,k.yV)(function(e,t){let{defaultOpen:r=!1,...n}=e,o=(0,i.useRef)(null),a=(0,m.T)(t,(0,m.h)(e=>{o.current=e},void 0===e.as||e.as===i.Fragment)),l=(0,i.useReducer)(S,{disclosureState:r?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:c,buttonId:s},u]=l,p=(0,d.z)(e=>{u({type:1});let t=(0,v.r)(o);if(!t||!s)return;let r=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(s):t.getElementById(s);null==r||r.focus()}),b=(0,i.useMemo)(()=>({close:p}),[p]),x=(0,i.useMemo)(()=>({open:0===c,close:p}),[c,p]),y=(0,k.L6)();return i.createElement(O.Provider,{value:l},i.createElement(j.Provider,{value:b},i.createElement(h.Z,{value:p},i.createElement(f.up,{value:(0,g.E)(c,{0:f.ZM.Open,1:f.ZM.Closed})},y({ourProps:{ref:a},theirProps:n,slot:x,defaultTag:Z,name:"Disclosure"})))))}),{Button:(0,k.yV)(function(e,t){let r=(0,i.useId)(),{id:n="headlessui-disclosure-button-".concat(r),disabled:o=!1,autoFocus:a=!1,...p}=e,[h,f]=M("Disclosure.Button"),g=(0,i.useContext)(N),v=null!==g&&g===h.panelId,x=(0,i.useRef)(null),w=(0,m.T)(x,t,(0,d.z)(e=>{if(!v)return f({type:4,element:e})}));(0,i.useEffect)(()=>{if(!v)return f({type:2,buttonId:n}),()=>{f({type:2,buttonId:null})}},[n,f,v]);let E=(0,d.z)(e=>{var t;if(v){if(1===h.disclosureState)return;switch(e.key){case y.R.Space:case y.R.Enter:e.preventDefault(),e.stopPropagation(),f({type:0}),null==(t=h.buttonElement)||t.focus()}}else switch(e.key){case y.R.Space:case y.R.Enter:e.preventDefault(),e.stopPropagation(),f({type:0})}}),C=(0,d.z)(e=>{e.key===y.R.Space&&e.preventDefault()}),O=(0,d.z)(e=>{var t;(0,b.P)(e.currentTarget)||o||(v?(f({type:0}),null==(t=h.buttonElement)||t.focus()):f({type:0}))}),{isFocusVisible:j,focusProps:S}=(0,l.F)({autoFocus:a}),{isHovered:Z,hoverProps:z}=(0,c.X)({isDisabled:o}),{pressed:H,pressProps:L}=(0,s.x)({disabled:o}),R=(0,i.useMemo)(()=>({open:0===h.disclosureState,hover:Z,active:H,disabled:o,focus:j,autofocus:a}),[h,Z,H,j,o,a]),I=(0,u.f)(e,h.buttonElement),q=v?(0,k.dG)({ref:w,type:I,disabled:o||void 0,autoFocus:a,onKeyDown:E,onClick:O},S,z,L):(0,k.dG)({ref:w,id:n,type:I,"aria-expanded":0===h.disclosureState,"aria-controls":h.panelElement?h.panelId:void 0,disabled:o||void 0,autoFocus:a,onKeyDown:E,onKeyUp:C,onClick:O},S,z,L);return(0,k.L6)()({ourProps:q,theirProps:p,slot:R,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,k.yV)(function(e,t){let r=(0,i.useId)(),{id:n="headlessui-disclosure-panel-".concat(r),transition:o=!1,...a}=e,[l,c]=M("Disclosure.Panel"),{close:s}=function e(t){let r=(0,i.useContext)(j);if(null===r){let r=Error("<".concat(t," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(r,e),r}return r}("Disclosure.Panel"),[u,h]=(0,i.useState)(null),b=(0,m.T)(t,(0,d.z)(e=>{x(()=>c({type:5,element:e}))}),h);(0,i.useEffect)(()=>(c({type:3,panelId:n}),()=>{c({type:3,panelId:null})}),[n,c]);let g=(0,f.oJ)(),[v,y]=(0,p.Y)(o,u,null!==g?(g&f.ZM.Open)===f.ZM.Open:0===l.disclosureState),w=(0,i.useMemo)(()=>({open:0===l.disclosureState,close:s}),[l.disclosureState,s]),E={ref:b,id:n,...(0,p.X)(y)},C=(0,k.L6)();return i.createElement(f.uu,null,i.createElement(N.Provider,{value:l.panelId},C({ourProps:E,theirProps:a,slot:w,defaultTag:"div",features:z,visible:v,name:"Disclosure.Panel"})))})})},33443:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(2265);let o=(0,n.createContext)(()=>{});function a(e){let{value:t,children:r}=e;return n.createElement(o.Provider,{value:t},r)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1518-499d06fabfcafb58.js b/litellm/proxy/_experimental/out/_next/static/chunks/1518-499d06fabfcafb58.js deleted file mode 100644 index f510aabc7d7..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1518-499d06fabfcafb58.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1518],{81518:function(e,s,a){a.r(s),a.d(s,{default:function(){return Q}});var t=a(57437),r=a(2265),n=a(75301),l=a(9114),i=a(26430),o=a(96473),d=a(50010),c=a(26349),m=a(37592),u=a(4260),x=a(99981),h=a(5545),g=a(93837),p=a(27930),v=a(66830),f=a(95459),j=a(10703),y=a(32489),b=a(98728),N=a(79862),w=a(82222),k=a(51817),A=a(62831),S=a(17906),C=a(94263),T=a(88712),L=a(94331),Z=a(38398),P=a(33152);function _(e){let{messages:s,isLoading:a}=e;if(0===s.length)return(0,t.jsx)("div",{className:"h-full"});let r=[],n=0;for(;n(0,t.jsxs)("div",{className:"whitespace-pre-wrap break-words",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:[(0,t.jsx)(T.Z,{message:e}),(0,t.jsx)(A.UG,{components:{code(e){let{node:s,inline:a,className:r,children:n,...l}=e,i=/language-(\w+)/.exec(r||"");return!a&&i?(0,t.jsx)(S.Z,{style:C.Z,language:i[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...l,children:String(n).replace(/\n$/,"")}):(0,t.jsx)("code",{className:"".concat(r," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),...l,children:n})},pre:e=>{let{node:s,...a}=e;return(0,t.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...a})}},children:"string"==typeof e.content?e.content:""})]});return(0,t.jsxs)("div",{className:"flex flex-col gap-6 min-w-0 w-full p-4",children:[r.map((e,s)=>{let n=e.assistant,i=(null==n?void 0:n.model)||"Assistant";return(0,t.jsxs)("div",{className:"space-y-4",children:[e.user&&(0,t.jsxs)("div",{className:"space-y-2 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-blue-100 text-blue-600",children:(0,t.jsx)(N.Z,{size:16})}),(0,t.jsx)("div",{className:"text-sm font-semibold text-gray-700",children:"You"})]}),l(e.user)]}),(0,t.jsx)("div",{className:"border-t border-gray-200"}),n?(0,t.jsxs)("div",{className:"space-y-3 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-gray-100 text-gray-600",children:(0,t.jsx)(w.Z,{size:16})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-gray-700",children:i}),n.toolName&&(0,t.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:n.toolName})]})]}),n.reasoningContent&&(0,t.jsx)(L.Z,{reasoningContent:n.reasoningContent}),n.searchResults&&(0,t.jsx)(P.J,{searchResults:n.searchResults}),l(n),(n.timeToFirstToken||n.totalLatency||n.usage)&&(0,t.jsx)(Z.Z,{timeToFirstToken:n.timeToFirstToken,totalLatency:n.totalLatency,usage:n.usage,toolName:n.toolName})]}):a&&s===r.length-1?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,t.jsx)(k.Z,{size:18,className:"animate-spin"}),(0,t.jsx)("span",{children:"Generating response..."})]}):(0,t.jsx)("div",{className:"text-sm text-gray-500",children:"Waiting for a response..."})]},s)}),a&&0===r.length&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-gray-500",children:[(0,t.jsx)(k.Z,{size:18,className:"animate-spin"}),(0,t.jsx)("span",{children:"Generating response..."})]})]})}var M=a(31283);function E(e){let{value:s,onChange:a,models:n,loading:l,disabled:i}=e,[o,d]=(0,r.useState)(!1),[c,u]=(0,r.useState)(""),x=(0,r.useMemo)(()=>Array.from(new Set(n)).sort(),[n]),h=(0,r.useMemo)(()=>s&&!x.includes(s)?[s,...x]:x,[x,s]),g=o?"__custom__":s||void 0,p=()=>{let e=c.trim();if(!e){d(!1),u("");return}a(e),d(!1),u("")};return(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)(m.default,{value:g,onChange:e=>{if("__custom__"===e){d(!0),s&&!x.includes(s)?u(s):u("");return}d(!1),u(""),a(e)},disabled:i,loading:l,placeholder:l?"Loading models...":"Select a model",className:"w-full rounded-md",showSearch:!0,optionFilterProp:"children",children:[h.map(e=>(0,t.jsx)(m.default.Option,{value:e,children:e},e)),(0,t.jsx)(m.default.Option,{value:"__custom__",children:"+ Add custom model"})]}),o&&(0,t.jsx)(M.o,{className:"mt-2",placeholder:"Custom Model Name (Enter to add)",value:c,onValueChange:u,onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p())},onBlur:p,autoFocus:!0})]})}var U=a(99020),R=a(97415),I=a(67479),O=a(61994),z=a(23496),K=a(85847),D=a(79326);function B(e){let{comparison:s,onUpdate:a,onRemove:n,canRemove:l,modelOptions:i,isLoadingModels:o,apiKey:d}=e,[c,m]=(0,r.useState)(!1),u=e=>{e?a({applyAcrossModels:!0,temperature:s.temperature,maxTokens:s.maxTokens,tags:[...s.tags],vectorStores:[...s.vectorStores],guardrails:[...s.guardrails],useAdvancedParams:s.useAdvancedParams},{applyToAll:!0,keysToApply:["temperature","maxTokens","tags","vectorStores","guardrails","useAdvancedParams"]}):a({applyAcrossModels:!1})},x=e=>{a({useAdvancedParams:e},s.applyAcrossModels?{applyToAll:!0,keysToApply:["useAdvancedParams"]}:void 0)},h=(e,t)=>{a({[e]:t},s.applyAcrossModels?{applyToAll:!0,keysToApply:[e]}:void 0)},g=s.useAdvancedParams?1:.4,p=s.useAdvancedParams?"text-gray-700":"text-gray-400",v=()=>{m(e=>!e)},f=(0,t.jsxs)("div",{className:"w-[300px] max-h-[65vh] overflow-y-auto relative",children:[(0,t.jsx)("button",{onClick:()=>{m(!1)},className:"absolute top-0 right-0 p-1 hover:bg-gray-100 rounded transition-colors text-gray-500 hover:text-gray-700 z-10",children:(0,t.jsx)(y.Z,{size:14})}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)(O.Z,{checked:s.applyAcrossModels,onChange:e=>u(e.target.checked),children:(0,t.jsx)("span",{className:"text-xs font-medium",children:"Sync Settings Across Models"})})}),(0,t.jsx)(z.Z,{className:"border-gray-200"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-gray-700 mb-1.5 uppercase tracking-wide",children:"General Settings"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-600 block mb-0.5",children:"Tags"}),(0,t.jsx)(U.Z,{value:s.tags,onChange:e=>h("tags",e),accessToken:d})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-600 block mb-0.5",children:"Vector Stores"}),(0,t.jsx)(R.Z,{value:s.vectorStores,onChange:e=>h("vectorStores",e),accessToken:d})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-600 block mb-0.5",children:"Guardrails"}),(0,t.jsx)(I.Z,{value:s.guardrails,onChange:e=>h("guardrails",e),accessToken:d})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-gray-700 mb-1.5 uppercase tracking-wide",children:"Advanced Settings"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 pb-1",children:(0,t.jsx)(O.Z,{checked:s.useAdvancedParams,onChange:e=>x(e.target.checked),children:(0,t.jsx)("span",{className:"text-sm font-medium",children:"Use Advanced Parameters"})})}),(0,t.jsxs)("div",{className:"space-y-2 transition-opacity duration-200",style:{opacity:g},children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("label",{className:"text-xs font-medium ".concat(p),children:"Temperature"}),(0,t.jsx)("span",{className:"text-xs ".concat(p),children:s.temperature.toFixed(2)})]}),(0,t.jsx)(K.Z,{min:0,max:2,step:.01,value:s.temperature,onChange:e=>{h("temperature",Math.min(2,Math.max(0,Number((Array.isArray(e)?e[0]:e).toFixed(2)))))},disabled:!s.useAdvancedParams})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("label",{className:"text-xs font-medium ".concat(p),children:"Max Tokens"}),(0,t.jsx)("span",{className:"text-xs ".concat(p),children:s.maxTokens})]}),(0,t.jsx)(K.Z,{min:1,max:32768,step:1,value:s.maxTokens,onChange:e=>{h("maxTokens",Math.min(32768,Math.max(1,Math.round(Array.isArray(e)?e[0]:e))))},disabled:!s.useAdvancedParams})]})]})]})]})]})]});return(0,t.jsxs)("div",{className:"bg-white first:border-l-0 border-l border-gray-200 flex flex-col min-h-0",children:[(0,t.jsxs)("div",{className:"border-b flex items-center justify-between gap-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-1",children:[(0,t.jsx)(E,{value:s.model,models:i,loading:o,onChange:e=>a({model:e})}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)(D.Z,{content:f,trigger:[],open:c,onOpenChange:()=>{},placement:"bottomRight",destroyTooltipOnHide:!1,children:(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),v()},className:"p-2 rounded-lg transition-colors ".concat(c?"bg-gray-200 text-gray-700":"hover:bg-gray-100 text-gray-600"),children:(0,t.jsx)(b.Z,{size:18})})})})]}),l&&(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},className:"p-2 hover:bg-red-50 text-red-600 rounded-lg transition-colors",children:(0,t.jsx)(y.Z,{size:18})})]}),(0,t.jsx)("div",{className:"relative flex-1 flex flex-col min-h-0",children:(0,t.jsx)("div",{className:"flex-1 max-h-[calc(100vh-385px)] overflow-auto rounded-b-2xl",children:(0,t.jsx)(_,{messages:s.messages,isLoading:s.isLoading})})})]})}var F=a(79276);let{TextArea:W}=u.default;function G(e){let{value:s,onChange:a,onSend:r,disabled:n,hasAttachment:l,uploadComponent:i}=e,o=!n&&(s.trim().length>0||!!l);return(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[i&&(0,t.jsx)("div",{className:"flex-shrink-0 mr-2",children:i}),(0,t.jsx)(W,{value:s,onChange:e=>a(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),o&&r())},placeholder:"Type your message... (Shift+Enter for new line)",disabled:n,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,t.jsx)(h.ZP,{onClick:r,disabled:!o,icon:(0,t.jsx)(F.Z,{}),shape:"circle"})]})})}let V=["Can you summarize the key points?","What assumptions did you make?","What are the next steps?"],H=["Write me a poem","Explain quantum computing","Draft a polite email requesting a meeting"],X="/v1/chat/completions";function Y(e){let{accessToken:s,disabledPersonalKeyCreation:a}=e,[n,y]=(0,r.useState)([{id:"1",model:"",messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1},{id:"2",model:"",messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1}]),[b,N]=(0,r.useState)([]),[w,k]=(0,r.useState)(!1),[A,S]=(0,r.useState)(""),[C,T]=(0,r.useState)(null),[L,Z]=(0,r.useState)(null),[P,_]=(0,r.useState)(a?"custom":"session"),[M,E]=(0,r.useState)(""),[U,R]=(0,r.useState)("");(0,r.useEffect)(()=>{let e=setTimeout(()=>{R(M)},300);return()=>clearTimeout(e)},[M]),(0,r.useEffect)(()=>()=>{L&&URL.revokeObjectURL(L)},[L]);let I=(0,r.useMemo)(()=>"session"===P?s||"":U.trim(),[P,s,U]),O=(0,r.useMemo)(()=>n.length>0&&n.every(e=>!e.isLoading&&e.messages.some(e=>"assistant"===e.role)),[n]);(0,r.useEffect)(()=>{let e=!0;return(async()=>{if(!I){N([]);return}k(!0);try{let s=await (0,j.p)(I);if(!e)return;let a=Array.from(new Set(s.map(e=>e.model_group)));N(a)}catch(s){console.error("CompareUI: failed to fetch models",s),e&&N([])}finally{e&&k(!1)}})(),()=>{e=!1}},[I]),(0,r.useEffect)(()=>{0!==b.length&&y(e=>e.map((e,s)=>{var a,t,r,n,l;return{...e,temperature:null!==(a=e.temperature)&&void 0!==a?a:1,maxTokens:null!==(t=e.maxTokens)&&void 0!==t?t:2048,applyAcrossModels:null!==(r=e.applyAcrossModels)&&void 0!==r&&r,useAdvancedParams:null!==(n=e.useAdvancedParams)&&void 0!==n&&n,...e.model?{}:{model:null!==(l=b[s%b.length])&&void 0!==l?l:""}}}))},[b]);let z=e=>{n.length>1&&y(s=>s.filter(s=>s.id!==e))},K=(e,s,a)=>{y(t=>{var r;if((null==a?void 0:a.applyToAll)&&(null===(r=a.keysToApply)||void 0===r?void 0:r.length)){let r={};a.keysToApply.forEach(e=>{let a=s[e];void 0!==a&&(r[e]=Array.isArray(a)?[...a]:a)});let n=Object.keys(r).length>0;return t.map(a=>a.id===e?{...a,...s}:n?{...a,...r}:a)}return t.map(a=>a.id===e?{...a,...s}:a)})},D=()=>{L&&URL.revokeObjectURL(L),T(null),Z(null)},F=(e,s,a)=>{s&&y(t=>t.map(t=>{if(t.id!==e)return t;let r=[...t.messages],n=r[r.length-1];if(n&&"assistant"===n.role){var l;let e="string"==typeof n.content?n.content:"";r[r.length-1]={...n,content:e+s,model:null!==(l=n.model)&&void 0!==l?l:a}}else r.push({role:"assistant",content:s,model:a});return{...t,messages:r}}))},W=(e,s)=>{s&&y(a=>a.map(a=>{if(a.id!==e)return a;let t=[...a.messages],r=t[t.length-1];return r&&"assistant"===r.role?t[t.length-1]={...r,reasoningContent:(r.reasoningContent||"")+s}:r&&"user"===r.role&&t.push({role:"assistant",content:"",reasoningContent:s}),{...a,messages:t}}))},Y=(e,s)=>{y(a=>a.map(a=>{if(a.id!==e)return a;let t=[...a.messages],r=t[t.length-1];return r&&"assistant"===r.role?t[t.length-1]={...r,timeToFirstToken:s}:r&&"user"===r.role&&t.push({role:"assistant",content:"",timeToFirstToken:s}),{...a,messages:t}}))},q=(e,s)=>{y(a=>a.map(a=>{if(a.id!==e)return a;let t=[...a.messages],r=t[t.length-1];return r&&"assistant"===r.role?t[t.length-1]={...r,totalLatency:s}:r&&"user"===r.role&&t.push({role:"assistant",content:"",totalLatency:s}),{...a,messages:t}}))},J=(e,s,a)=>{y(t=>t.map(t=>{if(t.id!==e)return t;let r=[...t.messages],n=r[r.length-1];return n&&"assistant"===n.role&&(r[r.length-1]={...n,usage:s,toolName:a}),{...t,messages:r}}))},$=(e,s)=>{s&&y(a=>a.map(a=>{if(a.id!==e)return a;let t=[...a.messages],r=t[t.length-1];return r&&"assistant"===r.role&&(t[t.length-1]={...r,searchResults:s}),{...a,messages:t}}))},Q=!!s,ee=async e=>{let s=e.trim(),a=!!C;if(!s&&!a)return;if(!I){l.Z.fromBackend("Please provide a Virtual Key or select Current UI Session");return}if(0===n.length)return;if(n.some(e=>!e.model)){l.Z.fromBackend("Select a model before sending a message.");return}let t=a?await (0,v.Sn)(s,C):{role:"user",content:s},r=(0,v.Hk)(s,a,L||void 0,null==C?void 0:C.name),i=new Map;n.forEach(e=>{var s;let a=null!==(s=e.traceId)&&void 0!==s?s:(0,g.Z)(),n=[...e.messages.map(e=>{let{role:s,content:a}=e;return{role:s,content:Array.isArray(a)?a:"string"==typeof a?a:""}}),t];i.set(e.id,{id:e.id,model:e.model,traceId:a,tags:e.tags,vectorStores:e.vectorStores,guardrails:e.guardrails,temperature:e.temperature,maxTokens:e.maxTokens,displayMessages:[...e.messages,r],apiChatHistory:n})}),0!==i.size&&(y(e=>e.map(e=>{let s=i.get(e.id);return s?{...e,traceId:s.traceId,messages:s.displayMessages,isLoading:!0}:e})),S(""),D(),i.forEach(e=>{var s;let a=e.tags.length>0?e.tags:void 0,t=e.vectorStores.length>0?e.vectorStores:void 0,r=e.guardrails.length>0?e.guardrails:void 0,i=n.find(s=>s.id===e.id),o=null!==(s=null==i?void 0:i.useAdvancedParams)&&void 0!==s&&s;(0,f.n)(e.apiChatHistory,(s,a)=>F(e.id,s,a),e.model,I,a,void 0,s=>W(e.id,s),s=>Y(e.id,s),s=>J(e.id,s),e.traceId,t,r,void 0,void 0,s=>$(e.id,s),o?e.temperature:void 0,o?e.maxTokens:void 0,s=>q(e.id,s)).catch(s=>{let a=s instanceof Error?s.message:String(s);console.error("CompareUI: failed to fetch response",s),l.Z.fromBackend(a),y(s=>s.map(s=>{if(s.id!==e.id)return s;let t=[...s.messages],r=t[t.length-1],n=r&&"assistant"===r.role&&"string"==typeof r.content?r.content:"";return r&&"assistant"===r.role?t[t.length-1]={...r,content:n?"".concat(n,"\nError fetching response: ").concat(a):"Error fetching response: ".concat(a)}:t.push({role:"assistant",content:"Error fetching response: ".concat(a)}),{...s,messages:t}}))}).finally(()=>{y(s=>s.map(s=>s.id===e.id?{...s,isLoading:!1}:s))})}))},es=e=>{S(e)},ea=n.some(e=>e.messages.length>0),et=n.some(e=>e.isLoading),er=!!C,en=!!(null==C?void 0:C.name.toLowerCase().endsWith(".pdf")),el=!ea&&!et&&!er;return(0,t.jsx)("div",{className:"w-full h-full p-4 bg-white",children:(0,t.jsxs)("div",{className:"rounded-2xl border border-gray-200 bg-white shadow-sm min-h-[calc(100vh-160px)] flex flex-col",children:[(0,t.jsx)("div",{className:"border-b px-4 py-2",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-600",children:"Virtual Key Source"}),(0,t.jsxs)(m.default,{value:P,onChange:e=>_(e),disabled:a,className:"w-48",children:[(0,t.jsx)(m.default.Option,{value:"session",disabled:!Q,children:"Current UI Session"}),(0,t.jsx)(m.default.Option,{value:"custom",children:"Virtual Key"})]}),"custom"===P&&(0,t.jsx)(u.default.Password,{value:M,onChange:e=>E(e.target.value),placeholder:"Enter Virtual Key",className:"w-56"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-600",children:"Endpoint"}),(0,t.jsx)(x.Z,{title:"Other endpoints will be available soon",children:(0,t.jsx)(m.default,{value:X,disabled:!0,className:"w-56",children:(0,t.jsx)(m.default.Option,{value:X,children:X})})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(h.ZP,{onClick:()=>{y(e=>e.map(e=>({...e,messages:[],traceId:void 0,isLoading:!1}))),S(""),D()},disabled:!ea,icon:(0,t.jsx)(i.Z,{}),children:"Clear All Chats"}),(0,t.jsx)(x.Z,{title:n.length>=3?"Compare up to 3 models at a time":"Add another comparison",children:(0,t.jsx)(h.ZP,{onClick:()=>{var e;if(n.length>=3)return;let s=null!==(e=b[n.length%(b.length||1)])&&void 0!==e?e:"",a={id:Date.now().toString(),model:s,messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1};y(e=>[...e,a])},disabled:n.length>=3,icon:(0,t.jsx)(o.Z,{}),children:"Add Comparison"})})]})]})}),(0,t.jsx)("div",{className:"grid flex-1 min-h-0 auto-rows-[minmax(0,1fr)]",style:{gridTemplateColumns:"repeat(".concat(n.length,", minmax(0, 1fr))")},children:n.map(e=>(0,t.jsx)(B,{comparison:e,onUpdate:(s,a)=>K(e.id,s,a),onRemove:()=>z(e.id),canRemove:n.length>1,modelOptions:b,isLoadingModels:w,apiKey:I},e.id))}),(0,t.jsx)("div",{className:"flex justify-center pb-4",children:(0,t.jsx)("div",{className:"w-full max-w-3xl px-4",children:(0,t.jsxs)("div",{className:"border border-gray-200 shadow-lg rounded-xl bg-white p-4",children:[(0,t.jsx)("div",{className:"flex items-center justify-between gap-4 mb-3 min-h-8",children:er?(0,t.jsx)("span",{className:"text-sm text-gray-500",children:"Attachment ready to send"}):el?(0,t.jsx)("div",{className:"flex items-center gap-2 overflow-x-auto",children:H.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>es(e),className:"shrink-0 rounded-full border border-gray-200 px-3 py-1 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100 cursor-pointer",children:e},e))}):O&&!er?(0,t.jsx)("div",{className:"flex items-center gap-2 overflow-x-auto",children:V.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>es(e),className:"shrink-0 rounded-full border border-gray-200 px-3 py-1 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100 cursor-pointer",children:e},e))}):et?(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,t.jsx)("span",{className:"h-2 w-2 rounded-full bg-blue-500 animate-pulse","aria-hidden":!0}),"Gathering responses from all models..."]}):(0,t.jsx)("span",{className:"text-sm text-gray-500",children:"Send a prompt to compare models"})}),C&&(0,t.jsx)("div",{className:"mb-3",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:en?(0,t.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,t.jsx)(d.Z,{style:{fontSize:"16px",color:"white"}})}):(0,t.jsx)("img",{src:L||"",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:C.name}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:en?"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:D,children:(0,t.jsx)(c.Z,{style:{fontSize:"12px"}})})]})}),(0,t.jsx)(G,{value:A,onChange:e=>{S(e)},onSend:()=>{ee(A)},disabled:0===n.length||n.every(e=>e.isLoading),hasAttachment:er,uploadComponent:(0,t.jsx)(p.Z,{chatUploadedImage:C,chatImagePreviewUrl:L,onImageUpload:e=>(L&&URL.revokeObjectURL(L),T(e),Z(URL.createObjectURL(e)),!1),onRemoveImage:D})})]})})})]})})}var q=a(58643),J=a(80443),$=a(91624);function Q(){let{accessToken:e,userRole:s,userId:a,disabledPersonalKeyCreation:l,token:i}=(0,J.Z)(),[o,d]=(0,r.useState)(void 0);return(0,r.useEffect)(()=>{(async()=>{if(e){let s=await (0,$.C)(e);s&&d({PROXY_BASE_URL:s.PROXY_BASE_URL,LITELLM_UI_API_DOC_BASE_URL:s.LITELLM_UI_API_DOC_BASE_URL})}})()},[e]),(0,t.jsxs)(q.v0,{className:"h-full w-full",children:[(0,t.jsxs)(q.td,{className:"mb-0",children:[(0,t.jsx)(q.OK,{children:"Chat"}),(0,t.jsx)(q.OK,{children:"Compare"})]}),(0,t.jsxs)(q.nP,{className:"h-full",children:[(0,t.jsx)(q.x4,{className:"h-full",children:(0,t.jsx)(n.Z,{accessToken:e,token:i,userRole:s,userID:a,disabledPersonalKeyCreation:l,proxySettings:o})}),(0,t.jsx)(q.x4,{className:"h-full",children:(0,t.jsx)(Y,{accessToken:e,disabledPersonalKeyCreation:l})})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1623-995fddc2b5647961.js b/litellm/proxy/_experimental/out/_next/static/chunks/1623-995fddc2b5647961.js new file mode 100644 index 00000000000..15400abe793 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1623-995fddc2b5647961.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1623],{2894:function(t,e,s){s.d(e,{R:function(){return u},m:function(){return n}});var i=s(18238),a=s(7989),r=s(11255),n=class extends a.F{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||u(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#a({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,r.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});let i="pending"===this.state.status,a=!this.#i.canStart();try{if(i)e();else{this.#a({type:"pending",variables:t,isPaused:a}),await this.#s.config.onMutate?.(t,this,s);let e=await this.options.onMutate?.(t,s);e!==this.state.context&&this.#a({type:"pending",context:e,variables:t,isPaused:a})}let r=await this.#i.start();return await this.#s.config.onSuccess?.(r,t,this.state.context,this,s),await this.options.onSuccess?.(r,t,this.state.context,s),await this.#s.config.onSettled?.(r,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(r,null,t,this.state.context,s),this.#a({type:"success",data:r}),r}catch(e){try{throw await this.#s.config.onError?.(e,t,this.state.context,this,s),await this.options.onError?.(e,t,this.state.context,s),await this.#s.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(void 0,e,t,this.state.context,s),e}finally{this.#a({type:"error",error:e})}}finally{this.#s.runNext(this)}}#a(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),i.Vr.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function u(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21623:function(t,e,s){s.d(e,{S:function(){return y}});var i=s(45345),a=s(21733),r=s(18238),n=s(24112),u=class extends n.l{constructor(t={}){super(),this.config=t,this.#r=new Map}#r;build(t,e,s){let r=e.queryKey,n=e.queryHash??(0,i.Rm)(r,e),u=this.get(n);return u||(u=new a.A({client:t,queryKey:r,queryHash:n,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(r)}),this.add(u)),u}add(t){this.#r.has(t.queryHash)||(this.#r.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#r.get(t.queryHash);e&&(t.destroy(),e===t&&this.#r.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){r.Vr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#r.get(t)}getAll(){return[...this.#r.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,i._x)(e,t))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(e=>(0,i._x)(t,e)):e}notify(t){r.Vr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){r.Vr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){r.Vr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},o=s(2894),h=class extends n.l{constructor(t={}){super(),this.config=t,this.#n=new Set,this.#u=new Map,this.#o=0}#n;#u;#o;build(t,e,s){let i=new o.m({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#n.add(t);let e=l(t);if("string"==typeof e){let s=this.#u.get(e);s?s.push(t):this.#u.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#n.delete(t)){let e=l(t);if("string"==typeof e){let s=this.#u.get(e);if(s){if(s.length>1){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#u.delete(e)}}}this.notify({type:"removed",mutation:t})}canRun(t){let e=l(t);if("string"!=typeof e)return!0;{let s=this.#u.get(e),i=s?.find(t=>"pending"===t.state.status);return!i||i===t}}runNext(t){let e=l(t);if("string"!=typeof e)return Promise.resolve();{let s=this.#u.get(e)?.find(e=>e!==t&&e.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){r.Vr.batch(()=>{this.#n.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#n.clear(),this.#u.clear()})}getAll(){return Array.from(this.#n)}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,i.X7)(e,t))}findAll(t={}){return this.getAll().filter(e=>(0,i.X7)(t,e))}notify(t){r.Vr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return r.Vr.batch(()=>Promise.all(t.map(t=>t.continue().catch(i.ZT))))}};function l(t){return t.options.scope?.id}var c=s(87045),d=s(57853);function f(t){return{onFetch:(e,s)=>{let a=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,n=e.state.data?.pages||[],u=e.state.data?.pageParams||[],o={pages:[],pageParams:[]},h=0,l=async()=>{let s=!1,l=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(e.signal.aborted?s=!0:e.signal.addEventListener("abort",()=>{s=!0}),e.signal)})},c=(0,i.cG)(e.options,e.fetchOptions),d=async(t,a,r)=>{if(s)return Promise.reject();if(null==a&&t.pages.length)return Promise.resolve(t);let n=(()=>{let t={client:e.client,queryKey:e.queryKey,pageParam:a,direction:r?"backward":"forward",meta:e.options.meta};return l(t),t})(),u=await c(n),{maxPages:o}=e.options,h=r?i.Ht:i.VX;return{pages:h(t.pages,u,o),pageParams:h(t.pageParams,a,o)}};if(r&&n.length){let t="backward"===r,e={pages:n,pageParams:u},s=(t?function(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}:p)(a,e);o=await d(e,s,t)}else{let e=t??n.length;do{let t=0===h?u[0]??a.initialPageParam:p(a,o);if(h>0&&null==t)break;o=await d(o,t),h++}while(he.options.persister?.(l,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=l}}}function p(t,{pages:e,pageParams:s}){let i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}var y=class{#h;#s;#l;#c;#d;#f;#p;#y;constructor(t={}){this.#h=t.queryCache||new u,this.#s=t.mutationCache||new h,this.#l=t.defaultOptions||{},this.#c=new Map,this.#d=new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#p=c.j.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onFocus())}),this.#y=d.N.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#p?.(),this.#p=void 0,this.#y?.(),this.#y=void 0)}isFetching(t){return this.#h.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#s.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),s=this.#h.build(this,e),a=s.state.data;return void 0===a?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime((0,i.KC)(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(a))}getQueriesData(t){return this.#h.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){let a=this.defaultQueryOptions({queryKey:t}),r=this.#h.get(a.queryHash),n=r?.state.data,u=(0,i.SE)(e,n);if(void 0!==u)return this.#h.build(this,a).setData(u,{...s,manual:!0})}setQueriesData(t,e,s){return r.Vr.batch(()=>this.#h.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state}removeQueries(t){let e=this.#h;r.Vr.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let s=this.#h;return r.Vr.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let s={revert:!0,...e};return Promise.all(r.Vr.batch(()=>this.#h.findAll(t).map(t=>t.cancel(s)))).then(i.ZT).catch(i.ZT)}invalidateQueries(t,e={}){return r.Vr.batch(()=>(this.#h.findAll(t).forEach(t=>{t.invalidate()}),t?.refetchType==="none")?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e))}refetchQueries(t,e={}){let s={...e,cancelRefetch:e.cancelRefetch??!0};return Promise.all(r.Vr.batch(()=>this.#h.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(i.ZT)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(i.ZT)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let s=this.#h.build(this,e);return s.isStaleByTime((0,i.KC)(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(i.ZT).catch(i.ZT)}fetchInfiniteQuery(t){return t.behavior=f(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(i.ZT).catch(i.ZT)}ensureInfiniteQueryData(t){return t.behavior=f(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return d.N.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#h}getMutationCache(){return this.#s}getDefaultOptions(){return this.#l}setDefaultOptions(t){this.#l=t}setQueryDefaults(t,e){this.#c.set((0,i.Ym)(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#c.values()],s={};return e.forEach(e=>{(0,i.to)(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#d.set((0,i.Ym)(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#d.values()],s={};return e.forEach(e=>{(0,i.to)(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#l.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=(0,i.Rm)(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===i.CN&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#l.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#h.clear(),this.#s.clear()}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/170-60c318d29d5e47f2.js b/litellm/proxy/_experimental/out/_next/static/chunks/170-60c318d29d5e47f2.js new file mode 100644 index 00000000000..09300428a82 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/170-60c318d29d5e47f2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[170],{1309:function(e,l,a){a.d(l,{C:function(){return t.Z}});var t=a(41649)},60170:function(e,l,a){a.d(l,{Z:function(){return lA}});var t,i,r,s,n=a(57437),o=a(2265),d=a(78489),c=a(12485),u=a(18135),m=a(35242),x=a(29706),p=a(77991),h=a(19250),g=a(57840),f=a(37592),j=a(15690),v=a(10032),y=a(3810),_=a(22116),b=a(64504);(t=r||(r={})).PresidioPII="Presidio PII",t.Bedrock="Bedrock Guardrail",t.Lakera="Lakera";let N={},w=e=>{let l={};return l.PresidioPII="Presidio PII",l.Bedrock="Bedrock Guardrail",l.Lakera="Lakera",Object.entries(e).forEach(e=>{let[a,t]=e;t&&"object"==typeof t&&"ui_friendly_name"in t&&(l[a.split("_").map((e,l)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=t.ui_friendly_name)}),N=l,l},k=()=>Object.keys(N).length>0?N:r,C={PresidioPII:"presidio",Bedrock:"bedrock",Lakera:"lakera_v2",LitellmContentFilter:"litellm_content_filter",ToolPermission:"tool_permission"},S=e=>{Object.entries(e).forEach(e=>{let[l,a]=e;a&&"object"==typeof a&&"ui_friendly_name"in a&&(C[l.split("_").map((e,l)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=l)})},Z=e=>!!e&&"Presidio PII"===k()[e],P=e=>!!e&&"LiteLLM Content Filter"===k()[e],O="../ui/assets/logos/",I={"Presidio PII":"".concat(O,"presidio.png"),"Bedrock Guardrail":"".concat(O,"bedrock.svg"),Lakera:"".concat(O,"lakeraai.jpeg"),"Azure Content Safety Prompt Shield":"".concat(O,"presidio.png"),"Azure Content Safety Text Moderation":"".concat(O,"presidio.png"),"Aporia AI":"".concat(O,"aporia.png"),"PANW Prisma AIRS":"".concat(O,"palo_alto_networks.jpeg"),"Noma Security":"".concat(O,"noma_security.png"),"Javelin Guardrails":"".concat(O,"javelin.png"),"Pillar Guardrail":"".concat(O,"pillar.jpeg"),"Google Cloud Model Armor":"".concat(O,"google.svg"),"Guardrails AI":"".concat(O,"guardrails_ai.jpeg"),"Lasso Guardrail":"".concat(O,"lasso.png"),"Pangea Guardrail":"".concat(O,"pangea.png"),"AIM Guardrail":"".concat(O,"aim_security.jpeg"),"OpenAI Moderation":"".concat(O,"openai_small.svg"),EnkryptAI:"".concat(O,"enkrypt_ai.avif"),"Prompt Security":"".concat(O,"prompt_security.png"),"LiteLLM Content Filter":"".concat(O,"litellm_logo.jpg")},A=e=>{if(!e)return{logo:"",displayName:"-"};let l=Object.keys(C).find(l=>C[l].toLowerCase()===e.toLowerCase());if(!l)return{logo:"",displayName:e};let a=k()[l];return{logo:I[a]||"",displayName:a||e}};var L=a(99981),E=a(5545),T=a(4156),z=a(97416),B=a(8881),G=a(10798),F=a(49638);let{Text:M}=g.default,{Option:K}=f.default,D=e=>e.replace(/_/g," "),R=e=>{switch(e){case"MASK":return(0,n.jsx)(z.Z,{style:{marginRight:4}});case"BLOCK":return(0,n.jsx)(B.Z,{style:{marginRight:4}});default:return null}},J=e=>{let{categories:l,selectedCategories:a,onChange:t}=e;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center mb-2",children:[(0,n.jsx)(G.Z,{className:"text-gray-500 mr-1"}),(0,n.jsx)(M,{className:"text-gray-500 font-medium",children:"Filter by category"})]}),(0,n.jsx)(f.default,{mode:"multiple",placeholder:"Select categories to filter by",style:{width:"100%"},onChange:t,value:a,allowClear:!0,showSearch:!0,optionFilterProp:"children",className:"mb-4",tagRender:e=>(0,n.jsx)(y.Z,{color:"blue",closable:e.closable,onClose:e.onClose,className:"mr-2 mb-2",children:e.label}),children:l.map(e=>(0,n.jsx)(K,{value:e.category,children:e.category},e.category))})]})},V=e=>{let{onSelectAll:l,onUnselectAll:a,hasSelectedEntities:t}=e;return(0,n.jsxs)("div",{className:"bg-gray-50 p-5 rounded-lg mb-6 border border-gray-200 shadow-sm",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(M,{strong:!0,className:"text-gray-700 text-base",children:"Quick Actions"}),(0,n.jsx)(L.Z,{title:"Apply action to all PII types at once",children:(0,n.jsx)("div",{className:"ml-2 text-gray-400 cursor-help text-xs",children:"ⓘ"})})]}),(0,n.jsx)(E.ZP,{color:"danger",variant:"outlined",onClick:a,disabled:!t,icon:(0,n.jsx)(F.Z,{}),children:"Unselect All"})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,n.jsx)(E.ZP,{color:"primary",variant:"outlined",onClick:()=>l("MASK"),className:"h-10",block:!0,icon:(0,n.jsx)(z.Z,{}),children:"Select All & Mask"}),(0,n.jsx)(E.ZP,{color:"danger",variant:"outlined",onClick:()=>l("BLOCK"),className:"h-10 hover:bg-red-100",block:!0,icon:(0,n.jsx)(B.Z,{}),children:"Select All & Block"})]})]})},U=e=>{let{entities:l,selectedEntities:a,selectedActions:t,actions:i,onEntitySelect:r,onActionSelect:s,entityToCategoryMap:o}=e;return(0,n.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,n.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,n.jsx)(M,{strong:!0,className:"flex-1 text-gray-700",children:"PII Type"}),(0,n.jsx)(M,{strong:!0,className:"w-32 text-right text-gray-700",children:"Action"})]}),(0,n.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:0===l.length?(0,n.jsx)("div",{className:"py-10 text-center text-gray-500",children:"No PII types match your filter criteria"}):l.map(e=>(0,n.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between hover:bg-gray-50 border-b ".concat(a.includes(e)?"bg-blue-50":""),children:[(0,n.jsxs)("div",{className:"flex items-center flex-1",children:[(0,n.jsx)(T.Z,{checked:a.includes(e),onChange:()=>r(e),className:"mr-3"}),(0,n.jsx)(M,{className:a.includes(e)?"font-medium text-gray-900":"text-gray-700",children:D(e)}),o.get(e)&&(0,n.jsx)(y.Z,{className:"ml-2 text-xs",color:"blue",children:o.get(e)})]}),(0,n.jsx)("div",{className:"w-32",children:(0,n.jsx)(f.default,{value:a.includes(e)&&t[e]||"MASK",onChange:l=>s(e,l),style:{width:120},disabled:!a.includes(e),className:"".concat(a.includes(e)?"":"opacity-50"),dropdownMatchSelectWidth:!1,children:i.map(e=>(0,n.jsx)(K,{value:e,children:(0,n.jsxs)("div",{className:"flex items-center",children:[R(e),e]})},e))})})]},e))})]})},{Title:q,Text:W}=g.default;var Y=e=>{let{entities:l,actions:a,selectedEntities:t,selectedActions:i,onEntitySelect:r,onActionSelect:s,entityCategories:d=[]}=e,[c,u]=(0,o.useState)([]),m=new Map;d.forEach(e=>{e.entities.forEach(l=>{m.set(l,e.category)})});let x=l.filter(e=>0===c.length||c.includes(m.get(e)||""));return(0,n.jsxs)("div",{className:"pii-configuration",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,n.jsx)("div",{className:"flex items-center",children:(0,n.jsx)(q,{level:4,className:"!m-0 font-semibold text-gray-800",children:"Configure PII Protection"})}),(0,n.jsxs)(W,{className:"text-gray-500",children:[t.length," items selected"]})]}),(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)(J,{categories:d,selectedCategories:c,onChange:u}),(0,n.jsx)(V,{onSelectAll:e=>{l.forEach(l=>{t.includes(l)||r(l),s(l,e)})},onUnselectAll:()=>{t.forEach(e=>{r(e)})},hasSelectedEntities:t.length>0})]}),(0,n.jsx)(U,{entities:x,selectedEntities:t,selectedActions:i,actions:a,onEntitySelect:r,onActionSelect:s,entityToCategoryMap:m})]})},H=a(10353),$=a(31283),Q=a(24199),X=e=>{var l;let{selectedProvider:a,accessToken:t,providerParams:i=null,value:r=null}=e,[s,d]=(0,o.useState)(!1),[c,u]=(0,o.useState)(i),[m,x]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(i){u(i);return}let e=async()=>{if(t){d(!0),x(null);try{let e=await (0,h.getGuardrailProviderSpecificParams)(t);console.log("Provider params API response:",e),u(e),w(e),S(e)}catch(e){console.error("Error fetching provider params:",e),x("Failed to load provider parameters")}finally{d(!1)}}};i||e()},[t,i]),!a)return null;if(s)return(0,n.jsx)(H.Z,{tip:"Loading provider parameters..."});if(m)return(0,n.jsx)("div",{className:"text-red-500",children:m});let p=null===(l=C[a])||void 0===l?void 0:l.toLowerCase(),g=c&&c[p];if(console.log("Provider key:",p),console.log("Provider fields:",g),!g||0===Object.keys(g).length)return(0,n.jsx)("div",{children:"No configuration fields available for this provider."});console.log("Value:",r);let j=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0;return Object.entries(e).map(e=>{let[t,i]=e,s=l?"".concat(l,".").concat(t):t,o=a?a[t]:null==r?void 0:r[t];return(console.log("Field value:",o),"ui_friendly_name"===t||"optional_params"===t&&"nested"===i.type&&i.fields)?null:"nested"===i.type&&i.fields?(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-2 font-medium",children:t}),(0,n.jsx)("div",{className:"ml-4 border-l-2 border-gray-200 pl-4",children:j(i.fields,s,o)})]},s):(0,n.jsx)(v.Z.Item,{name:s,label:t,tooltip:i.description,rules:i.required?[{required:!0,message:"".concat(t," is required")}]:void 0,children:"select"===i.type&&i.options?(0,n.jsx)(f.default,{placeholder:i.description,defaultValue:o||i.default_value,children:i.options.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}):"multiselect"===i.type&&i.options?(0,n.jsx)(f.default,{mode:"multiple",placeholder:i.description,defaultValue:o||i.default_value,children:i.options.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}):"bool"===i.type||"boolean"===i.type?(0,n.jsxs)(f.default,{placeholder:i.description,defaultValue:void 0!==o?String(o):i.default_value,children:[(0,n.jsx)(f.default.Option,{value:"true",children:"True"}),(0,n.jsx)(f.default.Option,{value:"false",children:"False"})]}):"number"===i.type?(0,n.jsx)(Q.Z,{step:1,width:400,placeholder:i.description,defaultValue:void 0!==o?Number(o):void 0}):t.includes("password")||t.includes("secret")||t.includes("key")?(0,n.jsx)($.o,{placeholder:i.description,type:"password",defaultValue:o||""}):(0,n.jsx)($.o,{placeholder:i.description,type:"text",defaultValue:o||""})},s)})};return(0,n.jsx)(n.Fragment,{children:j(g)})};let{Title:ee}=g.default,el=e=>{let{field:l,fieldKey:a,fullFieldKey:t,value:i}=e,[r,s]=o.useState([]),[d,c]=o.useState(l.dict_key_options||[]);o.useEffect(()=>{if(i&&"object"==typeof i){let e=Object.keys(i);s(e.map(e=>({key:e,id:"".concat(e,"_").concat(Date.now(),"_").concat(Math.random())}))),c((l.dict_key_options||[]).filter(l=>!e.includes(l)))}},[i,l.dict_key_options]);let u=e=>{e&&(s([...r,{key:e,id:"".concat(e,"_").concat(Date.now())}]),c(d.filter(l=>l!==e)))},m=(e,l)=>{s(r.filter(l=>l.id!==e)),c([...d,l].sort())};return(0,n.jsxs)("div",{className:"space-y-3",children:[r.map(e=>(0,n.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[(0,n.jsx)("div",{className:"w-24 font-medium text-sm",children:e.key}),(0,n.jsx)("div",{className:"flex-1",children:(0,n.jsx)(v.Z.Item,{name:Array.isArray(t)?[...t,e.key]:[t,e.key],style:{marginBottom:0},initialValue:i&&"object"==typeof i?i[e.key]:void 0,normalize:"number"===l.dict_value_type?e=>{if(null==e||""===e)return;let l=Number(e);return isNaN(l)?e:l}:void 0,children:"number"===l.dict_value_type?(0,n.jsx)(Q.Z,{step:1,width:200,placeholder:"Enter ".concat(e.key," value")}):"boolean"===l.dict_value_type?(0,n.jsxs)(f.default,{placeholder:"Select ".concat(e.key," value"),children:[(0,n.jsx)(f.default.Option,{value:!0,children:"True"}),(0,n.jsx)(f.default.Option,{value:!1,children:"False"})]}):(0,n.jsx)($.o,{placeholder:"Enter ".concat(e.key," value"),type:"text"})})}),(0,n.jsx)("button",{type:"button",className:"text-red-500 hover:text-red-700 text-sm",onClick:()=>m(e.id,e.key),children:"Remove"})]},e.id)),d.length>0&&(0,n.jsxs)("div",{className:"flex items-center space-x-3 mt-2",children:[(0,n.jsx)(f.default,{placeholder:"Select category to configure",style:{width:200},onSelect:e=>e&&u(e),value:void 0,children:d.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}),(0,n.jsx)("span",{className:"text-sm text-gray-500",children:"Select a category to add threshold configuration"})]})]})};var ea=e=>{let{optionalParams:l,parentFieldKey:a,values:t}=e,i=(e,l)=>{let i="".concat(a,".").concat(e),r=null==t?void 0:t[e];return(console.log("value",r),"dict"===l.type&&l.dict_key_options)?(0,n.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,n.jsx)("div",{className:"mb-4 font-medium text-gray-900 text-base",children:e}),(0,n.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:l.description}),(0,n.jsx)(el,{field:l,fieldKey:e,fullFieldKey:[a,e],value:r})]},i):(0,n.jsx)("div",{className:"mb-8 p-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:(0,n.jsx)(v.Z.Item,{name:[a,e],label:(0,n.jsxs)("div",{className:"mb-2",children:[(0,n.jsx)("div",{className:"font-medium text-gray-900 text-base",children:e}),(0,n.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:l.description})]}),rules:l.required?[{required:!0,message:"".concat(e," is required")}]:void 0,className:"mb-0",initialValue:void 0!==r?r:l.default_value,normalize:"number"===l.type?e=>{if(null==e||""===e)return;let l=Number(e);return isNaN(l)?e:l}:void 0,children:"select"===l.type&&l.options?(0,n.jsx)(f.default,{placeholder:l.description,children:l.options.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}):"multiselect"===l.type&&l.options?(0,n.jsx)(f.default,{mode:"multiple",placeholder:l.description,children:l.options.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}):"bool"===l.type||"boolean"===l.type?(0,n.jsxs)(f.default,{placeholder:l.description,children:[(0,n.jsx)(f.default.Option,{value:"true",children:"True"}),(0,n.jsx)(f.default.Option,{value:"false",children:"False"})]}):"number"===l.type?(0,n.jsx)(Q.Z,{step:1,width:400,placeholder:l.description}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,n.jsx)($.o,{placeholder:l.description,type:"password"}):(0,n.jsx)($.o,{placeholder:l.description,type:"text"})})},i)};return l.fields&&0!==Object.keys(l.fields).length?(0,n.jsxs)("div",{className:"guardrail-optional-params",children:[(0,n.jsxs)("div",{className:"mb-8 pb-4 border-b border-gray-100",children:[(0,n.jsx)(ee,{level:3,className:"mb-2 font-semibold text-gray-900",children:"Optional Parameters"}),(0,n.jsx)("p",{className:"text-gray-600 text-sm",children:l.description||"Configure additional settings for this guardrail provider"})]}),(0,n.jsx)("div",{className:"space-y-8",children:Object.entries(l.fields).map(e=>{let[l,a]=e;return i(l,a)})})]}):null},et=a(9114),ei=a(5945),er=a(58760),es=a(65319),en=a(96473),eo=a(3632),ed=a(16312);let{Text:ec}=g.default,{Option:eu}=f.default;var em=e=>{let{visible:l,prebuiltPatterns:a,categories:t,selectedPatternName:i,patternAction:r,onPatternNameChange:s,onActionChange:o,onAdd:d,onCancel:c}=e;return(0,n.jsxs)(_.Z,{title:"Add prebuilt pattern",open:l,onCancel:c,footer:null,width:800,children:[(0,n.jsxs)(er.Z,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(ec,{strong:!0,children:"Pattern type"}),(0,n.jsx)(f.default,{placeholder:"Choose pattern type",value:i,onChange:s,style:{width:"100%",marginTop:8},showSearch:!0,filterOption:(e,l)=>{let t=a.find(e=>e.name===(null==l?void 0:l.value));return!!t&&(t.display_name.toLowerCase().includes(e.toLowerCase())||t.name.toLowerCase().includes(e.toLowerCase()))},children:t.map(e=>{let l=a.filter(l=>l.category===e);return 0===l.length?null:(0,n.jsx)(f.default.OptGroup,{label:e,children:l.map(e=>(0,n.jsx)(eu,{value:e.name,children:e.display_name},e.name))},e)})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ec,{strong:!0,children:"Action"}),(0,n.jsx)(ec,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,n.jsxs)(f.default,{value:r,onChange:o,style:{width:"100%"},children:[(0,n.jsx)(eu,{value:"BLOCK",children:"Block"}),(0,n.jsx)(eu,{value:"MASK",children:"Mask"})]})]})]}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,n.jsx)(ed.z,{variant:"secondary",onClick:c,children:"Cancel"}),(0,n.jsx)(ed.z,{onClick:d,children:"Add"})]})]})};let{Text:ex}=g.default,{Option:ep}=f.default;var eh=e=>{let{visible:l,patternName:a,patternRegex:t,patternAction:i,onNameChange:r,onRegexChange:s,onActionChange:o,onAdd:d,onCancel:c}=e;return(0,n.jsxs)(_.Z,{title:"Add custom regex pattern",open:l,onCancel:c,footer:null,width:800,children:[(0,n.jsxs)(er.Z,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(ex,{strong:!0,children:"Pattern name"}),(0,n.jsx)(b.o,{placeholder:"e.g., internal_id, employee_code",value:a,onValueChange:r,style:{marginTop:8}})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ex,{strong:!0,children:"Regex pattern"}),(0,n.jsx)(b.o,{placeholder:"e.g., ID-[0-9]{6}",value:t,onValueChange:s,style:{marginTop:8}}),(0,n.jsx)(ex,{type:"secondary",style:{fontSize:12},children:"Enter a valid regular expression to match sensitive data"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ex,{strong:!0,children:"Action"}),(0,n.jsx)(ex,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,n.jsxs)(f.default,{value:i,onChange:o,style:{width:"100%"},children:[(0,n.jsx)(ep,{value:"BLOCK",children:"Block"}),(0,n.jsx)(ep,{value:"MASK",children:"Mask"})]})]})]}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,n.jsx)(b.z,{variant:"secondary",onClick:c,children:"Cancel"}),(0,n.jsx)(b.z,{onClick:d,children:"Add"})]})]})},eg=a(49566),ef=a(16853);let{Text:ej}=g.default,{Option:ev}=f.default;var ey=e=>{let{visible:l,keyword:a,action:t,description:i,onKeywordChange:r,onActionChange:s,onDescriptionChange:o,onAdd:c,onCancel:u}=e;return(0,n.jsxs)(_.Z,{title:"Add blocked keyword",open:l,onCancel:u,footer:null,width:800,children:[(0,n.jsxs)(er.Z,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(ej,{strong:!0,children:"Keyword"}),(0,n.jsx)(eg.Z,{placeholder:"Enter sensitive keyword or phrase",value:a,onValueChange:r,style:{marginTop:8}})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ej,{strong:!0,children:"Action"}),(0,n.jsx)(ej,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this keyword is detected"}),(0,n.jsxs)(f.default,{value:t,onChange:s,style:{width:"100%"},children:[(0,n.jsx)(ev,{value:"BLOCK",children:"Block"}),(0,n.jsx)(ev,{value:"MASK",children:"Mask"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ej,{strong:!0,children:"Description (optional)"}),(0,n.jsx)(ef.Z,{placeholder:"Explain why this keyword is sensitive",value:i,onValueChange:o,rows:3,style:{marginTop:8}})]})]}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,n.jsx)(d.Z,{variant:"secondary",onClick:u,children:"Cancel"}),(0,n.jsx)(d.Z,{onClick:c,children:"Add"})]})]})},e_=a(56609),eb=a(26349);let{Text:eN}=g.default,{Option:ew}=f.default;var ek=e=>{let{patterns:l,onActionChange:a,onRemove:t}=e,i=[{title:"Type",dataIndex:"type",key:"type",width:100,render:e=>(0,n.jsx)(y.Z,{color:"prebuilt"===e?"blue":"green",children:"prebuilt"===e?"Prebuilt":"Custom"})},{title:"Pattern name",dataIndex:"name",key:"name",render:(e,l)=>l.display_name||l.name},{title:"Regex pattern",dataIndex:"pattern",key:"pattern",render:e=>e?(0,n.jsxs)(eN,{code:!0,style:{fontSize:12},children:[e.substring(0,40),"..."]}):"-"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,l)=>(0,n.jsxs)(f.default,{value:e,onChange:e=>a(l.id,e),style:{width:120},size:"small",children:[(0,n.jsx)(ew,{value:"BLOCK",children:"Block"}),(0,n.jsx)(ew,{value:"MASK",children:"Mask"})]})},{title:"",key:"actions",width:100,render:(e,l)=>(0,n.jsx)(ed.z,{type:"button",variant:"light",color:"red",size:"xs",icon:eb.Z,onClick:()=>t(l.id),children:"Delete"})}];return 0===l.length?(0,n.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No patterns added."}):(0,n.jsx)(e_.Z,{dataSource:l,columns:i,rowKey:"id",pagination:!1,size:"small"})};let{Text:eC}=g.default,{Option:eS}=f.default;var eZ=e=>{let{keywords:l,onActionChange:a,onRemove:t}=e,i=[{title:"Keyword",dataIndex:"keyword",key:"keyword"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,l)=>(0,n.jsxs)(f.default,{value:e,onChange:e=>a(l.id,"action",e),style:{width:120},size:"small",children:[(0,n.jsx)(eS,{value:"BLOCK",children:"Block"}),(0,n.jsx)(eS,{value:"MASK",children:"Mask"})]})},{title:"Description",dataIndex:"description",key:"description",render:e=>e||"-"},{title:"",key:"actions",width:100,render:(e,l)=>(0,n.jsx)(ed.z,{type:"button",variant:"light",color:"red",size:"xs",icon:eb.Z,onClick:()=>t(l.id),children:"Delete"})}];return 0===l.length?(0,n.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No keywords added."}):(0,n.jsx)(e_.Z,{dataSource:l,columns:i,rowKey:"id",pagination:!1,size:"small"})};let{Title:eP,Text:eO}=g.default;var eI=e=>{let{prebuiltPatterns:l,categories:a,selectedPatterns:t,blockedWords:i,onPatternAdd:r,onPatternRemove:s,onPatternActionChange:d,onBlockedWordAdd:c,onBlockedWordRemove:u,onBlockedWordUpdate:m,onFileUpload:x,accessToken:p,showStep:g}=e,[f,j]=(0,o.useState)(!1),[v,y]=(0,o.useState)(!1),[_,b]=(0,o.useState)(!1),[N,w]=(0,o.useState)(""),[k,C]=(0,o.useState)("BLOCK"),[S,Z]=(0,o.useState)(""),[P,O]=(0,o.useState)(""),[I,A]=(0,o.useState)("BLOCK"),[L,E]=(0,o.useState)(""),[T,z]=(0,o.useState)("BLOCK"),[B,G]=(0,o.useState)(""),[F,M]=(0,o.useState)(!1),K=async e=>{M(!0);try{let l=await e.text();if(p){let e=await (0,h.validateBlockedWordsFile)(p,l);if(e.valid)x&&x(l),et.Z.success(e.message||"File uploaded successfully");else{let l=e.error||e.errors&&e.errors.join(", ")||"Invalid file";et.Z.error("Validation failed: ".concat(l))}}}catch(e){et.Z.error("Failed to upload file: ".concat(e))}finally{M(!1)}return!1};return(0,n.jsxs)("div",{className:"space-y-6",children:[!g&&(0,n.jsx)("div",{children:(0,n.jsx)(eO,{type:"secondary",children:"Configure patterns and keywords to detect and filter sensitive information in requests and responses."})}),(!g||"patterns"===g)&&(0,n.jsxs)(ei.Z,{title:(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,n.jsx)(eP,{level:5,style:{margin:0},children:"Pattern Detection"}),(0,n.jsx)(eO,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Detect sensitive information using regex patterns (SSN, credit cards, API keys, etc.)"})]}),size:"small",children:[(0,n.jsx)("div",{style:{marginBottom:16},children:(0,n.jsxs)(er.Z,{children:[(0,n.jsx)(ed.z,{type:"button",onClick:()=>j(!0),icon:en.Z,children:"Add prebuilt pattern"}),(0,n.jsx)(ed.z,{type:"button",onClick:()=>b(!0),variant:"secondary",icon:en.Z,children:"Add custom regex"})]})}),(0,n.jsx)(ek,{patterns:t,onActionChange:d,onRemove:s})]}),(!g||"keywords"===g)&&(0,n.jsxs)(ei.Z,{title:(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,n.jsx)(eP,{level:5,style:{margin:0},children:"Blocked Keywords"}),(0,n.jsx)(eO,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Block or mask specific sensitive terms and phrases"})]}),size:"small",children:[(0,n.jsx)("div",{style:{marginBottom:16},children:(0,n.jsxs)(er.Z,{children:[(0,n.jsx)(ed.z,{type:"button",onClick:()=>y(!0),icon:en.Z,children:"Add keyword"}),(0,n.jsx)(es.default,{beforeUpload:K,accept:".yaml,.yml",showUploadList:!1,children:(0,n.jsx)(ed.z,{type:"button",variant:"secondary",icon:eo.Z,loading:F,children:"Upload YAML file"})})]})}),(0,n.jsx)(eZ,{keywords:i,onActionChange:m,onRemove:u})]}),(0,n.jsx)(em,{visible:f,prebuiltPatterns:l,categories:a,selectedPatternName:N,patternAction:k,onPatternNameChange:w,onActionChange:e=>C(e),onAdd:()=>{if(!N){et.Z.error("Please select a pattern");return}let e=l.find(e=>e.name===N);r({id:"pattern-".concat(Date.now()),type:"prebuilt",name:N,display_name:null==e?void 0:e.display_name,action:k}),j(!1),w(""),C("BLOCK")},onCancel:()=>{j(!1),w(""),C("BLOCK")}}),(0,n.jsx)(eh,{visible:_,patternName:S,patternRegex:P,patternAction:I,onNameChange:Z,onRegexChange:O,onActionChange:e=>A(e),onAdd:()=>{if(!S||!P){et.Z.error("Please provide pattern name and regex");return}r({id:"custom-".concat(Date.now()),type:"custom",name:S,pattern:P,action:I}),b(!1),Z(""),O(""),A("BLOCK")},onCancel:()=>{b(!1),Z(""),O(""),A("BLOCK")}}),(0,n.jsx)(ey,{visible:v,keyword:L,action:T,description:B,onKeywordChange:E,onActionChange:e=>z(e),onDescriptionChange:G,onAdd:()=>{if(!L){et.Z.error("Please enter a keyword");return}c({id:"word-".concat(Date.now()),keyword:L,action:T,description:B||void 0}),y(!1),E(""),G(""),z("BLOCK")},onCancel:()=>{y(!1),E(""),G(""),z("BLOCK")}})]})},eA=a(78801),eL=a(4260),eE=a(23496),eT=a(85180),ez=a(15424);let eB={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},eG=e=>({...eB,...e||{},rules:(null==e?void 0:e.rules)?[...e.rules]:[]});var eF=e=>{let{value:l,onChange:a,disabled:t=!1}=e,i=eG(l),r=e=>{let l={...i,...e};null==a||a(l)},s=(e,l)=>{r({rules:i.rules.map((a,t)=>t===e?{...a,...l}:a)})},o=e=>{r({rules:i.rules.filter((l,a)=>a!==e)})},d=(e,l)=>{let a=i.rules[e];if(!a)return;let t=Object.entries(a.allowed_param_patterns||{});l(t);let r={};t.forEach(e=>{let[l,a]=e;r[l]=a}),s(e,{allowed_param_patterns:Object.keys(r).length>0?r:void 0})},c=(e,l,a)=>{d(e,e=>{if(!e[l])return;let[,t]=e[l];e[l]=[a,t]})},u=(e,l,a)=>{d(e,e=>{if(!e[l])return;let[t]=e[l];e[l]=[t,a]})},m=(e,l)=>{let a=Object.entries(e.allowed_param_patterns||{});return 0===a.length?(0,n.jsx)(E.ZP,{disabled:t,size:"small",onClick:()=>s(l,{allowed_param_patterns:{"":""}}),children:"+ Restrict tool arguments (optional)"}):(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(eA.x,{className:"text-sm text-gray-600",children:"Argument constraints (dot or array paths)"}),a.map((a,i)=>{let[r,s]=a;return(0,n.jsxs)(er.Z,{align:"start",children:[(0,n.jsx)(eL.default,{disabled:t,placeholder:"messages[0].content",value:r,onChange:e=>c(l,i,e.target.value)}),(0,n.jsx)(eL.default,{disabled:t,placeholder:"^email@.*$",value:s,onChange:e=>u(l,i,e.target.value)}),(0,n.jsx)(E.ZP,{disabled:t,icon:(0,n.jsx)(eb.Z,{}),danger:!0,onClick:()=>d(l,e=>{e.splice(i,1)})})]},"".concat(e.id||l,"-").concat(i))}),(0,n.jsx)(E.ZP,{disabled:t,size:"small",onClick:()=>s(l,{allowed_param_patterns:{...e.allowed_param_patterns||{},"":""}}),children:"+ Add another constraint"})]})};return(0,n.jsxs)(eA.Z,{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(eA.x,{className:"text-lg font-semibold",children:"LiteLLM Tool Permission Guardrail"}),(0,n.jsx)(eA.x,{className:"text-sm text-gray-500",children:"Provide regex patterns (e.g., ^mcp__github_.*$) for tool names or types and optionally constrain payload fields."})]}),!t&&(0,n.jsx)(E.ZP,{icon:(0,n.jsx)(en.Z,{}),type:"primary",onClick:()=>{r({rules:[...i.rules,{id:"rule_".concat(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,n.jsx)(eE.Z,{}),0===i.rules.length?(0,n.jsx)(eT.Z,{description:"No tool rules added yet"}):(0,n.jsx)("div",{className:"space-y-4",children:i.rules.map((e,l)=>{var a,i;return(0,n.jsxs)(eA.Z,{className:"bg-gray-50",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,n.jsxs)(eA.x,{className:"font-semibold",children:["Rule ",l+1]}),(0,n.jsx)(E.ZP,{icon:(0,n.jsx)(eb.Z,{}),danger:!0,type:"text",disabled:t,onClick:()=>o(l),children:"Remove"})]}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(eA.x,{className:"text-sm font-medium",children:"Rule ID"}),(0,n.jsx)(eL.default,{disabled:t,placeholder:"unique_rule_id",value:e.id,onChange:e=>s(l,{id:e.target.value})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(eA.x,{className:"text-sm font-medium",children:"Tool Name (optional)"}),(0,n.jsx)(eL.default,{disabled:t,placeholder:"^mcp__github_.*$",value:null!==(a=e.tool_name)&&void 0!==a?a:"",onChange:e=>s(l,{tool_name:""===e.target.value.trim()?void 0:e.target.value})})]})]}),(0,n.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 mt-4",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(eA.x,{className:"text-sm font-medium",children:"Tool Type (optional)"}),(0,n.jsx)(eL.default,{disabled:t,placeholder:"^function$",value:null!==(i=e.tool_type)&&void 0!==i?i:"",onChange:e=>s(l,{tool_type:""===e.target.value.trim()?void 0:e.target.value})})]})}),(0,n.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[(0,n.jsx)(eA.x,{className:"text-sm font-medium",children:"Decision"}),(0,n.jsxs)(f.default,{disabled:t,value:e.decision,style:{width:200},onChange:e=>s(l,{decision:e}),children:[(0,n.jsx)(f.default.Option,{value:"allow",children:"Allow"}),(0,n.jsx)(f.default.Option,{value:"deny",children:"Deny"})]})]}),(0,n.jsx)("div",{className:"mt-4",children:m(e,l)})]},e.id||l)})}),(0,n.jsx)(eE.Z,{}),(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(eA.x,{className:"text-sm font-medium",children:"Default action"}),(0,n.jsxs)(f.default,{disabled:t,value:i.default_action,onChange:e=>r({default_action:e}),children:[(0,n.jsx)(f.default.Option,{value:"allow",children:"Allow"}),(0,n.jsx)(f.default.Option,{value:"deny",children:"Deny"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)(eA.x,{className:"text-sm font-medium flex items-center gap-1",children:["On disallowed action",(0,n.jsx)(L.Z,{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,n.jsx)(ez.Z,{})})]}),(0,n.jsxs)(f.default,{disabled:t,value:i.on_disallowed_action,onChange:e=>r({on_disallowed_action:e}),children:[(0,n.jsx)(f.default.Option,{value:"block",children:"Block"}),(0,n.jsx)(f.default.Option,{value:"rewrite",children:"Rewrite"})]})]})]}),(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsx)(eA.x,{className:"text-sm font-medium",children:"Violation message (optional)"}),(0,n.jsx)(eL.default.TextArea,{disabled:t,rows:3,placeholder:"This violates our org policy...",value:i.violation_message_template,onChange:e=>r({violation_message_template:e.target.value})})]})]})};let{Title:eM,Text:eK,Link:eD}=g.default,{Option:eR}=f.default,{Step:eJ}=j.default,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"};var eU=e=>{let{visible:l,onClose:a,accessToken:t,onSuccess:i}=e,[r]=v.Z.useForm(),[s,d]=(0,o.useState)(!1),[c,u]=(0,o.useState)(null),[m,x]=(0,o.useState)(null),[p,g]=(0,o.useState)([]),[N,O]=(0,o.useState)({}),[A,L]=(0,o.useState)(0),[E,T]=(0,o.useState)(null),[z,B]=(0,o.useState)([]),[G,F]=(0,o.useState)(2),[M,K]=(0,o.useState)({}),[D,R]=(0,o.useState)([]),[J,V]=(0,o.useState)([]),[U,q]=(0,o.useState)({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),W=(0,o.useMemo)(()=>!!c&&"tool_permission"===(C[c]||"").toLowerCase(),[c]);(0,o.useEffect)(()=>{t&&(async()=>{try{let[e,l]=await Promise.all([(0,h.getGuardrailUISettings)(t),(0,h.getGuardrailProviderSpecificParams)(t)]);x(e),T(l),w(l),S(l)}catch(e){console.error("Error fetching guardrail data:",e),et.Z.fromBackend("Failed to load guardrail configuration")}})()},[t]);let H=e=>{u(e),r.setFieldsValue({config:void 0,presidio_analyzer_api_base:void 0,presidio_anonymizer_api_base:void 0}),g([]),O({}),B([]),F(2),K({}),q({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""})},$=e=>{g(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},Q=(e,l)=>{O(a=>({...a,[e]:l}))},ee=async()=>{try{if(0===A&&(await r.validateFields(["guardrail_name","provider","mode","default_on"]),c)){let e=["guardrail_name","provider","mode","default_on"];"PresidioPII"===c&&e.push("presidio_analyzer_api_base","presidio_anonymizer_api_base"),await r.validateFields(e)}if(1===A&&Z(c)&&0===p.length){et.Z.fromBackend("Please select at least one PII entity to continue");return}L(A+1)}catch(e){console.error("Form validation failed:",e)}},el=()=>{L(A-1)},ei=()=>{r.resetFields(),u(null),g([]),O({}),B([]),F(2),K({}),R([]),V([]),q({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),L(0)},er=()=>{ei(),a()},es=async()=>{try{d(!0),await r.validateFields();let l=r.getFieldsValue(!0),s=C[l.provider],n={guardrail_name:l.guardrail_name,litellm_params:{guardrail:s,mode:l.mode,default_on:l.default_on},guardrail_info:{}};if("PresidioPII"===l.provider&&p.length>0){let e={};p.forEach(l=>{e[l]=N[l]||"MASK"}),n.litellm_params.pii_entities_config=e,l.presidio_analyzer_api_base&&(n.litellm_params.presidio_analyzer_api_base=l.presidio_analyzer_api_base),l.presidio_anonymizer_api_base&&(n.litellm_params.presidio_anonymizer_api_base=l.presidio_anonymizer_api_base)}if(P(l.provider))D.length>0&&(n.litellm_params.patterns=D.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}))),J.length>0&&(n.litellm_params.blocked_words=J.map(e=>({keyword:e.keyword,action:e.action,description:e.description})));else if(l.config)try{let e=JSON.parse(l.config);n.guardrail_info=e}catch(e){et.Z.fromBackend("Invalid JSON in configuration"),d(!1);return}if("tool_permission"===s){if(0===U.rules.length){et.Z.fromBackend("Add at least one tool permission rule"),d(!1);return}n.litellm_params.rules=U.rules,n.litellm_params.default_action=U.default_action,n.litellm_params.on_disallowed_action=U.on_disallowed_action,U.violation_message_template&&(n.litellm_params.violation_message_template=U.violation_message_template)}if(console.log("values: ",JSON.stringify(l)),E&&c){var e;let a=null===(e=C[c])||void 0===e?void 0:e.toLowerCase();console.log("providerKey: ",a);let t=E[a]||{},i=new Set;console.log("providerSpecificParams: ",JSON.stringify(t)),Object.keys(t).forEach(e=>{"optional_params"!==e&&i.add(e)}),t.optional_params&&t.optional_params.fields&&Object.keys(t.optional_params.fields).forEach(e=>{i.add(e)}),console.log("allowedParams: ",i),i.forEach(e=>{let a=l[e];if(null==a||""===a){var t;a=null===(t=l.optional_params)||void 0===t?void 0:t[e]}null!=a&&""!==a&&(n.litellm_params[e]=a)})}if(!t)throw Error("No access token available");console.log("Sending guardrail data:",JSON.stringify(n)),await (0,h.createGuardrailCall)(t,n),et.Z.success("Guardrail created successfully"),ei(),i(),a()}catch(e){console.error("Failed to create guardrail:",e),et.Z.fromBackend("Failed to create guardrail: "+(e instanceof Error?e.message:String(e)))}finally{d(!1)}},en=()=>{var e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,n.jsx)(b.o,{placeholder:"Enter a name for this guardrail"})}),(0,n.jsx)(v.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,n.jsx)(f.default,{placeholder:"Select a guardrail provider",onChange:H,labelInValue:!1,optionLabelProp:"label",dropdownRender:e=>e,showSearch:!0,children:Object.entries(k()).map(e=>{let[l,a]=e;return(0,n.jsx)(eR,{value:l,label:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[I[a]&&(0,n.jsx)("img",{src:I[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,n.jsx)("span",{children:a})]}),children:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[I[a]&&(0,n.jsx)("img",{src:I[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,n.jsx)("span",{children:a})]})},l)})})}),(0,n.jsx)(v.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,n.jsx)(f.default,{optionLabelProp:"label",mode:"multiple",children:(null==m?void 0:null===(e=m.supported_modes)||void 0===e?void 0:e.map(e=>(0,n.jsx)(eR,{value:e,label:e,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:e}),"pre_call"===e&&(0,n.jsx)(y.Z,{color:"green",style:{marginLeft:"8px"},children:"Recommended"})]}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV[e]})]})},e)))||(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eR,{value:"pre_call",label:"pre_call",children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"pre_call"})," ",(0,n.jsx)(y.Z,{color:"green",children:"Recommended"})]}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.pre_call})]})}),(0,n.jsx)(eR,{value:"during_call",label:"during_call",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:(0,n.jsx)("strong",{children:"during_call"})}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.during_call})]})}),(0,n.jsx)(eR,{value:"post_call",label:"post_call",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:(0,n.jsx)("strong",{children:"post_call"})}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.post_call})]})}),(0,n.jsx)(eR,{value:"logging_only",label:"logging_only",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:(0,n.jsx)("strong",{children:"logging_only"})}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.logging_only})]})})]})})}),(0,n.jsx)(v.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default.",children:(0,n.jsxs)(f.default,{children:[(0,n.jsx)(f.default.Option,{value:!0,children:"Yes"}),(0,n.jsx)(f.default.Option,{value:!1,children:"No"})]})}),!W&&(0,n.jsx)(X,{selectedProvider:c,accessToken:t,providerParams:E})]})},eo=()=>m&&"PresidioPII"===c?(0,n.jsx)(Y,{entities:m.supported_entities,actions:m.supported_actions,selectedEntities:p,selectedActions:N,onEntitySelect:$,onActionSelect:Q,entityCategories:m.pii_entity_categories}):null,ed=e=>{if(!m||!P(c))return null;let l=m.content_filter_settings;return l?(0,n.jsx)(eI,{prebuiltPatterns:l.prebuilt_patterns||[],categories:l.pattern_categories||[],selectedPatterns:D,blockedWords:J,onPatternAdd:e=>R([...D,e]),onPatternRemove:e=>R(D.filter(l=>l.id!==e)),onPatternActionChange:(e,l)=>{R(D.map(a=>a.id===e?{...a,action:l}:a))},onBlockedWordAdd:e=>V([...J,e]),onBlockedWordRemove:e=>V(J.filter(l=>l.id!==e)),onBlockedWordUpdate:(e,l,a)=>{V(J.map(t=>t.id===e?{...t,[l]:a}:t))},accessToken:t,showStep:e}):null},ec=()=>{var e;if(!c)return null;if(W)return(0,n.jsx)(eF,{value:U,onChange:q});if(!E)return null;console.log("guardrail_provider_map: ",C),console.log("selectedProvider: ",c);let l=null===(e=C[c])||void 0===e?void 0:e.toLowerCase(),a=E&&E[l];return a&&a.optional_params?(0,n.jsx)(ea,{optionalParams:a.optional_params,parentFieldKey:"optional_params"}):null};return(0,n.jsx)(_.Z,{title:"Add Guardrail",open:l,onCancel:er,footer:null,width:700,children:(0,n.jsxs)(v.Z,{form:r,layout:"vertical",initialValues:{mode:"pre_call",default_on:!1},children:[(0,n.jsxs)(j.default,{current:A,className:"mb-6",children:[(0,n.jsx)(eJ,{title:"Basic Info"}),(0,n.jsx)(eJ,{title:Z(c)?"PII Configuration":P(c)?"Pattern Detection":"Provider Configuration"}),P(c)&&(0,n.jsx)(eJ,{title:"Blocked Keywords"})]}),(()=>{switch(A){case 0:return en();case 1:if(Z(c))return eo();if(P(c))return ed("patterns");return ec();case 2:if(P(c))return ed("keywords");return null;default:return null}})(),(()=>{let e=A===(P(c)?3:2)-1;return(0,n.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[A>0&&(0,n.jsx)(b.z,{variant:"secondary",onClick:el,children:"Previous"}),!e&&(0,n.jsx)(b.z,{onClick:ee,children:"Next"}),e&&(0,n.jsx)(b.z,{onClick:es,loading:s,children:"Create Guardrail"}),(0,n.jsx)(b.z,{variant:"secondary",onClick:er,children:"Cancel"})]})})()]})})},eq=a(47323),eW=a(21626),eY=a(97214),eH=a(28241),e$=a(58834),eQ=a(69552),eX=a(71876),e0=a(74998),e1=a(44633),e4=a(86462),e2=a(49084),e5=a(1309),e8=a(71594),e6=a(24525),e3=a(63709);let{Title:e9,Text:e7}=g.default,{Option:le}=f.default;var ll=e=>{var l;let{visible:a,onClose:t,accessToken:i,onSuccess:r,guardrailId:s,initialValues:d}=e,[c]=v.Z.useForm(),[u,m]=(0,o.useState)(!1),[x,p]=(0,o.useState)((null==d?void 0:d.provider)||null),[g,j]=(0,o.useState)(null),[y,N]=(0,o.useState)([]),[w,S]=(0,o.useState)({});(0,o.useEffect)(()=>{(async()=>{try{if(!i)return;let e=await (0,h.getGuardrailUISettings)(i);j(e)}catch(e){console.error("Error fetching guardrail settings:",e),et.Z.fromBackend("Failed to load guardrail settings")}})()},[i]),(0,o.useEffect)(()=>{(null==d?void 0:d.pii_entities_config)&&Object.keys(d.pii_entities_config).length>0&&(N(Object.keys(d.pii_entities_config)),S(d.pii_entities_config))},[d]);let Z=e=>{N(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},P=(e,l)=>{S(a=>({...a,[e]:l}))},O=async()=>{try{m(!0);let e=await c.validateFields(),l=C[e.provider],a={guardrail_id:s,guardrail:{guardrail_name:e.guardrail_name,litellm_params:{guardrail:l,mode:e.mode,default_on:e.default_on},guardrail_info:{}}};if("PresidioPII"===e.provider&&y.length>0){let e={};y.forEach(l=>{e[l]=w[l]||"MASK"}),a.guardrail.litellm_params.pii_entities_config=e}else if(e.config)try{let l=JSON.parse(e.config);"Bedrock"===e.provider&&l?(l.guardrail_id&&(a.guardrail.litellm_params.guardrailIdentifier=l.guardrail_id),l.guardrail_version&&(a.guardrail.litellm_params.guardrailVersion=l.guardrail_version)):a.guardrail.guardrail_info=l}catch(e){et.Z.fromBackend("Invalid JSON in configuration"),m(!1);return}if(!i)throw Error("No access token available");console.log("Sending guardrail update data:",JSON.stringify(a));let n=await fetch("/guardrails/".concat(s),{method:"PUT",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(a)});if(!n.ok){let e=await n.text();throw Error(e||"Failed to update guardrail")}et.Z.success("Guardrail updated successfully"),r(),t()}catch(e){console.error("Failed to update guardrail:",e),et.Z.fromBackend("Failed to update guardrail: "+(e instanceof Error?e.message:String(e)))}finally{m(!1)}},A=()=>g&&x&&"PresidioPII"===x?(0,n.jsx)(Y,{entities:g.supported_entities,actions:g.supported_actions,selectedEntities:y,selectedActions:w,onEntitySelect:Z,onActionSelect:P,entityCategories:g.pii_entity_categories}):null;return(0,n.jsx)(_.Z,{title:"Edit Guardrail",open:a,onCancel:t,footer:null,width:700,children:(0,n.jsxs)(v.Z,{form:c,layout:"vertical",initialValues:d,children:[(0,n.jsx)(v.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,n.jsx)(b.o,{placeholder:"Enter a name for this guardrail"})}),(0,n.jsx)(v.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,n.jsx)(f.default,{placeholder:"Select a guardrail provider",onChange:e=>{p(e),c.setFieldsValue({config:void 0}),N([]),S({})},disabled:!0,optionLabelProp:"label",children:Object.entries(k()).map(e=>{let[l,a]=e;return(0,n.jsx)(le,{value:l,label:a,children:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[I[a]&&(0,n.jsx)("img",{src:I[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,n.jsx)("span",{children:a})]})},l)})})}),(0,n.jsx)(v.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,n.jsx)(f.default,{children:(null==g?void 0:null===(l=g.supported_modes)||void 0===l?void 0:l.map(e=>(0,n.jsx)(le,{value:e,children:e},e)))||(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(le,{value:"pre_call",children:"pre_call"}),(0,n.jsx)(le,{value:"post_call",children:"post_call"})]})})}),(0,n.jsx)(v.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default",valuePropName:"checked",children:(0,n.jsx)(e3.Z,{})}),(()=>{if(!x)return null;if("PresidioPII"===x)return A();switch(x){case"Aporia":return(0,n.jsx)(v.Z.Item,{label:"Aporia Configuration",name:"config",tooltip:"JSON configuration for Aporia",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aporia_api_key",\n "project_name": "your_project_name"\n}'})});case"AimSecurity":return(0,n.jsx)(v.Z.Item,{label:"Aim Security Configuration",name:"config",tooltip:"JSON configuration for Aim Security",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aim_api_key"\n}'})});case"Bedrock":return(0,n.jsx)(v.Z.Item,{label:"Amazon Bedrock Configuration",name:"config",tooltip:"JSON configuration for Amazon Bedrock guardrails",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "guardrail_id": "your_guardrail_id",\n "guardrail_version": "your_guardrail_version"\n}'})});case"GuardrailsAI":return(0,n.jsx)(v.Z.Item,{label:"Guardrails.ai Configuration",name:"config",tooltip:"JSON configuration for Guardrails.ai",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_guardrails_api_key",\n "guardrail_id": "your_guardrail_id"\n}'})});case"LakeraAI":return(0,n.jsx)(v.Z.Item,{label:"Lakera AI Configuration",name:"config",tooltip:"JSON configuration for Lakera AI",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_lakera_api_key"\n}'})});case"PromptInjection":return(0,n.jsx)(v.Z.Item,{label:"Prompt Injection Configuration",name:"config",tooltip:"JSON configuration for prompt injection detection",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "threshold": 0.8\n}'})});default:return(0,n.jsx)(v.Z.Item,{label:"Custom Configuration",name:"config",tooltip:"JSON configuration for your custom guardrail",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "key1": "value1",\n "key2": "value2"\n}'})})}})(),(0,n.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[(0,n.jsx)(b.z,{variant:"secondary",onClick:t,children:"Cancel"}),(0,n.jsx)(b.z,{onClick:O,loading:u,children:"Update Guardrail"})]})]})})};(i=s||(s={})).DB="db",i.CONFIG="config";var la=e=>{let{guardrailsList:l,isLoading:a,onDeleteClick:t,accessToken:i,onGuardrailUpdated:r,isAdmin:c=!1,onGuardrailClick:u}=e,[m,x]=(0,o.useState)([{id:"created_at",desc:!0}]),[p,h]=(0,o.useState)(!1),[g,f]=(0,o.useState)(null),j=e=>e?new Date(e).toLocaleString():"-",v=[{header:"Guardrail ID",accessorKey:"guardrail_id",cell:e=>(0,n.jsx)(L.Z,{title:String(e.getValue()||""),children:(0,n.jsx)(d.Z,{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()&&u(e.getValue()),children:e.getValue()?"".concat(String(e.getValue()).slice(0,7),"..."):""})})},{header:"Name",accessorKey:"guardrail_name",cell:e=>{let{row:l}=e,a=l.original;return(0,n.jsx)(L.Z,{title:a.guardrail_name,children:(0,n.jsx)("span",{className:"text-xs font-medium",children:a.guardrail_name||"-"})})}},{header:"Provider",accessorKey:"litellm_params.guardrail",cell:e=>{let{row:l}=e,{logo:a,displayName:t}=A(l.original.litellm_params.guardrail);return(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,n.jsx)("img",{src:a,alt:"".concat(t," logo"),className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,n.jsx)("span",{className:"text-xs",children:t})]})}},{header:"Mode",accessorKey:"litellm_params.mode",cell:e=>{let{row:l}=e,a=l.original;return(0,n.jsx)("span",{className:"text-xs",children:a.litellm_params.mode})}},{header:"Default On",accessorKey:"litellm_params.default_on",cell:e=>{var l,a;let{row:t}=e,i=t.original;return(0,n.jsx)(e5.C,{color:(null===(l=i.litellm_params)||void 0===l?void 0:l.default_on)?"green":"gray",className:"text-xs font-normal",size:"xs",children:(null===(a=i.litellm_params)||void 0===a?void 0:a.default_on)?"Default On":"Default Off"})}},{header:"Created At",accessorKey:"created_at",cell:e=>{let{row:l}=e,a=l.original;return(0,n.jsx)(L.Z,{title:a.created_at,children:(0,n.jsx)("span",{className:"text-xs",children:j(a.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:e=>{let{row:l}=e,a=l.original;return(0,n.jsx)(L.Z,{title:a.updated_at,children:(0,n.jsx)("span",{className:"text-xs",children:j(a.updated_at)})})}},{id:"actions",header:"Actions",cell:e=>{let{row:l}=e,a=l.original,i=a.guardrail_definition_location===s.CONFIG;return(0,n.jsx)("div",{className:"flex space-x-2",children:i?(0,n.jsx)(L.Z,{title:"Config guardrail cannot be deleted on the dashboard. Please delete it from the config file.",children:(0,n.jsx)(eq.Z,{"data-testid":"config-delete-icon",icon:e0.Z,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,n.jsx)(L.Z,{title:"Delete guardrail",children:(0,n.jsx)(eq.Z,{icon:e0.Z,size:"sm",onClick:()=>a.guardrail_id&&t(a.guardrail_id,a.guardrail_name||"Unnamed Guardrail"),className:"cursor-pointer hover:text-red-500"})})})}}],y=(0,e8.b7)({data:l,columns:v,state:{sorting:m},onSortingChange:x,getCoreRowModel:(0,e6.sC)(),getSortedRowModel:(0,e6.tj)(),enableSorting:!0});return(0,n.jsxs)("div",{className:"rounded-lg custom-border relative",children:[(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)(eW.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,n.jsx)(e$.Z,{children:y.getHeaderGroups().map(e=>(0,n.jsx)(eX.Z,{children:e.headers.map(e=>(0,n.jsx)(eQ.Z,{className:"py-1 h-8 ".concat("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,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,e8.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,n.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,n.jsx)(e1.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,n.jsx)(e4.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,n.jsx)(e2.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,n.jsx)(eY.Z,{children:a?(0,n.jsx)(eX.Z,{children:(0,n.jsx)(eH.Z,{colSpan:v.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"Loading..."})})})}):l.length>0?y.getRowModel().rows.map(e=>(0,n.jsx)(eX.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,n.jsx)(eH.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,e8.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,n.jsx)(eX.Z,{children:(0,n.jsx)(eH.Z,{colSpan:v.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"No guardrails found"})})})})})]})}),g&&(0,n.jsx)(ll,{visible:p,onClose:()=>h(!1),accessToken:i,onSuccess:()=>{h(!1),f(null),r()},guardrailId:g.guardrail_id||"",initialValues:{guardrail_name:g.guardrail_name||"",provider:Object.keys(C).find(e=>C[e]===(null==g?void 0:g.litellm_params.guardrail))||"",mode:g.litellm_params.mode,default_on:g.litellm_params.default_on,pii_entities_config:g.litellm_params.pii_entities_config,...g.guardrail_info}})]})},lt=a(20347),li=a(30078),lr=a(41649),ls=a(12514),ln=a(84264),lo=e=>{let{patterns:l,blockedWords:a,readOnly:t=!0,onPatternActionChange:i,onPatternRemove:r,onBlockedWordUpdate:s,onBlockedWordRemove:o}=e;if(0===l.length&&0===a.length)return null;let d=()=>{};return(0,n.jsxs)(n.Fragment,{children:[l.length>0&&(0,n.jsxs)(ls.Z,{className:"mt-6",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(ln.Z,{className:"text-lg font-semibold",children:"Pattern Detection"}),(0,n.jsxs)(lr.Z,{color:"blue",children:[l.length," patterns configured"]})]}),(0,n.jsx)(ek,{patterns:l,onActionChange:t?d:i||d,onRemove:t?d:r||d})]}),a.length>0&&(0,n.jsxs)(ls.Z,{className:"mt-6",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(ln.Z,{className:"text-lg font-semibold",children:"Blocked Keywords"}),(0,n.jsxs)(lr.Z,{color:"blue",children:[a.length," keywords configured"]})]}),(0,n.jsx)(eZ,{keywords:a,onActionChange:t?d:s||d,onRemove:t?d:o||d})]})]})},ld=e=>{var l;let{guardrailData:a,guardrailSettings:t,isEditing:i,accessToken:r,onDataChange:s,onUnsavedChanges:d}=e,[c,u]=(0,o.useState)([]),[m,x]=(0,o.useState)([]),[p,h]=(0,o.useState)([]),[g,f]=(0,o.useState)([]);(0,o.useEffect)(()=>{var e,l;if(null==a?void 0:null===(e=a.litellm_params)||void 0===e?void 0:e.patterns){let e=a.litellm_params.patterns.map((e,l)=>({id:"pattern-".concat(l),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"}));u(e),h(e)}else u([]),h([]);if(null==a?void 0:null===(l=a.litellm_params)||void 0===l?void 0:l.blocked_words){let e=a.litellm_params.blocked_words.map((e,l)=>({id:"word-".concat(l),keyword:e.keyword,action:e.action||"BLOCK",description:e.description}));x(e),f(e)}else x([]),f([])},[a]),(0,o.useEffect)(()=>{s&&s(c,m)},[c,m,s]);let j=o.useMemo(()=>{let e=JSON.stringify(c)!==JSON.stringify(p),l=JSON.stringify(m)!==JSON.stringify(g);return e||l},[c,m,p,g]);return((0,o.useEffect)(()=>{i&&d&&d(j)},[j,i,d]),(null==a?void 0:null===(l=a.litellm_params)||void 0===l?void 0:l.guardrail)!=="litellm_content_filter")?null:i?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eE.Z,{orientation:"left",children:"Content Filter Configuration"}),j&&(0,n.jsx)("div",{className:"mb-4 px-4 py-3 bg-yellow-50 border border-yellow-200 rounded-md",children:(0,n.jsx)("p",{className:"text-sm text-yellow-800 font-medium",children:'⚠️ You have unsaved changes to patterns or keywords. Remember to click "Save Changes" at the bottom.'})}),(0,n.jsx)("div",{className:"mb-6",children:t&&t.content_filter_settings&&(0,n.jsx)(eI,{prebuiltPatterns:t.content_filter_settings.prebuilt_patterns||[],categories:t.content_filter_settings.pattern_categories||[],selectedPatterns:c,blockedWords:m,onPatternAdd:e=>u([...c,e]),onPatternRemove:e=>u(c.filter(l=>l.id!==e)),onPatternActionChange:(e,l)=>u(c.map(a=>a.id===e?{...a,action:l}:a)),onBlockedWordAdd:e=>x([...m,e]),onBlockedWordRemove:e=>x(m.filter(l=>l.id!==e)),onBlockedWordUpdate:(e,l,a)=>x(m.map(t=>t.id===e?{...t,[l]:a}:t)),onFileUpload:e=>{console.log("File uploaded:",e)},accessToken:r})})]}):(0,n.jsx)(lo,{patterns:c,blockedWords:m,readOnly:!0})};let lc=(e,l)=>({patterns:e.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:l.map(e=>({keyword:e.keyword,action:e.action,description:e.description}))});var lu=a(10900),lm=a(59872),lx=a(30401),lp=a(78867),lh=e=>{var l,a,t,i,r,s,d,c,u,m,x,p,g,j,y,_;let{guardrailId:b,onClose:N,accessToken:w,isAdmin:k}=e,[S,Z]=(0,o.useState)(null),[P,O]=(0,o.useState)(null),[I,T]=(0,o.useState)(!0),[G,F]=(0,o.useState)(!1),[M]=v.Z.useForm(),[K,D]=(0,o.useState)([]),[R,J]=(0,o.useState)({}),[V,U]=(0,o.useState)(null),[q,W]=(0,o.useState)({}),[H,$]=(0,o.useState)(!1),Q={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},[ee,el]=(0,o.useState)(Q),[ei,er]=(0,o.useState)(!1),es=o.useRef({patterns:[],blockedWords:[]}),en=(0,o.useCallback)((e,l)=>{es.current={patterns:e,blockedWords:l}},[]),eo=async()=>{try{var e;if(T(!0),!w)return;let l=await (0,h.getGuardrailInfo)(w,b);if(Z(l),null===(e=l.litellm_params)||void 0===e?void 0:e.pii_entities_config){let e=l.litellm_params.pii_entities_config;if(D([]),J({}),Object.keys(e).length>0){let l=[],a={};Object.entries(e).forEach(e=>{let[t,i]=e;l.push(t),a[t]="string"==typeof i?i:"MASK"}),D(l),J(a)}}else D([]),J({})}catch(e){et.Z.fromBackend("Failed to load guardrail information"),console.error("Error fetching guardrail info:",e)}finally{T(!1)}},ed=async()=>{try{if(!w)return;let e=await (0,h.getGuardrailProviderSpecificParams)(w);O(e)}catch(e){console.error("Error fetching guardrail provider specific params:",e)}},ec=async()=>{try{if(!w)return;let e=await (0,h.getGuardrailUISettings)(w);U(e)}catch(e){console.error("Error fetching guardrail UI settings:",e)}};(0,o.useEffect)(()=>{ed()},[w]),(0,o.useEffect)(()=>{eo(),ec()},[b,w]),(0,o.useEffect)(()=>{if(S&&M){var e;M.setFieldsValue({guardrail_name:S.guardrail_name,...S.litellm_params,guardrail_info:S.guardrail_info?JSON.stringify(S.guardrail_info,null,2):"",...(null===(e=S.litellm_params)||void 0===e?void 0:e.optional_params)&&{optional_params:S.litellm_params.optional_params}})}},[S,P,M]);let eu=(0,o.useCallback)(()=>{var e,l,a,t,i;(null==S?void 0:null===(e=S.litellm_params)||void 0===e?void 0:e.guardrail)==="tool_permission"?el({rules:(null===(l=S.litellm_params)||void 0===l?void 0:l.rules)||[],default_action:((null===(a=S.litellm_params)||void 0===a?void 0:a.default_action)||"deny").toLowerCase(),on_disallowed_action:((null===(t=S.litellm_params)||void 0===t?void 0:t.on_disallowed_action)||"block").toLowerCase(),violation_message_template:(null===(i=S.litellm_params)||void 0===i?void 0:i.violation_message_template)||""}):el(Q),er(!1)},[S]);(0,o.useEffect)(()=>{eu()},[eu]);let em=async e=>{try{var l,a,t,i,r,s,n,o,d,c,u,m;if(!w)return;let x={litellm_params:{}};e.guardrail_name!==S.guardrail_name&&(x.guardrail_name=e.guardrail_name),e.default_on!==(null===(l=S.litellm_params)||void 0===l?void 0:l.default_on)&&(x.litellm_params.default_on=e.default_on);let p=S.guardrail_info,g=e.guardrail_info?JSON.parse(e.guardrail_info):void 0;JSON.stringify(p)!==JSON.stringify(g)&&(x.guardrail_info=g);let f=(null===(a=S.litellm_params)||void 0===a?void 0:a.pii_entities_config)||{},j={};if(K.forEach(e=>{j[e]=R[e]||"MASK"}),JSON.stringify(f)!==JSON.stringify(j)&&(x.litellm_params.pii_entities_config=j),(null===(t=S.litellm_params)||void 0===t?void 0:t.guardrail)==="litellm_content_filter"){let e=(null===(s=S.litellm_params)||void 0===s?void 0:s.patterns)||[],l=(null===(n=S.litellm_params)||void 0===n?void 0:n.blocked_words)||[],a=lc(es.current.patterns,es.current.blockedWords);JSON.stringify(e)!==JSON.stringify(a.patterns)&&(x.litellm_params.patterns=a.patterns),JSON.stringify(l)!==JSON.stringify(a.blocked_words)&&(x.litellm_params.blocked_words=a.blocked_words)}if((null===(i=S.litellm_params)||void 0===i?void 0:i.guardrail)==="tool_permission"){let e=(null===(o=S.litellm_params)||void 0===o?void 0:o.rules)||[],l=ee.rules||[],a=JSON.stringify(e)!==JSON.stringify(l),t=((null===(d=S.litellm_params)||void 0===d?void 0:d.default_action)||"deny").toLowerCase(),i=(ee.default_action||"deny").toLowerCase(),r=t!==i,s=((null===(c=S.litellm_params)||void 0===c?void 0:c.on_disallowed_action)||"block").toLowerCase(),n=(ee.on_disallowed_action||"block").toLowerCase(),m=s!==n,p=(null===(u=S.litellm_params)||void 0===u?void 0:u.violation_message_template)||"",h=ee.violation_message_template||"",g=p!==h;(ei||a||r||m||g)&&(x.litellm_params.rules=l,x.litellm_params.default_action=i,x.litellm_params.on_disallowed_action=n,x.litellm_params.violation_message_template=h||null)}let v=Object.keys(C).find(e=>{var l;return C[e]===(null===(l=S.litellm_params)||void 0===l?void 0:l.guardrail)});console.log("values: ",JSON.stringify(e)),console.log("currentProvider: ",v);let y=(null===(r=S.litellm_params)||void 0===r?void 0:r.guardrail)==="tool_permission";if(P&&v&&!y){let l=P[null===(m=C[v])||void 0===m?void 0:m.toLowerCase()]||{},a=new Set;console.log("providerSpecificParams: ",JSON.stringify(l)),Object.keys(l).forEach(e=>{"optional_params"!==e&&a.add(e)}),l.optional_params&&l.optional_params.fields&&Object.keys(l.optional_params.fields).forEach(e=>{a.add(e)}),console.log("allowedParams: ",a),a.forEach(l=>{var a,t;let i=e[l];(null==i||""===i)&&(i=null===(t=e.optional_params)||void 0===t?void 0:t[l]);let r=null===(a=S.litellm_params)||void 0===a?void 0:a[l];JSON.stringify(i)!==JSON.stringify(r)&&(null!=i&&""!==i?x.litellm_params[l]=i:null!=r&&""!==r&&(x.litellm_params[l]=null))})}if(0===Object.keys(x.litellm_params).length&&delete x.litellm_params,0===Object.keys(x).length){et.Z.info("No changes detected"),F(!1);return}await (0,h.updateGuardrailCall)(w,b,x),et.Z.success("Guardrail updated successfully"),$(!1),eo(),F(!1)}catch(e){console.error("Error updating guardrail:",e),et.Z.fromBackend("Failed to update guardrail")}};if(I)return(0,n.jsx)("div",{className:"p-4",children:"Loading..."});if(!S)return(0,n.jsx)("div",{className:"p-4",children:"Guardrail not found"});let ex=e=>e?new Date(e).toLocaleString():"-",{logo:ep,displayName:eh}=A((null===(l=S.litellm_params)||void 0===l?void 0:l.guardrail)||""),eg=async(e,l)=>{await (0,lm.vQ)(e)&&(W(e=>({...e,[l]:!0})),setTimeout(()=>{W(e=>({...e,[l]:!1}))},2e3))},ef="config"===S.guardrail_definition_location;return(0,n.jsxs)("div",{className:"p-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(li.zx,{icon:lu.Z,variant:"light",onClick:N,className:"mb-4",children:"Back to Guardrails"}),(0,n.jsx)(li.Dx,{children:S.guardrail_name||"Unnamed Guardrail"}),(0,n.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,n.jsx)(li.xv,{className:"text-gray-500 font-mono",children:S.guardrail_id}),(0,n.jsx)(E.ZP,{type:"text",size:"small",icon:q["guardrail-id"]?(0,n.jsx)(lx.Z,{size:12}):(0,n.jsx)(lp.Z,{size:12}),onClick:()=>eg(S.guardrail_id,"guardrail-id"),className:"left-2 z-10 transition-all duration-200 ".concat(q["guardrail-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,n.jsxs)(li.v0,{children:[(0,n.jsxs)(li.td,{className:"mb-4",children:[(0,n.jsx)(li.OK,{children:"Overview"},"overview"),k?(0,n.jsx)(li.OK,{children:"Settings"},"settings"):(0,n.jsx)(n.Fragment,{})]}),(0,n.jsxs)(li.nP,{children:[(0,n.jsxs)(li.x4,{children:[(0,n.jsxs)(li.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,n.jsxs)(li.Zb,{children:[(0,n.jsx)(li.xv,{children:"Provider"}),(0,n.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[ep&&(0,n.jsx)("img",{src:ep,alt:"".concat(eh," logo"),className:"w-6 h-6",onError:e=>{e.target.style.display="none"}}),(0,n.jsx)(li.Dx,{children:eh})]})]}),(0,n.jsxs)(li.Zb,{children:[(0,n.jsx)(li.xv,{children:"Mode"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(li.Dx,{children:(null===(a=S.litellm_params)||void 0===a?void 0:a.mode)||"-"}),(0,n.jsx)(li.Ct,{color:(null===(t=S.litellm_params)||void 0===t?void 0:t.default_on)?"green":"gray",children:(null===(i=S.litellm_params)||void 0===i?void 0:i.default_on)?"Default On":"Default Off"})]})]}),(0,n.jsxs)(li.Zb,{children:[(0,n.jsx)(li.xv,{children:"Created At"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(li.Dx,{children:ex(S.created_at)}),(0,n.jsxs)(li.xv,{children:["Last Updated: ",ex(S.updated_at)]})]})]})]}),(null===(r=S.litellm_params)||void 0===r?void 0:r.pii_entities_config)&&Object.keys(S.litellm_params.pii_entities_config).length>0&&(0,n.jsx)(li.Zb,{className:"mt-6",children:(0,n.jsxs)("div",{className:"flex justify-between items-center",children:[(0,n.jsx)(li.xv,{className:"font-medium",children:"PII Protection"}),(0,n.jsxs)(li.Ct,{color:"blue",children:[Object.keys(S.litellm_params.pii_entities_config).length," PII entities configured"]})]})}),(null===(s=S.litellm_params)||void 0===s?void 0:s.pii_entities_config)&&Object.keys(S.litellm_params.pii_entities_config).length>0&&(0,n.jsxs)(li.Zb,{className:"mt-6",children:[(0,n.jsx)(li.xv,{className:"mb-4 text-lg font-semibold",children:"PII Entity Configuration"}),(0,n.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,n.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,n.jsx)(li.xv,{className:"flex-1 font-semibold text-gray-700",children:"Entity Type"}),(0,n.jsx)(li.xv,{className:"flex-1 font-semibold text-gray-700",children:"Configuration"})]}),(0,n.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:Object.entries(null===(d=S.litellm_params)||void 0===d?void 0:d.pii_entities_config).map(e=>{let[l,a]=e;return(0,n.jsxs)("div",{className:"px-5 py-3 flex border-b hover:bg-gray-50 transition-colors",children:[(0,n.jsx)(li.xv,{className:"flex-1 font-medium text-gray-900",children:l}),(0,n.jsx)(li.xv,{className:"flex-1",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5 ".concat("MASK"===a?"text-blue-600":"text-red-600"),children:["MASK"===a?(0,n.jsx)(z.Z,{}):(0,n.jsx)(B.Z,{}),String(a)]})})]},l)})})]})]}),(null===(c=S.litellm_params)||void 0===c?void 0:c.guardrail)==="tool_permission"&&(0,n.jsx)(li.Zb,{className:"mt-6",children:(0,n.jsx)(eF,{value:ee,disabled:!0})}),(0,n.jsx)(ld,{guardrailData:S,guardrailSettings:V,isEditing:!1,accessToken:w})]}),k&&(0,n.jsx)(li.x4,{children:(0,n.jsxs)(li.Zb,{children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(li.Dx,{children:"Guardrail Settings"}),ef&&(0,n.jsx)(L.Z,{title:"Guardrail is defined in the config file and cannot be edited.",children:(0,n.jsx)(ez.Z,{})}),!G&&!ef&&(0,n.jsx)(li.zx,{onClick:()=>F(!0),children:"Edit Settings"})]}),G?(0,n.jsxs)(v.Z,{form:M,onFinish:em,initialValues:{guardrail_name:S.guardrail_name,...S.litellm_params,guardrail_info:S.guardrail_info?JSON.stringify(S.guardrail_info,null,2):"",...(null===(u=S.litellm_params)||void 0===u?void 0:u.optional_params)&&{optional_params:S.litellm_params.optional_params}},layout:"vertical",children:[(0,n.jsx)(v.Z.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Please input a guardrail name"}],children:(0,n.jsx)(li.oi,{})}),(0,n.jsx)(v.Z.Item,{label:"Default On",name:"default_on",children:(0,n.jsxs)(f.default,{children:[(0,n.jsx)(f.default.Option,{value:!0,children:"Yes"}),(0,n.jsx)(f.default.Option,{value:!1,children:"No"})]})}),(null===(m=S.litellm_params)||void 0===m?void 0:m.guardrail)==="presidio"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eE.Z,{orientation:"left",children:"PII Protection"}),(0,n.jsx)("div",{className:"mb-6",children:V&&(0,n.jsx)(Y,{entities:V.supported_entities,actions:V.supported_actions,selectedEntities:K,selectedActions:R,onEntitySelect:e=>{D(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},onActionSelect:(e,l)=>{J(a=>({...a,[e]:l}))},entityCategories:V.pii_entity_categories})})]}),(0,n.jsx)(ld,{guardrailData:S,guardrailSettings:V,isEditing:!0,accessToken:w,onDataChange:en,onUnsavedChanges:$}),(0,n.jsx)(eE.Z,{orientation:"left",children:"Provider Settings"}),(null===(x=S.litellm_params)||void 0===x?void 0:x.guardrail)==="tool_permission"?(0,n.jsx)(eF,{value:ee,onChange:el}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(X,{selectedProvider:Object.keys(C).find(e=>{var l;return C[e]===(null===(l=S.litellm_params)||void 0===l?void 0:l.guardrail)})||null,accessToken:w,providerParams:P,value:S.litellm_params}),P&&(()=>{var e;let l=Object.keys(C).find(e=>{var l;return C[e]===(null===(l=S.litellm_params)||void 0===l?void 0:l.guardrail)});if(!l)return null;let a=P[null===(e=C[l])||void 0===e?void 0:e.toLowerCase()];return a&&a.optional_params?(0,n.jsx)(ea,{optionalParams:a.optional_params,parentFieldKey:"optional_params",values:S.litellm_params}):null})()]}),(0,n.jsx)(eE.Z,{orientation:"left",children:"Advanced Settings"}),(0,n.jsx)(v.Z.Item,{label:"Guardrail Information",name:"guardrail_info",children:(0,n.jsx)(eL.default.TextArea,{rows:5})}),(0,n.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,n.jsx)(E.ZP,{onClick:()=>{F(!1),$(!1),eu()},children:"Cancel"}),(0,n.jsx)(li.zx,{children:"Save Changes"})]})]}):(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(li.xv,{className:"font-medium",children:"Guardrail ID"}),(0,n.jsx)("div",{className:"font-mono",children:S.guardrail_id})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(li.xv,{className:"font-medium",children:"Guardrail Name"}),(0,n.jsx)("div",{children:S.guardrail_name||"Unnamed Guardrail"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(li.xv,{className:"font-medium",children:"Provider"}),(0,n.jsx)("div",{children:eh})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(li.xv,{className:"font-medium",children:"Mode"}),(0,n.jsx)("div",{children:(null===(p=S.litellm_params)||void 0===p?void 0:p.mode)||"-"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(li.xv,{className:"font-medium",children:"Default On"}),(0,n.jsx)(li.Ct,{color:(null===(g=S.litellm_params)||void 0===g?void 0:g.default_on)?"green":"gray",children:(null===(j=S.litellm_params)||void 0===j?void 0:j.default_on)?"Yes":"No"})]}),(null===(y=S.litellm_params)||void 0===y?void 0:y.pii_entities_config)&&Object.keys(S.litellm_params.pii_entities_config).length>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)(li.xv,{className:"font-medium",children:"PII Protection"}),(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsxs)(li.Ct,{color:"blue",children:[Object.keys(S.litellm_params.pii_entities_config).length," PII entities configured"]})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(li.xv,{className:"font-medium",children:"Created At"}),(0,n.jsx)("div",{children:ex(S.created_at)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(li.xv,{className:"font-medium",children:"Last Updated"}),(0,n.jsx)("div",{children:ex(S.updated_at)})]}),(null===(_=S.litellm_params)||void 0===_?void 0:_.guardrail)==="tool_permission"&&(0,n.jsx)(eF,{value:ee,disabled:!0})]})]})})]})]})]})},lg=a(96761),lf=a(35631),lj=a(29436),lv=a(41169),ly=a(23639),l_=a(77565),lb=a(70464),lN=a(83669),lw=a(5540);let{Text:lk}=g.default;var lC=function(e){let{results:l,errors:a}=e,[t,i]=(0,o.useState)(new Set),r=e=>{let l=new Set(t);l.has(e)?l.delete(e):l.add(e),i(l)},s=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let l=document.createElement("textarea");l.value=e,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.focus(),l.select();let a=document.execCommand("copy");if(document.body.removeChild(l),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}};return l||a?(0,n.jsxs)("div",{className:"space-y-3 pt-4 border-t border-gray-200",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Results"}),l&&l.map(e=>{let l=t.has(e.guardrailName);return(0,n.jsx)(ls.Z,{className:"bg-green-50 border-green-200",children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer flex-1",onClick:()=>r(e.guardrailName),children:[l?(0,n.jsx)(l_.Z,{className:"text-gray-500 text-xs"}):(0,n.jsx)(lb.Z,{className:"text-gray-500 text-xs"}),(0,n.jsx)(lN.Z,{className:"text-green-600 text-lg"}),(0,n.jsx)("span",{className:"text-sm font-medium text-green-800",children:e.guardrailName})]}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,n.jsx)(lw.Z,{}),(0,n.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]}),!l&&(0,n.jsx)(d.Z,{size:"xs",variant:"secondary",icon:ly.Z,onClick:async()=>{await s(e.response_text)?et.Z.success("Result copied to clipboard"):et.Z.fromBackend("Failed to copy result")},children:"Copy"})]})]}),!l&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"bg-white border border-green-200 rounded p-3",children:[(0,n.jsx)("label",{className:"text-xs font-medium text-gray-600 mb-2 block",children:"Output Text"}),(0,n.jsx)("div",{className:"font-mono text-sm text-gray-900 whitespace-pre-wrap break-words",children:e.response_text})]}),(0,n.jsxs)("div",{className:"text-xs text-gray-600",children:[(0,n.jsx)("span",{className:"font-medium",children:"Characters:"})," ",e.response_text.length]})]})]})},e.guardrailName)}),a&&a.map(e=>{let l=t.has(e.guardrailName);return(0,n.jsx)(ls.Z,{className:"bg-red-50 border-red-200",children:(0,n.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,n.jsx)("div",{className:"cursor-pointer mt-0.5",onClick:()=>r(e.guardrailName),children:l?(0,n.jsx)(l_.Z,{className:"text-gray-500 text-xs"}):(0,n.jsx)(lb.Z,{className:"text-gray-500 text-xs"})}),(0,n.jsx)("div",{className:"text-red-600 mt-0.5",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,n.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,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,n.jsxs)("p",{className:"text-sm font-medium text-red-800 cursor-pointer",onClick:()=>r(e.guardrailName),children:[e.guardrailName," - Error"]}),(0,n.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,n.jsx)(lw.Z,{}),(0,n.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]})]}),!l&&(0,n.jsx)("p",{className:"text-sm text-red-700 mt-1",children:e.error.message})]})]})},e.guardrailName)})]}):null};let{TextArea:lS}=eL.default,{Text:lZ}=g.default;var lP=function(e){let{guardrailNames:l,onSubmit:a,isLoading:t,results:i,errors:r,onClose:s}=e,[d,c]=(0,o.useState)(""),u=()=>{if(!d.trim()){et.Z.fromBackend("Please enter text to test");return}a(d)},m=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let l=document.createElement("textarea");l.value=e,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.focus(),l.select();let a=document.execCommand("copy");if(document.body.removeChild(l),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},x=async()=>{await m(d)?et.Z.success("Input copied to clipboard"):et.Z.fromBackend("Failed to copy input")};return(0,n.jsxs)("div",{className:"space-y-4 h-full flex flex-col",children:[(0,n.jsx)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:(0,n.jsx)("div",{className:"flex items-center space-x-3",children:(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Guardrails:"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:l.map(e=>(0,n.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,n.jsx)("span",{className:"font-mono text-blue-700 font-medium text-sm",children:e})},e))})]}),(0,n.jsxs)("p",{className:"text-sm text-gray-500",children:["Test ",l.length>1?"guardrails":"guardrail"," and compare results"]})]})})}),(0,n.jsxs)("div",{className:"flex-1 overflow-auto space-y-4",children:[(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Input Text"}),(0,n.jsx)(L.Z,{title:"Press Enter to submit. Use Shift+Enter for new line.",children:(0,n.jsx)(ez.Z,{className:"text-gray-400 cursor-help"})})]}),d&&(0,n.jsx)(ed.z,{size:"xs",variant:"secondary",icon:ly.Z,onClick:x,children:"Copy Input"})]}),(0,n.jsx)(lS,{value:d,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey||(e.preventDefault(),u())},placeholder:"Enter text to test with guardrails...",rows:8,className:"font-mono text-sm"}),(0,n.jsxs)("div",{className:"flex justify-between items-center mt-1",children:[(0,n.jsxs)(lZ,{className:"text-xs text-gray-500",children:["Press ",(0,n.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 border border-gray-300 rounded text-xs",children:"Enter"})," to submit • ",(0,n.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,n.jsxs)(lZ,{className:"text-xs text-gray-500",children:["Characters: ",d.length]})]})]}),(0,n.jsx)("div",{className:"pt-2",children:(0,n.jsx)(ed.z,{onClick:u,loading:t,disabled:!d.trim(),className:"w-full",children:t?"Testing ".concat(l.length," guardrail").concat(l.length>1?"s":"","..."):"Test ".concat(l.length," guardrail").concat(l.length>1?"s":"")})})]}),(0,n.jsx)(lC,{results:i,errors:r})]})]})},lO=e=>{let{guardrailsList:l,isLoading:a,accessToken:t,onClose:i}=e,[r,s]=(0,o.useState)(new Set),[d,c]=(0,o.useState)(""),[u,m]=(0,o.useState)([]),[x,p]=(0,o.useState)([]),[g,f]=(0,o.useState)(!1),j=l.filter(e=>{var l;return null===(l=e.guardrail_name)||void 0===l?void 0:l.toLowerCase().includes(d.toLowerCase())}),v=e=>{let l=new Set(r);l.has(e)?l.delete(e):l.add(e),s(l)},y=async e=>{if(0===r.size||!t)return;f(!0),m([]),p([]);let l=[],a=[];await Promise.all(Array.from(r).map(async i=>{let r=Date.now();try{let a=await (0,h.applyGuardrail)(t,i,e,null,null),s=Date.now()-r;l.push({guardrailName:i,response_text:a.response_text,latency:s})}catch(l){let e=Date.now()-r;console.error("Error testing guardrail ".concat(i,":"),l),a.push({guardrailName:i,error:l,latency:e})}})),m(l),p(a),f(!1),l.length>0&&et.Z.success("".concat(l.length," guardrail").concat(l.length>1?"s":""," applied successfully")),a.length>0&&et.Z.fromBackend("".concat(a.length," guardrail").concat(a.length>1?"s":""," failed"))};return(0,n.jsx)("div",{className:"w-full h-[calc(100vh-200px)]",children:(0,n.jsx)(ls.Z,{className:"h-full",children:(0,n.jsxs)("div",{className:"flex h-full",children:[(0,n.jsxs)("div",{className:"w-1/4 border-r border-gray-200 flex flex-col overflow-hidden",children:[(0,n.jsx)("div",{className:"p-4 border-b border-gray-200",children:(0,n.jsxs)("div",{className:"mb-3",children:[(0,n.jsx)(lg.Z,{className:"text-lg font-semibold mb-3",children:"Guardrails"}),(0,n.jsx)(eg.Z,{icon:lj.Z,placeholder:"Search guardrails...",value:d,onValueChange:c})]})}),(0,n.jsx)("div",{className:"flex-1 overflow-auto",children:a?(0,n.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,n.jsx)(H.Z,{})}):0===j.length?(0,n.jsx)("div",{className:"p-4",children:(0,n.jsx)(eT.Z,{description:d?"No guardrails match your search":"No guardrails available"})}):(0,n.jsx)(lf.Z,{dataSource:j,renderItem:e=>(0,n.jsx)(lf.Z.Item,{onClick:()=>{e.guardrail_name&&v(e.guardrail_name)},className:"cursor-pointer hover:bg-gray-50 transition-colors px-4 ".concat(r.has(e.guardrail_name||"")?"bg-blue-50 border-l-4 border-l-blue-500":"border-l-4 border-l-transparent"),children:(0,n.jsx)(lf.Z.Item.Meta,{avatar:(0,n.jsx)(T.Z,{checked:r.has(e.guardrail_name||""),onClick:l=>{l.stopPropagation(),e.guardrail_name&&v(e.guardrail_name)}}),title:(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(lv.Z,{className:"text-gray-400"}),(0,n.jsx)("span",{className:"font-medium text-gray-900",children:e.guardrail_name})]}),description:(0,n.jsxs)("div",{className:"text-xs space-y-1 mt-1",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Type: "}),(0,n.jsx)("span",{className:"text-gray-600",children:e.litellm_params.guardrail})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Mode: "}),(0,n.jsx)("span",{className:"text-gray-600",children:e.litellm_params.mode})]})]})})})})}),(0,n.jsx)("div",{className:"p-3 border-t border-gray-200 bg-gray-50",children:(0,n.jsxs)(ln.Z,{className:"text-xs text-gray-600",children:[r.size," of ",j.length," selected"]})})]}),(0,n.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,n.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,n.jsx)(lg.Z,{className:"text-xl font-semibold mb-0",children:"Guardrail Testing Playground"})}),(0,n.jsx)("div",{className:"flex-1 overflow-auto p-4",children:0===r.size?(0,n.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,n.jsx)(lv.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,n.jsx)(ln.Z,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select Guardrails to Test"}),(0,n.jsx)(ln.Z,{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,n.jsx)("div",{className:"h-full",children:(0,n.jsx)(lP,{guardrailNames:Array.from(r),onSubmit:y,results:u.length>0?u:null,errors:x.length>0?x:null,isLoading:g,onClose:()=>s(new Set)})})})]})]})})})},lI=a(21609),lA=e=>{let{accessToken:l,userRole:a}=e,[t,i]=(0,o.useState)([]),[r,s]=(0,o.useState)(!1),[g,f]=(0,o.useState)(!1),[j,v]=(0,o.useState)(!1),[y,_]=(0,o.useState)(null),[b,N]=(0,o.useState)(!1),[w,k]=(0,o.useState)(null),[C,S]=(0,o.useState)(0),Z=!!a&&(0,lt.tY)(a),P=async()=>{if(l){f(!0);try{let e=await (0,h.getGuardrailsList)(l);console.log("guardrails: ".concat(JSON.stringify(e))),i(e.guardrails)}catch(e){console.error("Error fetching guardrails:",e)}finally{f(!1)}}};(0,o.useEffect)(()=>{P()},[l]);let O=async()=>{if(y&&l){v(!0);try{await (0,h.deleteGuardrailCall)(l,y.guardrail_id),et.Z.success('Guardrail "'.concat(y.guardrail_name,'" deleted successfully')),await P()}catch(e){console.error("Error deleting guardrail:",e),et.Z.fromBackend("Failed to delete guardrail")}finally{v(!1),N(!1),_(null)}}},I=y&&y.litellm_params?A(y.litellm_params.guardrail).displayName:void 0;return(0,n.jsx)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:(0,n.jsxs)(u.Z,{index:C,onIndexChange:S,children:[(0,n.jsxs)(m.Z,{className:"mb-4",children:[(0,n.jsx)(c.Z,{children:"Guardrails"}),(0,n.jsx)(c.Z,{disabled:!l||0===t.length,children:"Test Playground"})]}),(0,n.jsxs)(p.Z,{children:[(0,n.jsxs)(x.Z,{children:[(0,n.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,n.jsx)(d.Z,{onClick:()=>{w&&k(null),s(!0)},disabled:!l,children:"+ Add New Guardrail"})}),w?(0,n.jsx)(lh,{guardrailId:w,onClose:()=>k(null),accessToken:l,isAdmin:Z}):(0,n.jsx)(la,{guardrailsList:t,isLoading:g,onDeleteClick:(e,l)=>{_(t.find(l=>l.guardrail_id===e)||null),N(!0)},accessToken:l,onGuardrailUpdated:P,isAdmin:Z,onGuardrailClick:e=>k(e)}),(0,n.jsx)(eU,{visible:r,onClose:()=>{s(!1)},accessToken:l,onSuccess:()=>{P()}}),(0,n.jsx)(lI.Z,{isOpen:b,title:"Delete Guardrail",message:"Are you sure you want to delete guardrail: ".concat(null==y?void 0:y.guardrail_name,"? This action cannot be undone."),resourceInformationTitle:"Guardrail Information",resourceInformation:[{label:"Name",value:null==y?void 0:y.guardrail_name},{label:"ID",value:null==y?void 0:y.guardrail_id,code:!0},{label:"Provider",value:I},{label:"Mode",value:null==y?void 0:y.litellm_params.mode},{label:"Default On",value:(null==y?void 0:y.litellm_params.default_on)?"Yes":"No"}],onCancel:()=>{N(!1),_(null)},onOk:O,confirmLoading:j})]}),(0,n.jsx)(x.Z,{children:(0,n.jsx)(lO,{guardrailsList:t,isLoading:g,accessToken:l,onClose:()=>S(0)})})]})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1739-a97d403afe23a96f.js b/litellm/proxy/_experimental/out/_next/static/chunks/1739-d57d9d44428d06fc.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/1739-a97d403afe23a96f.js rename to litellm/proxy/_experimental/out/_next/static/chunks/1739-d57d9d44428d06fc.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1971-92070b200b9aaa46.js b/litellm/proxy/_experimental/out/_next/static/chunks/1971-92070b200b9aaa46.js deleted file mode 100644 index beb041d010a..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1971-92070b200b9aaa46.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1971,5945],{58747:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(5853),a=r(2265);let o=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}},4537:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(5853),a=r(2265);let o=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.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"}))}},30150:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(5853),a=r(2265);let o=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),a.createElement("path",{d:"M12 4v16m8-8H4"}))},i=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),a.createElement("path",{d:"M20 12H4"}))};var s=r(13241),l=r(1153),c=r(69262);let u="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",d="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",h=a.forwardRef((e,t)=>{let{onSubmit:r,enableStepper:h=!0,disabled:m,onValueChange:f,onChange:p}=e,b=(0,n._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),g=(0,a.useRef)(null),[v,y]=a.useState(!1),w=a.useCallback(()=>{y(!0)},[]),x=a.useCallback(()=>{y(!1)},[]),[E,C]=a.useState(!1),O=a.useCallback(()=>{C(!0)},[]),k=a.useCallback(()=>{C(!1)},[]);return a.createElement(c.Z,Object.assign({type:"number",ref:(0,l.lq)([g,t]),disabled:m,makeInputClassName:(0,l.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=g.current)||void 0===t?void 0:t.value;null==r||r(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&w(),"ArrowUp"===e.key&&O()},onKeyUp:e=>{"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&k()},onChange:e=>{m||(null==f||f(parseFloat(e.target.value)),null==p||p(e))},stepper:h?a.createElement("div",{className:(0,s.q)("flex justify-center align-middle")},a.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;m||(null===(e=g.current)||void 0===e||e.stepDown(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,s.q)(!m&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},a.createElement(i,{"data-testid":"step-down",className:(v?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),a.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;m||(null===(e=g.current)||void 0===e||e.stepUp(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,s.q)(!m&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},a.createElement(o,{"data-testid":"step-up",className:(E?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},b))});h.displayName="NumberInput"},27281:function(e,t,r){r.d(t,{Z:function(){return f}});var n=r(5853),a=r(58747),o=r(2265),i=r(4537),s=r(13241),l=r(1153),c=r(96398),u=r(51975),d=r(85238),h=r(44140);let m=(0,l.fn)("Select"),f=o.forwardRef((e,t)=>{let{defaultValue:r="",value:l,onValueChange:f,placeholder:p="Select...",disabled:b=!1,icon:g,enableClear:v=!1,required:y,children:w,name:x,error:E=!1,errorMessage:C,className:O,id:k}=e,S=(0,n._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),P=(0,o.useRef)(null),N=o.Children.toArray(w),[T,q]=(0,h.Z)(r,l),M=(0,o.useMemo)(()=>{let e=o.Children.toArray(w).filter(o.isValidElement);return(0,c.sl)(e)},[w]);return o.createElement("div",{className:(0,s.q)("w-full min-w-[10rem] text-tremor-default",O)},o.createElement("div",{className:"relative"},o.createElement("select",{title:"select-hidden",required:y,className:(0,s.q)("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:T,onChange:e=>{e.preventDefault()},name:x,disabled:b,id:k,onFocus:()=>{let e=P.current;e&&e.focus()}},o.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},p),N.map(e=>{let t=e.props.value,r=e.props.children;return o.createElement("option",{className:"hidden",key:t,value:t},r)})),o.createElement(u.Ri,Object.assign({as:"div",ref:t,defaultValue:T,value:T,onChange:e=>{null==f||f(e),q(e)},disabled:b,id:k},S),e=>{var t;let{value:r}=e;return o.createElement(o.Fragment,null,o.createElement(u.Y4,{ref:P,className:(0,s.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",g?"pl-10":"pl-3",(0,c.um)((0,c.Uh)(r),b,E))},g&&o.createElement("span",{className:(0,s.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(g,{className:(0,s.q)(m("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("span",{className:"w-[90%] block truncate"},r&&null!==(t=M.get(r))&&void 0!==t?t:p),o.createElement("span",{className:(0,s.q)("absolute inset-y-0 right-0 flex items-center mr-3")},o.createElement(a.Z,{className:(0,s.q)(m("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),v&&T?o.createElement("button",{type:"button",className:(0,s.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),q(""),null==f||f("")}},o.createElement(i.Z,{className:(0,s.q)(m("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(d.u,{enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(u.O_,{anchor:"bottom start",className:(0,s.q)("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")},w)))})),E&&C?o.createElement("p",{className:(0,s.q)("errorMessage","text-sm text-rose-500 mt-1")},C):null)});f.displayName="Select"},16853:function(e,t,r){r.d(t,{Z:function(){return u}});var n=r(5853),a=r(96398),o=r(44140),i=r(2265),s=r(13241),l=r(1153);let c=(0,l.fn)("Textarea"),u=i.forwardRef((e,t)=>{let{value:r,defaultValue:u="",placeholder:d="Type...",error:h=!1,errorMessage:m,disabled:f=!1,className:p,onChange:b,onValueChange:g,autoHeight:v=!1}=e,y=(0,n._T)(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange","autoHeight"]),[w,x]=(0,o.Z)(u,r),E=(0,i.useRef)(null),C=(0,a.Uh)(w);return(0,i.useEffect)(()=>{let e=E.current;if(v&&e){e.style.height="60px";let t=e.scrollHeight;e.style.height=t+"px"}},[v,E,w]),i.createElement(i.Fragment,null,i.createElement("textarea",Object.assign({ref:(0,l.lq)([E,t]),value:w,placeholder:d,disabled:f,className:(0,s.q)(c("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",(0,a.um)(C,f,h),f?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",p),"data-testid":"text-area",onChange:e=>{null==b||b(e),x(e.target.value),null==g||g(e.target.value)}},y)),h&&m?i.createElement("p",{className:(0,s.q)(c("errorMessage"),"text-sm text-red-500 mt-1")},m):null)});u.displayName="Textarea"},87452:function(e,t,r){r.d(t,{Z:function(){return d},r:function(){return u}});var n=r(5853),a=r(91054);r(42698),r(64016);var o=r(8710);r(33232);var i=r(13241),s=r(1153),l=r(2265);let c=(0,s.fn)("Accordion"),u=(0,l.createContext)({isOpen:!1}),d=l.forwardRef((e,t)=>{var r;let{defaultOpen:s=!1,children:d,className:h}=e,m=(0,n._T)(e,["defaultOpen","children","className"]),f=null!==(r=(0,l.useContext)(o.Z))&&void 0!==r?r:(0,i.q)("rounded-tremor-default border");return l.createElement(a.pJ,Object.assign({as:"div",ref:t,className:(0,i.q)(c("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",f,h),defaultOpen:s},m),e=>{let{open:t}=e;return l.createElement(u.Provider,{value:{isOpen:t}},d)})});d.displayName="Accordion"},88829:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(5853),a=r(2265),o=r(91054),i=r(13241);let s=(0,r(1153).fn)("AccordionBody"),l=a.forwardRef((e,t)=>{let{children:r,className:l}=e,c=(0,n._T)(e,["children","className"]);return a.createElement(o.pJ.Panel,Object.assign({ref:t,className:(0,i.q)(s("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",l)},c),r)});l.displayName="AccordionBody"},72208:function(e,t,r){r.d(t,{Z:function(){return u}});var n=r(5853),a=r(2265),o=r(91054);let i=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.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 s=r(87452),l=r(13241);let c=(0,r(1153).fn)("AccordionHeader"),u=a.forwardRef((e,t)=>{let{children:r,className:u}=e,d=(0,n._T)(e,["children","className"]),{isOpen:h}=(0,a.useContext)(s.r);return a.createElement(o.pJ.Button,Object.assign({ref:t,className:(0,l.q)(c("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",u)},d),a.createElement("div",{className:(0,l.q)(c("children"),"flex flex-1 text-inherit mr-4")},r),a.createElement("div",null,a.createElement(i,{className:(0,l.q)(c("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",h?"transition-all":"transition-all -rotate-180")})))});u.displayName="AccordionHeader"},67982:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(5853),a=r(13241),o=r(1153),i=r(2265);let s=(0,o.fn)("Divider"),l=i.forwardRef((e,t)=>{let{className:r,children:o}=e,l=(0,n._T)(e,["className","children"]);return i.createElement("div",Object.assign({ref:t,className:(0,a.q)(s("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",r)},l),o?i.createElement(i.Fragment,null,i.createElement("div",{className:(0,a.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),i.createElement("div",{className:(0,a.q)("text-inherit whitespace-nowrap")},o),i.createElement("div",{className:(0,a.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):i.createElement("div",{className:(0,a.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});l.displayName="Divider"},44140:function(e,t,r){r.d(t,{Z:function(){return a}});var n=r(2265);let a=(e,t)=>{let r=void 0!==t,[a,o]=(0,n.useState)(e);return[r?t:a,e=>{r||o(e)}]}},5945:function(e,t,r){r.d(t,{Z:function(){return M}});var n=r(2265),a=r(36760),o=r.n(a),i=r(18694),s=r(71744),l=r(33759),c=r(50337),u=r(65869),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 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},h=e=>{var{prefixCls:t,className:r,hoverable:a=!0}=e,i=d(e,["prefixCls","className","hoverable"]);let{getPrefixCls:l}=n.useContext(s.E_),c=l("card",t),u=o()("".concat(c,"-grid"),r,{["".concat(c,"-grid-hoverable")]:a});return n.createElement("div",Object.assign({},i,{className:u}))},m=r(93463),f=r(12918),p=r(99320),b=r(71140);let g=e=>{let{antCls:t,componentCls:r,headerHeight:n,headerPadding:a,tabsMarginBottom:o}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:n,marginBottom:-1,padding:"0 ".concat((0,m.bf)(a)),color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary),borderRadius:"".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG)," 0 0")},(0,f.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},f.vS),{["\n > ".concat(r,"-typography,\n > ").concat(r,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(t,"-tabs-top")]:{clear:"both",marginBottom:o,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary)}}})},v=e=>{let{cardPaddingBase:t,colorBorderSecondary:r,cardShadow:n,lineWidth:a}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:"\n ".concat((0,m.bf)(a)," 0 0 0 ").concat(r,",\n 0 ").concat((0,m.bf)(a)," 0 0 ").concat(r,",\n ").concat((0,m.bf)(a)," ").concat((0,m.bf)(a)," 0 0 ").concat(r,",\n ").concat((0,m.bf)(a)," 0 0 0 ").concat(r," inset,\n 0 ").concat((0,m.bf)(a)," 0 0 ").concat(r," inset;\n "),transition:"all ".concat(e.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:n}}},y=e=>{let{componentCls:t,iconCls:r,actionsLiMargin:n,cardActionsIconSize:a,colorBorderSecondary:o,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(o),display:"flex",borderRadius:"0 0 ".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG))},(0,f.dF)()),{"& > 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 ".concat(e.motionDurationMid)},["a:not(".concat(t,"-btn), > ").concat(r)]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:(0,m.bf)(e.fontHeight),transition:"color ".concat(e.motionDurationMid),"&:hover":{color:e.colorPrimary}},["> ".concat(r)]:{fontSize:a,lineHeight:(0,m.bf)(e.calc(a).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(o)}}})},w=e=>Object.assign(Object.assign({margin:"".concat((0,m.bf)(e.calc(e.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,f.dF)()),{"&-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},f.vS),"&-description":{color:e.colorTextDescription}}),x=e=>{let{componentCls:t,colorFillAlter:r,headerPadding:n,bodyPadding:a}=e;return{["".concat(t,"-head")]:{padding:"0 ".concat((0,m.bf)(n)),background:r,"&-title":{fontSize:e.fontSize}},["".concat(t,"-body")]:{padding:"".concat((0,m.bf)(e.padding)," ").concat((0,m.bf)(a))}}},E=e=>{let{componentCls:t}=e;return{overflow:"hidden",["".concat(t,"-body")]:{userSelect:"none"}}},C=e=>{let{componentCls:t,cardShadow:r,cardHeadPadding:n,colorBorderSecondary:a,boxShadowTertiary:o,bodyPadding:i,extraColor:s}=e;return{[t]:Object.assign(Object.assign({},(0,f.Wf)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,["&:not(".concat(t,"-bordered)")]:{boxShadow:o},["".concat(t,"-head")]:g(e),["".concat(t,"-extra")]:{marginInlineStart:"auto",color:s,fontWeight:"normal",fontSize:e.fontSize},["".concat(t,"-body")]:{padding:i,borderRadius:"0 0 ".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG))},["".concat(t,"-grid")]:v(e),["".concat(t,"-cover")]:{"> *":{display:"block",width:"100%",borderRadius:"".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG)," 0 0")}},["".concat(t,"-actions")]:y(e),["".concat(t,"-meta")]:w(e)}),["".concat(t,"-bordered")]:{border:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),["".concat(t,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(t,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(e.motionDurationMid,", border-color ").concat(e.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:r}},["".concat(t,"-contain-grid")]:{borderRadius:"".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG)," 0 0 "),["".concat(t,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(t,"-loading) ").concat(t,"-body")]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},["".concat(t,"-contain-tabs")]:{["> div".concat(t,"-head")]:{minHeight:0,["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:n}}},["".concat(t,"-type-inner")]:x(e),["".concat(t,"-loading")]:E(e),["".concat(t,"-rtl")]:{direction:"rtl"}}},O=e=>{let{componentCls:t,bodyPaddingSM:r,headerPaddingSM:n,headerHeightSM:a,headerFontSizeSM:o}=e;return{["".concat(t,"-small")]:{["> ".concat(t,"-head")]:{minHeight:a,padding:"0 ".concat((0,m.bf)(n)),fontSize:o,["> ".concat(t,"-head-wrapper")]:{["> ".concat(t,"-extra")]:{fontSize:e.fontSize}}},["> ".concat(t,"-body")]:{padding:r}},["".concat(t,"-small").concat(t,"-contain-tabs")]:{["> ".concat(t,"-head")]:{["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var k=(0,p.I$)("Card",e=>{let t=(0,b.IX)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[C(t),O(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:"".concat(e.paddingSM,"px 0"),tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:null!==(t=e.bodyPadding)&&void 0!==t?t:e.paddingLG,headerPadding:null!==(r=e.headerPadding)&&void 0!==r?r:e.paddingLG}}),S=r(56250),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 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 N=e=>{let{actionClasses:t,actions:r=[],actionStyle:a}=e;return n.createElement("ul",{className:t,style:a},r.map((e,t)=>n.createElement("li",{style:{width:"".concat(100/r.length,"%")},key:"action-".concat(t)},n.createElement("span",null,e))))},T=n.forwardRef((e,t)=>{let r;let{prefixCls:a,className:d,rootClassName:m,style:f,extra:p,headStyle:b={},bodyStyle:g={},title:v,loading:y,bordered:w,variant:x,size:E,type:C,cover:O,actions:T,tabList:q,children:M,activeTabKey:j,defaultActiveTabKey:D,tabBarExtraContent:L,hoverable:R,tabProps:I={},classNames:_,styles:Z}=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:A,direction:z,card:H}=n.useContext(s.E_),[B]=(0,S.Z)("card",x,w),V=e=>{var t;return o()(null===(t=null==H?void 0:H.classNames)||void 0===t?void 0:t[e],null==_?void 0:_[e])},Q=e=>{var t;return Object.assign(Object.assign({},null===(t=null==H?void 0:H.styles)||void 0===t?void 0:t[e]),null==Z?void 0:Z[e])},G=n.useMemo(()=>{let e=!1;return n.Children.forEach(M,t=>{(null==t?void 0:t.type)===h&&(e=!0)}),e},[M]),K=A("card",a),[W,U,X]=k(K),J=n.createElement(c.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},M),Y=void 0!==j,$=Object.assign(Object.assign({},I),{[Y?"activeKey":"defaultActiveKey"]:Y?j:D,tabBarExtraContent:L}),ee=(0,l.Z)(E),et=ee&&"default"!==ee?ee:"large",er=q?n.createElement(u.default,Object.assign({size:et},$,{className:"".concat(K,"-head-tabs"),onChange:t=>{var r;null===(r=e.onTabChange)||void 0===r||r.call(e,t)},items:q.map(e=>{var{tab:t}=e;return Object.assign({label:t},P(e,["tab"]))})})):null;if(v||p||er){let e=o()("".concat(K,"-head"),V("header")),t=o()("".concat(K,"-head-title"),V("title")),a=o()("".concat(K,"-extra"),V("extra")),i=Object.assign(Object.assign({},b),Q("header"));r=n.createElement("div",{className:e,style:i},n.createElement("div",{className:"".concat(K,"-head-wrapper")},v&&n.createElement("div",{className:t,style:Q("title")},v),p&&n.createElement("div",{className:a,style:Q("extra")},p)),er)}let en=o()("".concat(K,"-cover"),V("cover")),ea=O?n.createElement("div",{className:en,style:Q("cover")},O):null,eo=o()("".concat(K,"-body"),V("body")),ei=Object.assign(Object.assign({},g),Q("body")),es=n.createElement("div",{className:eo,style:ei},y?J:M),el=o()("".concat(K,"-actions"),V("actions")),ec=(null==T?void 0:T.length)?n.createElement(N,{actionClasses:el,actionStyle:Q("actions"),actions:T}):null,eu=(0,i.Z)(F,["onTabChange"]),ed=o()(K,null==H?void 0:H.className,{["".concat(K,"-loading")]:y,["".concat(K,"-bordered")]:"borderless"!==B,["".concat(K,"-hoverable")]:R,["".concat(K,"-contain-grid")]:G,["".concat(K,"-contain-tabs")]:null==q?void 0:q.length,["".concat(K,"-").concat(ee)]:ee,["".concat(K,"-type-").concat(C)]:!!C,["".concat(K,"-rtl")]:"rtl"===z},d,m,U,X),eh=Object.assign(Object.assign({},null==H?void 0:H.style),f);return W(n.createElement("div",Object.assign({ref:t},eu,{className:ed,style:eh}),r,ea,es,ec))});var q=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};T.Grid=h,T.Meta=e=>{let{prefixCls:t,className:r,avatar:a,title:i,description:l}=e,c=q(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:u}=n.useContext(s.E_),d=u("card",t),h=o()("".concat(d,"-meta"),r),m=a?n.createElement("div",{className:"".concat(d,"-meta-avatar")},a):null,f=i?n.createElement("div",{className:"".concat(d,"-meta-title")},i):null,p=l?n.createElement("div",{className:"".concat(d,"-meta-description")},l):null,b=f||p?n.createElement("div",{className:"".concat(d,"-meta-detail")},f,p):null;return n.createElement("div",Object.assign({},c,{className:h}),m,b)};var M=T},10900:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});t.Z=a},44633:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=a},15731:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},53410:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},23628:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},49084:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=a},2894:function(e,t,r){r.d(t,{R:function(){return s},m:function(){return i}});var n=r(18238),a=r(7989),o=r(11255),i=class extends a.F{#e;#t;#r;#n;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||s(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#a({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,o.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#a({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#a({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});let n="pending"===this.state.status,a=!this.#n.canStart();try{if(n)t();else{this.#a({type:"pending",variables:e,isPaused:a}),await this.#r.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:a})}let o=await this.#n.start();return await this.#r.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#r.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#a({type:"success",data:o}),o}catch(t){try{throw await this.#r.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#r.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#a({type:"error",error:t})}}finally{this.#r.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.Vr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function s(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21623:function(e,t,r){r.d(t,{S:function(){return p}});var n=r(45345),a=r(21733),o=r(18238),i=r(24112),s=class extends i.l{constructor(e={}){super(),this.config=e,this.#o=new Map}#o;build(e,t,r){let o=t.queryKey,i=t.queryHash??(0,n.Rm)(o,t),s=this.get(i);return s||(s=new a.A({client:e,queryKey:o,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(o)}),this.add(s)),s}add(e){this.#o.has(e.queryHash)||(this.#o.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#o.get(e.queryHash);t&&(e.destroy(),t===e&&this.#o.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){o.Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#o.get(e)}getAll(){return[...this.#o.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n._x)(e,t)):t}notify(e){o.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){o.Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){o.Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},l=r(2894),c=class extends i.l{constructor(e={}){super(),this.config=e,this.#i=new Set,this.#s=new Map,this.#l=0}#i;#s;#l;build(e,t,r){let n=new l.m({client:e,mutationCache:this,mutationId:++this.#l,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#i.add(e);let t=u(e);if("string"==typeof t){let r=this.#s.get(t);r?r.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#i.delete(e)){let t=u(e);if("string"==typeof t){let r=this.#s.get(t);if(r){if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#s.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=u(e);if("string"!=typeof t)return!0;{let r=this.#s.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=u(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){o.Vr.batch(()=>{this.#i.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#i.clear(),this.#s.clear()})}getAll(){return Array.from(this.#i)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.X7)(e,t))}notify(e){o.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return o.Vr.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.ZT))))}};function u(e){return e.options.scope?.id}var d=r(87045),h=r(57853);function m(e){return{onFetch:(t,r)=>{let a=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],s=t.state.data?.pageParams||[],l={pages:[],pageParams:[]},c=0,u=async()=>{let r=!1,u=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)})},d=(0,n.cG)(t.options,t.fetchOptions),h=async(e,a,o)=>{if(r)return Promise.reject();if(null==a&&e.pages.length)return Promise.resolve(e);let i=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:a,direction:o?"backward":"forward",meta:t.options.meta};return u(e),e})(),s=await d(i),{maxPages:l}=t.options,c=o?n.Ht:n.VX;return{pages:c(e.pages,s,l),pageParams:c(e.pageParams,a,l)}};if(o&&i.length){let e="backward"===o,t={pages:i,pageParams:s},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:f)(a,t);l=await h(t,r,e)}else{let t=e??i.length;do{let e=0===c?s[0]??a.initialPageParam:f(a,l);if(c>0&&null==e)break;l=await h(l,e),c++}while(ct.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function f(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var p=class{#c;#r;#u;#d;#h;#m;#f;#p;constructor(e={}){this.#c=e.queryCache||new s,this.#r=e.mutationCache||new c,this.#u=e.defaultOptions||{},this.#d=new Map,this.#h=new Map,this.#m=0}mount(){this.#m++,1===this.#m&&(this.#f=d.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#c.onFocus())}),this.#p=h.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#c.onOnline())}))}unmount(){this.#m--,0===this.#m&&(this.#f?.(),this.#f=void 0,this.#p?.(),this.#p=void 0)}isFetching(e){return this.#c.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#r.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#c.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#c.build(this,t),a=r.state.data;return void 0===a?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,n.KC)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#c.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let a=this.defaultQueryOptions({queryKey:e}),o=this.#c.get(a.queryHash),i=o?.state.data,s=(0,n.SE)(t,i);if(void 0!==s)return this.#c.build(this,a).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return o.Vr.batch(()=>this.#c.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#c.get(t.queryHash)?.state}removeQueries(e){let t=this.#c;o.Vr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#c;return o.Vr.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(o.Vr.batch(()=>this.#c.findAll(e).map(e=>e.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e,t={}){return o.Vr.batch(()=>(this.#c.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(o.Vr.batch(()=>this.#c.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(n.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#c.build(this,t);return r.isStaleByTime((0,n.KC)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.ZT).catch(n.ZT)}fetchInfiniteQuery(e){return e.behavior=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return h.N.isOnline()?this.#r.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#c}getMutationCache(){return this.#r}getDefaultOptions(){return this.#u}setDefaultOptions(e){this.#u=e}setQueryDefaults(e,t){this.#d.set((0,n.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#d.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#h.set((0,n.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#h.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#u.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#u.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#c.clear(),this.#r.clear()}}},19616:function(e,t,r){r.d(t,{G:function(){return i}});var n=r(2265);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 i(e,t){let[r,a]=(0,n.useState)(e),i=function(e,t){let[r]=(0,n.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 r.setOptions(t),r}(a,t);return[r,i.maybeExecute,i]}},91054:function(e,t,r){let n,a;r.d(t,{pJ:function(){return j}});var o,i=r(71049),s=r(11323),l=r(2265),c=r(66797),u=r(93980),d=r(65573),h=r(67561),m=r(98218),f=r(33443),p=r(28294),b=r(31370),g=r(72468),v=r(5664),y=r(38929);let w=null!=(o=l.startTransition)?o:function(e){e()};var x=r(52724),E=((n=E||{})[n.Open=0]="Open",n[n.Closed=1]="Closed",n),C=((a=C||{})[a.ToggleDisclosure=0]="ToggleDisclosure",a[a.CloseDisclosure=1]="CloseDisclosure",a[a.SetButtonId=2]="SetButtonId",a[a.SetPanelId=3]="SetPanelId",a[a.SetButtonElement=4]="SetButtonElement",a[a.SetPanelElement=5]="SetPanelElement",a);let O={0:e=>({...e,disclosureState:(0,g.E)(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}},k=(0,l.createContext)(null);function S(e){let t=(0,l.useContext)(k);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,S),t}return t}k.displayName="DisclosureContext";let P=(0,l.createContext)(null);P.displayName="DisclosureAPIContext";let N=(0,l.createContext)(null);function T(e,t){return(0,g.E)(t.type,O,e,t)}N.displayName="DisclosurePanelContext";let q=l.Fragment,M=y.VN.RenderStrategy|y.VN.Static,j=Object.assign((0,y.yV)(function(e,t){let{defaultOpen:r=!1,...n}=e,a=(0,l.useRef)(null),o=(0,h.T)(t,(0,h.h)(e=>{a.current=e},void 0===e.as||e.as===l.Fragment)),i=(0,l.useReducer)(T,{disclosureState:r?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:s,buttonId:c},d]=i,m=(0,u.z)(e=>{d({type:1});let t=(0,v.r)(a);if(!t||!c)return;let r=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(c):t.getElementById(c);null==r||r.focus()}),b=(0,l.useMemo)(()=>({close:m}),[m]),w=(0,l.useMemo)(()=>({open:0===s,close:m}),[s,m]),x=(0,y.L6)();return l.createElement(k.Provider,{value:i},l.createElement(P.Provider,{value:b},l.createElement(f.Z,{value:m},l.createElement(p.up,{value:(0,g.E)(s,{0:p.ZM.Open,1:p.ZM.Closed})},x({ourProps:{ref:o},theirProps:n,slot:w,defaultTag:q,name:"Disclosure"})))))}),{Button:(0,y.yV)(function(e,t){let r=(0,l.useId)(),{id:n="headlessui-disclosure-button-".concat(r),disabled:a=!1,autoFocus:o=!1,...m}=e,[f,p]=S("Disclosure.Button"),g=(0,l.useContext)(N),v=null!==g&&g===f.panelId,w=(0,l.useRef)(null),E=(0,h.T)(w,t,(0,u.z)(e=>{if(!v)return p({type:4,element:e})}));(0,l.useEffect)(()=>{if(!v)return p({type:2,buttonId:n}),()=>{p({type:2,buttonId:null})}},[n,p,v]);let C=(0,u.z)(e=>{var t;if(v){if(1===f.disclosureState)return;switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),p({type:0}),null==(t=f.buttonElement)||t.focus()}}else switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),p({type:0})}}),O=(0,u.z)(e=>{e.key===x.R.Space&&e.preventDefault()}),k=(0,u.z)(e=>{var t;(0,b.P)(e.currentTarget)||a||(v?(p({type:0}),null==(t=f.buttonElement)||t.focus()):p({type:0}))}),{isFocusVisible:P,focusProps:T}=(0,i.F)({autoFocus:o}),{isHovered:q,hoverProps:M}=(0,s.X)({isDisabled:a}),{pressed:j,pressProps:D}=(0,c.x)({disabled:a}),L=(0,l.useMemo)(()=>({open:0===f.disclosureState,hover:q,active:j,disabled:a,focus:P,autofocus:o}),[f,q,j,P,a,o]),R=(0,d.f)(e,f.buttonElement),I=v?(0,y.dG)({ref:E,type:R,disabled:a||void 0,autoFocus:o,onKeyDown:C,onClick:k},T,M,D):(0,y.dG)({ref:E,id:n,type:R,"aria-expanded":0===f.disclosureState,"aria-controls":f.panelElement?f.panelId:void 0,disabled:a||void 0,autoFocus:o,onKeyDown:C,onKeyUp:O,onClick:k},T,M,D);return(0,y.L6)()({ourProps:I,theirProps:m,slot:L,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,y.yV)(function(e,t){let r=(0,l.useId)(),{id:n="headlessui-disclosure-panel-".concat(r),transition:a=!1,...o}=e,[i,s]=S("Disclosure.Panel"),{close:c}=function e(t){let r=(0,l.useContext)(P);if(null===r){let r=Error("<".concat(t," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(r,e),r}return r}("Disclosure.Panel"),[d,f]=(0,l.useState)(null),b=(0,h.T)(t,(0,u.z)(e=>{w(()=>s({type:5,element:e}))}),f);(0,l.useEffect)(()=>(s({type:3,panelId:n}),()=>{s({type:3,panelId:null})}),[n,s]);let g=(0,p.oJ)(),[v,x]=(0,m.Y)(a,d,null!==g?(g&p.ZM.Open)===p.ZM.Open:0===i.disclosureState),E=(0,l.useMemo)(()=>({open:0===i.disclosureState,close:c}),[i.disclosureState,c]),C={ref:b,id:n,...(0,m.X)(x)},O=(0,y.L6)();return l.createElement(p.uu,null,l.createElement(N.Provider,{value:i.panelId},O({ourProps:C,theirProps:o,slot:E,defaultTag:"div",features:M,visible:v,name:"Disclosure.Panel"})))})})},85238:function(e,t,r){let n;r.d(t,{u:function(){return N}});var a=r(2265),o=r(59456),i=r(93980),s=r(25289),l=r(73389),c=r(43507),u=r(180),d=r(67561),h=r(98218),m=r(28294),f=r(95504),p=r(72468),b=r(38929);function g(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||(null!=(t=e.as)?t:C)!==a.Fragment||1===a.Children.count(e.children)}let v=(0,a.createContext)(null);v.displayName="TransitionContext";var y=((n=y||{}).Visible="visible",n.Hidden="hidden",n);let w=(0,a.createContext)(null);function x(e){return"children"in e?x(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function E(e,t){let r=(0,c.E)(e),n=(0,a.useRef)([]),l=(0,s.t)(),u=(0,o.G)(),d=(0,i.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.l4.Hidden,a=n.current.findIndex(t=>{let{el:r}=t;return r===e});-1!==a&&((0,p.E)(t,{[b.l4.Unmount](){n.current.splice(a,1)},[b.l4.Hidden](){n.current[a].state="hidden"}}),u.microTask(()=>{var e;!x(n)&&l.current&&(null==(e=r.current)||e.call(r))}))}),h=(0,i.z)(e=>{let t=n.current.find(t=>{let{el:r}=t;return r===e});return t?"visible"!==t.state&&(t.state="visible"):n.current.push({el:e,state:"visible"}),()=>d(e,b.l4.Unmount)}),m=(0,a.useRef)([]),f=(0,a.useRef)(Promise.resolve()),g=(0,a.useRef)({enter:[],leave:[]}),v=(0,i.z)((e,r,n)=>{m.current.splice(0),t&&(t.chains.current[r]=t.chains.current[r].filter(t=>{let[r]=t;return r!==e})),null==t||t.chains.current[r].push([e,new Promise(e=>{m.current.push(e)})]),null==t||t.chains.current[r].push([e,new Promise(e=>{Promise.all(g.current[r].map(e=>{let[t,r]=e;return r})).then(()=>e())})]),"enter"===r?f.current=f.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),y=(0,i.z)((e,t,r)=>{Promise.all(g.current[t].splice(0).map(e=>{let[t,r]=e;return r})).then(()=>{var e;null==(e=m.current.shift())||e()}).then(()=>r(t))});return(0,a.useMemo)(()=>({children:n,register:h,unregister:d,onStart:v,onStop:y,wait:f,chains:g}),[h,d,n,v,y,g,f])}w.displayName="NestingContext";let C=a.Fragment,O=b.VN.RenderStrategy,k=(0,b.yV)(function(e,t){let{show:r,appear:n=!1,unmount:o=!0,...s}=e,c=(0,a.useRef)(null),h=g(e),f=(0,d.T)(...h?[c,t]:null===t?[]:[t]);(0,u.H)();let p=(0,m.oJ)();if(void 0===r&&null!==p&&(r=(p&m.ZM.Open)===m.ZM.Open),void 0===r)throw Error("A is used but it is missing a `show={true | false}` prop.");let[y,C]=(0,a.useState)(r?"visible":"hidden"),k=E(()=>{r||C("hidden")}),[P,N]=(0,a.useState)(!0),T=(0,a.useRef)([r]);(0,l.e)(()=>{!1!==P&&T.current[T.current.length-1]!==r&&(T.current.push(r),N(!1))},[T,r]);let q=(0,a.useMemo)(()=>({show:r,appear:n,initial:P}),[r,n,P]);(0,l.e)(()=>{r?C("visible"):x(k)||null===c.current||C("hidden")},[r,k]);let M={unmount:o},j=(0,i.z)(()=>{var t;P&&N(!1),null==(t=e.beforeEnter)||t.call(e)}),D=(0,i.z)(()=>{var t;P&&N(!1),null==(t=e.beforeLeave)||t.call(e)}),L=(0,b.L6)();return a.createElement(w.Provider,{value:k},a.createElement(v.Provider,{value:q},L({ourProps:{...M,as:a.Fragment,children:a.createElement(S,{ref:f,...M,...s,beforeEnter:j,beforeLeave:D})},theirProps:{},defaultTag:a.Fragment,features:O,visible:"visible"===y,name:"Transition"})))}),S=(0,b.yV)(function(e,t){var r,n;let{transition:o=!0,beforeEnter:s,afterEnter:c,beforeLeave:y,afterLeave:k,enter:S,enterFrom:P,enterTo:N,entered:T,leave:q,leaveFrom:M,leaveTo:j,...D}=e,[L,R]=(0,a.useState)(null),I=(0,a.useRef)(null),_=g(e),Z=(0,d.T)(..._?[I,t,R]:null===t?[]:[t]),F=null==(r=D.unmount)||r?b.l4.Unmount:b.l4.Hidden,{show:A,appear:z,initial:H}=function(){let e=(0,a.useContext)(v);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),[B,V]=(0,a.useState)(A?"visible":"hidden"),Q=function(){let e=(0,a.useContext)(w);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),{register:G,unregister:K}=Q;(0,l.e)(()=>G(I),[G,I]),(0,l.e)(()=>{if(F===b.l4.Hidden&&I.current){if(A&&"visible"!==B){V("visible");return}return(0,p.E)(B,{hidden:()=>K(I),visible:()=>G(I)})}},[B,I,G,K,A,F]);let W=(0,u.H)();(0,l.e)(()=>{if(_&&W&&"visible"===B&&null===I.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[I,B,W,_]);let U=H&&!z,X=z&&A&&H,J=(0,a.useRef)(!1),Y=E(()=>{J.current||(V("hidden"),K(I))},Q),$=(0,i.z)(e=>{J.current=!0,Y.onStart(I,e?"enter":"leave",e=>{"enter"===e?null==s||s():"leave"===e&&(null==y||y())})}),ee=(0,i.z)(e=>{let t=e?"enter":"leave";J.current=!1,Y.onStop(I,t,e=>{"enter"===e?null==c||c():"leave"===e&&(null==k||k())}),"leave"!==t||x(Y)||(V("hidden"),K(I))});(0,a.useEffect)(()=>{_&&o||($(A),ee(A))},[A,_,o]);let et=!(!o||!_||!W||U),[,er]=(0,h.Y)(et,L,A,{start:$,end:ee}),en=(0,b.oA)({ref:Z,className:(null==(n=(0,f.A)(D.className,X&&S,X&&P,er.enter&&S,er.enter&&er.closed&&P,er.enter&&!er.closed&&N,er.leave&&q,er.leave&&!er.closed&&M,er.leave&&er.closed&&j,!er.transition&&A&&T))?void 0:n.trim())||void 0,...(0,h.X)(er)}),ea=0;"visible"===B&&(ea|=m.ZM.Open),"hidden"===B&&(ea|=m.ZM.Closed),er.enter&&(ea|=m.ZM.Opening),er.leave&&(ea|=m.ZM.Closing);let eo=(0,b.L6)();return a.createElement(w.Provider,{value:Y},a.createElement(m.up,{value:ea},eo({ourProps:en,theirProps:D,defaultTag:C,features:O,visible:"visible"===B,name:"Transition.Child"})))}),P=(0,b.yV)(function(e,t){let r=null!==(0,a.useContext)(v),n=null!==(0,m.oJ)();return a.createElement(a.Fragment,null,!r&&n?a.createElement(k,{ref:t,...e}):a.createElement(S,{ref:t,...e}))}),N=Object.assign(k,{Child:P,Root:k})},33443:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(2265);let a=(0,n.createContext)(()=>{});function o(e){let{value:t,children:r}=e;return n.createElement(a.Provider,{value:t},r)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1971-e7ecf0afb327457d.js b/litellm/proxy/_experimental/out/_next/static/chunks/1971-e7ecf0afb327457d.js new file mode 100644 index 00000000000..b23e1a59a2b --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1971-e7ecf0afb327457d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1971,5945,1623],{58747:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(5853),a=r(2265);let o=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}},4537:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(5853),a=r(2265);let o=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.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"}))}},30150:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(5853),a=r(2265);let o=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),a.createElement("path",{d:"M12 4v16m8-8H4"}))},i=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),a.createElement("path",{d:"M20 12H4"}))};var s=r(13241),l=r(1153),c=r(69262);let u="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",d="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",h=a.forwardRef((e,t)=>{let{onSubmit:r,enableStepper:h=!0,disabled:m,onValueChange:f,onChange:p}=e,b=(0,n._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),g=(0,a.useRef)(null),[v,y]=a.useState(!1),w=a.useCallback(()=>{y(!0)},[]),x=a.useCallback(()=>{y(!1)},[]),[E,C]=a.useState(!1),O=a.useCallback(()=>{C(!0)},[]),k=a.useCallback(()=>{C(!1)},[]);return a.createElement(c.Z,Object.assign({type:"number",ref:(0,l.lq)([g,t]),disabled:m,makeInputClassName:(0,l.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=g.current)||void 0===t?void 0:t.value;null==r||r(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&w(),"ArrowUp"===e.key&&O()},onKeyUp:e=>{"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&k()},onChange:e=>{m||(null==f||f(parseFloat(e.target.value)),null==p||p(e))},stepper:h?a.createElement("div",{className:(0,s.q)("flex justify-center align-middle")},a.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;m||(null===(e=g.current)||void 0===e||e.stepDown(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,s.q)(!m&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},a.createElement(i,{"data-testid":"step-down",className:(v?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),a.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;m||(null===(e=g.current)||void 0===e||e.stepUp(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,s.q)(!m&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},a.createElement(o,{"data-testid":"step-up",className:(E?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},b))});h.displayName="NumberInput"},27281:function(e,t,r){r.d(t,{Z:function(){return f}});var n=r(5853),a=r(58747),o=r(2265),i=r(4537),s=r(13241),l=r(1153),c=r(96398),u=r(51975),d=r(85238),h=r(44140);let m=(0,l.fn)("Select"),f=o.forwardRef((e,t)=>{let{defaultValue:r="",value:l,onValueChange:f,placeholder:p="Select...",disabled:b=!1,icon:g,enableClear:v=!1,required:y,children:w,name:x,error:E=!1,errorMessage:C,className:O,id:k}=e,S=(0,n._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),P=(0,o.useRef)(null),N=o.Children.toArray(w),[T,q]=(0,h.Z)(r,l),M=(0,o.useMemo)(()=>{let e=o.Children.toArray(w).filter(o.isValidElement);return(0,c.sl)(e)},[w]);return o.createElement("div",{className:(0,s.q)("w-full min-w-[10rem] text-tremor-default",O)},o.createElement("div",{className:"relative"},o.createElement("select",{title:"select-hidden",required:y,className:(0,s.q)("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:T,onChange:e=>{e.preventDefault()},name:x,disabled:b,id:k,onFocus:()=>{let e=P.current;e&&e.focus()}},o.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},p),N.map(e=>{let t=e.props.value,r=e.props.children;return o.createElement("option",{className:"hidden",key:t,value:t},r)})),o.createElement(u.Ri,Object.assign({as:"div",ref:t,defaultValue:T,value:T,onChange:e=>{null==f||f(e),q(e)},disabled:b,id:k},S),e=>{var t;let{value:r}=e;return o.createElement(o.Fragment,null,o.createElement(u.Y4,{ref:P,className:(0,s.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",g?"pl-10":"pl-3",(0,c.um)((0,c.Uh)(r),b,E))},g&&o.createElement("span",{className:(0,s.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(g,{className:(0,s.q)(m("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("span",{className:"w-[90%] block truncate"},r&&null!==(t=M.get(r))&&void 0!==t?t:p),o.createElement("span",{className:(0,s.q)("absolute inset-y-0 right-0 flex items-center mr-3")},o.createElement(a.Z,{className:(0,s.q)(m("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),v&&T?o.createElement("button",{type:"button",className:(0,s.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),q(""),null==f||f("")}},o.createElement(i.Z,{className:(0,s.q)(m("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(d.u,{enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(u.O_,{anchor:"bottom start",className:(0,s.q)("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")},w)))})),E&&C?o.createElement("p",{className:(0,s.q)("errorMessage","text-sm text-rose-500 mt-1")},C):null)});f.displayName="Select"},16853:function(e,t,r){r.d(t,{Z:function(){return u}});var n=r(5853),a=r(96398),o=r(44140),i=r(2265),s=r(13241),l=r(1153);let c=(0,l.fn)("Textarea"),u=i.forwardRef((e,t)=>{let{value:r,defaultValue:u="",placeholder:d="Type...",error:h=!1,errorMessage:m,disabled:f=!1,className:p,onChange:b,onValueChange:g,autoHeight:v=!1}=e,y=(0,n._T)(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange","autoHeight"]),[w,x]=(0,o.Z)(u,r),E=(0,i.useRef)(null),C=(0,a.Uh)(w);return(0,i.useEffect)(()=>{let e=E.current;if(v&&e){e.style.height="60px";let t=e.scrollHeight;e.style.height=t+"px"}},[v,E,w]),i.createElement(i.Fragment,null,i.createElement("textarea",Object.assign({ref:(0,l.lq)([E,t]),value:w,placeholder:d,disabled:f,className:(0,s.q)(c("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",(0,a.um)(C,f,h),f?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",p),"data-testid":"text-area",onChange:e=>{null==b||b(e),x(e.target.value),null==g||g(e.target.value)}},y)),h&&m?i.createElement("p",{className:(0,s.q)(c("errorMessage"),"text-sm text-red-500 mt-1")},m):null)});u.displayName="Textarea"},87452:function(e,t,r){r.d(t,{Z:function(){return d},r:function(){return u}});var n=r(5853),a=r(91054);r(42698),r(64016);var o=r(8710);r(33232);var i=r(13241),s=r(1153),l=r(2265);let c=(0,s.fn)("Accordion"),u=(0,l.createContext)({isOpen:!1}),d=l.forwardRef((e,t)=>{var r;let{defaultOpen:s=!1,children:d,className:h}=e,m=(0,n._T)(e,["defaultOpen","children","className"]),f=null!==(r=(0,l.useContext)(o.Z))&&void 0!==r?r:(0,i.q)("rounded-tremor-default border");return l.createElement(a.pJ,Object.assign({as:"div",ref:t,className:(0,i.q)(c("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",f,h),defaultOpen:s},m),e=>{let{open:t}=e;return l.createElement(u.Provider,{value:{isOpen:t}},d)})});d.displayName="Accordion"},88829:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(5853),a=r(2265),o=r(91054),i=r(13241);let s=(0,r(1153).fn)("AccordionBody"),l=a.forwardRef((e,t)=>{let{children:r,className:l}=e,c=(0,n._T)(e,["children","className"]);return a.createElement(o.pJ.Panel,Object.assign({ref:t,className:(0,i.q)(s("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",l)},c),r)});l.displayName="AccordionBody"},72208:function(e,t,r){r.d(t,{Z:function(){return u}});var n=r(5853),a=r(2265),o=r(91054);let i=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.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 s=r(87452),l=r(13241);let c=(0,r(1153).fn)("AccordionHeader"),u=a.forwardRef((e,t)=>{let{children:r,className:u}=e,d=(0,n._T)(e,["children","className"]),{isOpen:h}=(0,a.useContext)(s.r);return a.createElement(o.pJ.Button,Object.assign({ref:t,className:(0,l.q)(c("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",u)},d),a.createElement("div",{className:(0,l.q)(c("children"),"flex flex-1 text-inherit mr-4")},r),a.createElement("div",null,a.createElement(i,{className:(0,l.q)(c("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",h?"transition-all":"transition-all -rotate-180")})))});u.displayName="AccordionHeader"},67982:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(5853),a=r(13241),o=r(1153),i=r(2265);let s=(0,o.fn)("Divider"),l=i.forwardRef((e,t)=>{let{className:r,children:o}=e,l=(0,n._T)(e,["className","children"]);return i.createElement("div",Object.assign({ref:t,className:(0,a.q)(s("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",r)},l),o?i.createElement(i.Fragment,null,i.createElement("div",{className:(0,a.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),i.createElement("div",{className:(0,a.q)("text-inherit whitespace-nowrap")},o),i.createElement("div",{className:(0,a.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):i.createElement("div",{className:(0,a.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});l.displayName="Divider"},44140:function(e,t,r){r.d(t,{Z:function(){return a}});var n=r(2265);let a=(e,t)=>{let r=void 0!==t,[a,o]=(0,n.useState)(e);return[r?t:a,e=>{r||o(e)}]}},5945:function(e,t,r){r.d(t,{Z:function(){return M}});var n=r(2265),a=r(36760),o=r.n(a),i=r(18694),s=r(71744),l=r(33759),c=r(50337),u=r(65869),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 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},h=e=>{var{prefixCls:t,className:r,hoverable:a=!0}=e,i=d(e,["prefixCls","className","hoverable"]);let{getPrefixCls:l}=n.useContext(s.E_),c=l("card",t),u=o()("".concat(c,"-grid"),r,{["".concat(c,"-grid-hoverable")]:a});return n.createElement("div",Object.assign({},i,{className:u}))},m=r(93463),f=r(12918),p=r(99320),b=r(71140);let g=e=>{let{antCls:t,componentCls:r,headerHeight:n,headerPadding:a,tabsMarginBottom:o}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:n,marginBottom:-1,padding:"0 ".concat((0,m.bf)(a)),color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary),borderRadius:"".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG)," 0 0")},(0,f.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},f.vS),{["\n > ".concat(r,"-typography,\n > ").concat(r,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(t,"-tabs-top")]:{clear:"both",marginBottom:o,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary)}}})},v=e=>{let{cardPaddingBase:t,colorBorderSecondary:r,cardShadow:n,lineWidth:a}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:"\n ".concat((0,m.bf)(a)," 0 0 0 ").concat(r,",\n 0 ").concat((0,m.bf)(a)," 0 0 ").concat(r,",\n ").concat((0,m.bf)(a)," ").concat((0,m.bf)(a)," 0 0 ").concat(r,",\n ").concat((0,m.bf)(a)," 0 0 0 ").concat(r," inset,\n 0 ").concat((0,m.bf)(a)," 0 0 ").concat(r," inset;\n "),transition:"all ".concat(e.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:n}}},y=e=>{let{componentCls:t,iconCls:r,actionsLiMargin:n,cardActionsIconSize:a,colorBorderSecondary:o,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(o),display:"flex",borderRadius:"0 0 ".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG))},(0,f.dF)()),{"& > 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 ".concat(e.motionDurationMid)},["a:not(".concat(t,"-btn), > ").concat(r)]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:(0,m.bf)(e.fontHeight),transition:"color ".concat(e.motionDurationMid),"&:hover":{color:e.colorPrimary}},["> ".concat(r)]:{fontSize:a,lineHeight:(0,m.bf)(e.calc(a).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(o)}}})},w=e=>Object.assign(Object.assign({margin:"".concat((0,m.bf)(e.calc(e.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,f.dF)()),{"&-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},f.vS),"&-description":{color:e.colorTextDescription}}),x=e=>{let{componentCls:t,colorFillAlter:r,headerPadding:n,bodyPadding:a}=e;return{["".concat(t,"-head")]:{padding:"0 ".concat((0,m.bf)(n)),background:r,"&-title":{fontSize:e.fontSize}},["".concat(t,"-body")]:{padding:"".concat((0,m.bf)(e.padding)," ").concat((0,m.bf)(a))}}},E=e=>{let{componentCls:t}=e;return{overflow:"hidden",["".concat(t,"-body")]:{userSelect:"none"}}},C=e=>{let{componentCls:t,cardShadow:r,cardHeadPadding:n,colorBorderSecondary:a,boxShadowTertiary:o,bodyPadding:i,extraColor:s}=e;return{[t]:Object.assign(Object.assign({},(0,f.Wf)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,["&:not(".concat(t,"-bordered)")]:{boxShadow:o},["".concat(t,"-head")]:g(e),["".concat(t,"-extra")]:{marginInlineStart:"auto",color:s,fontWeight:"normal",fontSize:e.fontSize},["".concat(t,"-body")]:{padding:i,borderRadius:"0 0 ".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG))},["".concat(t,"-grid")]:v(e),["".concat(t,"-cover")]:{"> *":{display:"block",width:"100%",borderRadius:"".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG)," 0 0")}},["".concat(t,"-actions")]:y(e),["".concat(t,"-meta")]:w(e)}),["".concat(t,"-bordered")]:{border:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),["".concat(t,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(t,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(e.motionDurationMid,", border-color ").concat(e.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:r}},["".concat(t,"-contain-grid")]:{borderRadius:"".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG)," 0 0 "),["".concat(t,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(t,"-loading) ").concat(t,"-body")]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},["".concat(t,"-contain-tabs")]:{["> div".concat(t,"-head")]:{minHeight:0,["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:n}}},["".concat(t,"-type-inner")]:x(e),["".concat(t,"-loading")]:E(e),["".concat(t,"-rtl")]:{direction:"rtl"}}},O=e=>{let{componentCls:t,bodyPaddingSM:r,headerPaddingSM:n,headerHeightSM:a,headerFontSizeSM:o}=e;return{["".concat(t,"-small")]:{["> ".concat(t,"-head")]:{minHeight:a,padding:"0 ".concat((0,m.bf)(n)),fontSize:o,["> ".concat(t,"-head-wrapper")]:{["> ".concat(t,"-extra")]:{fontSize:e.fontSize}}},["> ".concat(t,"-body")]:{padding:r}},["".concat(t,"-small").concat(t,"-contain-tabs")]:{["> ".concat(t,"-head")]:{["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var k=(0,p.I$)("Card",e=>{let t=(0,b.IX)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[C(t),O(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:"".concat(e.paddingSM,"px 0"),tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:null!==(t=e.bodyPadding)&&void 0!==t?t:e.paddingLG,headerPadding:null!==(r=e.headerPadding)&&void 0!==r?r:e.paddingLG}}),S=r(56250),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 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 N=e=>{let{actionClasses:t,actions:r=[],actionStyle:a}=e;return n.createElement("ul",{className:t,style:a},r.map((e,t)=>n.createElement("li",{style:{width:"".concat(100/r.length,"%")},key:"action-".concat(t)},n.createElement("span",null,e))))},T=n.forwardRef((e,t)=>{let r;let{prefixCls:a,className:d,rootClassName:m,style:f,extra:p,headStyle:b={},bodyStyle:g={},title:v,loading:y,bordered:w,variant:x,size:E,type:C,cover:O,actions:T,tabList:q,children:M,activeTabKey:j,defaultActiveTabKey:D,tabBarExtraContent:L,hoverable:R,tabProps:I={},classNames:_,styles:Z}=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:A,direction:z,card:H}=n.useContext(s.E_),[B]=(0,S.Z)("card",x,w),V=e=>{var t;return o()(null===(t=null==H?void 0:H.classNames)||void 0===t?void 0:t[e],null==_?void 0:_[e])},Q=e=>{var t;return Object.assign(Object.assign({},null===(t=null==H?void 0:H.styles)||void 0===t?void 0:t[e]),null==Z?void 0:Z[e])},G=n.useMemo(()=>{let e=!1;return n.Children.forEach(M,t=>{(null==t?void 0:t.type)===h&&(e=!0)}),e},[M]),K=A("card",a),[W,U,X]=k(K),J=n.createElement(c.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},M),Y=void 0!==j,$=Object.assign(Object.assign({},I),{[Y?"activeKey":"defaultActiveKey"]:Y?j:D,tabBarExtraContent:L}),ee=(0,l.Z)(E),et=ee&&"default"!==ee?ee:"large",er=q?n.createElement(u.default,Object.assign({size:et},$,{className:"".concat(K,"-head-tabs"),onChange:t=>{var r;null===(r=e.onTabChange)||void 0===r||r.call(e,t)},items:q.map(e=>{var{tab:t}=e;return Object.assign({label:t},P(e,["tab"]))})})):null;if(v||p||er){let e=o()("".concat(K,"-head"),V("header")),t=o()("".concat(K,"-head-title"),V("title")),a=o()("".concat(K,"-extra"),V("extra")),i=Object.assign(Object.assign({},b),Q("header"));r=n.createElement("div",{className:e,style:i},n.createElement("div",{className:"".concat(K,"-head-wrapper")},v&&n.createElement("div",{className:t,style:Q("title")},v),p&&n.createElement("div",{className:a,style:Q("extra")},p)),er)}let en=o()("".concat(K,"-cover"),V("cover")),ea=O?n.createElement("div",{className:en,style:Q("cover")},O):null,eo=o()("".concat(K,"-body"),V("body")),ei=Object.assign(Object.assign({},g),Q("body")),es=n.createElement("div",{className:eo,style:ei},y?J:M),el=o()("".concat(K,"-actions"),V("actions")),ec=(null==T?void 0:T.length)?n.createElement(N,{actionClasses:el,actionStyle:Q("actions"),actions:T}):null,eu=(0,i.Z)(F,["onTabChange"]),ed=o()(K,null==H?void 0:H.className,{["".concat(K,"-loading")]:y,["".concat(K,"-bordered")]:"borderless"!==B,["".concat(K,"-hoverable")]:R,["".concat(K,"-contain-grid")]:G,["".concat(K,"-contain-tabs")]:null==q?void 0:q.length,["".concat(K,"-").concat(ee)]:ee,["".concat(K,"-type-").concat(C)]:!!C,["".concat(K,"-rtl")]:"rtl"===z},d,m,U,X),eh=Object.assign(Object.assign({},null==H?void 0:H.style),f);return W(n.createElement("div",Object.assign({ref:t},eu,{className:ed,style:eh}),r,ea,es,ec))});var q=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};T.Grid=h,T.Meta=e=>{let{prefixCls:t,className:r,avatar:a,title:i,description:l}=e,c=q(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:u}=n.useContext(s.E_),d=u("card",t),h=o()("".concat(d,"-meta"),r),m=a?n.createElement("div",{className:"".concat(d,"-meta-avatar")},a):null,f=i?n.createElement("div",{className:"".concat(d,"-meta-title")},i):null,p=l?n.createElement("div",{className:"".concat(d,"-meta-description")},l):null,b=f||p?n.createElement("div",{className:"".concat(d,"-meta-detail")},f,p):null;return n.createElement("div",Object.assign({},c,{className:h}),m,b)};var M=T},10900:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});t.Z=a},44633:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=a},15731:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},53410:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},23628:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=a},49084:function(e,t,r){var n=r(2265);let a=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=a},2894:function(e,t,r){r.d(t,{R:function(){return s},m:function(){return i}});var n=r(18238),a=r(7989),o=r(11255),i=class extends a.F{#e;#t;#r;#n;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||s(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#a({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,o.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#a({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#a({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});let n="pending"===this.state.status,a=!this.#n.canStart();try{if(n)t();else{this.#a({type:"pending",variables:e,isPaused:a}),await this.#r.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:a})}let o=await this.#n.start();return await this.#r.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#r.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#a({type:"success",data:o}),o}catch(t){try{throw await this.#r.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#r.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#a({type:"error",error:t})}}finally{this.#r.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.Vr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function s(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21623:function(e,t,r){r.d(t,{S:function(){return p}});var n=r(45345),a=r(21733),o=r(18238),i=r(24112),s=class extends i.l{constructor(e={}){super(),this.config=e,this.#o=new Map}#o;build(e,t,r){let o=t.queryKey,i=t.queryHash??(0,n.Rm)(o,t),s=this.get(i);return s||(s=new a.A({client:e,queryKey:o,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(o)}),this.add(s)),s}add(e){this.#o.has(e.queryHash)||(this.#o.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#o.get(e.queryHash);t&&(e.destroy(),t===e&&this.#o.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){o.Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#o.get(e)}getAll(){return[...this.#o.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n._x)(e,t)):t}notify(e){o.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){o.Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){o.Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},l=r(2894),c=class extends i.l{constructor(e={}){super(),this.config=e,this.#i=new Set,this.#s=new Map,this.#l=0}#i;#s;#l;build(e,t,r){let n=new l.m({client:e,mutationCache:this,mutationId:++this.#l,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#i.add(e);let t=u(e);if("string"==typeof t){let r=this.#s.get(t);r?r.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#i.delete(e)){let t=u(e);if("string"==typeof t){let r=this.#s.get(t);if(r){if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#s.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=u(e);if("string"!=typeof t)return!0;{let r=this.#s.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=u(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){o.Vr.batch(()=>{this.#i.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#i.clear(),this.#s.clear()})}getAll(){return Array.from(this.#i)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.X7)(e,t))}notify(e){o.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return o.Vr.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.ZT))))}};function u(e){return e.options.scope?.id}var d=r(87045),h=r(57853);function m(e){return{onFetch:(t,r)=>{let a=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],s=t.state.data?.pageParams||[],l={pages:[],pageParams:[]},c=0,u=async()=>{let r=!1,u=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)})},d=(0,n.cG)(t.options,t.fetchOptions),h=async(e,a,o)=>{if(r)return Promise.reject();if(null==a&&e.pages.length)return Promise.resolve(e);let i=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:a,direction:o?"backward":"forward",meta:t.options.meta};return u(e),e})(),s=await d(i),{maxPages:l}=t.options,c=o?n.Ht:n.VX;return{pages:c(e.pages,s,l),pageParams:c(e.pageParams,a,l)}};if(o&&i.length){let e="backward"===o,t={pages:i,pageParams:s},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:f)(a,t);l=await h(t,r,e)}else{let t=e??i.length;do{let e=0===c?s[0]??a.initialPageParam:f(a,l);if(c>0&&null==e)break;l=await h(l,e),c++}while(ct.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function f(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var p=class{#c;#r;#u;#d;#h;#m;#f;#p;constructor(e={}){this.#c=e.queryCache||new s,this.#r=e.mutationCache||new c,this.#u=e.defaultOptions||{},this.#d=new Map,this.#h=new Map,this.#m=0}mount(){this.#m++,1===this.#m&&(this.#f=d.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#c.onFocus())}),this.#p=h.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#c.onOnline())}))}unmount(){this.#m--,0===this.#m&&(this.#f?.(),this.#f=void 0,this.#p?.(),this.#p=void 0)}isFetching(e){return this.#c.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#r.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#c.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#c.build(this,t),a=r.state.data;return void 0===a?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,n.KC)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#c.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let a=this.defaultQueryOptions({queryKey:e}),o=this.#c.get(a.queryHash),i=o?.state.data,s=(0,n.SE)(t,i);if(void 0!==s)return this.#c.build(this,a).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return o.Vr.batch(()=>this.#c.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#c.get(t.queryHash)?.state}removeQueries(e){let t=this.#c;o.Vr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#c;return o.Vr.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(o.Vr.batch(()=>this.#c.findAll(e).map(e=>e.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e,t={}){return o.Vr.batch(()=>(this.#c.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(o.Vr.batch(()=>this.#c.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(n.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#c.build(this,t);return r.isStaleByTime((0,n.KC)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.ZT).catch(n.ZT)}fetchInfiniteQuery(e){return e.behavior=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return h.N.isOnline()?this.#r.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#c}getMutationCache(){return this.#r}getDefaultOptions(){return this.#u}setDefaultOptions(e){this.#u=e}setQueryDefaults(e,t){this.#d.set((0,n.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#d.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#h.set((0,n.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#h.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#u.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#u.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#c.clear(),this.#r.clear()}}},19616:function(e,t,r){r.d(t,{G:function(){return i}});var n=r(2265);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 i(e,t){let[r,a]=(0,n.useState)(e),i=function(e,t){let[r]=(0,n.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 r.setOptions(t),r}(a,t);return[r,i.maybeExecute,i]}},91054:function(e,t,r){let n,a;r.d(t,{pJ:function(){return j}});var o,i=r(71049),s=r(11323),l=r(2265),c=r(66797),u=r(93980),d=r(65573),h=r(67561),m=r(98218),f=r(33443),p=r(28294),b=r(31370),g=r(72468),v=r(5664),y=r(38929);let w=null!=(o=l.startTransition)?o:function(e){e()};var x=r(52724),E=((n=E||{})[n.Open=0]="Open",n[n.Closed=1]="Closed",n),C=((a=C||{})[a.ToggleDisclosure=0]="ToggleDisclosure",a[a.CloseDisclosure=1]="CloseDisclosure",a[a.SetButtonId=2]="SetButtonId",a[a.SetPanelId=3]="SetPanelId",a[a.SetButtonElement=4]="SetButtonElement",a[a.SetPanelElement=5]="SetPanelElement",a);let O={0:e=>({...e,disclosureState:(0,g.E)(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}},k=(0,l.createContext)(null);function S(e){let t=(0,l.useContext)(k);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,S),t}return t}k.displayName="DisclosureContext";let P=(0,l.createContext)(null);P.displayName="DisclosureAPIContext";let N=(0,l.createContext)(null);function T(e,t){return(0,g.E)(t.type,O,e,t)}N.displayName="DisclosurePanelContext";let q=l.Fragment,M=y.VN.RenderStrategy|y.VN.Static,j=Object.assign((0,y.yV)(function(e,t){let{defaultOpen:r=!1,...n}=e,a=(0,l.useRef)(null),o=(0,h.T)(t,(0,h.h)(e=>{a.current=e},void 0===e.as||e.as===l.Fragment)),i=(0,l.useReducer)(T,{disclosureState:r?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:s,buttonId:c},d]=i,m=(0,u.z)(e=>{d({type:1});let t=(0,v.r)(a);if(!t||!c)return;let r=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(c):t.getElementById(c);null==r||r.focus()}),b=(0,l.useMemo)(()=>({close:m}),[m]),w=(0,l.useMemo)(()=>({open:0===s,close:m}),[s,m]),x=(0,y.L6)();return l.createElement(k.Provider,{value:i},l.createElement(P.Provider,{value:b},l.createElement(f.Z,{value:m},l.createElement(p.up,{value:(0,g.E)(s,{0:p.ZM.Open,1:p.ZM.Closed})},x({ourProps:{ref:o},theirProps:n,slot:w,defaultTag:q,name:"Disclosure"})))))}),{Button:(0,y.yV)(function(e,t){let r=(0,l.useId)(),{id:n="headlessui-disclosure-button-".concat(r),disabled:a=!1,autoFocus:o=!1,...m}=e,[f,p]=S("Disclosure.Button"),g=(0,l.useContext)(N),v=null!==g&&g===f.panelId,w=(0,l.useRef)(null),E=(0,h.T)(w,t,(0,u.z)(e=>{if(!v)return p({type:4,element:e})}));(0,l.useEffect)(()=>{if(!v)return p({type:2,buttonId:n}),()=>{p({type:2,buttonId:null})}},[n,p,v]);let C=(0,u.z)(e=>{var t;if(v){if(1===f.disclosureState)return;switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),p({type:0}),null==(t=f.buttonElement)||t.focus()}}else switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),p({type:0})}}),O=(0,u.z)(e=>{e.key===x.R.Space&&e.preventDefault()}),k=(0,u.z)(e=>{var t;(0,b.P)(e.currentTarget)||a||(v?(p({type:0}),null==(t=f.buttonElement)||t.focus()):p({type:0}))}),{isFocusVisible:P,focusProps:T}=(0,i.F)({autoFocus:o}),{isHovered:q,hoverProps:M}=(0,s.X)({isDisabled:a}),{pressed:j,pressProps:D}=(0,c.x)({disabled:a}),L=(0,l.useMemo)(()=>({open:0===f.disclosureState,hover:q,active:j,disabled:a,focus:P,autofocus:o}),[f,q,j,P,a,o]),R=(0,d.f)(e,f.buttonElement),I=v?(0,y.dG)({ref:E,type:R,disabled:a||void 0,autoFocus:o,onKeyDown:C,onClick:k},T,M,D):(0,y.dG)({ref:E,id:n,type:R,"aria-expanded":0===f.disclosureState,"aria-controls":f.panelElement?f.panelId:void 0,disabled:a||void 0,autoFocus:o,onKeyDown:C,onKeyUp:O,onClick:k},T,M,D);return(0,y.L6)()({ourProps:I,theirProps:m,slot:L,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,y.yV)(function(e,t){let r=(0,l.useId)(),{id:n="headlessui-disclosure-panel-".concat(r),transition:a=!1,...o}=e,[i,s]=S("Disclosure.Panel"),{close:c}=function e(t){let r=(0,l.useContext)(P);if(null===r){let r=Error("<".concat(t," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(r,e),r}return r}("Disclosure.Panel"),[d,f]=(0,l.useState)(null),b=(0,h.T)(t,(0,u.z)(e=>{w(()=>s({type:5,element:e}))}),f);(0,l.useEffect)(()=>(s({type:3,panelId:n}),()=>{s({type:3,panelId:null})}),[n,s]);let g=(0,p.oJ)(),[v,x]=(0,m.Y)(a,d,null!==g?(g&p.ZM.Open)===p.ZM.Open:0===i.disclosureState),E=(0,l.useMemo)(()=>({open:0===i.disclosureState,close:c}),[i.disclosureState,c]),C={ref:b,id:n,...(0,m.X)(x)},O=(0,y.L6)();return l.createElement(p.uu,null,l.createElement(N.Provider,{value:i.panelId},O({ourProps:C,theirProps:o,slot:E,defaultTag:"div",features:M,visible:v,name:"Disclosure.Panel"})))})})},85238:function(e,t,r){let n;r.d(t,{u:function(){return N}});var a=r(2265),o=r(59456),i=r(93980),s=r(25289),l=r(73389),c=r(43507),u=r(180),d=r(67561),h=r(98218),m=r(28294),f=r(95504),p=r(72468),b=r(38929);function g(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||(null!=(t=e.as)?t:C)!==a.Fragment||1===a.Children.count(e.children)}let v=(0,a.createContext)(null);v.displayName="TransitionContext";var y=((n=y||{}).Visible="visible",n.Hidden="hidden",n);let w=(0,a.createContext)(null);function x(e){return"children"in e?x(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function E(e,t){let r=(0,c.E)(e),n=(0,a.useRef)([]),l=(0,s.t)(),u=(0,o.G)(),d=(0,i.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.l4.Hidden,a=n.current.findIndex(t=>{let{el:r}=t;return r===e});-1!==a&&((0,p.E)(t,{[b.l4.Unmount](){n.current.splice(a,1)},[b.l4.Hidden](){n.current[a].state="hidden"}}),u.microTask(()=>{var e;!x(n)&&l.current&&(null==(e=r.current)||e.call(r))}))}),h=(0,i.z)(e=>{let t=n.current.find(t=>{let{el:r}=t;return r===e});return t?"visible"!==t.state&&(t.state="visible"):n.current.push({el:e,state:"visible"}),()=>d(e,b.l4.Unmount)}),m=(0,a.useRef)([]),f=(0,a.useRef)(Promise.resolve()),g=(0,a.useRef)({enter:[],leave:[]}),v=(0,i.z)((e,r,n)=>{m.current.splice(0),t&&(t.chains.current[r]=t.chains.current[r].filter(t=>{let[r]=t;return r!==e})),null==t||t.chains.current[r].push([e,new Promise(e=>{m.current.push(e)})]),null==t||t.chains.current[r].push([e,new Promise(e=>{Promise.all(g.current[r].map(e=>{let[t,r]=e;return r})).then(()=>e())})]),"enter"===r?f.current=f.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),y=(0,i.z)((e,t,r)=>{Promise.all(g.current[t].splice(0).map(e=>{let[t,r]=e;return r})).then(()=>{var e;null==(e=m.current.shift())||e()}).then(()=>r(t))});return(0,a.useMemo)(()=>({children:n,register:h,unregister:d,onStart:v,onStop:y,wait:f,chains:g}),[h,d,n,v,y,g,f])}w.displayName="NestingContext";let C=a.Fragment,O=b.VN.RenderStrategy,k=(0,b.yV)(function(e,t){let{show:r,appear:n=!1,unmount:o=!0,...s}=e,c=(0,a.useRef)(null),h=g(e),f=(0,d.T)(...h?[c,t]:null===t?[]:[t]);(0,u.H)();let p=(0,m.oJ)();if(void 0===r&&null!==p&&(r=(p&m.ZM.Open)===m.ZM.Open),void 0===r)throw Error("A is used but it is missing a `show={true | false}` prop.");let[y,C]=(0,a.useState)(r?"visible":"hidden"),k=E(()=>{r||C("hidden")}),[P,N]=(0,a.useState)(!0),T=(0,a.useRef)([r]);(0,l.e)(()=>{!1!==P&&T.current[T.current.length-1]!==r&&(T.current.push(r),N(!1))},[T,r]);let q=(0,a.useMemo)(()=>({show:r,appear:n,initial:P}),[r,n,P]);(0,l.e)(()=>{r?C("visible"):x(k)||null===c.current||C("hidden")},[r,k]);let M={unmount:o},j=(0,i.z)(()=>{var t;P&&N(!1),null==(t=e.beforeEnter)||t.call(e)}),D=(0,i.z)(()=>{var t;P&&N(!1),null==(t=e.beforeLeave)||t.call(e)}),L=(0,b.L6)();return a.createElement(w.Provider,{value:k},a.createElement(v.Provider,{value:q},L({ourProps:{...M,as:a.Fragment,children:a.createElement(S,{ref:f,...M,...s,beforeEnter:j,beforeLeave:D})},theirProps:{},defaultTag:a.Fragment,features:O,visible:"visible"===y,name:"Transition"})))}),S=(0,b.yV)(function(e,t){var r,n;let{transition:o=!0,beforeEnter:s,afterEnter:c,beforeLeave:y,afterLeave:k,enter:S,enterFrom:P,enterTo:N,entered:T,leave:q,leaveFrom:M,leaveTo:j,...D}=e,[L,R]=(0,a.useState)(null),I=(0,a.useRef)(null),_=g(e),Z=(0,d.T)(..._?[I,t,R]:null===t?[]:[t]),F=null==(r=D.unmount)||r?b.l4.Unmount:b.l4.Hidden,{show:A,appear:z,initial:H}=function(){let e=(0,a.useContext)(v);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),[B,V]=(0,a.useState)(A?"visible":"hidden"),Q=function(){let e=(0,a.useContext)(w);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),{register:G,unregister:K}=Q;(0,l.e)(()=>G(I),[G,I]),(0,l.e)(()=>{if(F===b.l4.Hidden&&I.current){if(A&&"visible"!==B){V("visible");return}return(0,p.E)(B,{hidden:()=>K(I),visible:()=>G(I)})}},[B,I,G,K,A,F]);let W=(0,u.H)();(0,l.e)(()=>{if(_&&W&&"visible"===B&&null===I.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[I,B,W,_]);let U=H&&!z,X=z&&A&&H,J=(0,a.useRef)(!1),Y=E(()=>{J.current||(V("hidden"),K(I))},Q),$=(0,i.z)(e=>{J.current=!0,Y.onStart(I,e?"enter":"leave",e=>{"enter"===e?null==s||s():"leave"===e&&(null==y||y())})}),ee=(0,i.z)(e=>{let t=e?"enter":"leave";J.current=!1,Y.onStop(I,t,e=>{"enter"===e?null==c||c():"leave"===e&&(null==k||k())}),"leave"!==t||x(Y)||(V("hidden"),K(I))});(0,a.useEffect)(()=>{_&&o||($(A),ee(A))},[A,_,o]);let et=!(!o||!_||!W||U),[,er]=(0,h.Y)(et,L,A,{start:$,end:ee}),en=(0,b.oA)({ref:Z,className:(null==(n=(0,f.A)(D.className,X&&S,X&&P,er.enter&&S,er.enter&&er.closed&&P,er.enter&&!er.closed&&N,er.leave&&q,er.leave&&!er.closed&&M,er.leave&&er.closed&&j,!er.transition&&A&&T))?void 0:n.trim())||void 0,...(0,h.X)(er)}),ea=0;"visible"===B&&(ea|=m.ZM.Open),"hidden"===B&&(ea|=m.ZM.Closed),er.enter&&(ea|=m.ZM.Opening),er.leave&&(ea|=m.ZM.Closing);let eo=(0,b.L6)();return a.createElement(w.Provider,{value:Y},a.createElement(m.up,{value:ea},eo({ourProps:en,theirProps:D,defaultTag:C,features:O,visible:"visible"===B,name:"Transition.Child"})))}),P=(0,b.yV)(function(e,t){let r=null!==(0,a.useContext)(v),n=null!==(0,m.oJ)();return a.createElement(a.Fragment,null,!r&&n?a.createElement(k,{ref:t,...e}):a.createElement(S,{ref:t,...e}))}),N=Object.assign(k,{Child:P,Root:k})},33443:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(2265);let a=(0,n.createContext)(()=>{});function o(e){let{value:t,children:r}=e;return n.createElement(a.Provider,{value:t},r)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1994-6637a121c9ee1602.js b/litellm/proxy/_experimental/out/_next/static/chunks/1994-6637a121c9ee1602.js new file mode 100644 index 00000000000..90f29480d63 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1994-6637a121c9ee1602.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1994],{4156:function(e,n,t){t.d(n,{Z:function(){return O}});var o=t(2265),a=t(36760),r=t.n(a),c=t(20873),l=t(28791),i=t(6694),s=t(34709),u=t(71744),d=t(86586),b=t(64024),p=t(39109);let f=o.createContext(null);var v=t(23159),m=t(66531),h=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>n.indexOf(o)&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);an.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]]);return t};let g=o.forwardRef((e,n)=>{var t;let{prefixCls:a,className:g,rootClassName:C,children:y,indeterminate:k=!1,style:x,onMouseEnter:O,onMouseLeave:E,skipGroup:S=!1,disabled:w}=e,Z=h(e,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:P,direction:N,checkbox:j}=o.useContext(u.E_),I=o.useContext(f),{isFormItemInput:R}=o.useContext(p.aM),z=o.useContext(d.Z),B=null!==(t=(null==I?void 0:I.disabled)||w)&&void 0!==t?t:z,D=o.useRef(Z.value),M=o.useRef(null),_=(0,l.sQ)(n,M);o.useEffect(()=>{null==I||I.registerValue(Z.value)},[]),o.useEffect(()=>{if(!S)return Z.value!==D.current&&(null==I||I.cancelValue(D.current),null==I||I.registerValue(Z.value),D.current=Z.value),()=>null==I?void 0:I.cancelValue(Z.value)},[Z.value]),o.useEffect(()=>{var e;(null===(e=M.current)||void 0===e?void 0:e.input)&&(M.current.input.indeterminate=k)},[k]);let W=P("checkbox",a),q=(0,b.Z)(W),[H,T,G]=(0,v.ZP)(W,q),V=Object.assign({},Z);I&&!S&&(V.onChange=function(){for(var e=arguments.length,n=Array(e),t=0;tn.indexOf(o)&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);an.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]]);return t};let x=o.forwardRef((e,n)=>{let{defaultValue:t,children:a,options:c=[],prefixCls:l,className:i,rootClassName:s,style:d,onChange:p}=e,m=k(e,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:h,direction:x}=o.useContext(u.E_),[O,E]=o.useState(m.value||t||[]),[S,w]=o.useState([]);o.useEffect(()=>{"value"in m&&E(m.value||[])},[m.value]);let Z=o.useMemo(()=>c.map(e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e),[c]),P=e=>{w(n=>n.filter(n=>n!==e))},N=e=>{w(n=>[].concat((0,C.Z)(n),[e]))},j=e=>{let n=O.indexOf(e.value),t=(0,C.Z)(O);-1===n?t.push(e.value):t.splice(n,1),"value"in m||E(t),null==p||p(t.filter(e=>S.includes(e)).sort((e,n)=>Z.findIndex(n=>n.value===e)-Z.findIndex(e=>e.value===n)))},I=h("checkbox",l),R="".concat(I,"-group"),z=(0,b.Z)(I),[B,D,M]=(0,v.ZP)(I,z),_=(0,y.Z)(m,["value","disabled"]),W=c.length?Z.map(e=>o.createElement(g,{prefixCls:I,key:e.value.toString(),disabled:"disabled"in e?e.disabled:m.disabled,value:e.value,checked:O.includes(e.value),onChange:e.onChange,className:r()("".concat(R,"-item"),e.className),style:e.style,title:e.title,id:e.id,required:e.required},e.label)):a,q=o.useMemo(()=>({toggleOption:j,value:O,disabled:m.disabled,name:m.name,registerValue:N,cancelValue:P}),[j,O,m.disabled,m.name,N,P]),H=r()(R,{["".concat(R,"-rtl")]:"rtl"===x},i,s,M,z,D);return B(o.createElement("div",Object.assign({className:H,style:d},_,{ref:n}),o.createElement(f.Provider,{value:q},W)))});g.Group=x,g.__ANT_CHECKBOX=!0;var O=g},23159:function(e,n,t){t.d(n,{C2:function(){return i}});var o=t(93463),a=t(12918),r=t(71140),c=t(99320);let l=e=>{let{checkboxCls:n}=e,t="".concat(n,"-wrapper");return[{["".concat(n,"-group")]:Object.assign(Object.assign({},(0,a.Wf)(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,["> ".concat(e.antCls,"-row")]:{flex:1}}),[t]:Object.assign(Object.assign({},(0,a.Wf)(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},["& + ".concat(t)]:{marginInlineStart:0},["&".concat(t,"-in-form-item")]:{'input[type="checkbox"]':{width:14,height:14}}}),[n]:Object.assign(Object.assign({},(0,a.Wf)(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",["".concat(n,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,["&:focus-visible + ".concat(n,"-inner")]:(0,a.oN)(e)},["".concat(n,"-inner")]:{boxSizing:"border-box",display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:"".concat((0,o.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:"all ".concat(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:"".concat((0,o.bf)(e.lineWidthBold)," solid ").concat(e.colorWhite),borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:"all ".concat(e.motionDurationFast," ").concat(e.motionEaseInBack,", opacity ").concat(e.motionDurationFast)}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{["\n ".concat(t,":not(").concat(t,"-disabled),\n ").concat(n,":not(").concat(n,"-disabled)\n ")]:{["&:hover ".concat(n,"-inner")]:{borderColor:e.colorPrimary}},["".concat(t,":not(").concat(t,"-disabled)")]:{["&:hover ".concat(n,"-checked:not(").concat(n,"-disabled) ").concat(n,"-inner")]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},["&:hover ".concat(n,"-checked:not(").concat(n,"-disabled):after")]:{borderColor:e.colorPrimaryHover}}},{["".concat(n,"-checked")]:{["".concat(n,"-inner")]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseOutBack," ").concat(e.motionDurationFast)}}},["\n ".concat(t,"-checked:not(").concat(t,"-disabled),\n ").concat(n,"-checked:not(").concat(n,"-disabled)\n ")]:{["&:hover ".concat(n,"-inner")]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[n]:{"&-indeterminate":{"&":{["".concat(n,"-inner")]:{backgroundColor:"".concat(e.colorBgContainer),borderColor:"".concat(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 ".concat(n,"-inner")]:{backgroundColor:"".concat(e.colorBgContainer),borderColor:"".concat(e.colorPrimary)}}}}},{["".concat(t,"-disabled")]:{cursor:"not-allowed"},["".concat(n,"-disabled")]:{["&, ".concat(n,"-input")]:{cursor:"not-allowed",pointerEvents:"none"},["".concat(n,"-inner")]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},["&".concat(n,"-indeterminate ").concat(n,"-inner::after")]:{background:e.colorTextDisabled}}}]};function i(e,n){return l((0,r.IX)(n,{checkboxCls:".".concat(e),checkboxSize:n.controlInteractiveSize}))}n.ZP=(0,c.I$)("Checkbox",(e,n)=>{let{prefixCls:t}=n;return[i(t,e)]})},66531:function(e,n,t){t.d(n,{Z:function(){return r}});var o=t(2265),a=t(53346);function r(e){let n=o.useRef(null),t=()=>{a.Z.cancel(n.current),n.current=null};return[()=>{t(),n.current=(0,a.Z)(()=>{n.current=null})},o=>{n.current&&(o.stopPropagation(),t()),null==e||e(o)}]}},20873:function(e,n,t){var o=t(1119),a=t(31686),r=t(11993),c=t(26365),l=t(6989),i=t(36760),s=t.n(i),u=t(50506),d=t(2265),b=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],p=(0,d.forwardRef)(function(e,n){var t=e.prefixCls,i=void 0===t?"rc-checkbox":t,p=e.className,f=e.style,v=e.checked,m=e.disabled,h=e.defaultChecked,g=e.type,C=void 0===g?"checkbox":g,y=e.title,k=e.onChange,x=(0,l.Z)(e,b),O=(0,d.useRef)(null),E=(0,d.useRef)(null),S=(0,u.Z)(void 0!==h&&h,{value:v}),w=(0,c.Z)(S,2),Z=w[0],P=w[1];(0,d.useImperativeHandle)(n,function(){return{focus:function(e){var n;null===(n=O.current)||void 0===n||n.focus(e)},blur:function(){var e;null===(e=O.current)||void 0===e||e.blur()},input:O.current,nativeElement:E.current}});var N=s()(i,p,(0,r.Z)((0,r.Z)({},"".concat(i,"-checked"),Z),"".concat(i,"-disabled"),m));return d.createElement("span",{className:N,title:y,style:f,ref:E},d.createElement("input",(0,o.Z)({},x,{className:"".concat(i,"-input"),ref:O,onChange:function(n){m||("checked"in e||P(n.target.checked),null==k||k({target:(0,a.Z)((0,a.Z)({},e),{},{type:C,checked:n.target.checked}),stopPropagation:function(){n.stopPropagation()},preventDefault:function(){n.preventDefault()},nativeEvent:n.nativeEvent}))},disabled:m,checked:!!Z,type:C})),d.createElement("span",{className:"".concat(i,"-inner")}))});n.Z=p}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1994-a4d0b99849c16b62.js b/litellm/proxy/_experimental/out/_next/static/chunks/1994-a4d0b99849c16b62.js deleted file mode 100644 index 3211472683d..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1994-a4d0b99849c16b62.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1994],{61994:function(e,n,t){t.d(n,{Z:function(){return O}});var o=t(2265),a=t(36760),r=t.n(a),c=t(20873),l=t(28791),i=t(6694),s=t(34709),u=t(71744),d=t(86586),b=t(64024),p=t(39109);let f=o.createContext(null);var v=t(23159),m=t(66531),h=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>n.indexOf(o)&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);an.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]]);return t};let g=o.forwardRef((e,n)=>{var t;let{prefixCls:a,className:g,rootClassName:C,children:y,indeterminate:k=!1,style:x,onMouseEnter:O,onMouseLeave:E,skipGroup:S=!1,disabled:w}=e,Z=h(e,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:P,direction:N,checkbox:j}=o.useContext(u.E_),I=o.useContext(f),{isFormItemInput:R}=o.useContext(p.aM),z=o.useContext(d.Z),B=null!==(t=(null==I?void 0:I.disabled)||w)&&void 0!==t?t:z,D=o.useRef(Z.value),M=o.useRef(null),_=(0,l.sQ)(n,M);o.useEffect(()=>{null==I||I.registerValue(Z.value)},[]),o.useEffect(()=>{if(!S)return Z.value!==D.current&&(null==I||I.cancelValue(D.current),null==I||I.registerValue(Z.value),D.current=Z.value),()=>null==I?void 0:I.cancelValue(Z.value)},[Z.value]),o.useEffect(()=>{var e;(null===(e=M.current)||void 0===e?void 0:e.input)&&(M.current.input.indeterminate=k)},[k]);let W=P("checkbox",a),q=(0,b.Z)(W),[H,T,G]=(0,v.ZP)(W,q),V=Object.assign({},Z);I&&!S&&(V.onChange=function(){for(var e=arguments.length,n=Array(e),t=0;tn.indexOf(o)&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);an.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]]);return t};let x=o.forwardRef((e,n)=>{let{defaultValue:t,children:a,options:c=[],prefixCls:l,className:i,rootClassName:s,style:d,onChange:p}=e,m=k(e,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:h,direction:x}=o.useContext(u.E_),[O,E]=o.useState(m.value||t||[]),[S,w]=o.useState([]);o.useEffect(()=>{"value"in m&&E(m.value||[])},[m.value]);let Z=o.useMemo(()=>c.map(e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e),[c]),P=e=>{w(n=>n.filter(n=>n!==e))},N=e=>{w(n=>[].concat((0,C.Z)(n),[e]))},j=e=>{let n=O.indexOf(e.value),t=(0,C.Z)(O);-1===n?t.push(e.value):t.splice(n,1),"value"in m||E(t),null==p||p(t.filter(e=>S.includes(e)).sort((e,n)=>Z.findIndex(n=>n.value===e)-Z.findIndex(e=>e.value===n)))},I=h("checkbox",l),R="".concat(I,"-group"),z=(0,b.Z)(I),[B,D,M]=(0,v.ZP)(I,z),_=(0,y.Z)(m,["value","disabled"]),W=c.length?Z.map(e=>o.createElement(g,{prefixCls:I,key:e.value.toString(),disabled:"disabled"in e?e.disabled:m.disabled,value:e.value,checked:O.includes(e.value),onChange:e.onChange,className:r()("".concat(R,"-item"),e.className),style:e.style,title:e.title,id:e.id,required:e.required},e.label)):a,q=o.useMemo(()=>({toggleOption:j,value:O,disabled:m.disabled,name:m.name,registerValue:N,cancelValue:P}),[j,O,m.disabled,m.name,N,P]),H=r()(R,{["".concat(R,"-rtl")]:"rtl"===x},i,s,M,z,D);return B(o.createElement("div",Object.assign({className:H,style:d},_,{ref:n}),o.createElement(f.Provider,{value:q},W)))});g.Group=x,g.__ANT_CHECKBOX=!0;var O=g},23159:function(e,n,t){t.d(n,{C2:function(){return i}});var o=t(93463),a=t(12918),r=t(71140),c=t(99320);let l=e=>{let{checkboxCls:n}=e,t="".concat(n,"-wrapper");return[{["".concat(n,"-group")]:Object.assign(Object.assign({},(0,a.Wf)(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,["> ".concat(e.antCls,"-row")]:{flex:1}}),[t]:Object.assign(Object.assign({},(0,a.Wf)(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},["& + ".concat(t)]:{marginInlineStart:0},["&".concat(t,"-in-form-item")]:{'input[type="checkbox"]':{width:14,height:14}}}),[n]:Object.assign(Object.assign({},(0,a.Wf)(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",["".concat(n,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,["&:focus-visible + ".concat(n,"-inner")]:(0,a.oN)(e)},["".concat(n,"-inner")]:{boxSizing:"border-box",display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:"".concat((0,o.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:"all ".concat(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:"".concat((0,o.bf)(e.lineWidthBold)," solid ").concat(e.colorWhite),borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:"all ".concat(e.motionDurationFast," ").concat(e.motionEaseInBack,", opacity ").concat(e.motionDurationFast)}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{["\n ".concat(t,":not(").concat(t,"-disabled),\n ").concat(n,":not(").concat(n,"-disabled)\n ")]:{["&:hover ".concat(n,"-inner")]:{borderColor:e.colorPrimary}},["".concat(t,":not(").concat(t,"-disabled)")]:{["&:hover ".concat(n,"-checked:not(").concat(n,"-disabled) ").concat(n,"-inner")]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},["&:hover ".concat(n,"-checked:not(").concat(n,"-disabled):after")]:{borderColor:e.colorPrimaryHover}}},{["".concat(n,"-checked")]:{["".concat(n,"-inner")]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseOutBack," ").concat(e.motionDurationFast)}}},["\n ".concat(t,"-checked:not(").concat(t,"-disabled),\n ").concat(n,"-checked:not(").concat(n,"-disabled)\n ")]:{["&:hover ".concat(n,"-inner")]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[n]:{"&-indeterminate":{"&":{["".concat(n,"-inner")]:{backgroundColor:"".concat(e.colorBgContainer),borderColor:"".concat(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 ".concat(n,"-inner")]:{backgroundColor:"".concat(e.colorBgContainer),borderColor:"".concat(e.colorPrimary)}}}}},{["".concat(t,"-disabled")]:{cursor:"not-allowed"},["".concat(n,"-disabled")]:{["&, ".concat(n,"-input")]:{cursor:"not-allowed",pointerEvents:"none"},["".concat(n,"-inner")]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},["&".concat(n,"-indeterminate ").concat(n,"-inner::after")]:{background:e.colorTextDisabled}}}]};function i(e,n){return l((0,r.IX)(n,{checkboxCls:".".concat(e),checkboxSize:n.controlInteractiveSize}))}n.ZP=(0,c.I$)("Checkbox",(e,n)=>{let{prefixCls:t}=n;return[i(t,e)]})},66531:function(e,n,t){t.d(n,{Z:function(){return r}});var o=t(2265),a=t(53346);function r(e){let n=o.useRef(null),t=()=>{a.Z.cancel(n.current),n.current=null};return[()=>{t(),n.current=(0,a.Z)(()=>{n.current=null})},o=>{n.current&&(o.stopPropagation(),t()),null==e||e(o)}]}},20873:function(e,n,t){var o=t(1119),a=t(31686),r=t(11993),c=t(26365),l=t(6989),i=t(36760),s=t.n(i),u=t(50506),d=t(2265),b=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],p=(0,d.forwardRef)(function(e,n){var t=e.prefixCls,i=void 0===t?"rc-checkbox":t,p=e.className,f=e.style,v=e.checked,m=e.disabled,h=e.defaultChecked,g=e.type,C=void 0===g?"checkbox":g,y=e.title,k=e.onChange,x=(0,l.Z)(e,b),O=(0,d.useRef)(null),E=(0,d.useRef)(null),S=(0,u.Z)(void 0!==h&&h,{value:v}),w=(0,c.Z)(S,2),Z=w[0],P=w[1];(0,d.useImperativeHandle)(n,function(){return{focus:function(e){var n;null===(n=O.current)||void 0===n||n.focus(e)},blur:function(){var e;null===(e=O.current)||void 0===e||e.blur()},input:O.current,nativeElement:E.current}});var N=s()(i,p,(0,r.Z)((0,r.Z)({},"".concat(i,"-checked"),Z),"".concat(i,"-disabled"),m));return d.createElement("span",{className:N,title:y,style:f,ref:E},d.createElement("input",(0,o.Z)({},x,{className:"".concat(i,"-input"),ref:O,onChange:function(n){m||("checked"in e||P(n.target.checked),null==k||k({target:(0,a.Z)((0,a.Z)({},e),{},{type:C,checked:n.target.checked}),stopPropagation:function(){n.stopPropagation()},preventDefault:function(){n.preventDefault()},nativeEvent:n.nativeEvent}))},disabled:m,checked:!!Z,type:C})),d.createElement("span",{className:"".concat(i,"-inner")}))});n.Z=p}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2004-e6c5ce8d6dc32432.js b/litellm/proxy/_experimental/out/_next/static/chunks/2004-6cc040dd055a6d40.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/2004-e6c5ce8d6dc32432.js rename to litellm/proxy/_experimental/out/_next/static/chunks/2004-6cc040dd055a6d40.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2012-4854cbc146d8a7eb.js b/litellm/proxy/_experimental/out/_next/static/chunks/2012-4854cbc146d8a7eb.js deleted file mode 100644 index 65f6b48bc30..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2012-4854cbc146d8a7eb.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2012],{26210:function(e,l,s){s.d(l,{UQ:function(){return t.Z},X1:function(){return i.Z},_m:function(){return a.Z},oi:function(){return n.Z},xv:function(){return r.Z}});var t=s(87452),i=s(88829),a=s(72208),r=s(84264),n=s(49566)},30078:function(e,l,s){s.d(l,{Ct:function(){return t.Z},Dx:function(){return x.Z},OK:function(){return n.Z},Zb:function(){return a.Z},nP:function(){return c.Z},oi:function(){return h.Z},rj:function(){return r.Z},td:function(){return o.Z},v0:function(){return m.Z},x4:function(){return d.Z},xv:function(){return u.Z},zx:function(){return i.Z}});var t=s(41649),i=s(78489),a=s(12514),r=s(67101),n=s(12485),m=s(18135),o=s(35242),d=s(29706),c=s(77991),u=s(84264),h=s(49566),x=s(96761)},62490:function(e,l,s){s.d(l,{Ct:function(){return t.Z},RM:function(){return n.Z},SC:function(){return c.Z},Zb:function(){return a.Z},iA:function(){return r.Z},pj:function(){return m.Z},ss:function(){return o.Z},xs:function(){return d.Z},xv:function(){return u.Z},zx:function(){return i.Z}});var t=s(41649),i=s(78489),a=s(12514),r=s(21626),n=s(97214),m=s(28241),o=s(58834),d=s(69552),c=s(71876),u=s(84264)},11318:function(e,l,s){s.d(l,{Z:function(){return n}});var t=s(2265),i=s(80443),a=s(19250);let r=async(e,l,s,t)=>"Admin"!=s&&"Admin Viewer"!=s?await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null,l):await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null);var n=()=>{let[e,l]=(0,t.useState)([]),{accessToken:s,userId:a,userRole:n}=(0,i.Z)();return(0,t.useEffect)(()=>{(async()=>{l(await r(s,a,n,null))})()},[s,a,n]),{teams:e,setTeams:l}}},21609:function(e,l,s){s.d(l,{Z:function(){return d}});var t=s(57437),i=s(57840),a=s(22116),r=s(51653),n=s(76188),m=s(4260),o=s(2265);function d(e){let{isOpen:l,title:s,alertMessage:d,message:c,resourceInformationTitle:u,resourceInformation:h,onCancel:x,onOk:p,confirmLoading:g,requiredConfirmation:b}=e,{Title:_,Text:v}=i.default,[j,f]=(0,o.useState)("");return(0,o.useEffect)(()=>{l&&f("")},[l]),(0,t.jsx)(a.Z,{title:s,open:l,onOk:p,onCancel:x,confirmLoading:g,okText:g?"Deleting...":"Delete",cancelText:"Cancel",okButtonProps:{danger:!0,disabled:!!b&&j!==b||g},cancelButtonProps:{disabled:g},children:(0,t.jsxs)("div",{className:"space-y-4",children:[d&&(0,t.jsx)(r.Z,{message:d,type:"warning"}),(0,t.jsxs)("div",{className:"mt-4 p-4 bg-red-50 rounded-lg border border-red-200",children:[(0,t.jsx)(_,{level:5,className:"mb-3 text-gray-900",children:u}),(0,t.jsx)(n.Z,{column:1,size:"small",children:h&&h.map(e=>{let{label:l,value:s,...i}=e;return(0,t.jsx)(n.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:l}),children:(0,t.jsx)(v,{...i,children:null!=s?s:"-"})},l)})})]}),(0,t.jsx)("div",{children:(0,t.jsx)(v,{children:c})}),b&&(0,t.jsxs)("div",{className:"mb-6 mt-4 pt-4 border-t border-gray-200",children:[(0,t.jsxs)(v,{className:"block text-base font-medium text-gray-700 mb-2",children:[(0,t.jsx)(v,{children:"Type "}),(0,t.jsx)(v,{strong:!0,type:"danger",children:b}),(0,t.jsx)(v,{children:" to confirm deletion:"})]}),(0,t.jsx)(m.default,{value:j,onChange:e=>f(e.target.value),placeholder:b,className:"rounded-md text-base border-gray-200",autoFocus:!0})]})]})})}},33860:function(e,l,s){var t=s(57437),i=s(2265),a=s(10032),r=s(22116),n=s(37592),m=s(99981),o=s(5545),d=s(7310),c=s.n(d),u=s(19250);l.Z=e=>{let{isVisible:l,onCancel:s,onSubmit:d,accessToken:h,title:x="Add Team Member",roles:p=[{label:"admin",value:"admin",description:"Admin role. Can create team keys, add members, and manage settings."},{label:"user",value:"user",description:"User role. Can view team info, but not manage it."}],defaultRole:g="user"}=e,[b]=a.Z.useForm(),[_,v]=(0,i.useState)([]),[j,f]=(0,i.useState)(!1),[Z,y]=(0,i.useState)("user_email"),N=async(e,l)=>{if(!e){v([]);return}f(!0);try{let s=new URLSearchParams;if(s.append(l,e),null==h)return;let t=(await (0,u.userFilterUICall)(h,s)).map(e=>({label:"user_email"===l?"".concat(e.user_email):"".concat(e.user_id),value:"user_email"===l?e.user_email:e.user_id,user:e}));v(t)}catch(e){console.error("Error fetching users:",e)}finally{f(!1)}},w=(0,i.useCallback)(c()((e,l)=>N(e,l),300),[]),k=(e,l)=>{y(l),w(e,l)},M=(e,l)=>{let s=l.user;b.setFieldsValue({user_email:s.user_email,user_id:s.user_id,role:b.getFieldValue("role")})};return(0,t.jsx)(r.Z,{title:x,open:l,onCancel:()=>{b.resetFields(),v([]),s()},footer:null,width:800,children:(0,t.jsxs)(a.Z,{form:b,onFinish:d,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{role:g},children:[(0,t.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,t.jsx)(n.default,{showSearch:!0,className:"w-full",placeholder:"Search by email",filterOption:!1,onSearch:e=>k(e,"user_email"),onSelect:(e,l)=>M(e,l),options:"user_email"===Z?_:[],loading:j,allowClear:!0})}),(0,t.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,t.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,t.jsx)(n.default,{showSearch:!0,className:"w-full",placeholder:"Search by user ID",filterOption:!1,onSearch:e=>k(e,"user_id"),onSelect:(e,l)=>M(e,l),options:"user_id"===Z?_:[],loading:j,allowClear:!0})}),(0,t.jsx)(a.Z.Item,{label:"Member Role",name:"role",className:"mb-4",children:(0,t.jsx)(n.default,{defaultValue:g,children:p.map(e=>(0,t.jsx)(n.default.Option,{value:e.value,children:(0,t.jsxs)(m.Z,{title:e.description,children:[(0,t.jsx)("span",{className:"font-medium",children:e.label}),(0,t.jsxs)("span",{className:"ml-2 text-gray-500 text-sm",children:["- ",e.description]})]})},e.value))})}),(0,t.jsx)("div",{className:"text-right mt-4",children:(0,t.jsx)(o.ZP,{type:"default",htmlType:"submit",children:"Add Member"})})]})})}},36894:function(e,l,s){var t=s(57437),i=s(56522),a=s(10032),r=s(37592),n=s(22116),m=s(5545),o=s(2265),d=s(24199);l.Z=e=>{var l,s,c;let{visible:u,onCancel:h,onSubmit:x,initialData:p,mode:g,config:b}=e,[_]=a.Z.useForm();console.log("Initial Data:",p),(0,o.useEffect)(()=>{if(u){if("edit"===g&&p){let e={...p,role:p.role||b.defaultRole,max_budget_in_team:p.max_budget_in_team||null,tpm_limit:p.tpm_limit||null,rpm_limit:p.rpm_limit||null};console.log("Setting form values:",e),_.setFieldsValue(e)}else{var e;_.resetFields(),_.setFieldsValue({role:b.defaultRole||(null===(e=b.roleOptions[0])||void 0===e?void 0:e.value)})}}},[u,p,g,_,b.defaultRole,b.roleOptions]);let v=async e=>{try{let l=Object.entries(e).reduce((e,l)=>{let[s,t]=l;if("string"==typeof t){let l=t.trim();return""===l&&("max_budget_in_team"===s||"tpm_limit"===s||"rpm_limit"===s)?{...e,[s]:null}:{...e,[s]:l}}return{...e,[s]:t}},{});console.log("Submitting form data:",l),x(l),_.resetFields()}catch(e){console.error("Form submission error:",e)}},j=e=>{switch(e.type){case"input":return(0,t.jsx)(i.o,{placeholder:e.placeholder});case"numerical":return(0,t.jsx)(d.Z,{step:e.step||1,min:e.min||0,style:{width:"100%"},placeholder:e.placeholder||"Enter a numerical value"});case"select":var l;return(0,t.jsx)(r.default,{children:null===(l=e.options)||void 0===l?void 0:l.map(e=>(0,t.jsx)(r.default.Option,{value:e.value,children:e.label},e.value))});default:return null}};return(0,t.jsx)(n.Z,{title:b.title||("add"===g?"Add Member":"Edit Member"),open:u,width:1e3,footer:null,onCancel:h,children:(0,t.jsxs)(a.Z,{form:_,onFinish:v,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[b.showEmail&&(0,t.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",rules:[{type:"email",message:"Please enter a valid email!"}],children:(0,t.jsx)(i.o,{placeholder:"user@example.com"})}),b.showEmail&&b.showUserId&&(0,t.jsx)("div",{className:"text-center mb-4",children:(0,t.jsx)(i.x,{children:"OR"})}),b.showUserId&&(0,t.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,t.jsx)(i.o,{placeholder:"user_123"})}),(0,t.jsx)(a.Z.Item,{label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{children:"Role"}),"edit"===g&&p&&(0,t.jsxs)("span",{className:"text-gray-500 text-sm",children:["(Current: ",(s=p.role,(null===(c=b.roleOptions.find(e=>e.value===s))||void 0===c?void 0:c.label)||s),")"]})]}),name:"role",className:"mb-4",rules:[{required:!0,message:"Please select a role!"}],children:(0,t.jsx)(r.default,{children:"edit"===g&&p?[...b.roleOptions.filter(e=>e.value===p.role),...b.roleOptions.filter(e=>e.value!==p.role)].map(e=>(0,t.jsx)(r.default.Option,{value:e.value,children:e.label},e.value)):b.roleOptions.map(e=>(0,t.jsx)(r.default.Option,{value:e.value,children:e.label},e.value))})}),null===(l=b.additionalFields)||void 0===l?void 0:l.map(e=>(0,t.jsx)(a.Z.Item,{label:e.label,name:e.name,className:"mb-4",rules:e.rules,children:j(e)},e.name)),(0,t.jsxs)("div",{className:"text-right mt-6",children:[(0,t.jsx)(m.ZP,{onClick:h,className:"mr-2",children:"Cancel"}),(0,t.jsx)(m.ZP,{type:"default",htmlType:"submit",children:"add"===g?"Add Member":"Save Changes"})]})]})})}},33293:function(e,l,s){s.d(l,{Z:function(){return et}});var t=s(57437),i=s(33860),a=s(19250),r=s(59872),n=s(33304),m=s(15424),o=s(10900),d=s(30078),c=s(10032),u=s(42264),h=s(5545),x=s(4260),p=s(37592),g=s(99981),b=s(63709),_=s(30401),v=s(78867),j=s(2265),f=s(82586),Z=s(21609),y=s(95096),N=s(46468),w=s(27799),k=s(95920),M=s(68473),C=s(9114),S=s(60131),T=s(24199),I=s(97415),P=s(21425),L=s(36894),O=s(78489),F=s(12514),E=s(21626),D=s(97214),A=s(28241),R=s(58834),z=s(69552),U=s(71876),V=s(84264),B=s(96761),G=s(61994),q=s(85180),K=s(89245),$=s(78355);let J={"/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"},Q=e=>e.includes("/info")||e.includes("/list")?"GET":"POST",W=e=>{let l=Q(e),s=J[e];if(!s){for(let[l,t]of Object.entries(J))if(e.includes(l)){s=t;break}}return s||(s="Access ".concat(e)),{method:l,endpoint:e,description:s,route:e}};var X=e=>{let{teamId:l,accessToken:s,canEditTeam:i}=e,[r,n]=(0,j.useState)([]),[m,o]=(0,j.useState)([]),[d,c]=(0,j.useState)(!0),[u,x]=(0,j.useState)(!1),[p,g]=(0,j.useState)(!1),b=async()=>{try{if(c(!0),!s)return;let e=await (0,a.getTeamPermissionsCall)(s,l),t=e.all_available_permissions||[];n(t);let i=e.team_member_permissions||[];o(i),g(!1)}catch(e){C.Z.fromBackend("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{c(!1)}};(0,j.useEffect)(()=>{b()},[l,s]);let _=(e,l)=>{o(l?[...m,e]:m.filter(l=>l!==e)),g(!0)},v=async()=>{try{if(!s)return;x(!0),await (0,a.teamPermissionsUpdateCall)(s,l,m),C.Z.success("Permissions updated successfully"),g(!1)}catch(e){C.Z.fromBackend("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{x(!1)}};if(d)return(0,t.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let f=r.length>0;return(0,t.jsxs)(F.Z,{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)(B.Z,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),i&&p&&(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(h.ZP,{icon:(0,t.jsx)(K.Z,{}),onClick:()=>{b()},children:"Reset"}),(0,t.jsxs)(O.Z,{onClick:v,loading:u,className:"flex items-center gap-2",children:[(0,t.jsx)($.Z,{})," Save Changes"]})]})]}),(0,t.jsx)(V.Z,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),f?(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(E.Z,{className:" min-w-full",children:[(0,t.jsx)(R.Z,{children:(0,t.jsxs)(U.Z,{children:[(0,t.jsx)(z.Z,{children:"Method"}),(0,t.jsx)(z.Z,{children:"Endpoint"}),(0,t.jsx)(z.Z,{children:"Description"}),(0,t.jsx)(z.Z,{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)(D.Z,{children:r.map(e=>{let l=W(e);return(0,t.jsxs)(U.Z,{className:"hover:bg-gray-50 transition-colors",children:[(0,t.jsx)(A.Z,{children:(0,t.jsx)("span",{className:"px-2 py-1 rounded text-xs font-medium ".concat("GET"===l.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"),children:l.method})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)("span",{className:"font-mono text-sm text-gray-800",children:l.endpoint})}),(0,t.jsx)(A.Z,{className:"text-gray-700",children:l.description}),(0,t.jsx)(A.Z,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:(0,t.jsx)(G.Z,{checked:m.includes(e),onChange:l=>_(e,l.target.checked),disabled:!i})})]},e)})})]})}):(0,t.jsx)("div",{className:"py-12",children:(0,t.jsx)(q.Z,{description:"No permissions available"})})]})},Y=s(47323),H=s(53410),ee=s(74998),el=e=>{let{teamData:l,canEditTeam:s,handleMemberDelete:i,setSelectedEditMember:a,setIsEditMemberModalVisible:n,setIsAddMemberModalVisible:o}=e,d=e=>{if(null==e)return"0";if("number"==typeof e){let l=Number(e);return l===Math.floor(l)?l.toString():(0,r.pw)(l,8).replace(/\.?0+$/,"")}return"0"},c=e=>{if(!e)return 0;let s=l.team_memberships.find(l=>l.user_id===e);return(null==s?void 0:s.spend)||0},u=e=>{var s;if(!e)return null;let t=l.team_memberships.find(l=>l.user_id===e);console.log("membership=".concat(t));let i=null==t?void 0:null===(s=t.litellm_budget_table)||void 0===s?void 0:s.max_budget;return null==i?null:d(i)},h=e=>{var s,t;if(!e)return"No Limits";let i=l.team_memberships.find(l=>l.user_id===e),a=null==i?void 0:null===(s=i.litellm_budget_table)||void 0===s?void 0:s.rpm_limit,r=null==i?void 0:null===(t=i.litellm_budget_table)||void 0===t?void 0:t.tpm_limit,n=[a?"".concat(d(a)," RPM"):null,r?"".concat(d(r)," TPM"):null].filter(Boolean);return n.length>0?n.join(" / "):"No Limits"};return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(F.Z,{className:"w-full mx-auto flex-auto overflow-auto max-h-[50vh]",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(E.Z,{className:"min-w-full",children:[(0,t.jsx)(R.Z,{children:(0,t.jsxs)(U.Z,{children:[(0,t.jsx)(z.Z,{children:"User ID"}),(0,t.jsx)(z.Z,{children:"User Email"}),(0,t.jsx)(z.Z,{children:"Role"}),(0,t.jsxs)(z.Z,{children:["Team Member Spend (USD)"," ",(0,t.jsx)(g.Z,{title:"This is the amount spent by a user in the team.",children:(0,t.jsx)(m.Z,{})})]}),(0,t.jsx)(z.Z,{children:"Team Member Budget (USD)"}),(0,t.jsxs)(z.Z,{children:["Team Member Rate Limits"," ",(0,t.jsx)(g.Z,{title:"Rate limits for this member's usage within this team.",children:(0,t.jsx)(m.Z,{})})]}),(0,t.jsx)(z.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:"Actions"})]})}),(0,t.jsx)(D.Z,{children:l.team_info.members_with_roles.map((e,m)=>(0,t.jsxs)(U.Z,{children:[(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:e.user_id})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:e.user_email?e.user_email:"No Email"})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:e.role})}),(0,t.jsx)(A.Z,{children:(0,t.jsxs)(V.Z,{className:"font-mono",children:["$",(0,r.pw)(c(e.user_id),4)]})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:u(e.user_id)?"$".concat((0,r.pw)(Number(u(e.user_id)),4)):"No Limit"})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:h(e.user_id)})}),(0,t.jsx)(A.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:s&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(Y.Z,{icon:H.Z,size:"sm",onClick:()=>{var s,t,i;let r=l.team_memberships.find(l=>l.user_id===e.user_id);a({...e,max_budget_in_team:(null==r?void 0:null===(s=r.litellm_budget_table)||void 0===s?void 0:s.max_budget)||null,tpm_limit:(null==r?void 0:null===(t=r.litellm_budget_table)||void 0===t?void 0:t.tpm_limit)||null,rpm_limit:(null==r?void 0:null===(i=r.litellm_budget_table)||void 0===i?void 0:i.rpm_limit)||null}),n(!0)},className:"cursor-pointer hover:text-blue-600"}),(0,t.jsx)(Y.Z,{icon:ee.Z,size:"sm",onClick:()=>i(e),className:"cursor-pointer hover:text-red-600"})]})})]},m))})]})})}),(0,t.jsx)(O.Z,{onClick:()=>o(!0),children:"Add Member"})]})};let es=(e,l)=>{let s=[];return s=e?e.models.includes("all-proxy-models")?l:e.models.length>0?e.models:l:l,(0,N.Ob)(s,l)};var et=e=>{var l,s,O,F,E,D,A,R,z,U,V,B,G,q,K,$,J,Q,W,Y,H;let ee;let{teamId:et,onClose:ei,accessToken:ea,is_team_admin:er,is_proxy_admin:en,userModels:em,editTeam:eo,premiumUser:ed=!1,onUpdate:ec}=e,[eu,eh]=(0,j.useState)(null),[ex,ep]=(0,j.useState)(!0),[eg,eb]=(0,j.useState)(!1),[e_]=c.Z.useForm(),[ev,ej]=(0,j.useState)(!1),[ef,eZ]=(0,j.useState)(null),[ey,eN]=(0,j.useState)(!1),[ew,ek]=(0,j.useState)([]),[eM,eC]=(0,j.useState)(!1),[eS,eT]=(0,j.useState)({}),[eI,eP]=(0,j.useState)([]),[eL,eO]=(0,j.useState)(null),[eF,eE]=(0,j.useState)(!1),[eD,eA]=(0,j.useState)(!1),[eR,ez]=(0,j.useState)(!1),[eU,eV]=(0,j.useState)(null);console.log("userModels in team info",em);let eB=er||en,eG=async()=>{try{if(ep(!0),!ea)return;let e=await (0,a.teamInfoCall)(ea,et);eh(e)}catch(e){C.Z.fromBackend("Failed to load team information"),console.error("Error fetching team info:",e)}finally{ep(!1)}};(0,j.useEffect)(()=>{eG()},[et,ea]),(0,j.useEffect)(()=>{(async()=>{var e;if(!ea||!(null==eu?void 0:null===(e=eu.team_info)||void 0===e?void 0:e.organization_id)){eV(null);return}try{let e=await (0,a.organizationInfoCall)(ea,eu.team_info.organization_id);eV(e)}catch(e){console.error("Error fetching organization info:",e),eV(null)}})()},[ea,null==eu?void 0:null===(l=eu.team_info)||void 0===l?void 0:l.organization_id]);let eq=(0,j.useMemo)(()=>es(eU,em),[eU,em]);(0,j.useEffect)(()=>{(async()=>{try{if(!ea)return;let e=(await (0,a.getGuardrailsList)(ea)).guardrails.map(e=>e.guardrail_name);eP(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[ea]);let eK=async e=>{try{if(null==ea)return;let l={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,a.teamMemberAddCall)(ea,et,l),C.Z.success("Team member added successfully"),eb(!1),e_.resetFields();let s=await (0,a.teamInfoCall)(ea,et);eh(s),ec(s)}catch(i){var l,s,t;let e="Failed to add team member";(null==i?void 0:null===(t=i.raw)||void 0===t?void 0:null===(s=t.detail)||void 0===s?void 0:null===(l=s.error)||void 0===l?void 0:l.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==i?void 0:i.message)&&(e=i.message),C.Z.fromBackend(e),console.error("Error adding team member:",i)}},e$=async e=>{try{if(null==ea)return;let l={user_email:e.user_email,user_id:e.user_id,role:e.role,max_budget_in_team:e.max_budget_in_team,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit};console.log("Updating member with values:",l),u.ZP.destroy(),await (0,a.teamMemberUpdateCall)(ea,et,l),C.Z.success("Team member updated successfully"),ej(!1);let s=await (0,a.teamInfoCall)(ea,et);eh(s),ec(s)}catch(t){var l,s;let e="Failed to update team member";(null==t?void 0:null===(s=t.raw)||void 0===s?void 0:null===(l=s.detail)||void 0===l?void 0:l.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==t?void 0:t.message)&&(e=t.message),ej(!1),u.ZP.destroy(),C.Z.fromBackend(e),console.error("Error updating team member:",t)}},eJ=async()=>{if(eL&&ea){eA(!0);try{await (0,a.teamMemberDeleteCall)(ea,et,eL),C.Z.success("Team member removed successfully");let e=await (0,a.teamInfoCall)(ea,et);eh(e),ec(e)}catch(e){C.Z.fromBackend("Failed to remove team member"),console.error("Error removing team member:",e)}finally{eA(!1),eE(!1),eO(null)}}},eQ=async e=>{try{if(!ea)return;ez(!0);let l={};try{l=e.metadata?JSON.parse(e.metadata):{}}catch(e){C.Z.fromBackend("Invalid JSON in metadata field");return}let s=e=>null==e||"string"==typeof e&&""===e.trim()||"number"==typeof e&&Number.isNaN(e)?null:e,t={team_id:et,team_alias:e.team_alias,models:e.models,tpm_limit:s(e.tpm_limit),rpm_limit:s(e.rpm_limit),max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:{...l,guardrails:e.guardrails||[],logging:e.logging_settings||[]},organization_id:e.organization_id};t.max_budget=(0,n.C)(t.max_budget),void 0!==e.team_member_budget&&(t.team_member_budget=Number(e.team_member_budget)),void 0!==e.team_member_key_duration&&(t.team_member_key_duration=e.team_member_key_duration),(void 0!==e.team_member_tpm_limit||void 0!==e.team_member_rpm_limit)&&(t.team_member_tpm_limit=s(e.team_member_tpm_limit),t.team_member_rpm_limit=s(e.team_member_rpm_limit));let{servers:i,accessGroups:r}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]},m=new Set(i||[]),o=Object.fromEntries(Object.entries(e.mcp_tool_permissions||{}).filter(e=>{let[l]=e;return m.has(l)}));t.object_permission={},i&&(t.object_permission.mcp_servers=i),r&&(t.object_permission.mcp_access_groups=r),o&&(t.object_permission.mcp_tool_permissions=o),delete e.mcp_servers_and_groups,delete e.mcp_tool_permissions;let{agents:d,accessGroups:c}=e.agents_and_groups||{agents:[],accessGroups:[]};d&&d.length>0&&(t.object_permission.agents=d),c&&c.length>0&&(t.object_permission.agent_access_groups=c),delete e.agents_and_groups,await (0,a.teamUpdateCall)(ea,t),C.Z.success("Team settings updated successfully"),eN(!1),eG()}catch(e){console.error("Error updating team:",e)}finally{ez(!1)}};if(ex)return(0,t.jsx)("div",{className:"p-4",children:"Loading..."});if(!(null==eu?void 0:eu.team_info))return(0,t.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:eW}=eu,eX=async(e,l)=>{await (0,r.vQ)(e)&&(eT(e=>({...e,[l]:!0})),setTimeout(()=>{eT(e=>({...e,[l]:!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)(d.zx,{icon:o.Z,variant:"light",onClick:ei,className:"mb-4",children:"Back to Teams"}),(0,t.jsx)(d.Dx,{children:eW.team_alias}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(d.xv,{className:"text-gray-500 font-mono",children:eW.team_id}),(0,t.jsx)(h.ZP,{type:"text",size:"small",icon:eS["team-id"]?(0,t.jsx)(_.Z,{size:12}):(0,t.jsx)(v.Z,{size:12}),onClick:()=>eX(eW.team_id,"team-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eS["team-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,t.jsxs)(d.v0,{defaultIndex:eo?3:0,children:[(0,t.jsx)(d.td,{className:"mb-4",children:[(0,t.jsx)(d.OK,{children:"Overview"},"overview"),...eB?[(0,t.jsx)(d.OK,{children:"Members"},"members"),(0,t.jsx)(d.OK,{children:"Member Permissions"},"member-permissions"),(0,t.jsx)(d.OK,{children:"Settings"},"settings")]:[]]}),(0,t.jsxs)(d.nP,{children:[(0,t.jsx)(d.x4,{children:(0,t.jsxs)(d.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(d.Zb,{children:[(0,t.jsx)(d.xv,{children:"Budget Status"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(d.Dx,{children:["$",(0,r.pw)(eW.spend,4)]}),(0,t.jsxs)(d.xv,{children:["of ",null===eW.max_budget?"Unlimited":"$".concat((0,r.pw)(eW.max_budget,4))]}),eW.budget_duration&&(0,t.jsxs)(d.xv,{className:"text-gray-500",children:["Reset: ",eW.budget_duration]}),(0,t.jsx)("br",{}),eW.team_member_budget_table&&(0,t.jsxs)(d.xv,{className:"text-gray-500",children:["Team Member Budget: $",(0,r.pw)(eW.team_member_budget_table.max_budget,4)]})]})]}),(0,t.jsxs)(d.Zb,{children:[(0,t.jsx)(d.xv,{children:"Rate Limits"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(d.xv,{children:["TPM: ",eW.tpm_limit||"Unlimited"]}),(0,t.jsxs)(d.xv,{children:["RPM: ",eW.rpm_limit||"Unlimited"]}),eW.max_parallel_requests&&(0,t.jsxs)(d.xv,{children:["Max Parallel Requests: ",eW.max_parallel_requests]})]})]}),(0,t.jsxs)(d.Zb,{children:[(0,t.jsx)(d.xv,{children:"Models"}),(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===eW.models.length?(0,t.jsx)(d.Ct,{color:"red",children:"All proxy models"}):eW.models.map((e,l)=>(0,t.jsx)(d.Ct,{color:"red",children:e},l))})]}),(0,t.jsxs)(d.Zb,{children:[(0,t.jsx)(d.xv,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(d.xv,{children:["User Keys: ",eu.keys.filter(e=>e.user_id).length]}),(0,t.jsxs)(d.xv,{children:["Service Account Keys: ",eu.keys.filter(e=>!e.user_id).length]}),(0,t.jsxs)(d.xv,{className:"text-gray-500",children:["Total: ",eu.keys.length]})]})]}),(0,t.jsx)(S.Z,{objectPermission:eW.object_permission,variant:"card",accessToken:ea}),(0,t.jsx)(w.Z,{loggingConfigs:(null===(s=eW.metadata)||void 0===s?void 0:s.logging)||[],disabledCallbacks:[],variant:"card"})]})}),(0,t.jsx)(d.x4,{children:(0,t.jsx)(el,{teamData:eu,canEditTeam:eB,handleMemberDelete:e=>{eO(e),eE(!0)},setSelectedEditMember:eZ,setIsEditMemberModalVisible:ej,setIsAddMemberModalVisible:eb})}),eB&&(0,t.jsx)(d.x4,{children:(0,t.jsx)(X,{teamId:et,accessToken:ea,canEditTeam:eB})}),(0,t.jsx)(d.x4,{children:(0,t.jsxs)(d.Zb,{className:"overflow-y-auto max-h-[65vh]",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(d.Dx,{children:"Team Settings"}),eB&&!ey&&(0,t.jsx)(d.zx,{onClick:()=>eN(!0),children:"Edit Settings"})]}),ey?(0,t.jsxs)(c.Z,{form:e_,onFinish:eQ,initialValues:{...eW,team_alias:eW.team_alias,models:eW.models,tpm_limit:eW.tpm_limit,rpm_limit:eW.rpm_limit,max_budget:eW.max_budget,budget_duration:eW.budget_duration,team_member_tpm_limit:null===(O=eW.team_member_budget_table)||void 0===O?void 0:O.tpm_limit,team_member_rpm_limit:null===(F=eW.team_member_budget_table)||void 0===F?void 0:F.rpm_limit,guardrails:(null===(E=eW.metadata)||void 0===E?void 0:E.guardrails)||[],disable_global_guardrails:(null===(D=eW.metadata)||void 0===D?void 0:D.disable_global_guardrails)||!1,metadata:eW.metadata?JSON.stringify((e=>{let{logging:l,...s}=e;return s})(eW.metadata),null,2):"",logging_settings:(null===(A=eW.metadata)||void 0===A?void 0:A.logging)||[],organization_id:eW.organization_id,vector_stores:(null===(R=eW.object_permission)||void 0===R?void 0:R.vector_stores)||[],mcp_servers:(null===(z=eW.object_permission)||void 0===z?void 0:z.mcp_servers)||[],mcp_access_groups:(null===(U=eW.object_permission)||void 0===U?void 0:U.mcp_access_groups)||[],mcp_servers_and_groups:{servers:(null===(V=eW.object_permission)||void 0===V?void 0:V.mcp_servers)||[],accessGroups:(null===(B=eW.object_permission)||void 0===B?void 0:B.mcp_access_groups)||[]},mcp_tool_permissions:(null===(G=eW.object_permission)||void 0===G?void 0:G.mcp_tool_permissions)||{},agents_and_groups:{agents:(null===(q=eW.object_permission)||void 0===q?void 0:q.agents)||[],accessGroups:(null===(K=eW.object_permission)||void 0===K?void 0:K.agent_access_groups)||[]}},layout:"vertical",children:[(0,t.jsx)(c.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,t.jsx)(x.default,{type:""})}),(0,t.jsx)(c.Z.Item,{label:"Models",name:"models",rules:[{required:!0,message:"Please select at least one model"}],children:(0,t.jsxs)(p.default,{mode:"multiple",placeholder:"Select models",children:[(ee=!1,eU?(0===eU.models.length||eU.models.includes("all-proxy-models"))&&(ee=!0):ee=en||em.includes("all-proxy-models"),ee?(0,t.jsx)(p.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"):null),!eU||eU.models.includes("no-default-models")?(0,t.jsx)(p.default.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"):null,Array.from(new Set(eq)).map((e,l)=>(0,t.jsx)(p.default.Option,{value:e,children:(0,N.W0)(e)},l))]})}),(0,t.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(T.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",tooltip:"This is the individual budget for a user in the team.",children:(0,t.jsx)(T.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{label:"Team Member 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)(d.oi,{placeholder:"e.g., 30d"})}),(0,t.jsx)(c.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"Default tokens per minute limit for an individual team member. This limit applies to all requests the user makes within this team. Can be overridden per member.",children:(0,t.jsx)(T.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 1000"})}),(0,t.jsx)(c.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"Default requests per minute limit for an individual team member. This limit applies to all requests the user makes within this team. Can be overridden per member.",children:(0,t.jsx)(T.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 100"})}),(0,t.jsx)(c.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsxs)(p.default,{placeholder:"n/a",children:[(0,t.jsx)(p.default.Option,{value:"24h",children:"daily"}),(0,t.jsx)(p.default.Option,{value:"7d",children:"weekly"}),(0,t.jsx)(p.default.Option,{value:"30d",children:"monthly"})]})}),(0,t.jsx)(c.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,t.jsx)(T.Z,{step:1,style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,t.jsx)(T.Z,{step:1,style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{label:(0,t.jsxs)("span",{children:["Guardrails"," ",(0,t.jsx)(g.Z,{title:"Setup your first guardrail",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)(m.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,t.jsx)(p.default,{mode:"tags",placeholder:"Select or enter guardrails",options:eI.map(e=>({value:e,label:e}))})}),(0,t.jsx)(c.Z.Item,{label:(0,t.jsxs)("span",{children:["Disable Global Guardrails"," ",(0,t.jsx)(g.Z,{title:"When enabled, this team will bypass any guardrails configured to run on every request (global guardrails)",children:(0,t.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),name:"disable_global_guardrails",valuePropName:"checked",help:"Bypass global guardrails for this team",children:(0,t.jsx)(b.Z,{checkedChildren:"Yes",unCheckedChildren:"No"})}),(0,t.jsx)(c.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,t.jsx)(I.Z,{onChange:e=>e_.setFieldValue("vector_stores",e),value:e_.getFieldValue("vector_stores"),accessToken:ea||"",placeholder:"Select vector stores"})}),(0,t.jsx)(c.Z.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,t.jsx)(y.Z,{onChange:e=>e_.setFieldValue("allowed_passthrough_routes",e),value:e_.getFieldValue("allowed_passthrough_routes"),accessToken:ea||"",placeholder:"Select pass through routes"})}),(0,t.jsx)(c.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,t.jsx)(k.Z,{onChange:e=>e_.setFieldValue("mcp_servers_and_groups",e),value:e_.getFieldValue("mcp_servers_and_groups"),accessToken:ea||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,t.jsx)(c.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,t.jsx)(x.default,{type:"hidden"})}),(0,t.jsx)(c.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.mcp_servers_and_groups!==l.mcp_servers_and_groups||e.mcp_tool_permissions!==l.mcp_tool_permissions,children:()=>{var e;return(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)(M.Z,{accessToken:ea||"",selectedServers:(null===(e=e_.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:e_.getFieldValue("mcp_tool_permissions")||{},onChange:e=>e_.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,t.jsx)(c.Z.Item,{label:"Agents / Access Groups",name:"agents_and_groups",children:(0,t.jsx)(f.Z,{onChange:e=>e_.setFieldValue("agents_and_groups",e),value:e_.getFieldValue("agents_and_groups"),accessToken:ea||"",placeholder:"Select agents or access groups (optional)"})}),(0,t.jsx)(c.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,t.jsx)(x.default,{type:"",disabled:!0})}),(0,t.jsx)(c.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,t.jsx)(P.Z,{value:e_.getFieldValue("logging_settings"),onChange:e=>e_.setFieldValue("logging_settings",e)})}),(0,t.jsx)(c.Z.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(x.default.TextArea,{rows:10})}),(0,t.jsx)("div",{className:"sticky z-10 bg-white p-4 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)(d.zx,{variant:"secondary",onClick:()=>eN(!1),disabled:eR,children:"Cancel"}),(0,t.jsx)(d.zx,{type:"submit",loading:eR,children:"Save Changes"})]})})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Team Name"}),(0,t.jsx)("div",{children:eW.team_alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Team ID"}),(0,t.jsx)("div",{className:"font-mono",children:eW.team_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Created At"}),(0,t.jsx)("div",{children:new Date(eW.created_at).toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:eW.models.map((e,l)=>(0,t.jsx)(d.Ct,{color:"red",children:e},l))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Rate Limits"}),(0,t.jsxs)("div",{children:["TPM: ",eW.tpm_limit||"Unlimited"]}),(0,t.jsxs)("div",{children:["RPM: ",eW.rpm_limit||"Unlimited"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Team Budget"}),(0,t.jsxs)("div",{children:["Max Budget:"," ",null!==eW.max_budget?"$".concat((0,r.pw)(eW.max_budget,4)):"No Limit"]}),(0,t.jsxs)("div",{children:["Budget Reset: ",eW.budget_duration||"Never"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)(d.xv,{className:"font-medium",children:["Team Member Settings"," ",(0,t.jsx)(g.Z,{title:"These are limits on individual team members",children:(0,t.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),(0,t.jsxs)("div",{children:["Max Budget: ",(null===($=eW.team_member_budget_table)||void 0===$?void 0:$.max_budget)||"No Limit"]}),(0,t.jsxs)("div",{children:["Key Duration: ",(null===(J=eW.metadata)||void 0===J?void 0:J.team_member_key_duration)||"No Limit"]}),(0,t.jsxs)("div",{children:["TPM Limit: ",(null===(Q=eW.team_member_budget_table)||void 0===Q?void 0:Q.tpm_limit)||"No Limit"]}),(0,t.jsxs)("div",{children:["RPM Limit: ",(null===(W=eW.team_member_budget_table)||void 0===W?void 0:W.rpm_limit)||"No Limit"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Organization ID"}),(0,t.jsx)("div",{children:eW.organization_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Status"}),(0,t.jsx)(d.Ct,{color:eW.blocked?"red":"green",children:eW.blocked?"Blocked":"Active"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Disable Global Guardrails"}),(0,t.jsx)("div",{children:(null===(Y=eW.metadata)||void 0===Y?void 0:Y.disable_global_guardrails)===!0?(0,t.jsx)(d.Ct,{color:"yellow",children:"Enabled - Global guardrails bypassed"}):(0,t.jsx)(d.Ct,{color:"green",children:"Disabled - Global guardrails active"})})]}),(0,t.jsx)(S.Z,{objectPermission:eW.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:ea}),(0,t.jsx)(w.Z,{loggingConfigs:(null===(H=eW.metadata)||void 0===H?void 0:H.logging)||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]}),(0,t.jsx)(L.Z,{visible:ev,onCancel:()=>ej(!1),onSubmit:e$,initialData:ef,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)(g.Z,{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)(m.Z,{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)(g.Z,{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)(m.Z,{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)(g.Z,{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)(m.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Requests per minute limit for this member in this team"}]}}),(0,t.jsx)(i.Z,{isVisible:eg,onCancel:()=>eb(!1),onSubmit:eK,accessToken:ea}),(0,t.jsx)(Z.Z,{isOpen:eF,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:null==eL?void 0:eL.user_id,code:!0},{label:"Email",value:null==eL?void 0:eL.user_email},{label:"Role",value:null==eL?void 0:eL.role}],onCancel:()=>{eE(!1),eO(null)},onOk:eJ,confirmLoading:eD})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2012-ff2f1705611fe96b.js b/litellm/proxy/_experimental/out/_next/static/chunks/2012-ff2f1705611fe96b.js new file mode 100644 index 00000000000..2c469f317e5 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2012-ff2f1705611fe96b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2012],{26210:function(e,l,s){s.d(l,{UQ:function(){return t.Z},X1:function(){return i.Z},_m:function(){return a.Z},oi:function(){return n.Z},xv:function(){return r.Z}});var t=s(87452),i=s(88829),a=s(72208),r=s(84264),n=s(49566)},30078:function(e,l,s){s.d(l,{Ct:function(){return t.Z},Dx:function(){return x.Z},OK:function(){return n.Z},Zb:function(){return a.Z},nP:function(){return c.Z},oi:function(){return h.Z},rj:function(){return r.Z},td:function(){return o.Z},v0:function(){return m.Z},x4:function(){return d.Z},xv:function(){return u.Z},zx:function(){return i.Z}});var t=s(41649),i=s(78489),a=s(12514),r=s(67101),n=s(12485),m=s(18135),o=s(35242),d=s(29706),c=s(77991),u=s(84264),h=s(49566),x=s(96761)},62490:function(e,l,s){s.d(l,{Ct:function(){return t.Z},RM:function(){return n.Z},SC:function(){return c.Z},Zb:function(){return a.Z},iA:function(){return r.Z},pj:function(){return m.Z},ss:function(){return o.Z},xs:function(){return d.Z},xv:function(){return u.Z},zx:function(){return i.Z}});var t=s(41649),i=s(78489),a=s(12514),r=s(21626),n=s(97214),m=s(28241),o=s(58834),d=s(69552),c=s(71876),u=s(84264)},11318:function(e,l,s){s.d(l,{Z:function(){return n}});var t=s(2265),i=s(39760),a=s(19250);let r=async(e,l,s,t)=>"Admin"!=s&&"Admin Viewer"!=s?await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null,l):await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null);var n=()=>{let[e,l]=(0,t.useState)([]),{accessToken:s,userId:a,userRole:n}=(0,i.Z)();return(0,t.useEffect)(()=>{(async()=>{l(await r(s,a,n,null))})()},[s,a,n]),{teams:e,setTeams:l}}},21609:function(e,l,s){s.d(l,{Z:function(){return d}});var t=s(57437),i=s(57840),a=s(22116),r=s(51653),n=s(76188),m=s(4260),o=s(2265);function d(e){let{isOpen:l,title:s,alertMessage:d,message:c,resourceInformationTitle:u,resourceInformation:h,onCancel:x,onOk:p,confirmLoading:g,requiredConfirmation:b}=e,{Title:_,Text:v}=i.default,[j,f]=(0,o.useState)("");return(0,o.useEffect)(()=>{l&&f("")},[l]),(0,t.jsx)(a.Z,{title:s,open:l,onOk:p,onCancel:x,confirmLoading:g,okText:g?"Deleting...":"Delete",cancelText:"Cancel",okButtonProps:{danger:!0,disabled:!!b&&j!==b||g},cancelButtonProps:{disabled:g},children:(0,t.jsxs)("div",{className:"space-y-4",children:[d&&(0,t.jsx)(r.Z,{message:d,type:"warning"}),(0,t.jsxs)("div",{className:"mt-4 p-4 bg-red-50 rounded-lg border border-red-200",children:[(0,t.jsx)(_,{level:5,className:"mb-3 text-gray-900",children:u}),(0,t.jsx)(n.Z,{column:1,size:"small",children:h&&h.map(e=>{let{label:l,value:s,...i}=e;return(0,t.jsx)(n.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:l}),children:(0,t.jsx)(v,{...i,children:null!=s?s:"-"})},l)})})]}),(0,t.jsx)("div",{children:(0,t.jsx)(v,{children:c})}),b&&(0,t.jsxs)("div",{className:"mb-6 mt-4 pt-4 border-t border-gray-200",children:[(0,t.jsxs)(v,{className:"block text-base font-medium text-gray-700 mb-2",children:[(0,t.jsx)(v,{children:"Type "}),(0,t.jsx)(v,{strong:!0,type:"danger",children:b}),(0,t.jsx)(v,{children:" to confirm deletion:"})]}),(0,t.jsx)(m.default,{value:j,onChange:e=>f(e.target.value),placeholder:b,className:"rounded-md text-base border-gray-200",autoFocus:!0})]})]})})}},33860:function(e,l,s){var t=s(57437),i=s(2265),a=s(10032),r=s(22116),n=s(37592),m=s(99981),o=s(5545),d=s(7310),c=s.n(d),u=s(19250);l.Z=e=>{let{isVisible:l,onCancel:s,onSubmit:d,accessToken:h,title:x="Add Team Member",roles:p=[{label:"admin",value:"admin",description:"Admin role. Can create team keys, add members, and manage settings."},{label:"user",value:"user",description:"User role. Can view team info, but not manage it."}],defaultRole:g="user"}=e,[b]=a.Z.useForm(),[_,v]=(0,i.useState)([]),[j,f]=(0,i.useState)(!1),[Z,y]=(0,i.useState)("user_email"),N=async(e,l)=>{if(!e){v([]);return}f(!0);try{let s=new URLSearchParams;if(s.append(l,e),null==h)return;let t=(await (0,u.userFilterUICall)(h,s)).map(e=>({label:"user_email"===l?"".concat(e.user_email):"".concat(e.user_id),value:"user_email"===l?e.user_email:e.user_id,user:e}));v(t)}catch(e){console.error("Error fetching users:",e)}finally{f(!1)}},w=(0,i.useCallback)(c()((e,l)=>N(e,l),300),[]),k=(e,l)=>{y(l),w(e,l)},M=(e,l)=>{let s=l.user;b.setFieldsValue({user_email:s.user_email,user_id:s.user_id,role:b.getFieldValue("role")})};return(0,t.jsx)(r.Z,{title:x,open:l,onCancel:()=>{b.resetFields(),v([]),s()},footer:null,width:800,children:(0,t.jsxs)(a.Z,{form:b,onFinish:d,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{role:g},children:[(0,t.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,t.jsx)(n.default,{showSearch:!0,className:"w-full",placeholder:"Search by email",filterOption:!1,onSearch:e=>k(e,"user_email"),onSelect:(e,l)=>M(e,l),options:"user_email"===Z?_:[],loading:j,allowClear:!0})}),(0,t.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,t.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,t.jsx)(n.default,{showSearch:!0,className:"w-full",placeholder:"Search by user ID",filterOption:!1,onSearch:e=>k(e,"user_id"),onSelect:(e,l)=>M(e,l),options:"user_id"===Z?_:[],loading:j,allowClear:!0})}),(0,t.jsx)(a.Z.Item,{label:"Member Role",name:"role",className:"mb-4",children:(0,t.jsx)(n.default,{defaultValue:g,children:p.map(e=>(0,t.jsx)(n.default.Option,{value:e.value,children:(0,t.jsxs)(m.Z,{title:e.description,children:[(0,t.jsx)("span",{className:"font-medium",children:e.label}),(0,t.jsxs)("span",{className:"ml-2 text-gray-500 text-sm",children:["- ",e.description]})]})},e.value))})}),(0,t.jsx)("div",{className:"text-right mt-4",children:(0,t.jsx)(o.ZP,{type:"default",htmlType:"submit",children:"Add Member"})})]})})}},36894:function(e,l,s){var t=s(57437),i=s(56522),a=s(10032),r=s(37592),n=s(22116),m=s(5545),o=s(2265),d=s(24199);l.Z=e=>{var l,s,c;let{visible:u,onCancel:h,onSubmit:x,initialData:p,mode:g,config:b}=e,[_]=a.Z.useForm(),[v,j]=(0,o.useState)(!1);console.log("Initial Data:",p),(0,o.useEffect)(()=>{if(u){if("edit"===g&&p){let e={...p,role:p.role||b.defaultRole,max_budget_in_team:p.max_budget_in_team||null,tpm_limit:p.tpm_limit||null,rpm_limit:p.rpm_limit||null};console.log("Setting form values:",e),_.setFieldsValue(e)}else{var e;_.resetFields(),_.setFieldsValue({role:b.defaultRole||(null===(e=b.roleOptions[0])||void 0===e?void 0:e.value)})}}},[u,p,g,_,b.defaultRole,b.roleOptions]);let f=async e=>{try{j(!0);let l=Object.entries(e).reduce((e,l)=>{let[s,t]=l;if("string"==typeof t){let l=t.trim();return""===l&&("max_budget_in_team"===s||"tpm_limit"===s||"rpm_limit"===s)?{...e,[s]:null}:{...e,[s]:l}}return{...e,[s]:t}},{});console.log("Submitting form data:",l),await Promise.resolve(x(l)),_.resetFields()}catch(e){console.error("Form submission error:",e)}finally{j(!1)}},Z=e=>{switch(e.type){case"input":return(0,t.jsx)(i.o,{placeholder:e.placeholder});case"numerical":return(0,t.jsx)(d.Z,{step:e.step||1,min:e.min||0,style:{width:"100%"},placeholder:e.placeholder||"Enter a numerical value"});case"select":var l;return(0,t.jsx)(r.default,{children:null===(l=e.options)||void 0===l?void 0:l.map(e=>(0,t.jsx)(r.default.Option,{value:e.value,children:e.label},e.value))});default:return null}};return(0,t.jsx)(n.Z,{title:b.title||("add"===g?"Add Member":"Edit Member"),open:u,width:1e3,footer:null,onCancel:h,children:(0,t.jsxs)(a.Z,{form:_,onFinish:f,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[b.showEmail&&(0,t.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",rules:[{type:"email",message:"Please enter a valid email!"}],children:(0,t.jsx)(i.o,{placeholder:"user@example.com"})}),b.showEmail&&b.showUserId&&(0,t.jsx)("div",{className:"text-center mb-4",children:(0,t.jsx)(i.x,{children:"OR"})}),b.showUserId&&(0,t.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,t.jsx)(i.o,{placeholder:"user_123"})}),(0,t.jsx)(a.Z.Item,{label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{children:"Role"}),"edit"===g&&p&&(0,t.jsxs)("span",{className:"text-gray-500 text-sm",children:["(Current: ",(s=p.role,(null===(c=b.roleOptions.find(e=>e.value===s))||void 0===c?void 0:c.label)||s),")"]})]}),name:"role",className:"mb-4",rules:[{required:!0,message:"Please select a role!"}],children:(0,t.jsx)(r.default,{children:"edit"===g&&p?[...b.roleOptions.filter(e=>e.value===p.role),...b.roleOptions.filter(e=>e.value!==p.role)].map(e=>(0,t.jsx)(r.default.Option,{value:e.value,children:e.label},e.value)):b.roleOptions.map(e=>(0,t.jsx)(r.default.Option,{value:e.value,children:e.label},e.value))})}),null===(l=b.additionalFields)||void 0===l?void 0:l.map(e=>(0,t.jsx)(a.Z.Item,{label:e.label,name:e.name,className:"mb-4",rules:e.rules,children:Z(e)},e.name)),(0,t.jsxs)("div",{className:"text-right mt-6",children:[(0,t.jsx)(m.ZP,{onClick:h,className:"mr-2",disabled:v,children:"Cancel"}),(0,t.jsx)(m.ZP,{type:"default",htmlType:"submit",loading:v,children:"add"===g?v?"Adding...":"Add Member":v?"Saving...":"Save Changes"})]})]})})}},33293:function(e,l,s){s.d(l,{Z:function(){return et}});var t=s(57437),i=s(33860),a=s(19250),r=s(59872),n=s(33304),m=s(15424),o=s(10900),d=s(30078),c=s(10032),u=s(42264),h=s(5545),x=s(4260),p=s(37592),g=s(99981),b=s(63709),_=s(30401),v=s(78867),j=s(2265),f=s(82586),Z=s(21609),y=s(95096),N=s(46468),w=s(27799),k=s(95920),M=s(68473),S=s(9114),C=s(60131),T=s(24199),I=s(97415),P=s(21425),L=s(36894),O=s(78489),F=s(12514),E=s(21626),D=s(97214),A=s(28241),R=s(58834),z=s(69552),U=s(71876),V=s(84264),B=s(96761),G=s(4156),q=s(85180),K=s(89245),$=s(78355);let J={"/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"},Q=e=>e.includes("/info")||e.includes("/list")?"GET":"POST",W=e=>{let l=Q(e),s=J[e];if(!s){for(let[l,t]of Object.entries(J))if(e.includes(l)){s=t;break}}return s||(s="Access ".concat(e)),{method:l,endpoint:e,description:s,route:e}};var X=e=>{let{teamId:l,accessToken:s,canEditTeam:i}=e,[r,n]=(0,j.useState)([]),[m,o]=(0,j.useState)([]),[d,c]=(0,j.useState)(!0),[u,x]=(0,j.useState)(!1),[p,g]=(0,j.useState)(!1),b=async()=>{try{if(c(!0),!s)return;let e=await (0,a.getTeamPermissionsCall)(s,l),t=e.all_available_permissions||[];n(t);let i=e.team_member_permissions||[];o(i),g(!1)}catch(e){S.Z.fromBackend("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{c(!1)}};(0,j.useEffect)(()=>{b()},[l,s]);let _=(e,l)=>{o(l?[...m,e]:m.filter(l=>l!==e)),g(!0)},v=async()=>{try{if(!s)return;x(!0),await (0,a.teamPermissionsUpdateCall)(s,l,m),S.Z.success("Permissions updated successfully"),g(!1)}catch(e){S.Z.fromBackend("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{x(!1)}};if(d)return(0,t.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let f=r.length>0;return(0,t.jsxs)(F.Z,{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)(B.Z,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),i&&p&&(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(h.ZP,{icon:(0,t.jsx)(K.Z,{}),onClick:()=>{b()},children:"Reset"}),(0,t.jsxs)(O.Z,{onClick:v,loading:u,className:"flex items-center gap-2",children:[(0,t.jsx)($.Z,{})," Save Changes"]})]})]}),(0,t.jsx)(V.Z,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),f?(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(E.Z,{className:" min-w-full",children:[(0,t.jsx)(R.Z,{children:(0,t.jsxs)(U.Z,{children:[(0,t.jsx)(z.Z,{children:"Method"}),(0,t.jsx)(z.Z,{children:"Endpoint"}),(0,t.jsx)(z.Z,{children:"Description"}),(0,t.jsx)(z.Z,{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)(D.Z,{children:r.map(e=>{let l=W(e);return(0,t.jsxs)(U.Z,{className:"hover:bg-gray-50 transition-colors",children:[(0,t.jsx)(A.Z,{children:(0,t.jsx)("span",{className:"px-2 py-1 rounded text-xs font-medium ".concat("GET"===l.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"),children:l.method})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)("span",{className:"font-mono text-sm text-gray-800",children:l.endpoint})}),(0,t.jsx)(A.Z,{className:"text-gray-700",children:l.description}),(0,t.jsx)(A.Z,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:(0,t.jsx)(G.Z,{checked:m.includes(e),onChange:l=>_(e,l.target.checked),disabled:!i})})]},e)})})]})}):(0,t.jsx)("div",{className:"py-12",children:(0,t.jsx)(q.Z,{description:"No permissions available"})})]})},Y=s(47323),H=s(53410),ee=s(74998),el=e=>{let{teamData:l,canEditTeam:s,handleMemberDelete:i,setSelectedEditMember:a,setIsEditMemberModalVisible:n,setIsAddMemberModalVisible:o}=e,d=e=>{if(null==e)return"0";if("number"==typeof e){let l=Number(e);return l===Math.floor(l)?l.toString():(0,r.pw)(l,8).replace(/\.?0+$/,"")}return"0"},c=e=>{if(!e)return 0;let s=l.team_memberships.find(l=>l.user_id===e);return(null==s?void 0:s.spend)||0},u=e=>{var s;if(!e)return null;let t=l.team_memberships.find(l=>l.user_id===e);console.log("membership=".concat(t));let i=null==t?void 0:null===(s=t.litellm_budget_table)||void 0===s?void 0:s.max_budget;return null==i?null:d(i)},h=e=>{var s,t;if(!e)return"No Limits";let i=l.team_memberships.find(l=>l.user_id===e),a=null==i?void 0:null===(s=i.litellm_budget_table)||void 0===s?void 0:s.rpm_limit,r=null==i?void 0:null===(t=i.litellm_budget_table)||void 0===t?void 0:t.tpm_limit,n=[a?"".concat(d(a)," RPM"):null,r?"".concat(d(r)," TPM"):null].filter(Boolean);return n.length>0?n.join(" / "):"No Limits"};return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(F.Z,{className:"w-full mx-auto flex-auto overflow-auto max-h-[50vh]",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(E.Z,{className:"min-w-full",children:[(0,t.jsx)(R.Z,{children:(0,t.jsxs)(U.Z,{children:[(0,t.jsx)(z.Z,{children:"User ID"}),(0,t.jsx)(z.Z,{children:"User Email"}),(0,t.jsx)(z.Z,{children:"Role"}),(0,t.jsxs)(z.Z,{children:["Team Member Spend (USD)"," ",(0,t.jsx)(g.Z,{title:"This is the amount spent by a user in the team.",children:(0,t.jsx)(m.Z,{})})]}),(0,t.jsx)(z.Z,{children:"Team Member Budget (USD)"}),(0,t.jsxs)(z.Z,{children:["Team Member Rate Limits"," ",(0,t.jsx)(g.Z,{title:"Rate limits for this member's usage within this team.",children:(0,t.jsx)(m.Z,{})})]}),(0,t.jsx)(z.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:"Actions"})]})}),(0,t.jsx)(D.Z,{children:l.team_info.members_with_roles.map((e,m)=>(0,t.jsxs)(U.Z,{children:[(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:e.user_id})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:e.user_email?e.user_email:"No Email"})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:e.role})}),(0,t.jsx)(A.Z,{children:(0,t.jsxs)(V.Z,{className:"font-mono",children:["$",(0,r.pw)(c(e.user_id),4)]})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:u(e.user_id)?"$".concat((0,r.pw)(Number(u(e.user_id)),4)):"No Limit"})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:h(e.user_id)})}),(0,t.jsx)(A.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:s&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(Y.Z,{icon:H.Z,size:"sm",onClick:()=>{var s,t,i;let r=l.team_memberships.find(l=>l.user_id===e.user_id);a({...e,max_budget_in_team:(null==r?void 0:null===(s=r.litellm_budget_table)||void 0===s?void 0:s.max_budget)||null,tpm_limit:(null==r?void 0:null===(t=r.litellm_budget_table)||void 0===t?void 0:t.tpm_limit)||null,rpm_limit:(null==r?void 0:null===(i=r.litellm_budget_table)||void 0===i?void 0:i.rpm_limit)||null}),n(!0)},className:"cursor-pointer hover:text-blue-600"}),(0,t.jsx)(Y.Z,{icon:ee.Z,size:"sm",onClick:()=>i(e),className:"cursor-pointer hover:text-red-600"})]})})]},m))})]})})}),(0,t.jsx)(O.Z,{onClick:()=>o(!0),children:"Add Member"})]})};let es=(e,l)=>{let s=[];return s=e?e.models.includes("all-proxy-models")?l:e.models.length>0?e.models:l:l,(0,N.Ob)(s,l)};var et=e=>{var l,s,O,F,E,D,A,R,z,U,V,B,G,q,K,$,J,Q,W,Y,H;let ee;let{teamId:et,onClose:ei,accessToken:ea,is_team_admin:er,is_proxy_admin:en,userModels:em,editTeam:eo,premiumUser:ed=!1,onUpdate:ec}=e,[eu,eh]=(0,j.useState)(null),[ex,ep]=(0,j.useState)(!0),[eg,eb]=(0,j.useState)(!1),[e_]=c.Z.useForm(),[ev,ej]=(0,j.useState)(!1),[ef,eZ]=(0,j.useState)(null),[ey,eN]=(0,j.useState)(!1),[ew,ek]=(0,j.useState)([]),[eM,eS]=(0,j.useState)(!1),[eC,eT]=(0,j.useState)({}),[eI,eP]=(0,j.useState)([]),[eL,eO]=(0,j.useState)(null),[eF,eE]=(0,j.useState)(!1),[eD,eA]=(0,j.useState)(!1),[eR,ez]=(0,j.useState)(!1),[eU,eV]=(0,j.useState)(null);console.log("userModels in team info",em);let eB=er||en,eG=async()=>{try{if(ep(!0),!ea)return;let e=await (0,a.teamInfoCall)(ea,et);eh(e)}catch(e){S.Z.fromBackend("Failed to load team information"),console.error("Error fetching team info:",e)}finally{ep(!1)}};(0,j.useEffect)(()=>{eG()},[et,ea]),(0,j.useEffect)(()=>{(async()=>{var e;if(!ea||!(null==eu?void 0:null===(e=eu.team_info)||void 0===e?void 0:e.organization_id)){eV(null);return}try{let e=await (0,a.organizationInfoCall)(ea,eu.team_info.organization_id);eV(e)}catch(e){console.error("Error fetching organization info:",e),eV(null)}})()},[ea,null==eu?void 0:null===(l=eu.team_info)||void 0===l?void 0:l.organization_id]);let eq=(0,j.useMemo)(()=>es(eU,em),[eU,em]);(0,j.useEffect)(()=>{(async()=>{try{if(!ea)return;let e=(await (0,a.getGuardrailsList)(ea)).guardrails.map(e=>e.guardrail_name);eP(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[ea]);let eK=async e=>{try{if(null==ea)return;let l={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,a.teamMemberAddCall)(ea,et,l),S.Z.success("Team member added successfully"),eb(!1),e_.resetFields();let s=await (0,a.teamInfoCall)(ea,et);eh(s),ec(s)}catch(i){var l,s,t;let e="Failed to add team member";(null==i?void 0:null===(t=i.raw)||void 0===t?void 0:null===(s=t.detail)||void 0===s?void 0:null===(l=s.error)||void 0===l?void 0:l.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==i?void 0:i.message)&&(e=i.message),S.Z.fromBackend(e),console.error("Error adding team member:",i)}},e$=async e=>{try{if(null==ea)return;let l={user_email:e.user_email,user_id:e.user_id,role:e.role,max_budget_in_team:e.max_budget_in_team,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit};console.log("Updating member with values:",l),u.ZP.destroy(),await (0,a.teamMemberUpdateCall)(ea,et,l),S.Z.success("Team member updated successfully"),ej(!1);let s=await (0,a.teamInfoCall)(ea,et);eh(s),ec(s)}catch(t){var l,s;let e="Failed to update team member";(null==t?void 0:null===(s=t.raw)||void 0===s?void 0:null===(l=s.detail)||void 0===l?void 0:l.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==t?void 0:t.message)&&(e=t.message),ej(!1),u.ZP.destroy(),S.Z.fromBackend(e),console.error("Error updating team member:",t)}},eJ=async()=>{if(eL&&ea){eA(!0);try{await (0,a.teamMemberDeleteCall)(ea,et,eL),S.Z.success("Team member removed successfully");let e=await (0,a.teamInfoCall)(ea,et);eh(e),ec(e)}catch(e){S.Z.fromBackend("Failed to remove team member"),console.error("Error removing team member:",e)}finally{eA(!1),eE(!1),eO(null)}}},eQ=async e=>{try{if(!ea)return;ez(!0);let l={};try{l=e.metadata?JSON.parse(e.metadata):{}}catch(e){S.Z.fromBackend("Invalid JSON in metadata field");return}let s=e=>null==e||"string"==typeof e&&""===e.trim()||"number"==typeof e&&Number.isNaN(e)?null:e,t={team_id:et,team_alias:e.team_alias,models:e.models,tpm_limit:s(e.tpm_limit),rpm_limit:s(e.rpm_limit),max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:{...l,guardrails:e.guardrails||[],logging:e.logging_settings||[]},organization_id:e.organization_id};t.max_budget=(0,n.C)(t.max_budget),void 0!==e.team_member_budget&&(t.team_member_budget=Number(e.team_member_budget)),void 0!==e.team_member_key_duration&&(t.team_member_key_duration=e.team_member_key_duration),(void 0!==e.team_member_tpm_limit||void 0!==e.team_member_rpm_limit)&&(t.team_member_tpm_limit=s(e.team_member_tpm_limit),t.team_member_rpm_limit=s(e.team_member_rpm_limit));let{servers:i,accessGroups:r}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]},m=new Set(i||[]),o=Object.fromEntries(Object.entries(e.mcp_tool_permissions||{}).filter(e=>{let[l]=e;return m.has(l)}));t.object_permission={},i&&(t.object_permission.mcp_servers=i),r&&(t.object_permission.mcp_access_groups=r),o&&(t.object_permission.mcp_tool_permissions=o),delete e.mcp_servers_and_groups,delete e.mcp_tool_permissions;let{agents:d,accessGroups:c}=e.agents_and_groups||{agents:[],accessGroups:[]};d&&d.length>0&&(t.object_permission.agents=d),c&&c.length>0&&(t.object_permission.agent_access_groups=c),delete e.agents_and_groups,await (0,a.teamUpdateCall)(ea,t),S.Z.success("Team settings updated successfully"),eN(!1),eG()}catch(e){console.error("Error updating team:",e)}finally{ez(!1)}};if(ex)return(0,t.jsx)("div",{className:"p-4",children:"Loading..."});if(!(null==eu?void 0:eu.team_info))return(0,t.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:eW}=eu,eX=async(e,l)=>{await (0,r.vQ)(e)&&(eT(e=>({...e,[l]:!0})),setTimeout(()=>{eT(e=>({...e,[l]:!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)(d.zx,{icon:o.Z,variant:"light",onClick:ei,className:"mb-4",children:"Back to Teams"}),(0,t.jsx)(d.Dx,{children:eW.team_alias}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(d.xv,{className:"text-gray-500 font-mono",children:eW.team_id}),(0,t.jsx)(h.ZP,{type:"text",size:"small",icon:eC["team-id"]?(0,t.jsx)(_.Z,{size:12}):(0,t.jsx)(v.Z,{size:12}),onClick:()=>eX(eW.team_id,"team-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eC["team-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,t.jsxs)(d.v0,{defaultIndex:eo?3:0,children:[(0,t.jsx)(d.td,{className:"mb-4",children:[(0,t.jsx)(d.OK,{children:"Overview"},"overview"),...eB?[(0,t.jsx)(d.OK,{children:"Members"},"members"),(0,t.jsx)(d.OK,{children:"Member Permissions"},"member-permissions"),(0,t.jsx)(d.OK,{children:"Settings"},"settings")]:[]]}),(0,t.jsxs)(d.nP,{children:[(0,t.jsx)(d.x4,{children:(0,t.jsxs)(d.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(d.Zb,{children:[(0,t.jsx)(d.xv,{children:"Budget Status"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(d.Dx,{children:["$",(0,r.pw)(eW.spend,4)]}),(0,t.jsxs)(d.xv,{children:["of ",null===eW.max_budget?"Unlimited":"$".concat((0,r.pw)(eW.max_budget,4))]}),eW.budget_duration&&(0,t.jsxs)(d.xv,{className:"text-gray-500",children:["Reset: ",eW.budget_duration]}),(0,t.jsx)("br",{}),eW.team_member_budget_table&&(0,t.jsxs)(d.xv,{className:"text-gray-500",children:["Team Member Budget: $",(0,r.pw)(eW.team_member_budget_table.max_budget,4)]})]})]}),(0,t.jsxs)(d.Zb,{children:[(0,t.jsx)(d.xv,{children:"Rate Limits"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(d.xv,{children:["TPM: ",eW.tpm_limit||"Unlimited"]}),(0,t.jsxs)(d.xv,{children:["RPM: ",eW.rpm_limit||"Unlimited"]}),eW.max_parallel_requests&&(0,t.jsxs)(d.xv,{children:["Max Parallel Requests: ",eW.max_parallel_requests]})]})]}),(0,t.jsxs)(d.Zb,{children:[(0,t.jsx)(d.xv,{children:"Models"}),(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===eW.models.length?(0,t.jsx)(d.Ct,{color:"red",children:"All proxy models"}):eW.models.map((e,l)=>(0,t.jsx)(d.Ct,{color:"red",children:e},l))})]}),(0,t.jsxs)(d.Zb,{children:[(0,t.jsx)(d.xv,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(d.xv,{children:["User Keys: ",eu.keys.filter(e=>e.user_id).length]}),(0,t.jsxs)(d.xv,{children:["Service Account Keys: ",eu.keys.filter(e=>!e.user_id).length]}),(0,t.jsxs)(d.xv,{className:"text-gray-500",children:["Total: ",eu.keys.length]})]})]}),(0,t.jsx)(C.Z,{objectPermission:eW.object_permission,variant:"card",accessToken:ea}),(0,t.jsx)(w.Z,{loggingConfigs:(null===(s=eW.metadata)||void 0===s?void 0:s.logging)||[],disabledCallbacks:[],variant:"card"})]})}),(0,t.jsx)(d.x4,{children:(0,t.jsx)(el,{teamData:eu,canEditTeam:eB,handleMemberDelete:e=>{eO(e),eE(!0)},setSelectedEditMember:eZ,setIsEditMemberModalVisible:ej,setIsAddMemberModalVisible:eb})}),eB&&(0,t.jsx)(d.x4,{children:(0,t.jsx)(X,{teamId:et,accessToken:ea,canEditTeam:eB})}),(0,t.jsx)(d.x4,{children:(0,t.jsxs)(d.Zb,{className:"overflow-y-auto max-h-[65vh]",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(d.Dx,{children:"Team Settings"}),eB&&!ey&&(0,t.jsx)(d.zx,{onClick:()=>eN(!0),children:"Edit Settings"})]}),ey?(0,t.jsxs)(c.Z,{form:e_,onFinish:eQ,initialValues:{...eW,team_alias:eW.team_alias,models:eW.models,tpm_limit:eW.tpm_limit,rpm_limit:eW.rpm_limit,max_budget:eW.max_budget,budget_duration:eW.budget_duration,team_member_tpm_limit:null===(O=eW.team_member_budget_table)||void 0===O?void 0:O.tpm_limit,team_member_rpm_limit:null===(F=eW.team_member_budget_table)||void 0===F?void 0:F.rpm_limit,guardrails:(null===(E=eW.metadata)||void 0===E?void 0:E.guardrails)||[],disable_global_guardrails:(null===(D=eW.metadata)||void 0===D?void 0:D.disable_global_guardrails)||!1,metadata:eW.metadata?JSON.stringify((e=>{let{logging:l,...s}=e;return s})(eW.metadata),null,2):"",logging_settings:(null===(A=eW.metadata)||void 0===A?void 0:A.logging)||[],organization_id:eW.organization_id,vector_stores:(null===(R=eW.object_permission)||void 0===R?void 0:R.vector_stores)||[],mcp_servers:(null===(z=eW.object_permission)||void 0===z?void 0:z.mcp_servers)||[],mcp_access_groups:(null===(U=eW.object_permission)||void 0===U?void 0:U.mcp_access_groups)||[],mcp_servers_and_groups:{servers:(null===(V=eW.object_permission)||void 0===V?void 0:V.mcp_servers)||[],accessGroups:(null===(B=eW.object_permission)||void 0===B?void 0:B.mcp_access_groups)||[]},mcp_tool_permissions:(null===(G=eW.object_permission)||void 0===G?void 0:G.mcp_tool_permissions)||{},agents_and_groups:{agents:(null===(q=eW.object_permission)||void 0===q?void 0:q.agents)||[],accessGroups:(null===(K=eW.object_permission)||void 0===K?void 0:K.agent_access_groups)||[]}},layout:"vertical",children:[(0,t.jsx)(c.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,t.jsx)(x.default,{type:""})}),(0,t.jsx)(c.Z.Item,{label:"Models",name:"models",rules:[{required:!0,message:"Please select at least one model"}],children:(0,t.jsxs)(p.default,{mode:"multiple",placeholder:"Select models",children:[(ee=!1,eU?(0===eU.models.length||eU.models.includes("all-proxy-models"))&&(ee=!0):ee=en||em.includes("all-proxy-models"),ee?(0,t.jsx)(p.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"):null),!eU||eU.models.includes("no-default-models")?(0,t.jsx)(p.default.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"):null,Array.from(new Set(eq)).map((e,l)=>(0,t.jsx)(p.default.Option,{value:e,children:(0,N.W0)(e)},l))]})}),(0,t.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(T.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",tooltip:"This is the individual budget for a user in the team.",children:(0,t.jsx)(T.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{label:"Team Member 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)(d.oi,{placeholder:"e.g., 30d"})}),(0,t.jsx)(c.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"Default tokens per minute limit for an individual team member. This limit applies to all requests the user makes within this team. Can be overridden per member.",children:(0,t.jsx)(T.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 1000"})}),(0,t.jsx)(c.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"Default requests per minute limit for an individual team member. This limit applies to all requests the user makes within this team. Can be overridden per member.",children:(0,t.jsx)(T.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 100"})}),(0,t.jsx)(c.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsxs)(p.default,{placeholder:"n/a",children:[(0,t.jsx)(p.default.Option,{value:"24h",children:"daily"}),(0,t.jsx)(p.default.Option,{value:"7d",children:"weekly"}),(0,t.jsx)(p.default.Option,{value:"30d",children:"monthly"})]})}),(0,t.jsx)(c.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,t.jsx)(T.Z,{step:1,style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,t.jsx)(T.Z,{step:1,style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{label:(0,t.jsxs)("span",{children:["Guardrails"," ",(0,t.jsx)(g.Z,{title:"Setup your first guardrail",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)(m.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,t.jsx)(p.default,{mode:"tags",placeholder:"Select or enter guardrails",options:eI.map(e=>({value:e,label:e}))})}),(0,t.jsx)(c.Z.Item,{label:(0,t.jsxs)("span",{children:["Disable Global Guardrails"," ",(0,t.jsx)(g.Z,{title:"When enabled, this team will bypass any guardrails configured to run on every request (global guardrails)",children:(0,t.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),name:"disable_global_guardrails",valuePropName:"checked",help:"Bypass global guardrails for this team",children:(0,t.jsx)(b.Z,{checkedChildren:"Yes",unCheckedChildren:"No"})}),(0,t.jsx)(c.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,t.jsx)(I.Z,{onChange:e=>e_.setFieldValue("vector_stores",e),value:e_.getFieldValue("vector_stores"),accessToken:ea||"",placeholder:"Select vector stores"})}),(0,t.jsx)(c.Z.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,t.jsx)(y.Z,{onChange:e=>e_.setFieldValue("allowed_passthrough_routes",e),value:e_.getFieldValue("allowed_passthrough_routes"),accessToken:ea||"",placeholder:"Select pass through routes"})}),(0,t.jsx)(c.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,t.jsx)(k.Z,{onChange:e=>e_.setFieldValue("mcp_servers_and_groups",e),value:e_.getFieldValue("mcp_servers_and_groups"),accessToken:ea||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,t.jsx)(c.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,t.jsx)(x.default,{type:"hidden"})}),(0,t.jsx)(c.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.mcp_servers_and_groups!==l.mcp_servers_and_groups||e.mcp_tool_permissions!==l.mcp_tool_permissions,children:()=>{var e;return(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)(M.Z,{accessToken:ea||"",selectedServers:(null===(e=e_.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:e_.getFieldValue("mcp_tool_permissions")||{},onChange:e=>e_.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,t.jsx)(c.Z.Item,{label:"Agents / Access Groups",name:"agents_and_groups",children:(0,t.jsx)(f.Z,{onChange:e=>e_.setFieldValue("agents_and_groups",e),value:e_.getFieldValue("agents_and_groups"),accessToken:ea||"",placeholder:"Select agents or access groups (optional)"})}),(0,t.jsx)(c.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,t.jsx)(x.default,{type:"",disabled:!0})}),(0,t.jsx)(c.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,t.jsx)(P.Z,{value:e_.getFieldValue("logging_settings"),onChange:e=>e_.setFieldValue("logging_settings",e)})}),(0,t.jsx)(c.Z.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(x.default.TextArea,{rows:10})}),(0,t.jsx)("div",{className:"sticky z-10 bg-white p-4 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)(d.zx,{variant:"secondary",onClick:()=>eN(!1),disabled:eR,children:"Cancel"}),(0,t.jsx)(d.zx,{type:"submit",loading:eR,children:"Save Changes"})]})})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Team Name"}),(0,t.jsx)("div",{children:eW.team_alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Team ID"}),(0,t.jsx)("div",{className:"font-mono",children:eW.team_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Created At"}),(0,t.jsx)("div",{children:new Date(eW.created_at).toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:eW.models.map((e,l)=>(0,t.jsx)(d.Ct,{color:"red",children:e},l))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Rate Limits"}),(0,t.jsxs)("div",{children:["TPM: ",eW.tpm_limit||"Unlimited"]}),(0,t.jsxs)("div",{children:["RPM: ",eW.rpm_limit||"Unlimited"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Team Budget"}),(0,t.jsxs)("div",{children:["Max Budget:"," ",null!==eW.max_budget?"$".concat((0,r.pw)(eW.max_budget,4)):"No Limit"]}),(0,t.jsxs)("div",{children:["Budget Reset: ",eW.budget_duration||"Never"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)(d.xv,{className:"font-medium",children:["Team Member Settings"," ",(0,t.jsx)(g.Z,{title:"These are limits on individual team members",children:(0,t.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),(0,t.jsxs)("div",{children:["Max Budget: ",(null===($=eW.team_member_budget_table)||void 0===$?void 0:$.max_budget)||"No Limit"]}),(0,t.jsxs)("div",{children:["Key Duration: ",(null===(J=eW.metadata)||void 0===J?void 0:J.team_member_key_duration)||"No Limit"]}),(0,t.jsxs)("div",{children:["TPM Limit: ",(null===(Q=eW.team_member_budget_table)||void 0===Q?void 0:Q.tpm_limit)||"No Limit"]}),(0,t.jsxs)("div",{children:["RPM Limit: ",(null===(W=eW.team_member_budget_table)||void 0===W?void 0:W.rpm_limit)||"No Limit"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Organization ID"}),(0,t.jsx)("div",{children:eW.organization_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Status"}),(0,t.jsx)(d.Ct,{color:eW.blocked?"red":"green",children:eW.blocked?"Blocked":"Active"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Disable Global Guardrails"}),(0,t.jsx)("div",{children:(null===(Y=eW.metadata)||void 0===Y?void 0:Y.disable_global_guardrails)===!0?(0,t.jsx)(d.Ct,{color:"yellow",children:"Enabled - Global guardrails bypassed"}):(0,t.jsx)(d.Ct,{color:"green",children:"Disabled - Global guardrails active"})})]}),(0,t.jsx)(C.Z,{objectPermission:eW.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:ea}),(0,t.jsx)(w.Z,{loggingConfigs:(null===(H=eW.metadata)||void 0===H?void 0:H.logging)||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]}),(0,t.jsx)(L.Z,{visible:ev,onCancel:()=>ej(!1),onSubmit:e$,initialData:ef,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)(g.Z,{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)(m.Z,{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)(g.Z,{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)(m.Z,{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)(g.Z,{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)(m.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Requests per minute limit for this member in this team"}]}}),(0,t.jsx)(i.Z,{isVisible:eg,onCancel:()=>eb(!1),onSubmit:eK,accessToken:ea}),(0,t.jsx)(Z.Z,{isOpen:eF,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:null==eL?void 0:eL.user_id,code:!0},{label:"Email",value:null==eL?void 0:eL.user_email},{label:"Role",value:null==eL?void 0:eL.role}],onCancel:()=>{eE(!1),eO(null)},onOk:eJ,confirmLoading:eD})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2202-721dd881f2afe3d2.js b/litellm/proxy/_experimental/out/_next/static/chunks/2202-05323ec7080a42a4.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/2202-721dd881f2afe3d2.js rename to litellm/proxy/_experimental/out/_next/static/chunks/2202-05323ec7080a42a4.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2249-985208cb7064c804.js b/litellm/proxy/_experimental/out/_next/static/chunks/2249-985208cb7064c804.js deleted file mode 100644 index e255730d8cd..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2249-985208cb7064c804.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2249],{64748:function(e,s,l){l.d(s,{Ct:function(){return a.Z},Dx:function(){return m.Z},OK:function(){return n.Z},Zb:function(){return r.Z},nP:function(){return o.Z},td:function(){return c.Z},v0:function(){return i.Z},x4:function(){return d.Z},xv:function(){return x.Z},zx:function(){return t.Z}});var a=l(41649),t=l(78489),r=l(12514),n=l(12485),i=l(18135),c=l(35242),d=l(29706),o=l(77991),x=l(84264),m=l(96761)},78801:function(e,s,l){l.d(s,{Z:function(){return a.Z},x:function(){return t.Z}});var a=l(12514),t=l(84264)},92249:function(e,s,l){l.d(s,{Z:function(){return W}});var a=l(57437),t=l(23639),r=l(64748),n=l(22116),i=l(78867),c=l(99376),d=l(2265),o=l(17906),x=l(20347),m=l(41649),h=l(78489),u=l(84264),p=l(99981),g=l(3810),j=l(15424),v=l(15690),b=l(10032),N=l(61994),f=l(5545),y=l(96761),_=l(19250),k=l(9114);let{Step:w}=v.default;var Z=e=>{let{visible:s,onClose:l,accessToken:t,agentHubData:r,onSuccess:i}=e,[c,o]=(0,d.useState)(0),[x,h]=(0,d.useState)(new Set),[p,g]=(0,d.useState)(!1),[j]=b.Z.useForm(),Z=()=>{o(0),h(new Set),j.resetFields(),l()},C=(e,s)=>{let l=new Set(x);s?l.add(e):l.delete(e),h(l)},S=e=>{e?h(new Set(r.map(e=>e.agent_id||e.name))):h(new Set)};(0,d.useEffect)(()=>{s&&r.length>0&&h(new Set(r.filter(e=>!0===e.is_public).map(e=>e.agent_id||e.name)))},[s,r]);let P=async()=>{if(0===x.size){k.Z.fromBackend("Please select at least one agent to make public");return}g(!0);try{let e=Array.from(x);await (0,_.makeAgentsPublicCall)(t,e),k.Z.success("Successfully made ".concat(e.length," agent(s) public!")),Z(),i()}catch(e){console.error("Error making agents public:",e),k.Z.fromBackend("Failed to make agents public. Please try again.")}finally{g(!1)}},M=()=>{let e=r.length>0&&r.every(e=>x.has(e.agent_id||e.name)),s=x.size>0&&!e;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(y.Z,{children:"Select Agents to Make Public"}),(0,a.jsx)("div",{className:"flex items-center space-x-2",children:(0,a.jsxs)(N.Z,{checked:e,indeterminate:s,onChange:e=>S(e.target.checked),disabled:0===r.length,children:["Select All ",r.length>0&&"(".concat(r.length,")")]})})]}),(0,a.jsx)(u.Z,{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,a.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,a.jsx)("div",{className:"space-y-3",children:0===r.length?(0,a.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,a.jsx)(u.Z,{children:"No agents available."})}):r.map(e=>{let s=e.agent_id||e.name;return(0,a.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,a.jsx)(N.Z,{checked:x.has(s),onChange:e=>C(s,e.target.checked)}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:e.name}),(0,a.jsxs)(m.Z,{color:"blue",size:"sm",children:["v",e.version]})]}),(0,a.jsx)(u.Z,{className:"text-xs text-gray-600 mt-1",children:e.description}),e.skills&&e.skills.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.skills.slice(0,3).map(e=>(0,a.jsx)(m.Z,{color:"purple",size:"xs",children:e.name},e.id)),e.skills.length>3&&(0,a.jsxs)(u.Z,{className:"text-xs text-gray-500",children:["+",e.skills.length-3," more"]})]})]})]},s)})})}),x.size>0&&(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:[(0,a.jsx)("strong",{children:x.size})," agent",1!==x.size?"s":""," selected"]})})]})},z=()=>(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(y.Z,{children:"Confirm Making Agents Public"}),(0,a.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,a.jsxs)(u.Z,{className:"text-sm text-yellow-800",children:[(0,a.jsx)("strong",{children:"Warning:"})," Once you make these agents public, anyone who can go to the"," ",(0,a.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:"Agents to be made public:"}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,a.jsx)("div",{className:"space-y-2",children:Array.from(x).map(e=>{let s=r.find(s=>(s.agent_id||s.name)===e);return(0,a.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:(null==s?void 0:s.name)||e}),s&&(0,a.jsxs)(m.Z,{color:"blue",size:"xs",children:["v",s.version]})]}),(null==s?void 0:s.description)&&(0,a.jsx)(u.Z,{className:"text-xs text-gray-600 mt-1",children:s.description})]})},e)})})})]}),(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,a.jsx)("strong",{children:x.size})," agent",1!==x.size?"s":""," will be made public"]})})]});return(0,a.jsx)(n.Z,{title:"Make Agents Public",open:s,onCancel:Z,footer:null,width:1200,maskClosable:!1,children:(0,a.jsxs)(b.Z,{form:j,layout:"vertical",children:[(0,a.jsxs)(v.default,{current:c,className:"mb-6",children:[(0,a.jsx)(w,{title:"Select Agents"}),(0,a.jsx)(w,{title:"Confirm"})]}),(()=>{switch(c){case 0:return M();case 1:return z();default:return null}})(),(0,a.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,a.jsx)(f.ZP,{onClick:0===c?Z:()=>{1===c&&o(0)},children:0===c?"Cancel":"Previous"}),(0,a.jsxs)("div",{className:"flex space-x-2",children:[0===c&&(0,a.jsx)(f.ZP,{onClick:()=>{if(0===c){if(0===x.size){k.Z.fromBackend("Please select at least one agent to make public");return}o(1)}},disabled:0===x.size,children:"Next"}),1===c&&(0,a.jsx)(f.ZP,{onClick:P,loading:p,children:"Make Public"})]})]})]})})};let{Step:C}=v.default;var S=e=>{let{visible:s,onClose:l,accessToken:t,mcpHubData:r,onSuccess:i}=e,[c,o]=(0,d.useState)(0),[x,h]=(0,d.useState)(new Set),[p,g]=(0,d.useState)(!1),[j]=b.Z.useForm(),w=()=>{o(0),h(new Set),j.resetFields(),l()},Z=(e,s)=>{let l=new Set(x);s?l.add(e):l.delete(e),h(l)},S=e=>{e?h(new Set(r.map(e=>e.server_id))):h(new Set)};(0,d.useEffect)(()=>{s&&r.length>0&&h(new Set(r.filter(e=>{var s;return(null===(s=e.mcp_info)||void 0===s?void 0:s.is_public)===!0}).map(e=>e.server_id)))},[s]);let P=async()=>{if(0===x.size){k.Z.fromBackend("Please select at least one MCP server to make public");return}g(!0);try{let e=Array.from(x);await (0,_.makeMCPPublicCall)(t,e),k.Z.success("Successfully made ".concat(e.length," MCP server(s) public!")),w(),i()}catch(e){console.error("Error making MCP servers public:",e),k.Z.fromBackend("Failed to make MCP servers public. Please try again.")}finally{g(!1)}},M=()=>{let e=r.length>0&&r.every(e=>x.has(e.server_id)),s=x.size>0&&!e;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(y.Z,{children:"Select MCP Servers to Make Public"}),(0,a.jsx)("div",{className:"flex items-center space-x-2",children:(0,a.jsxs)(N.Z,{checked:e,indeterminate:s,onChange:e=>S(e.target.checked),disabled:0===r.length,children:["Select All ",r.length>0&&"(".concat(r.length,")")]})})]}),(0,a.jsx)(u.Z,{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,a.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,a.jsx)("div",{className:"space-y-3",children:0===r.length?(0,a.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,a.jsx)(u.Z,{children:"No MCP servers available."})}):r.map(e=>{var s;let l=(null===(s=e.mcp_info)||void 0===s?void 0:s.is_public)===!0;return(0,a.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,a.jsx)(N.Z,{checked:x.has(e.server_id),onChange:s=>Z(e.server_id,s.target.checked)}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:e.server_name}),l&&(0,a.jsx)(m.Z,{color:"emerald",size:"sm",children:"Public"}),(0,a.jsx)(m.Z,{color:"blue",size:"sm",children:e.transport}),(0,a.jsx)(m.Z,{color:"active"===e.status||"healthy"===e.status?"green":"inactive"===e.status||"unhealthy"===e.status?"red":"gray",size:"sm",children:e.status||"unknown"})]}),(0,a.jsx)(u.Z,{className:"text-xs text-gray-600 mt-1",children:e.description||e.url}),e.allowed_tools&&e.allowed_tools.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.allowed_tools.slice(0,3).map((e,s)=>(0,a.jsx)(m.Z,{color:"purple",size:"xs",children:e},s)),e.allowed_tools.length>3&&(0,a.jsxs)(u.Z,{className:"text-xs text-gray-500",children:["+",e.allowed_tools.length-3," more"]})]})]})]},e.server_id)})})}),x.size>0&&(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:[(0,a.jsx)("strong",{children:x.size})," MCP server",1!==x.size?"s":""," selected"]})})]})},z=()=>(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(y.Z,{children:"Confirm Making MCP Servers Public"}),(0,a.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,a.jsxs)(u.Z,{className:"text-sm text-yellow-800",children:[(0,a.jsx)("strong",{children:"Warning:"})," Once you make these MCP servers public, anyone who can go to the"," ",(0,a.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:"MCP Servers to be made public:"}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,a.jsx)("div",{className:"space-y-2",children:Array.from(x).map(e=>{let s=r.find(s=>s.server_id===e);return(0,a.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:(null==s?void 0:s.server_name)||e}),s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.Z,{color:"blue",size:"xs",children:s.transport}),(0,a.jsx)(m.Z,{color:"active"===s.status||"healthy"===s.status?"green":"inactive"===s.status||"unhealthy"===s.status?"red":"gray",size:"xs",children:s.status||"unknown"})]})]}),(null==s?void 0:s.description)&&(0,a.jsx)(u.Z,{className:"text-xs text-gray-600 mt-1",children:s.description}),(null==s?void 0:s.url)&&(0,a.jsx)(u.Z,{className:"text-xs text-gray-500 mt-1",children:s.url})]})},e)})})})]}),(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,a.jsx)("strong",{children:x.size})," MCP server",1!==x.size?"s":""," will be made public"]})})]});return(0,a.jsx)(n.Z,{title:"Make MCP Servers Public",open:s,onCancel:w,footer:null,width:1200,maskClosable:!1,children:(0,a.jsxs)(b.Z,{form:j,layout:"vertical",children:[(0,a.jsxs)(v.default,{current:c,className:"mb-6",children:[(0,a.jsx)(C,{title:"Select Servers"}),(0,a.jsx)(C,{title:"Confirm"})]}),(()=>{switch(c){case 0:return M();case 1:return z();default:return null}})(),(0,a.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,a.jsx)(f.ZP,{onClick:0===c?w:()=>{1===c&&o(0)},children:0===c?"Cancel":"Previous"}),(0,a.jsxs)("div",{className:"flex space-x-2",children:[0===c&&(0,a.jsx)(f.ZP,{onClick:()=>{if(0===c){if(0===x.size){k.Z.fromBackend("Please select at least one MCP server to make public");return}o(1)}},disabled:0===x.size,children:"Next"}),1===c&&(0,a.jsx)(f.ZP,{onClick:P,loading:p,children:"Make Public"})]})]})]})})},P=l(78801),M=e=>{let{modelHubData:s,onFilteredDataChange:l,showFiltersCard:t=!0,className:r=""}=e,[n,i]=(0,d.useState)(""),[c,o]=(0,d.useState)(""),[x,m]=(0,d.useState)(""),[h,u]=(0,d.useState)(""),p=(0,d.useRef)([]),g=(0,d.useMemo)(()=>(null==s?void 0:s.filter(e=>{let s=e.model_group.toLowerCase().includes(n.toLowerCase()),l=""===c||e.providers.includes(c),a=""===x||e.mode===x,t=""===h||Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).some(e=>{let[s]=e;return s.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")===h});return s&&l&&a&&t}))||[],[s,n,c,x,h]);(0,d.useEffect)(()=>{(g.length!==p.current.length||g.some((e,s)=>{var l;return e.model_group!==(null===(l=p.current[s])||void 0===l?void 0:l.model_group)}))&&(p.current=g,l(g))},[g,l]);let j=(0,a.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(P.x,{className:"text-sm font-medium mb-2",children:"Search Models:"}),(0,a.jsx)("input",{type:"text",placeholder:"Search model names...",value:n,onChange:e=>i(e.target.value),className:"border rounded px-3 py-2 w-64 h-10 text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(P.x,{className:"text-sm font-medium mb-2",children:"Provider:"}),(0,a.jsxs)("select",{value:c,onChange:e=>o(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-40 h-10",children:[(0,a.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Providers"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.providers.forEach(e=>s.add(e))}),Array.from(s)})(s).map(e=>(0,a.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(P.x,{className:"text-sm font-medium mb-2",children:"Mode:"}),(0,a.jsxs)("select",{value:x,onChange:e=>m(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-32 h-10",children:[(0,a.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Modes"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.mode&&s.add(e.mode)}),Array.from(s)})(s).map(e=>(0,a.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(P.x,{className:"text-sm font-medium mb-2",children:"Features:"}),(0,a.jsxs)("select",{value:h,onChange:e=>u(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-48 h-10",children:[(0,a.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Features"}),s&&(e=>{let s=new Set;return e.forEach(e=>{Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).forEach(e=>{let[l]=e,a=l.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");s.add(a)})}),Array.from(s).sort()})(s).map(e=>(0,a.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(n||c||x||h)&&(0,a.jsx)("div",{className:"flex items-end",children:(0,a.jsx)("button",{onClick:()=>{i(""),o(""),m(""),u("")},className:"text-blue-600 hover:text-blue-800 text-sm underline h-10 flex items-center",children:"Clear Filters"})})]});return t?(0,a.jsx)(P.Z,{className:"mb-6 ".concat(r),children:j}):(0,a.jsx)("div",{className:r,children:j})};let{Step:z}=v.default;var A=e=>{let{visible:s,onClose:l,accessToken:t,modelHubData:r,onSuccess:i}=e,[c,o]=(0,d.useState)(0),[x,h]=(0,d.useState)(new Set),[p,g]=(0,d.useState)([]),[j,w]=(0,d.useState)(!1),[Z]=b.Z.useForm(),C=()=>{o(0),h(new Set),g([]),Z.resetFields(),l()},S=(e,s)=>{let l=new Set(x);s?l.add(e):l.delete(e),h(l)},P=e=>{e?h(new Set(p.map(e=>e.model_group))):h(new Set)},A=(0,d.useCallback)(e=>{g(e)},[]);(0,d.useEffect)(()=>{s&&r.length>0&&(g(r),h(new Set(r.filter(e=>!0===e.is_public_model_group).map(e=>e.model_group))))},[s,r]);let F=async()=>{if(0===x.size){k.Z.fromBackend("Please select at least one model to make public");return}w(!0);try{let e=Array.from(x);await (0,_.makeModelGroupPublic)(t,e),k.Z.success("Successfully made ".concat(e.length," model group(s) public!")),C(),i()}catch(e){console.error("Error making model groups public:",e),k.Z.fromBackend("Failed to make model groups public. Please try again.")}finally{w(!1)}},L=()=>{let e=p.length>0&&p.every(e=>x.has(e.model_group)),s=x.size>0&&!e;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(y.Z,{children:"Select Models to Make Public"}),(0,a.jsx)("div",{className:"flex items-center space-x-2",children:(0,a.jsxs)(N.Z,{checked:e,indeterminate:s,onChange:e=>P(e.target.checked),disabled:0===p.length,children:["Select All ",p.length>0&&"(".concat(p.length,")")]})})]}),(0,a.jsx)(u.Z,{className:"text-sm text-gray-600",children:"Select the models you want to be visible on the public model hub. Users will still require a valid Virtual Key to use these models."}),(0,a.jsx)(M,{modelHubData:r,onFilteredDataChange:A,showFiltersCard:!1,className:"border rounded-lg p-4 bg-gray-50"}),(0,a.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,a.jsx)("div",{className:"space-y-3",children:0===p.length?(0,a.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,a.jsx)(u.Z,{children:"No models match the current filters."})}):p.map(e=>(0,a.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,a.jsx)(N.Z,{checked:x.has(e.model_group),onChange:s=>S(e.model_group,s.target.checked)}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:e.model_group}),e.mode&&(0,a.jsx)(m.Z,{color:"green",size:"sm",children:e.mode})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.providers.map(e=>(0,a.jsx)(m.Z,{color:"blue",size:"xs",children:e},e))})]})]},e.model_group))})}),x.size>0&&(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:[(0,a.jsx)("strong",{children:x.size})," model",1!==x.size?"s":""," selected"]})})]})},D=()=>(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(y.Z,{children:"Confirm Making Models Public"}),(0,a.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,a.jsxs)(u.Z,{className:"text-sm text-yellow-800",children:[(0,a.jsx)("strong",{children:"Warning:"})," Once you make these models public, anyone who can go to the"," ",(0,a.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:"Models to be made public:"}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,a.jsx)("div",{className:"space-y-2",children:Array.from(x).map(e=>{let s=r.find(s=>s.model_group===e);return(0,a.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(u.Z,{className:"font-medium",children:e}),s&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:s.providers.map(e=>(0,a.jsx)(m.Z,{color:"blue",size:"xs",children:e},e))})]})},e)})})})]}),(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,a.jsx)("strong",{children:x.size})," model",1!==x.size?"s":""," will be made public"]})})]});return(0,a.jsx)(n.Z,{title:"Make Models Public",open:s,onCancel:C,footer:null,width:1200,maskClosable:!1,children:(0,a.jsxs)(b.Z,{form:Z,layout:"vertical",children:[(0,a.jsxs)(v.default,{current:c,className:"mb-6",children:[(0,a.jsx)(z,{title:"Select Models"}),(0,a.jsx)(z,{title:"Confirm"})]}),(()=>{switch(c){case 0:return L();case 1:return D();default:return null}})(),(0,a.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,a.jsx)(f.ZP,{onClick:0===c?C:()=>{1===c&&o(0)},children:0===c?"Cancel":"Previous"}),(0,a.jsxs)("div",{className:"flex space-x-2",children:[0===c&&(0,a.jsx)(f.ZP,{onClick:()=>{if(0===c){if(0===x.size){k.Z.fromBackend("Please select at least one model to make public");return}o(1)}},disabled:0===x.size,children:"Next"}),1===c&&(0,a.jsx)(f.ZP,{onClick:F,loading:j,children:"Make Public"})]})]})]})})},F=l(8048);let L=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),D=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),O=e=>"$".concat((1e6*e).toFixed(2)),K=e=>e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString(),U=function(e,s){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[{header:"Public Model Name",accessorKey:"model_group",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,r=l.original;return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium text-sm",children:r.model_group}),(0,a.jsx)(p.Z,{title:"Copy model name",children:(0,a.jsx)(t.Z,{onClick:()=>s(r.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,a.jsx)("div",{className:"md:hidden",children:(0,a.jsx)(u.Z,{className:"text-xs text-gray-600",children:r.providers.join(", ")})})]})}},{header:"Provider",accessorKey:"providers",enableSorting:!0,sortingFn:(e,s)=>{let l=e.original.providers.join(", "),a=s.original.providers.join(", ");return l.localeCompare(a)},cell:e=>{let{row:s}=e,l=s.original;return(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.providers.slice(0,2).map(e=>(0,a.jsx)(g.Z,{color:"blue",className:"text-xs",children:e},e)),l.providers.length>2&&(0,a.jsxs)(u.Z,{className:"text-xs text-gray-500",children:["+",l.providers.length-2]})]})},meta:{className:"hidden md:table-cell"}},{header:"Mode",accessorKey:"mode",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return l.mode?(0,a.jsx)(m.Z,{color:"green",size:"sm",children:l.mode}):(0,a.jsx)(u.Z,{className:"text-gray-500",children:"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Tokens",accessorKey:"max_input_tokens",enableSorting:!0,sortingFn:(e,s)=>(e.original.max_input_tokens||0)+(e.original.max_output_tokens||0)-((s.original.max_input_tokens||0)+(s.original.max_output_tokens||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,a.jsx)("div",{className:"space-y-1",children:(0,a.jsxs)(u.Z,{className:"text-xs",children:[l.max_input_tokens?K(l.max_input_tokens):"-"," /"," ",l.max_output_tokens?K(l.max_output_tokens):"-"]})})},meta:{className:"hidden lg:table-cell"}},{header:"Cost/1M",accessorKey:"input_cost_per_token",enableSorting:!0,sortingFn:(e,s)=>(e.original.input_cost_per_token||0)+(e.original.output_cost_per_token||0)-((s.original.input_cost_per_token||0)+(s.original.output_cost_per_token||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)(u.Z,{className:"text-xs",children:l.input_cost_per_token?O(l.input_cost_per_token):"-"}),(0,a.jsx)(u.Z,{className:"text-xs text-gray-500",children:l.output_cost_per_token?O(l.output_cost_per_token):"-"})]})}},{header:"Features",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:s}=e,l=D(s.original),t=["green","blue","purple","orange","red","yellow"];return(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,a.jsx)(u.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map((e,s)=>(0,a.jsx)(m.Z,{color:t[s%t.length],size:"xs",children:L(e)},e))})}},{header:"Public",accessorKey:"is_public_model_group",enableSorting:!0,sortingFn:(e,s)=>(!0===e.original.is_public_model_group?1:0)-(!0===s.original.is_public_model_group?1:0),cell:e=>{let{row:s}=e;return!0===s.original.is_public_model_group?(0,a.jsx)(m.Z,{color:"green",size:"xs",children:"Yes"}):(0,a.jsx)(m.Z,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:s=>{let{row:l}=s,t=l.original;return(0,a.jsxs)(h.Z,{size:"xs",variant:"secondary",onClick:()=>e(t),icon:j.Z,children:[(0,a.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,a.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}];return l?r.filter(e=>!("accessorKey"in e)||"is_public_model_group"!==e.accessorKey):r};var E=l(87526),T=l(86462),H=l(47686),R=l(77355),B=l(93416),I=l(74998),Y=l(95704),V=e=>{let{accessToken:s,userRole:l}=e,[t,r]=(0,d.useState)([]),[i,c]=(0,d.useState)({url:"",displayName:""}),[o,m]=(0,d.useState)(null),[h,u]=(0,d.useState)(!1),[p,g]=(0,d.useState)(!0),j=async()=>{if(s)try{u(!0);let e=await (0,_.getPublicModelHubInfo)();if(e&&e.useful_links){let s=e.useful_links||{},l=Object.entries(s).map((e,s)=>{let[l,a]=e;return{id:"".concat(s,"-").concat(l),displayName:l,url:a}});r(l)}else r([])}catch(e){console.error("Error fetching useful links:",e),r([])}finally{u(!1)}};if((0,d.useEffect)(()=>{j()},[s]),!(0,x.tY)(l||""))return null;let v=async e=>{if(!s)return!1;try{let l={};return e.forEach(e=>{l[e.displayName]=e.url}),await (0,_.updateUsefulLinksCall)(s,l),n.Z.success({title:"Links Saved Successfully",content:(0,a.jsxs)("div",{className:"py-4",children:[(0,a.jsx)("p",{className:"text-gray-600 mb-4",children:"Your useful links have been saved and are now visible on the public model hub."}),(0,a.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-blue-800 mb-2 font-medium",children:"View your updated model hub:"}),(0,a.jsx)("a",{href:"".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table"),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-blue-600 hover:text-blue-800 underline text-sm font-medium",children:"Open Public Model Hub →"})]})]}),width:500,okText:"Close",maskClosable:!0,keyboard:!0}),!0}catch(e){return console.error("Error saving links:",e),k.Z.fromBackend("Failed to save links - ".concat(e)),!1}},b=async()=>{if(!i.url||!i.displayName)return;try{new URL(i.url)}catch(e){k.Z.fromBackend("Please enter a valid URL");return}if(t.some(e=>e.displayName===i.displayName)){k.Z.fromBackend("A link with this display name already exists");return}let e=[...t,{id:"".concat(Date.now(),"-").concat(i.displayName),displayName:i.displayName,url:i.url}];await v(e)&&(r(e),c({url:"",displayName:""}),k.Z.success("Link added successfully"))},N=e=>{m({...e})},f=async()=>{if(!o)return;try{new URL(o.url)}catch(e){k.Z.fromBackend("Please enter a valid URL");return}if(t.some(e=>e.id!==o.id&&e.displayName===o.displayName)){k.Z.fromBackend("A link with this display name already exists");return}let e=t.map(e=>e.id===o.id?o:e);await v(e)&&(r(e),m(null),k.Z.success("Link updated successfully"))},y=()=>{m(null)},w=async e=>{let s=t.filter(s=>s.id!==e);await v(s)&&(r(s),k.Z.success("Link deleted successfully"))},Z=e=>{window.open(e,"_blank")};return(0,a.jsxs)(Y.Zb,{className:"mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>g(!p),children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(Y.Dx,{className:"mb-0",children:"Link Management"}),(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Manage the links that are displayed under 'Useful Links' on the public model hub."})]}),(0,a.jsx)("div",{className:"flex items-center",children:p?(0,a.jsx)(T.Z,{className:"w-5 h-5 text-gray-500"}):(0,a.jsx)(H.Z,{className:"w-5 h-5 text-gray-500"})})]}),p&&(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(Y.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Link"}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"URL"}),(0,a.jsx)("input",{type:"text",value:i.url,onChange:e=>c({...i,url:e.target.value}),placeholder:"https://example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Display Name"}),(0,a.jsx)("input",{type:"text",value:i.displayName,onChange:e=>c({...i,displayName:e.target.value}),placeholder:"Friendly name",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,a.jsx)("div",{className:"flex items-end",children:(0,a.jsxs)("button",{onClick:b,disabled:!i.url||!i.displayName,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(i.url&&i.displayName?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,a.jsx)(R.Z,{className:"w-4 h-4 mr-1"}),"Add Link"]})})]})]}),(0,a.jsx)(Y.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Links"}),(0,a.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)(Y.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,a.jsx)(Y.ss,{children:(0,a.jsxs)(Y.SC,{children:[(0,a.jsx)(Y.xs,{className:"py-1 h-8",children:"Display Name"}),(0,a.jsx)(Y.xs,{className:"py-1 h-8",children:"URL"}),(0,a.jsx)(Y.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,a.jsxs)(Y.RM,{children:[t.map(e=>(0,a.jsx)(Y.SC,{className:"h-8",children:o&&o.id===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Y.pj,{className:"py-0.5",children:(0,a.jsx)("input",{type:"text",value:o.displayName,onChange:e=>m({...o,displayName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,a.jsx)(Y.pj,{className:"py-0.5",children:(0,a.jsx)("input",{type:"text",value:o.url,onChange:e=>m({...o,url:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,a.jsx)(Y.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:f,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,a.jsx)("button",{onClick:y,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Y.pj,{className:"py-0.5 text-sm text-gray-900",children:e.displayName}),(0,a.jsx)(Y.pj,{className:"py-0.5 text-sm text-gray-500",children:e.url}),(0,a.jsx)(Y.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>Z(e.url),className:"text-xs bg-green-50 text-green-600 px-2 py-1 rounded hover:bg-green-100",children:"Use"}),(0,a.jsx)("button",{onClick:()=>N(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,a.jsx)(B.Z,{className:"w-3 h-3"})}),(0,a.jsx)("button",{onClick:()=>w(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,a.jsx)(I.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===t.length&&(0,a.jsx)(Y.SC,{children:(0,a.jsx)(Y.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No links added yet. Add a new link above."})})]})]})})})]})]})},W=e=>{var s,l,v,b;let{accessToken:N,publicPage:f,premiumUser:y,userRole:w}=e,[C,P]=(0,d.useState)(!1),[z,L]=(0,d.useState)(null),[D,O]=(0,d.useState)(!0),[K,T]=(0,d.useState)(!1),[H,R]=(0,d.useState)(!1),[B,I]=(0,d.useState)(null),[Y,W]=(0,d.useState)([]),[q,G]=(0,d.useState)(!1),[J,$]=(0,d.useState)(null),[Q,X]=(0,d.useState)(!1),[ee,es]=(0,d.useState)(!0),[el,ea]=(0,d.useState)(null),[et,er]=(0,d.useState)(!1),[en,ei]=(0,d.useState)(null),[ec,ed]=(0,d.useState)(!0),[eo,ex]=(0,d.useState)(null),[em,eh]=(0,d.useState)(!1),[eu,ep]=(0,d.useState)(!1),eg=(0,c.useRouter)(),ej=(0,d.useRef)(null),ev=(0,d.useRef)(null),eb=(0,d.useRef)(null);(0,d.useEffect)(()=>{let e=async e=>{try{O(!0);let s=await (0,_.modelHubCall)(e);console.log("ModelHubData:",s),L(s.data),(0,_.getConfigFieldSetting)(e,"enable_public_model_hub").then(e=>{console.log("data: ".concat(JSON.stringify(e))),!0==e.field_value&&P(!0)}).catch(e=>{})}catch(e){console.error("There was an error fetching the model data",e)}finally{O(!1)}},s=async()=>{try{var e,s;O(!0),await (0,_.getUiConfig)();let l=await (0,_.modelHubPublicModelsCall)();console.log("ModelHubData:",l),console.log("First model structure:",l[0]),console.log("Model has model_group?",null===(e=l[0])||void 0===e?void 0:e.model_group),console.log("Model has providers?",null===(s=l[0])||void 0===s?void 0:s.providers),L(l),P(!0)}catch(e){console.error("There was an error fetching the public model data",e)}finally{O(!1)}};N?e(N):f&&s()},[N,f]),(0,d.useEffect)(()=>{let e=async()=>{if(N)try{es(!0);let e=await (0,_.getAgentsList)(N);console.log("AgentHubData:",e);let s=e.agents.map(e=>({agent_id:e.agent_id,...e.agent_card_params,is_public:e.litellm_params.is_public}));$(s)}catch(e){console.error("There was an error fetching the agent data",e)}finally{es(!1)}};f||e()},[f,N]),(0,d.useEffect)(()=>{let e=async()=>{if(N)try{ed(!0);let e=await (0,_.fetchMCPServers)(N);console.log("MCPHubData:",e),ei(e)}catch(e){console.error("There was an error fetching the MCP server data",e)}finally{ed(!1)}};f||e()},[f,N]);let eN=()=>{N&&G(!0)},ef=()=>{N&&X(!0)},ey=()=>{N&&ep(!0)},e_=()=>{T(!1),R(!1),I(null),er(!1),ea(null),eh(!1),ex(null)},ek=()=>{T(!1),R(!1),I(null),er(!1),ea(null),eh(!1),ex(null)},ew=e=>{navigator.clipboard.writeText(e),k.Z.success("Copied to clipboard!")},eZ=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),eC=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),eS=e=>"$".concat((1e6*e).toFixed(2)),eP=(0,d.useCallback)(e=>{W(e)},[]);return(console.log("publicPage: ",f),console.log("publicPageAllowed: ",C),f&&C)?(0,a.jsx)(E.Z,{accessToken:N}):(0,a.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[!1==f?(0,a.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,a.jsxs)("div",{className:"flex flex-col items-start",children:[(0,a.jsx)(r.Dx,{className:"text-center",children:"AI Hub"}),(0,x.tY)(w||"")?(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Make models, agents, and MCP servers public for developers to know what's available."}):(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"A list of all public model names personally available to you."})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsx)(r.xv,{children:"Model Hub URL:"}),(0,a.jsxs)("div",{className:"flex items-center bg-gray-200 px-2 py-1 rounded",children:[(0,a.jsx)(r.xv,{className:"mr-2",children:"".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table")}),(0,a.jsx)("button",{onClick:()=>ew("".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table")),className:"p-1 hover:bg-gray-300 rounded transition-colors",title:"Copy URL",children:(0,a.jsx)(i.Z,{size:16,className:"text-gray-600"})})]})]})]}),(0,x.tY)(w||"")&&(0,a.jsx)("div",{className:"mt-8 mb-2",children:(0,a.jsx)(V,{accessToken:N,userRole:w})}),(0,a.jsxs)(r.v0,{children:[(0,a.jsxs)(r.td,{className:"mb-4",children:[(0,a.jsx)(r.OK,{children:"Model Hub"}),(0,a.jsx)(r.OK,{children:"Agent Hub"}),(0,a.jsx)(r.OK,{children:"MCP Hub"})]}),(0,a.jsxs)(r.nP,{children:[(0,a.jsxs)(r.x4,{children:[(0,a.jsxs)(r.Zb,{children:[!1==f&&(0,x.tY)(w||"")&&(0,a.jsx)("div",{className:"flex justify-end mb-4",children:(0,a.jsx)(r.zx,{onClick:()=>eN(),children:"Select Models to Make Public"})}),(0,a.jsx)(M,{modelHubData:z||[],onFilteredDataChange:eP}),(0,a.jsx)(F.C,{columns:U(e=>{I(e),T(!0)},ew,f),data:Y,isLoading:D,table:ej,defaultSorting:[{id:"model_group",desc:!1}]})]}),(0,a.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,a.jsxs)(r.xv,{className:"text-sm text-gray-600",children:["Showing ",Y.length," of ",(null==z?void 0:z.length)||0," models"]})})]}),(0,a.jsxs)(r.x4,{children:[(0,a.jsxs)(r.Zb,{children:[!1==f&&(0,x.tY)(w||"")&&(0,a.jsx)("div",{className:"flex justify-end mb-4",children:(0,a.jsx)(r.zx,{onClick:()=>ef(),children:"Select Agents to Make Public"})}),(0,a.jsx)(F.C,{columns:function(e,s){return arguments.length>2&&void 0!==arguments[2]&&arguments[2],[{header:"Agent Name",accessorKey:"name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,r=l.original;return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium text-sm",children:r.name}),(0,a.jsx)(p.Z,{title:"Copy agent name",children:(0,a.jsx)(t.Z,{onClick:()=>s(r.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,a.jsx)("div",{className:"md:hidden",children:(0,a.jsx)(u.Z,{className:"text-xs text-gray-600",children:r.description})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,a.jsx)(u.Z,{className:"text-xs line-clamp-2",children:l.description||"-"})},meta:{className:"hidden md:table-cell"}},{header:"Version",accessorKey:"version",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,a.jsxs)(m.Z,{color:"blue",size:"sm",children:["v",l.version]})},meta:{className:"hidden lg:table-cell"}},{header:"Protocol",accessorKey:"protocolVersion",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,a.jsx)(u.Z,{className:"text-xs",children:l.protocolVersion||"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Skills",accessorKey:"skills",enableSorting:!1,cell:e=>{let{row:s}=e,l=s.original.skills||[];return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)(u.Z,{className:"text-xs font-medium",children:[l.length," skill",1!==l.length?"s":""]}),l.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,2).map(e=>(0,a.jsx)(g.Z,{color:"purple",className:"text-xs",children:e.name},e.id)),l.length>2&&(0,a.jsxs)(u.Z,{className:"text-xs text-gray-500",children:["+",l.length-2]})]})]})}},{header:"Capabilities",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:s}=e,l=Object.entries(s.original.capabilities||{}).filter(e=>{let[s,l]=e;return!0===l}).map(e=>{let[s]=e;return s});return(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,a.jsx)(u.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map(e=>(0,a.jsx)(m.Z,{color:"green",size:"xs",children:e},e))})}},{header:"I/O Modes",accessorKey:"defaultInputModes",enableSorting:!1,cell:e=>{let{row:s}=e,l=s.original,t=l.defaultInputModes||[],r=l.defaultOutputModes||[];return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)(u.Z,{className:"text-xs",children:[(0,a.jsx)("span",{className:"font-medium",children:"In:"})," ",t.join(", ")||"-"]}),(0,a.jsxs)(u.Z,{className:"text-xs",children:[(0,a.jsx)("span",{className:"font-medium",children:"Out:"})," ",r.join(", ")||"-"]})]})},meta:{className:"hidden xl:table-cell"}},{header:"Public",accessorKey:"is_public",enableSorting:!0,sortingFn:(e,s)=>(!0===e.original.is_public?1:0)-(!0===s.original.is_public?1:0),cell:e=>{let{row:s}=e;return console.log("CHECKPOINT 1: ".concat(JSON.stringify(s.original))),!0===s.original.is_public?(0,a.jsx)(m.Z,{color:"green",size:"xs",children:"Yes"}):(0,a.jsx)(m.Z,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:s=>{let{row:l}=s,t=l.original;return(0,a.jsxs)(h.Z,{size:"xs",variant:"secondary",onClick:()=>e(t),icon:j.Z,children:[(0,a.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,a.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}]}(e=>{ea(e),er(!0)},ew,f),data:J||[],isLoading:ee,table:ev,defaultSorting:[{id:"name",desc:!1}]})]}),(0,a.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,a.jsxs)(r.xv,{className:"text-sm text-gray-600",children:["Showing ",(null==J?void 0:J.length)||0," agent",(null==J?void 0:J.length)!==1?"s":""]})})]}),(0,a.jsxs)(r.x4,{children:[(0,a.jsxs)(r.Zb,{children:[!1==f&&(0,x.tY)(w||"")&&(0,a.jsx)("div",{className:"flex justify-end mb-4",children:(0,a.jsx)(r.zx,{onClick:()=>ey(),children:"Select MCP Servers to Make Public"})}),(0,a.jsx)(F.C,{columns:function(e,s){return arguments.length>2&&void 0!==arguments[2]&&arguments[2],[{header:"Server Name",accessorKey:"server_name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,r=l.original;return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium text-sm",children:r.server_name}),(0,a.jsx)(p.Z,{title:"Copy server name",children:(0,a.jsx)(t.Z,{onClick:()=>s(r.server_name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,a.jsx)("div",{className:"md:hidden",children:(0,a.jsx)(u.Z,{className:"text-xs text-gray-600",children:r.description||"-"})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,a.jsx)(u.Z,{className:"text-xs line-clamp-2",children:l.description||"-"})},meta:{className:"hidden md:table-cell"}},{header:"URL",accessorKey:"url",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,r=l.original;return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"text-xs truncate max-w-xs",children:r.url}),(0,a.jsx)(p.Z,{title:"Copy URL",children:(0,a.jsx)(t.Z,{onClick:()=>s(r.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:e=>{let{row:s}=e,l=s.original;return(0,a.jsx)(m.Z,{color:"blue",size:"sm",children:l.transport})},meta:{className:"hidden md:table-cell"}},{header:"Auth Type",accessorKey:"auth_type",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original,t="none"===l.auth_type?"gray":"green";return(0,a.jsx)(m.Z,{color:t,size:"sm",children:l.auth_type})},meta:{className:"hidden md:table-cell"}},{header:"Status",accessorKey:"status",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original,t={active:"green",inactive:"red",unknown:"gray",healthy:"green",unhealthy:"red"}[l.status]||"gray";return(0,a.jsx)(m.Z,{color:t,size:"sm",children:l.status||"unknown"})}},{header:"Tools",accessorKey:"allowed_tools",enableSorting:!1,cell:e=>{let{row:s}=e,l=s.original.allowed_tools||[];return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)(u.Z,{className:"text-xs font-medium",children:l.length>0?"".concat(l.length," tool").concat(1!==l.length?"s":""):"All tools"}),l.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,2).map((e,s)=>(0,a.jsx)(g.Z,{color:"purple",className:"text-xs",children:e},s)),l.length>2&&(0,a.jsxs)(u.Z,{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:e=>{let{row:s}=e,l=s.original;return(0,a.jsx)(u.Z,{className:"text-xs",children:l.created_by||"-"})},meta:{className:"hidden xl:table-cell"}},{header:"Public",accessorKey:"mcp_info.is_public",enableSorting:!0,sortingFn:(e,s)=>{var l,a;return((null===(l=e.original.mcp_info)||void 0===l?void 0:l.is_public)===!0?1:0)-((null===(a=s.original.mcp_info)||void 0===a?void 0:a.is_public)===!0?1:0)},cell:e=>{var s;let{row:l}=e;return(null===(s=l.original.mcp_info)||void 0===s?void 0:s.is_public)===!0?(0,a.jsx)(m.Z,{color:"green",size:"xs",children:"Yes"}):(0,a.jsx)(m.Z,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:s=>{let{row:l}=s,t=l.original;return(0,a.jsxs)(h.Z,{size:"xs",variant:"secondary",onClick:()=>e(t),icon:j.Z,children:[(0,a.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,a.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}]}(e=>{ex(e),eh(!0)},ew,f),data:en||[],isLoading:ec,table:eb,defaultSorting:[{id:"server_name",desc:!1}]})]}),(0,a.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,a.jsxs)(r.xv,{className:"text-sm text-gray-600",children:["Showing ",(null==en?void 0:en.length)||0," MCP server",(null==en?void 0:en.length)!==1?"s":""]})})]})]})]})]}):(0,a.jsxs)(r.Zb,{className:"mx-auto max-w-xl mt-10",children:[(0,a.jsx)(r.xv,{className:"text-xl text-center mb-2 text-black",children:"Public Model Hub not enabled."}),(0,a.jsx)("p",{className:"text-base text-center text-slate-800",children:"Ask your proxy admin to enable this on their Admin UI."})]}),(0,a.jsx)(n.Z,{title:"Public Model Hub",width:600,visible:H,footer:null,onOk:e_,onCancel:ek,children:(0,a.jsxs)("div",{className:"pt-5 pb-5",children:[(0,a.jsxs)("div",{className:"flex justify-between mb-4",children:[(0,a.jsx)(r.xv,{className:"text-base mr-2",children:"Shareable Link:"}),(0,a.jsx)(r.xv,{className:"max-w-sm ml-2 bg-gray-200 pr-2 pl-2 pt-1 pb-1 text-center rounded",children:"".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table")})]}),(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)(r.zx,{onClick:()=>{eg.replace("/model_hub_table?key=".concat(N))},children:"See Page"})})]})}),(0,a.jsx)(n.Z,{title:(null==B?void 0:B.model_group)||"Model Details",width:1e3,visible:K,footer:null,onOk:e_,onCancel:ek,children:B&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Model Overview"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Model Group:"}),(0,a.jsx)(r.xv,{children:B.model_group})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Mode:"}),(0,a.jsx)(r.xv,{children:B.mode||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Providers:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:B.providers.map(e=>(0,a.jsx)(r.Ct,{color:"blue",children:e},e))})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Token & Cost Information"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Max Input Tokens:"}),(0,a.jsx)(r.xv,{children:(null===(s=B.max_input_tokens)||void 0===s?void 0:s.toLocaleString())||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Max Output Tokens:"}),(0,a.jsx)(r.xv,{children:(null===(l=B.max_output_tokens)||void 0===l?void 0:l.toLocaleString())||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,a.jsx)(r.xv,{children:B.input_cost_per_token?eS(B.input_cost_per_token):"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,a.jsx)(r.xv,{children:B.output_cost_per_token?eS(B.output_cost_per_token):"Not specified"})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=eC(B),s=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,a.jsx)(r.xv,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,l)=>(0,a.jsx)(r.Ct,{color:s[l%s.length],children:eZ(e)},e))})()})]}),(B.tpm||B.rpm)&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[B.tpm&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Tokens per Minute:"}),(0,a.jsx)(r.xv,{children:B.tpm.toLocaleString()})]}),B.rpm&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Requests per Minute:"}),(0,a.jsx)(r.xv,{children:B.rpm.toLocaleString()})]})]})]}),B.supported_openai_params&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:B.supported_openai_params.map(e=>(0,a.jsx)(r.Ct,{color:"green",children:e},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,a.jsx)(o.Z,{language:"python",className:"text-sm",children:'import openai\n\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="http://0.0.0.0:4000" # Your LiteLLM Proxy URL\n)\n\nresponse = client.chat.completions.create(\n model="'.concat(B.model_group,'",\n messages=[\n {\n "role": "user",\n "content": "Hello, how are you?"\n }\n ]\n)\n\nprint(response.choices[0].message.content)')})]})]})}),(0,a.jsx)(n.Z,{title:(null==el?void 0:el.name)||"Agent Details",width:1e3,visible:et,footer:null,onOk:e_,onCancel:ek,children:el&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Agent Overview"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Name:"}),(0,a.jsx)(r.xv,{children:el.name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Version:"}),(0,a.jsxs)(r.Ct,{color:"blue",children:["v",el.version]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Protocol Version:"}),(0,a.jsx)(r.xv,{children:el.protocolVersion})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"URL:"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(r.xv,{className:"truncate",children:el.url}),(0,a.jsx)(t.Z,{onClick:()=>ew(el.url),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Description:"}),(0,a.jsx)(r.xv,{className:"mt-1",children:el.description})]})]}),el.capabilities&&Object.keys(el.capabilities).length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(el.capabilities).filter(e=>{let[s,l]=e;return!0===l}).map(e=>{let[s]=e;return(0,a.jsx)(r.Ct,{color:"green",children:s},s)})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Input/Output Modes"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Input Modes:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(null===(v=el.defaultInputModes)||void 0===v?void 0:v.map(e=>(0,a.jsx)(r.Ct,{color:"blue",children:e},e)))||(0,a.jsx)(r.xv,{children:"Not specified"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Output Modes:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(null===(b=el.defaultOutputModes)||void 0===b?void 0:b.map(e=>(0,a.jsx)(r.Ct,{color:"purple",children:e},e)))||(0,a.jsx)(r.xv,{children:"Not specified"})})]})]})]}),el.skills&&el.skills.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Skills"}),(0,a.jsx)("div",{className:"space-y-4",children:el.skills.map(e=>(0,a.jsxs)("div",{className:"border border-gray-200 rounded p-4",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium text-base",children:e.name}),(0,a.jsxs)(r.xv,{className:"text-xs text-gray-500",children:["ID: ",e.id]})]}),e.tags&&e.tags.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:e.tags.map(e=>(0,a.jsx)(r.Ct,{color:"purple",size:"xs",children:e},e))})]}),(0,a.jsx)(r.xv,{className:"text-sm mb-2",children:e.description}),e.examples&&e.examples.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-xs font-medium text-gray-700",children:"Examples:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.examples.map((e,s)=>(0,a.jsx)(r.Ct,{color:"gray",size:"xs",children:e},s))})]})]},e.id))})]}),el.supportsAuthenticatedExtendedCard&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Additional Features"}),(0,a.jsx)(r.Ct,{color:"green",children:"Supports Authenticated Extended Card"})]})]})}),(0,a.jsx)(n.Z,{title:(null==eo?void 0:eo.server_name)||"MCP Server Details",width:1e3,visible:em,footer:null,onOk:e_,onCancel:ek,children:eo&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Server Overview"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Server Name:"}),(0,a.jsx)(r.xv,{children:eo.server_name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Server ID:"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(r.xv,{className:"text-xs truncate",children:eo.server_id}),(0,a.jsx)(t.Z,{onClick:()=>ew(eo.server_id),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]}),eo.alias&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Alias:"}),(0,a.jsx)(r.xv,{children:eo.alias})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Transport:"}),(0,a.jsx)(r.Ct,{color:"blue",children:eo.transport})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Auth Type:"}),(0,a.jsx)(r.Ct,{color:"none"===eo.auth_type?"gray":"green",children:eo.auth_type})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Status:"}),(0,a.jsx)(r.Ct,{color:"active"===eo.status||"healthy"===eo.status?"green":"inactive"===eo.status||"unhealthy"===eo.status?"red":"gray",children:eo.status||"unknown"})]})]}),eo.description&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Description:"}),(0,a.jsx)(r.xv,{className:"mt-1",children:eo.description})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Connection Details"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"URL:"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2 mt-1",children:[(0,a.jsx)(r.xv,{className:"text-sm break-all bg-gray-100 p-2 rounded flex-1",children:eo.url}),(0,a.jsx)(t.Z,{onClick:()=>ew(eo.url),className:"cursor-pointer text-gray-500 hover:text-blue-500 flex-shrink-0"})]})]}),eo.command&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Command:"}),(0,a.jsx)(r.xv,{className:"text-sm bg-gray-100 p-2 rounded mt-1 font-mono",children:eo.command})]})]})]}),eo.allowed_tools&&eo.allowed_tools.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Allowed Tools"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.allowed_tools.map((e,s)=>(0,a.jsx)(r.Ct,{color:"purple",children:e},s))})]}),eo.teams&&eo.teams.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Teams"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.teams.map((e,s)=>(0,a.jsx)(r.Ct,{color:"blue",children:e},s))})]}),eo.mcp_access_groups&&eo.mcp_access_groups.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Access Groups"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.mcp_access_groups.map((e,s)=>(0,a.jsx)(r.Ct,{color:"green",children:e},s))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Metadata"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Created By:"}),(0,a.jsx)(r.xv,{children:eo.created_by})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Updated By:"}),(0,a.jsx)(r.xv,{children:eo.updated_by})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Created At:"}),(0,a.jsx)(r.xv,{className:"text-sm",children:new Date(eo.created_at).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Updated At:"}),(0,a.jsx)(r.xv,{className:"text-sm",children:new Date(eo.updated_at).toLocaleString()})]}),eo.last_health_check&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Last Health Check:"}),(0,a.jsx)(r.xv,{className:"text-sm",children:new Date(eo.last_health_check).toLocaleString()})]})]}),eo.health_check_error&&(0,a.jsxs)("div",{className:"mt-2 p-2 bg-red-50 rounded",children:[(0,a.jsx)(r.xv,{className:"font-medium text-red-700",children:"Health Check Error:"}),(0,a.jsx)(r.xv,{className:"text-sm text-red-600 mt-1",children:eo.health_check_error})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,a.jsx)(o.Z,{language:"python",className:"text-sm",children:'from fastmcp import Client\nimport asyncio\n\n# Standard MCP configuration\nconfig = {\n "mcpServers": {\n "'.concat(eo.server_name,'": {\n "url": "http://localhost:4000/').concat(eo.server_name,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer sk-1234"\n }\n }\n }\n}\n\n# Create a client that connects to the server\nclient = Client(config)\n\nasync def main():\n async with client:\n # List available tools\n tools = await client.list_tools()\n print(f"Available tools: {[tool.name for tool in tools]}")\n\n # Call a tool\n response = await client.call_tool(\n name="tool_name", \n arguments={"arg": "value"}\n )\n print(f"Response: {response}")\n\nif __name__ == "__main__":\n asyncio.run(main())')})]})]})}),(0,a.jsx)(A,{visible:q,onClose:()=>G(!1),accessToken:N||"",modelHubData:z||[],onSuccess:()=>{N&&(async()=>{try{let e=await (0,_.modelHubCall)(N);L(e.data)}catch(e){console.error("Error refreshing model data:",e)}})()}}),(0,a.jsx)(Z,{visible:Q,onClose:()=>X(!1),accessToken:N||"",agentHubData:J||[],onSuccess:()=>{N&&(async()=>{try{let e=(await (0,_.getAgentsList)(N)).agents.map(e=>({agent_id:e.agent_id,...e.agent_card_params,is_public:e.is_public}));$(e)}catch(e){console.error("Error refreshing agent data:",e)}})()}}),(0,a.jsx)(S,{visible:eu,onClose:()=>ep(!1),accessToken:N||"",mcpHubData:en||[],onSuccess:()=>{N&&(async()=>{try{let e=await (0,_.fetchMCPServers)(N);ei(e)}catch(e){console.error("Error refreshing MCP server data:",e)}})()}})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2249-9e9f1d322e7f71ec.js b/litellm/proxy/_experimental/out/_next/static/chunks/2249-9e9f1d322e7f71ec.js new file mode 100644 index 00000000000..6af2e20a84c --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2249-9e9f1d322e7f71ec.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2249],{64748:function(e,s,l){l.d(s,{Ct:function(){return t.Z},Dx:function(){return m.Z},OK:function(){return n.Z},Zb:function(){return r.Z},nP:function(){return o.Z},td:function(){return c.Z},v0:function(){return i.Z},x4:function(){return d.Z},xv:function(){return x.Z},zx:function(){return a.Z}});var t=l(41649),a=l(78489),r=l(12514),n=l(12485),i=l(18135),c=l(35242),d=l(29706),o=l(77991),x=l(84264),m=l(96761)},78801:function(e,s,l){l.d(s,{Z:function(){return t.Z},x:function(){return a.Z}});var t=l(12514),a=l(84264)},58927:function(e,s,l){l.d(s,{J:function(){return t.Z}});var t=l(47323)},39957:function(e,s,l){l.d(s,{Z:function(){return g}});var t=l(57437),a=l(53410),r=l(74998),n=l(91126),i=l(23628),c=l(44633),d=l(86462),o=l(3477),x=l(99981),m=l(10012),u=l(58927);function h(e){let{icon:s,onClick:l,className:a,disabled:r,dataTestId:n}=e;return r?(0,t.jsx)(u.J,{icon:s,size:"sm",className:"opacity-50 cursor-not-allowed","data-testid":n}):(0,t.jsx)(u.J,{icon:s,size:"sm",onClick:l,className:(0,m.cx)("cursor-pointer",a),"data-testid":n})}l(2265);let p={Edit:{icon:a.Z,className:"hover:text-blue-600"},Delete:{icon:r.Z,className:"hover:text-red-600"},Test:{icon:n.Z,className:"hover:text-blue-600"},Regenerate:{icon:i.Z,className:"hover:text-green-600"},Up:{icon:c.Z,className:"hover:text-blue-600"},Down:{icon:d.Z,className:"hover:text-blue-600"},Open:{icon:o.Z,className:"hover:text-green-600"}};function g(e){let{onClick:s,tooltipText:l,disabled:a=!1,disabledTooltipText:r,dataTestId:n,variant:i}=e,{icon:c,className:d}=p[i];return(0,t.jsx)(x.Z,{title:a?r:l,children:(0,t.jsx)("span",{children:(0,t.jsx)(h,{icon:c,onClick:s,className:d,disabled:a,dataTestId:n})})})}},92249:function(e,s,l){l.d(s,{Z:function(){return V}});var t=l(57437),a=l(23639),r=l(64748),n=l(22116),i=l(78867),c=l(99376),d=l(2265),o=l(17906),x=l(20347),m=l(41649),u=l(78489),h=l(84264),p=l(99981),g=l(3810),j=l(15424),v=l(15690),b=l(10032),f=l(4156),N=l(5545),y=l(96761),_=l(19250),k=l(9114);let{Step:w}=v.default;var Z=e=>{let{visible:s,onClose:l,accessToken:a,agentHubData:r,onSuccess:i}=e,[c,o]=(0,d.useState)(0),[x,u]=(0,d.useState)(new Set),[p,g]=(0,d.useState)(!1),[j]=b.Z.useForm(),Z=()=>{o(0),u(new Set),j.resetFields(),l()},C=(e,s)=>{let l=new Set(x);s?l.add(e):l.delete(e),u(l)},S=e=>{e?u(new Set(r.map(e=>e.agent_id||e.name))):u(new Set)};(0,d.useEffect)(()=>{s&&r.length>0&&u(new Set(r.filter(e=>!0===e.is_public).map(e=>e.agent_id||e.name)))},[s,r]);let M=async()=>{if(0===x.size){k.Z.fromBackend("Please select at least one agent to make public");return}g(!0);try{let e=Array.from(x);await (0,_.makeAgentsPublicCall)(a,e),k.Z.success("Successfully made ".concat(e.length," agent(s) public!")),Z(),i()}catch(e){console.error("Error making agents public:",e),k.Z.fromBackend("Failed to make agents public. Please try again.")}finally{g(!1)}},P=()=>{let e=r.length>0&&r.every(e=>x.has(e.agent_id||e.name)),s=x.size>0&&!e;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(y.Z,{children:"Select Agents to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(f.Z,{checked:e,indeterminate:s,onChange:e=>S(e.target.checked),disabled:0===r.length,children:["Select All ",r.length>0&&"(".concat(r.length,")")]})})]}),(0,t.jsx)(h.Z,{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===r.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(h.Z,{children:"No agents available."})}):r.map(e=>{let s=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)(f.Z,{checked:x.has(s),onChange:e=>C(s,e.target.checked)}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(h.Z,{className:"font-medium",children:e.name}),(0,t.jsxs)(m.Z,{color:"blue",size:"sm",children:["v",e.version]})]}),(0,t.jsx)(h.Z,{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.Z,{color:"purple",size:"xs",children:e.name},e.id)),e.skills.length>3&&(0,t.jsxs)(h.Z,{className:"text-xs text-gray-500",children:["+",e.skills.length-3," more"]})]})]})]},s)})})}),x.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(h.Z,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:x.size})," agent",1!==x.size?"s":""," selected"]})})]})},z=()=>(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(y.Z,{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)(h.Z,{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)(h.Z,{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(x).map(e=>{let s=r.find(s=>(s.agent_id||s.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)(h.Z,{className:"font-medium",children:(null==s?void 0:s.name)||e}),s&&(0,t.jsxs)(m.Z,{color:"blue",size:"xs",children:["v",s.version]})]}),(null==s?void 0:s.description)&&(0,t.jsx)(h.Z,{className:"text-xs text-gray-600 mt-1",children:s.description})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(h.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:x.size})," agent",1!==x.size?"s":""," will be made public"]})})]});return(0,t.jsx)(n.Z,{title:"Make Agents Public",open:s,onCancel:Z,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(b.Z,{form:j,layout:"vertical",children:[(0,t.jsxs)(v.default,{current:c,className:"mb-6",children:[(0,t.jsx)(w,{title:"Select Agents"}),(0,t.jsx)(w,{title:"Confirm"})]}),(()=>{switch(c){case 0:return P();case 1:return z();default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(N.ZP,{onClick:0===c?Z:()=>{1===c&&o(0)},children:0===c?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===c&&(0,t.jsx)(N.ZP,{onClick:()=>{if(0===c){if(0===x.size){k.Z.fromBackend("Please select at least one agent to make public");return}o(1)}},disabled:0===x.size,children:"Next"}),1===c&&(0,t.jsx)(N.ZP,{onClick:M,loading:p,children:"Make Public"})]})]})]})})};let{Step:C}=v.default;var S=e=>{let{visible:s,onClose:l,accessToken:a,mcpHubData:r,onSuccess:i}=e,[c,o]=(0,d.useState)(0),[x,u]=(0,d.useState)(new Set),[p,g]=(0,d.useState)(!1),[j]=b.Z.useForm(),w=()=>{o(0),u(new Set),j.resetFields(),l()},Z=(e,s)=>{let l=new Set(x);s?l.add(e):l.delete(e),u(l)},S=e=>{e?u(new Set(r.map(e=>e.server_id))):u(new Set)};(0,d.useEffect)(()=>{s&&r.length>0&&u(new Set(r.filter(e=>{var s;return(null===(s=e.mcp_info)||void 0===s?void 0:s.is_public)===!0}).map(e=>e.server_id)))},[s]);let M=async()=>{if(0===x.size){k.Z.fromBackend("Please select at least one MCP server to make public");return}g(!0);try{let e=Array.from(x);await (0,_.makeMCPPublicCall)(a,e),k.Z.success("Successfully made ".concat(e.length," MCP server(s) public!")),w(),i()}catch(e){console.error("Error making MCP servers public:",e),k.Z.fromBackend("Failed to make MCP servers public. Please try again.")}finally{g(!1)}},P=()=>{let e=r.length>0&&r.every(e=>x.has(e.server_id)),s=x.size>0&&!e;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(y.Z,{children:"Select MCP Servers to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(f.Z,{checked:e,indeterminate:s,onChange:e=>S(e.target.checked),disabled:0===r.length,children:["Select All ",r.length>0&&"(".concat(r.length,")")]})})]}),(0,t.jsx)(h.Z,{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===r.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(h.Z,{children:"No MCP servers available."})}):r.map(e=>{var s;let l=(null===(s=e.mcp_info)||void 0===s?void 0:s.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)(f.Z,{checked:x.has(e.server_id),onChange:s=>Z(e.server_id,s.target.checked)}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(h.Z,{className:"font-medium",children:e.server_name}),l&&(0,t.jsx)(m.Z,{color:"emerald",size:"sm",children:"Public"}),(0,t.jsx)(m.Z,{color:"blue",size:"sm",children:e.transport}),(0,t.jsx)(m.Z,{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)(h.Z,{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,s)=>(0,t.jsx)(m.Z,{color:"purple",size:"xs",children:e},s)),e.allowed_tools.length>3&&(0,t.jsxs)(h.Z,{className:"text-xs text-gray-500",children:["+",e.allowed_tools.length-3," more"]})]})]})]},e.server_id)})})}),x.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(h.Z,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:x.size})," MCP server",1!==x.size?"s":""," selected"]})})]})},z=()=>(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(y.Z,{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)(h.Z,{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)(h.Z,{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(x).map(e=>{let s=r.find(s=>s.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)(h.Z,{className:"font-medium",children:(null==s?void 0:s.server_name)||e}),s&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.Z,{color:"blue",size:"xs",children:s.transport}),(0,t.jsx)(m.Z,{color:"active"===s.status||"healthy"===s.status?"green":"inactive"===s.status||"unhealthy"===s.status?"red":"gray",size:"xs",children:s.status||"unknown"})]})]}),(null==s?void 0:s.description)&&(0,t.jsx)(h.Z,{className:"text-xs text-gray-600 mt-1",children:s.description}),(null==s?void 0:s.url)&&(0,t.jsx)(h.Z,{className:"text-xs text-gray-500 mt-1",children:s.url})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(h.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:x.size})," MCP server",1!==x.size?"s":""," will be made public"]})})]});return(0,t.jsx)(n.Z,{title:"Make MCP Servers Public",open:s,onCancel:w,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(b.Z,{form:j,layout:"vertical",children:[(0,t.jsxs)(v.default,{current:c,className:"mb-6",children:[(0,t.jsx)(C,{title:"Select Servers"}),(0,t.jsx)(C,{title:"Confirm"})]}),(()=>{switch(c){case 0:return P();case 1:return z();default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(N.ZP,{onClick:0===c?w:()=>{1===c&&o(0)},children:0===c?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===c&&(0,t.jsx)(N.ZP,{onClick:()=>{if(0===c){if(0===x.size){k.Z.fromBackend("Please select at least one MCP server to make public");return}o(1)}},disabled:0===x.size,children:"Next"}),1===c&&(0,t.jsx)(N.ZP,{onClick:M,loading:p,children:"Make Public"})]})]})]})})},M=l(78801),P=e=>{let{modelHubData:s,onFilteredDataChange:l,showFiltersCard:a=!0,className:r=""}=e,[n,i]=(0,d.useState)(""),[c,o]=(0,d.useState)(""),[x,m]=(0,d.useState)(""),[u,h]=(0,d.useState)(""),p=(0,d.useRef)([]),g=(0,d.useMemo)(()=>(null==s?void 0:s.filter(e=>{let s=e.model_group.toLowerCase().includes(n.toLowerCase()),l=""===c||e.providers.includes(c),t=""===x||e.mode===x,a=""===u||Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).some(e=>{let[s]=e;return s.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")===u});return s&&l&&t&&a}))||[],[s,n,c,x,u]);(0,d.useEffect)(()=>{(g.length!==p.current.length||g.some((e,s)=>{var l;return e.model_group!==(null===(l=p.current[s])||void 0===l?void 0:l.model_group)}))&&(p.current=g,l(g))},[g,l]);let j=(0,t.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(M.x,{className:"text-sm font-medium mb-2",children:"Search Models:"}),(0,t.jsx)("input",{type:"text",placeholder:"Search model names...",value:n,onChange:e=>i(e.target.value),className:"border rounded px-3 py-2 w-64 h-10 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(M.x,{className:"text-sm font-medium mb-2",children:"Provider:"}),(0,t.jsxs)("select",{value:c,onChange:e=>o(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-40 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Providers"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.providers.forEach(e=>s.add(e))}),Array.from(s)})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(M.x,{className:"text-sm font-medium mb-2",children:"Mode:"}),(0,t.jsxs)("select",{value:x,onChange:e=>m(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-32 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Modes"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.mode&&s.add(e.mode)}),Array.from(s)})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(M.x,{className:"text-sm font-medium mb-2",children:"Features:"}),(0,t.jsxs)("select",{value:u,onChange:e=>h(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-48 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Features"}),s&&(e=>{let s=new Set;return e.forEach(e=>{Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).forEach(e=>{let[l]=e,t=l.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");s.add(t)})}),Array.from(s).sort()})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(n||c||x||u)&&(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsx)("button",{onClick:()=>{i(""),o(""),m(""),h("")},className:"text-blue-600 hover:text-blue-800 text-sm underline h-10 flex items-center",children:"Clear Filters"})})]});return a?(0,t.jsx)(M.Z,{className:"mb-6 ".concat(r),children:j}):(0,t.jsx)("div",{className:r,children:j})};let{Step:z}=v.default;var A=e=>{let{visible:s,onClose:l,accessToken:a,modelHubData:r,onSuccess:i}=e,[c,o]=(0,d.useState)(0),[x,u]=(0,d.useState)(new Set),[p,g]=(0,d.useState)([]),[j,w]=(0,d.useState)(!1),[Z]=b.Z.useForm(),C=()=>{o(0),u(new Set),g([]),Z.resetFields(),l()},S=(e,s)=>{let l=new Set(x);s?l.add(e):l.delete(e),u(l)},M=e=>{e?u(new Set(p.map(e=>e.model_group))):u(new Set)},A=(0,d.useCallback)(e=>{g(e)},[]);(0,d.useEffect)(()=>{s&&r.length>0&&(g(r),u(new Set(r.filter(e=>!0===e.is_public_model_group).map(e=>e.model_group))))},[s,r]);let F=async()=>{if(0===x.size){k.Z.fromBackend("Please select at least one model to make public");return}w(!0);try{let e=Array.from(x);await (0,_.makeModelGroupPublic)(a,e),k.Z.success("Successfully made ".concat(e.length," model group(s) public!")),C(),i()}catch(e){console.error("Error making model groups public:",e),k.Z.fromBackend("Failed to make model groups public. Please try again.")}finally{w(!1)}},L=()=>{let e=p.length>0&&p.every(e=>x.has(e.model_group)),s=x.size>0&&!e;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(y.Z,{children:"Select Models to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(f.Z,{checked:e,indeterminate:s,onChange:e=>M(e.target.checked),disabled:0===p.length,children:["Select All ",p.length>0&&"(".concat(p.length,")")]})})]}),(0,t.jsx)(h.Z,{className:"text-sm text-gray-600",children:"Select the models you want to be visible on the public model hub. Users will still require a valid Virtual Key to use these models."}),(0,t.jsx)(P,{modelHubData:r,onFilteredDataChange:A,showFiltersCard:!1,className:"border rounded-lg p-4 bg-gray-50"}),(0,t.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,t.jsx)("div",{className:"space-y-3",children:0===p.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(h.Z,{children:"No models match the current filters."})}):p.map(e=>(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,t.jsx)(f.Z,{checked:x.has(e.model_group),onChange:s=>S(e.model_group,s.target.checked)}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(h.Z,{className:"font-medium",children:e.model_group}),e.mode&&(0,t.jsx)(m.Z,{color:"green",size:"sm",children:e.mode})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.providers.map(e=>(0,t.jsx)(m.Z,{color:"blue",size:"xs",children:e},e))})]})]},e.model_group))})}),x.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(h.Z,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:x.size})," model",1!==x.size?"s":""," selected"]})})]})},T=()=>(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(y.Z,{children:"Confirm Making Models Public"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(h.Z,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Warning:"})," Once you make these models public, anyone who can go to the"," ",(0,t.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(h.Z,{className:"font-medium",children:"Models to be made public:"}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,t.jsx)("div",{className:"space-y-2",children:Array.from(x).map(e=>{let s=r.find(s=>s.model_group===e);return(0,t.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(h.Z,{className:"font-medium",children:e}),s&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:s.providers.map(e=>(0,t.jsx)(m.Z,{color:"blue",size:"xs",children:e},e))})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(h.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:x.size})," model",1!==x.size?"s":""," will be made public"]})})]});return(0,t.jsx)(n.Z,{title:"Make Models Public",open:s,onCancel:C,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(b.Z,{form:Z,layout:"vertical",children:[(0,t.jsxs)(v.default,{current:c,className:"mb-6",children:[(0,t.jsx)(z,{title:"Select Models"}),(0,t.jsx)(z,{title:"Confirm"})]}),(()=>{switch(c){case 0:return L();case 1:return T();default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(N.ZP,{onClick:0===c?C:()=>{1===c&&o(0)},children:0===c?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===c&&(0,t.jsx)(N.ZP,{onClick:()=>{if(0===c){if(0===x.size){k.Z.fromBackend("Please select at least one model to make public");return}o(1)}},disabled:0===x.size,children:"Next"}),1===c&&(0,t.jsx)(N.ZP,{onClick:F,loading:j,children:"Make Public"})]})]})]})})},F=l(8048);let L=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),T=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),D=e=>"$".concat((1e6*e).toFixed(2)),O=e=>e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString(),E=function(e,s){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[{header:"Public Model Name",accessorKey:"model_group",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,r=l.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(h.Z,{className:"font-medium text-sm",children:r.model_group}),(0,t.jsx)(p.Z,{title:"Copy model name",children:(0,t.jsx)(a.Z,{onClick:()=>s(r.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(h.Z,{className:"text-xs text-gray-600",children:r.providers.join(", ")})})]})}},{header:"Provider",accessorKey:"providers",enableSorting:!0,sortingFn:(e,s)=>{let l=e.original.providers.join(", "),t=s.original.providers.join(", ");return l.localeCompare(t)},cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.providers.slice(0,2).map(e=>(0,t.jsx)(g.Z,{color:"blue",className:"text-xs",children:e},e)),l.providers.length>2&&(0,t.jsxs)(h.Z,{className:"text-xs text-gray-500",children:["+",l.providers.length-2]})]})},meta:{className:"hidden md:table-cell"}},{header:"Mode",accessorKey:"mode",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return l.mode?(0,t.jsx)(m.Z,{color:"green",size:"sm",children:l.mode}):(0,t.jsx)(h.Z,{className:"text-gray-500",children:"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Tokens",accessorKey:"max_input_tokens",enableSorting:!0,sortingFn:(e,s)=>(e.original.max_input_tokens||0)+(e.original.max_output_tokens||0)-((s.original.max_input_tokens||0)+(s.original.max_output_tokens||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsxs)(h.Z,{className:"text-xs",children:[l.max_input_tokens?O(l.max_input_tokens):"-"," /"," ",l.max_output_tokens?O(l.max_output_tokens):"-"]})})},meta:{className:"hidden lg:table-cell"}},{header:"Cost/1M",accessorKey:"input_cost_per_token",enableSorting:!0,sortingFn:(e,s)=>(e.original.input_cost_per_token||0)+(e.original.output_cost_per_token||0)-((s.original.input_cost_per_token||0)+(s.original.output_cost_per_token||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(h.Z,{className:"text-xs",children:l.input_cost_per_token?D(l.input_cost_per_token):"-"}),(0,t.jsx)(h.Z,{className:"text-xs text-gray-500",children:l.output_cost_per_token?D(l.output_cost_per_token):"-"})]})}},{header:"Features",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:s}=e,l=T(s.original),a=["green","blue","purple","orange","red","yellow"];return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,t.jsx)(h.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map((e,s)=>(0,t.jsx)(m.Z,{color:a[s%a.length],size:"xs",children:L(e)},e))})}},{header:"Public",accessorKey:"is_public_model_group",enableSorting:!0,sortingFn:(e,s)=>(!0===e.original.is_public_model_group?1:0)-(!0===s.original.is_public_model_group?1:0),cell:e=>{let{row:s}=e;return!0===s.original.is_public_model_group?(0,t.jsx)(m.Z,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(m.Z,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:s=>{let{row:l}=s,a=l.original;return(0,t.jsxs)(u.Z,{size:"xs",variant:"secondary",onClick:()=>e(a),icon:j.Z,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}];return l?r.filter(e=>!("accessorKey"in e)||"is_public_model_group"!==e.accessorKey):r};var K=l(87526),U=l(86462),I=l(47686),H=l(77355),R=l(95704),B=l(39957),Y=e=>{let{accessToken:s,userRole:l}=e,[a,r]=(0,d.useState)([]),[i,c]=(0,d.useState)({url:"",displayName:""}),[o,m]=(0,d.useState)(null),[u,h]=(0,d.useState)(!1),[p,g]=(0,d.useState)(!0),[j,v]=(0,d.useState)(!1),[b,f]=(0,d.useState)([]),N=async()=>{if(s)try{h(!0);let e=await (0,_.getPublicModelHubInfo)();if(e&&e.useful_links){let s=e.useful_links||{},l=Object.entries(s).map(e=>{var s,l;let[t,a]=e;return"object"==typeof a&&null!==a&&"url"in a?{id:"".concat(null!==(s=a.index)&&void 0!==s?s:0,"-").concat(t),displayName:t,url:a.url,index:null!==(l=a.index)&&void 0!==l?l:0}:{id:"0-".concat(t),displayName:t,url:a,index:0}}).sort((e,s)=>{var l,t;return(null!==(l=e.index)&&void 0!==l?l:0)-(null!==(t=s.index)&&void 0!==t?t:0)}).map((e,s)=>({...e,id:"".concat(s,"-").concat(e.displayName)}));r(l)}else r([])}catch(e){console.error("Error fetching useful links:",e),r([])}finally{h(!1)}};if((0,d.useEffect)(()=>{N()},[s]),!(0,x.tY)(l||""))return null;let y=async e=>{if(!s)return!1;try{let l={};return e.forEach((e,s)=>{l[e.displayName]={url:e.url,index:s}}),await (0,_.updateUsefulLinksCall)(s,l),n.Z.success({title:"Links Saved Successfully",content:(0,t.jsxs)("div",{className:"py-4",children:[(0,t.jsx)("p",{className:"text-gray-600 mb-4",children:"Your useful links have been saved and are now visible on the public model hub."}),(0,t.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,t.jsx)("p",{className:"text-sm text-blue-800 mb-2 font-medium",children:"View your updated model hub:"}),(0,t.jsx)("a",{href:"".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table"),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-blue-600 hover:text-blue-800 underline text-sm font-medium",children:"Open Public Model Hub →"})]})]}),width:500,okText:"Close",maskClosable:!0,keyboard:!0}),!0}catch(e){return console.error("Error saving links:",e),k.Z.fromBackend("Failed to save links - ".concat(e)),!1}},w=async()=>{if(!i.url||!i.displayName)return;try{new URL(i.url)}catch(e){k.Z.fromBackend("Please enter a valid URL");return}if(a.some(e=>e.displayName===i.displayName)){k.Z.fromBackend("A link with this display name already exists");return}let e=[...a,{id:"".concat(Date.now(),"-").concat(i.displayName),displayName:i.displayName,url:i.url}];await y(e)&&(r(e),c({url:"",displayName:""}),k.Z.success("Link added successfully"))},Z=e=>{m({...e})},C=async()=>{if(!o)return;try{new URL(o.url)}catch(e){k.Z.fromBackend("Please enter a valid URL");return}if(a.some(e=>e.id!==o.id&&e.displayName===o.displayName)){k.Z.fromBackend("A link with this display name already exists");return}let e=a.map(e=>e.id===o.id?o:e);await y(e)&&(r(e),m(null),k.Z.success("Link updated successfully"))},S=()=>{m(null)},M=async e=>{let s=a.filter(s=>s.id!==e);await y(s)&&(r(s),k.Z.success("Link deleted successfully"))},P=e=>{window.open(e,"_blank")},z=async()=>{await y(a)&&(v(!1),f([]),k.Z.success("Link order saved successfully"))},A=e=>{if(0===e)return;let s=[...a];[s[e-1],s[e]]=[s[e],s[e-1]],r(s)},F=e=>{if(e===a.length-1)return;let s=[...a];[s[e],s[e+1]]=[s[e+1],s[e]],r(s)};return(0,t.jsxs)(R.Zb,{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>g(!p),children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(R.Dx,{className:"mb-0",children:"Link Management"}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Manage the links that are displayed under 'Useful Links' on the public model hub."})]}),(0,t.jsx)("div",{className:"flex items-center",children:p?(0,t.jsx)(U.Z,{className:"w-5 h-5 text-gray-500"}):(0,t.jsx)(I.Z,{className:"w-5 h-5 text-gray-500"})})]}),p&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(R.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Link"}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Display Name"}),(0,t.jsx)("input",{type:"text",value:i.displayName,onChange:e=>c({...i,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:i.url,onChange:e=>c({...i,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:w,disabled:!i.url||!i.displayName,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(i.url&&i.displayName?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,t.jsx)(H.Z,{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)(R.xv,{className:"text-sm font-medium text-gray-700",children:"Manage Existing Links"}),j?(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:z,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:()=>{r([...b]),v(!1),f([])},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:()=>{o&&m(null),f([...a]),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)(R.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(R.ss,{children:(0,t.jsxs)(R.SC,{children:[(0,t.jsx)(R.xs,{className:"py-1 h-8",children:"Display Name"}),(0,t.jsx)(R.xs,{className:"py-1 h-8",children:"URL"}),(0,t.jsx)(R.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,t.jsxs)(R.RM,{children:[a.map((e,s)=>(0,t.jsx)(R.SC,{className:"h-8",children:o&&o.id===e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.pj,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:o.displayName,onChange:e=>m({...o,displayName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(R.pj,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:o.url,onChange:e=>m({...o,url:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(R.pj,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:C,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:S,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)(R.pj,{className:"py-0.5 text-sm text-gray-900",children:e.displayName}),(0,t.jsx)(R.pj,{className:"py-0.5 text-sm text-gray-500",children:e.url}),(0,t.jsx)(R.pj,{className:"py-0.5 whitespace-nowrap",children:j?(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)(B.Z,{variant:"Up",onClick:()=>A(s),tooltipText:"Move up",disabled:0===s,disabledTooltipText:"Already at the top",dataTestId:"move-up-".concat(e.id)}),(0,t.jsx)(B.Z,{variant:"Down",onClick:()=>F(s),tooltipText:"Move down",disabled:s===a.length-1,disabledTooltipText:"Already at the bottom",dataTestId:"move-down-".concat(e.id)})]}):(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)(B.Z,{variant:"Open",onClick:()=>P(e.url),tooltipText:"Open link",dataTestId:"open-link-".concat(e.id)}),(0,t.jsx)(B.Z,{variant:"Edit",onClick:()=>Z(e),tooltipText:"Edit link",dataTestId:"edit-link-".concat(e.id)}),(0,t.jsx)(B.Z,{variant:"Delete",onClick:()=>M(e.id),tooltipText:"Delete link",dataTestId:"delete-link-".concat(e.id)})]})})]})},e.id)),0===a.length&&(0,t.jsx)(R.SC,{children:(0,t.jsx)(R.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No links added yet. Add a new link above."})})]})]})})})]})]})},V=e=>{var s,l,v,b;let{accessToken:f,publicPage:N,premiumUser:y,userRole:w}=e,[C,M]=(0,d.useState)(!1),[z,L]=(0,d.useState)(null),[T,D]=(0,d.useState)(!0),[O,U]=(0,d.useState)(!1),[I,H]=(0,d.useState)(!1),[R,B]=(0,d.useState)(null),[V,W]=(0,d.useState)([]),[J,q]=(0,d.useState)(!1),[G,$]=(0,d.useState)(null),[Q,X]=(0,d.useState)(!1),[ee,es]=(0,d.useState)(!0),[el,et]=(0,d.useState)(null),[ea,er]=(0,d.useState)(!1),[en,ei]=(0,d.useState)(null),[ec,ed]=(0,d.useState)(!0),[eo,ex]=(0,d.useState)(null),[em,eu]=(0,d.useState)(!1),[eh,ep]=(0,d.useState)(!1),eg=(0,c.useRouter)(),ej=(0,d.useRef)(null),ev=(0,d.useRef)(null),eb=(0,d.useRef)(null);(0,d.useEffect)(()=>{let e=async e=>{try{D(!0);let s=await (0,_.modelHubCall)(e);console.log("ModelHubData:",s),L(s.data),(0,_.getConfigFieldSetting)(e,"enable_public_model_hub").then(e=>{console.log("data: ".concat(JSON.stringify(e))),!0==e.field_value&&M(!0)}).catch(e=>{})}catch(e){console.error("There was an error fetching the model data",e)}finally{D(!1)}},s=async()=>{try{var e,s;D(!0),await (0,_.getUiConfig)();let l=await (0,_.modelHubPublicModelsCall)();console.log("ModelHubData:",l),console.log("First model structure:",l[0]),console.log("Model has model_group?",null===(e=l[0])||void 0===e?void 0:e.model_group),console.log("Model has providers?",null===(s=l[0])||void 0===s?void 0:s.providers),L(l),M(!0)}catch(e){console.error("There was an error fetching the public model data",e)}finally{D(!1)}};f?e(f):N&&s()},[f,N]),(0,d.useEffect)(()=>{let e=async()=>{if(f)try{es(!0);let e=await (0,_.getAgentsList)(f);console.log("AgentHubData:",e);let s=e.agents.map(e=>({agent_id:e.agent_id,...e.agent_card_params,is_public:e.litellm_params.is_public}));$(s)}catch(e){console.error("There was an error fetching the agent data",e)}finally{es(!1)}};N||e()},[N,f]),(0,d.useEffect)(()=>{let e=async()=>{if(f)try{ed(!0);let e=await (0,_.fetchMCPServers)(f);console.log("MCPHubData:",e),ei(e)}catch(e){console.error("There was an error fetching the MCP server data",e)}finally{ed(!1)}};N||e()},[N,f]);let ef=()=>{f&&q(!0)},eN=()=>{f&&X(!0)},ey=()=>{f&&ep(!0)},e_=()=>{U(!1),H(!1),B(null),er(!1),et(null),eu(!1),ex(null)},ek=()=>{U(!1),H(!1),B(null),er(!1),et(null),eu(!1),ex(null)},ew=e=>{navigator.clipboard.writeText(e),k.Z.success("Copied to clipboard!")},eZ=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),eC=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),eS=e=>"$".concat((1e6*e).toFixed(2)),eM=(0,d.useCallback)(e=>{W(e)},[]);return(console.log("publicPage: ",N),console.log("publicPageAllowed: ",C),N&&C)?(0,t.jsx)(K.Z,{accessToken:f}):(0,t.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[!1==N?(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)(r.Dx,{className:"text-center",children:"AI Hub"}),(0,x.tY)(w||"")?(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)(r.xv,{children:"Model Hub URL:"}),(0,t.jsxs)("div",{className:"flex items-center bg-gray-200 px-2 py-1 rounded",children:[(0,t.jsx)(r.xv,{className:"mr-2",children:"".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table")}),(0,t.jsx)("button",{onClick:()=>ew("".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table")),className:"p-1 hover:bg-gray-300 rounded transition-colors",title:"Copy URL",children:(0,t.jsx)(i.Z,{size:16,className:"text-gray-600"})})]})]})]}),(0,x.tY)(w||"")&&(0,t.jsx)("div",{className:"mt-8 mb-2",children:(0,t.jsx)(Y,{accessToken:f,userRole:w})}),(0,t.jsxs)(r.v0,{children:[(0,t.jsxs)(r.td,{className:"mb-4",children:[(0,t.jsx)(r.OK,{children:"Model Hub"}),(0,t.jsx)(r.OK,{children:"Agent Hub"}),(0,t.jsx)(r.OK,{children:"MCP Hub"})]}),(0,t.jsxs)(r.nP,{children:[(0,t.jsxs)(r.x4,{children:[(0,t.jsxs)(r.Zb,{children:[!1==N&&(0,x.tY)(w||"")&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(r.zx,{onClick:()=>ef(),children:"Select Models to Make Public"})}),(0,t.jsx)(P,{modelHubData:z||[],onFilteredDataChange:eM}),(0,t.jsx)(F.C,{columns:E(e=>{B(e),U(!0)},ew,N),data:V,isLoading:T,table:ej,defaultSorting:[{id:"model_group",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(r.xv,{className:"text-sm text-gray-600",children:["Showing ",V.length," of ",(null==z?void 0:z.length)||0," models"]})})]}),(0,t.jsxs)(r.x4,{children:[(0,t.jsxs)(r.Zb,{children:[!1==N&&(0,x.tY)(w||"")&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(r.zx,{onClick:()=>eN(),children:"Select Agents to Make Public"})}),(0,t.jsx)(F.C,{columns:function(e,s){return arguments.length>2&&void 0!==arguments[2]&&arguments[2],[{header:"Agent Name",accessorKey:"name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,r=l.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(h.Z,{className:"font-medium text-sm",children:r.name}),(0,t.jsx)(p.Z,{title:"Copy agent name",children:(0,t.jsx)(a.Z,{onClick:()=>s(r.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(h.Z,{className:"text-xs text-gray-600",children:r.description})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)(h.Z,{className:"text-xs line-clamp-2",children:l.description||"-"})},meta:{className:"hidden md:table-cell"}},{header:"Version",accessorKey:"version",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)(m.Z,{color:"blue",size:"sm",children:["v",l.version]})},meta:{className:"hidden lg:table-cell"}},{header:"Protocol",accessorKey:"protocolVersion",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)(h.Z,{className:"text-xs",children:l.protocolVersion||"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Skills",accessorKey:"skills",enableSorting:!1,cell:e=>{let{row:s}=e,l=s.original.skills||[];return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(h.Z,{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)(g.Z,{color:"purple",className:"text-xs",children:e.name},e.id)),l.length>2&&(0,t.jsxs)(h.Z,{className:"text-xs text-gray-500",children:["+",l.length-2]})]})]})}},{header:"Capabilities",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:s}=e,l=Object.entries(s.original.capabilities||{}).filter(e=>{let[s,l]=e;return!0===l}).map(e=>{let[s]=e;return s});return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,t.jsx)(h.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map(e=>(0,t.jsx)(m.Z,{color:"green",size:"xs",children:e},e))})}},{header:"I/O Modes",accessorKey:"defaultInputModes",enableSorting:!1,cell:e=>{let{row:s}=e,l=s.original,a=l.defaultInputModes||[],r=l.defaultOutputModes||[];return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(h.Z,{className:"text-xs",children:[(0,t.jsx)("span",{className:"font-medium",children:"In:"})," ",a.join(", ")||"-"]}),(0,t.jsxs)(h.Z,{className:"text-xs",children:[(0,t.jsx)("span",{className:"font-medium",children:"Out:"})," ",r.join(", ")||"-"]})]})},meta:{className:"hidden xl:table-cell"}},{header:"Public",accessorKey:"is_public",enableSorting:!0,sortingFn:(e,s)=>(!0===e.original.is_public?1:0)-(!0===s.original.is_public?1:0),cell:e=>{let{row:s}=e;return console.log("CHECKPOINT 1: ".concat(JSON.stringify(s.original))),!0===s.original.is_public?(0,t.jsx)(m.Z,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(m.Z,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:s=>{let{row:l}=s,a=l.original;return(0,t.jsxs)(u.Z,{size:"xs",variant:"secondary",onClick:()=>e(a),icon:j.Z,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}]}(e=>{et(e),er(!0)},ew,N),data:G||[],isLoading:ee,table:ev,defaultSorting:[{id:"name",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(r.xv,{className:"text-sm text-gray-600",children:["Showing ",(null==G?void 0:G.length)||0," agent",(null==G?void 0:G.length)!==1?"s":""]})})]}),(0,t.jsxs)(r.x4,{children:[(0,t.jsxs)(r.Zb,{children:[!1==N&&(0,x.tY)(w||"")&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(r.zx,{onClick:()=>ey(),children:"Select MCP Servers to Make Public"})}),(0,t.jsx)(F.C,{columns:function(e,s){return arguments.length>2&&void 0!==arguments[2]&&arguments[2],[{header:"Server Name",accessorKey:"server_name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,r=l.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(h.Z,{className:"font-medium text-sm",children:r.server_name}),(0,t.jsx)(p.Z,{title:"Copy server name",children:(0,t.jsx)(a.Z,{onClick:()=>s(r.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)(h.Z,{className:"text-xs text-gray-600",children:r.description||"-"})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)(h.Z,{className:"text-xs line-clamp-2",children:l.description||"-"})},meta:{className:"hidden md:table-cell"}},{header:"URL",accessorKey:"url",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,r=l.original;return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(h.Z,{className:"text-xs truncate max-w-xs",children:r.url}),(0,t.jsx)(p.Z,{title:"Copy URL",children:(0,t.jsx)(a.Z,{onClick:()=>s(r.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:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)(m.Z,{color:"blue",size:"sm",children:l.transport})},meta:{className:"hidden md:table-cell"}},{header:"Auth Type",accessorKey:"auth_type",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original,a="none"===l.auth_type?"gray":"green";return(0,t.jsx)(m.Z,{color:a,size:"sm",children:l.auth_type})},meta:{className:"hidden md:table-cell"}},{header:"Status",accessorKey:"status",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original,a={active:"green",inactive:"red",unknown:"gray",healthy:"green",unhealthy:"red"}[l.status]||"gray";return(0,t.jsx)(m.Z,{color:a,size:"sm",children:l.status||"unknown"})}},{header:"Tools",accessorKey:"allowed_tools",enableSorting:!1,cell:e=>{let{row:s}=e,l=s.original.allowed_tools||[];return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(h.Z,{className:"text-xs font-medium",children:l.length>0?"".concat(l.length," tool").concat(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,s)=>(0,t.jsx)(g.Z,{color:"purple",className:"text-xs",children:e},s)),l.length>2&&(0,t.jsxs)(h.Z,{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:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)(h.Z,{className:"text-xs",children:l.created_by||"-"})},meta:{className:"hidden xl:table-cell"}},{header:"Public",accessorKey:"mcp_info.is_public",enableSorting:!0,sortingFn:(e,s)=>{var l,t;return((null===(l=e.original.mcp_info)||void 0===l?void 0:l.is_public)===!0?1:0)-((null===(t=s.original.mcp_info)||void 0===t?void 0:t.is_public)===!0?1:0)},cell:e=>{var s;let{row:l}=e;return(null===(s=l.original.mcp_info)||void 0===s?void 0:s.is_public)===!0?(0,t.jsx)(m.Z,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(m.Z,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:s=>{let{row:l}=s,a=l.original;return(0,t.jsxs)(u.Z,{size:"xs",variant:"secondary",onClick:()=>e(a),icon:j.Z,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}]}(e=>{ex(e),eu(!0)},ew,N),data:en||[],isLoading:ec,table:eb,defaultSorting:[{id:"server_name",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(r.xv,{className:"text-sm text-gray-600",children:["Showing ",(null==en?void 0:en.length)||0," MCP server",(null==en?void 0:en.length)!==1?"s":""]})})]})]})]})]}):(0,t.jsxs)(r.Zb,{className:"mx-auto max-w-xl mt-10",children:[(0,t.jsx)(r.xv,{className:"text-xl text-center mb-2 text-black",children:"Public Model Hub not enabled."}),(0,t.jsx)("p",{className:"text-base text-center text-slate-800",children:"Ask your proxy admin to enable this on their Admin UI."})]}),(0,t.jsx)(n.Z,{title:"Public Model Hub",width:600,visible:I,footer:null,onOk:e_,onCancel:ek,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)(r.xv,{className:"text-base mr-2",children:"Shareable Link:"}),(0,t.jsx)(r.xv,{className:"max-w-sm ml-2 bg-gray-200 pr-2 pl-2 pt-1 pb-1 text-center rounded",children:"".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table")})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(r.zx,{onClick:()=>{eg.replace("/model_hub_table?key=".concat(f))},children:"See Page"})})]})}),(0,t.jsx)(n.Z,{title:(null==R?void 0:R.model_group)||"Model Details",width:1e3,visible:O,footer:null,onOk:e_,onCancel:ek,children:R&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Model Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Model Group:"}),(0,t.jsx)(r.xv,{children:R.model_group})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Mode:"}),(0,t.jsx)(r.xv,{children:R.mode||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Providers:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:R.providers.map(e=>(0,t.jsx)(r.Ct,{color:"blue",children:e},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Token & Cost Information"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Max Input Tokens:"}),(0,t.jsx)(r.xv,{children:(null===(s=R.max_input_tokens)||void 0===s?void 0:s.toLocaleString())||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Max Output Tokens:"}),(0,t.jsx)(r.xv,{children:(null===(l=R.max_output_tokens)||void 0===l?void 0:l.toLocaleString())||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,t.jsx)(r.xv,{children:R.input_cost_per_token?eS(R.input_cost_per_token):"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,t.jsx)(r.xv,{children:R.output_cost_per_token?eS(R.output_cost_per_token):"Not specified"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=eC(R),s=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,t.jsx)(r.xv,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,l)=>(0,t.jsx)(r.Ct,{color:s[l%s.length],children:eZ(e)},e))})()})]}),(R.tpm||R.rpm)&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[R.tpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Tokens per Minute:"}),(0,t.jsx)(r.xv,{children:R.tpm.toLocaleString()})]}),R.rpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Requests per Minute:"}),(0,t.jsx)(r.xv,{children:R.rpm.toLocaleString()})]})]})]}),R.supported_openai_params&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:R.supported_openai_params.map(e=>(0,t.jsx)(r.Ct,{color:"green",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)(o.Z,{language:"python",className:"text-sm",children:'import openai\n\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="http://0.0.0.0:4000" # Your LiteLLM Proxy URL\n)\n\nresponse = client.chat.completions.create(\n model="'.concat(R.model_group,'",\n messages=[\n {\n "role": "user",\n "content": "Hello, how are you?"\n }\n ]\n)\n\nprint(response.choices[0].message.content)')})]})]})}),(0,t.jsx)(n.Z,{title:(null==el?void 0:el.name)||"Agent Details",width:1e3,visible:ea,footer:null,onOk:e_,onCancel:ek,children:el&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Name:"}),(0,t.jsx)(r.xv,{children:el.name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Version:"}),(0,t.jsxs)(r.Ct,{color:"blue",children:["v",el.version]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Protocol Version:"}),(0,t.jsx)(r.xv,{children:el.protocolVersion})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"URL:"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(r.xv,{className:"truncate",children:el.url}),(0,t.jsx)(a.Z,{onClick:()=>ew(el.url),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Description:"}),(0,t.jsx)(r.xv,{className:"mt-1",children:el.description})]})]}),el.capabilities&&Object.keys(el.capabilities).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(el.capabilities).filter(e=>{let[s,l]=e;return!0===l}).map(e=>{let[s]=e;return(0,t.jsx)(r.Ct,{color:"green",children:s},s)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Input Modes:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(null===(v=el.defaultInputModes)||void 0===v?void 0:v.map(e=>(0,t.jsx)(r.Ct,{color:"blue",children:e},e)))||(0,t.jsx)(r.xv,{children:"Not specified"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Output Modes:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(null===(b=el.defaultOutputModes)||void 0===b?void 0:b.map(e=>(0,t.jsx)(r.Ct,{color:"purple",children:e},e)))||(0,t.jsx)(r.xv,{children:"Not specified"})})]})]})]}),el.skills&&el.skills.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Skills"}),(0,t.jsx)("div",{className:"space-y-4",children:el.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)(r.xv,{className:"font-medium text-base",children:e.name}),(0,t.jsxs)(r.xv,{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)(r.Ct,{color:"purple",size:"xs",children:e},e))})]}),(0,t.jsx)(r.xv,{className:"text-sm mb-2",children:e.description}),e.examples&&e.examples.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{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,s)=>(0,t.jsx)(r.Ct,{color:"gray",size:"xs",children:e},s))})]})]},e.id))})]}),el.supportsAuthenticatedExtendedCard&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Additional Features"}),(0,t.jsx)(r.Ct,{color:"green",children:"Supports Authenticated Extended Card"})]})]})}),(0,t.jsx)(n.Z,{title:(null==eo?void 0:eo.server_name)||"MCP Server Details",width:1e3,visible:em,footer:null,onOk:e_,onCancel:ek,children:eo&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Server Name:"}),(0,t.jsx)(r.xv,{children:eo.server_name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Server ID:"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(r.xv,{className:"text-xs truncate",children:eo.server_id}),(0,t.jsx)(a.Z,{onClick:()=>ew(eo.server_id),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]}),eo.alias&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Alias:"}),(0,t.jsx)(r.xv,{children:eo.alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Transport:"}),(0,t.jsx)(r.Ct,{color:"blue",children:eo.transport})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Auth Type:"}),(0,t.jsx)(r.Ct,{color:"none"===eo.auth_type?"gray":"green",children:eo.auth_type})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Status:"}),(0,t.jsx)(r.Ct,{color:"active"===eo.status||"healthy"===eo.status?"green":"inactive"===eo.status||"unhealthy"===eo.status?"red":"gray",children:eo.status||"unknown"})]})]}),eo.description&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Description:"}),(0,t.jsx)(r.xv,{className:"mt-1",children:eo.description})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"URL:"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 mt-1",children:[(0,t.jsx)(r.xv,{className:"text-sm break-all bg-gray-100 p-2 rounded flex-1",children:eo.url}),(0,t.jsx)(a.Z,{onClick:()=>ew(eo.url),className:"cursor-pointer text-gray-500 hover:text-blue-500 flex-shrink-0"})]})]}),eo.command&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Command:"}),(0,t.jsx)(r.xv,{className:"text-sm bg-gray-100 p-2 rounded mt-1 font-mono",children:eo.command})]})]})]}),eo.allowed_tools&&eo.allowed_tools.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Allowed Tools"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.allowed_tools.map((e,s)=>(0,t.jsx)(r.Ct,{color:"purple",children:e},s))})]}),eo.teams&&eo.teams.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Teams"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.teams.map((e,s)=>(0,t.jsx)(r.Ct,{color:"blue",children:e},s))})]}),eo.mcp_access_groups&&eo.mcp_access_groups.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Access Groups"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.mcp_access_groups.map((e,s)=>(0,t.jsx)(r.Ct,{color:"green",children:e},s))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Created By:"}),(0,t.jsx)(r.xv,{children:eo.created_by})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Updated By:"}),(0,t.jsx)(r.xv,{children:eo.updated_by})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Created At:"}),(0,t.jsx)(r.xv,{className:"text-sm",children:new Date(eo.created_at).toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Updated At:"}),(0,t.jsx)(r.xv,{className:"text-sm",children:new Date(eo.updated_at).toLocaleString()})]}),eo.last_health_check&&(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"font-medium",children:"Last Health Check:"}),(0,t.jsx)(r.xv,{className:"text-sm",children:new Date(eo.last_health_check).toLocaleString()})]})]}),eo.health_check_error&&(0,t.jsxs)("div",{className:"mt-2 p-2 bg-red-50 rounded",children:[(0,t.jsx)(r.xv,{className:"font-medium text-red-700",children:"Health Check Error:"}),(0,t.jsx)(r.xv,{className:"text-sm text-red-600 mt-1",children:eo.health_check_error})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)(o.Z,{language:"python",className:"text-sm",children:'from fastmcp import Client\nimport asyncio\n\n# Standard MCP configuration\nconfig = {\n "mcpServers": {\n "'.concat(eo.server_name,'": {\n "url": "http://localhost:4000/').concat(eo.server_name,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer sk-1234"\n }\n }\n }\n}\n\n# Create a client that connects to the server\nclient = Client(config)\n\nasync def main():\n async with client:\n # List available tools\n tools = await client.list_tools()\n print(f"Available tools: {[tool.name for tool in tools]}")\n\n # Call a tool\n response = await client.call_tool(\n name="tool_name", \n arguments={"arg": "value"}\n )\n print(f"Response: {response}")\n\nif __name__ == "__main__":\n asyncio.run(main())')})]})]})}),(0,t.jsx)(A,{visible:J,onClose:()=>q(!1),accessToken:f||"",modelHubData:z||[],onSuccess:()=>{f&&(async()=>{try{let e=await (0,_.modelHubCall)(f);L(e.data)}catch(e){console.error("Error refreshing model data:",e)}})()}}),(0,t.jsx)(Z,{visible:Q,onClose:()=>X(!1),accessToken:f||"",agentHubData:G||[],onSuccess:()=>{f&&(async()=>{try{let e=(await (0,_.getAgentsList)(f)).agents.map(e=>({agent_id:e.agent_id,...e.agent_card_params,is_public:e.is_public}));$(e)}catch(e){console.error("Error refreshing agent data:",e)}})()}}),(0,t.jsx)(S,{visible:eh,onClose:()=>ep(!1),accessToken:f||"",mcpHubData:en||[],onSuccess:()=>{f&&(async()=>{try{let e=await (0,_.fetchMCPServers)(f);ei(e)}catch(e){console.error("Error refreshing MCP server data:",e)}})()}})]})}},10012:function(e,s,l){l.d(s,{cx:function(){return n}});var t=l(49096),a=l(53335);let{cva:r,cx:n,compose:i}=(0,t.ZD)({hooks:{onComplete:e=>(0,a.m6)(e)}})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2273-fdf410d28cc9d394.js b/litellm/proxy/_experimental/out/_next/static/chunks/2273-133d3eb96ebd12f6.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/2273-fdf410d28cc9d394.js rename to litellm/proxy/_experimental/out/_next/static/chunks/2273-133d3eb96ebd12f6.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2586-352b7c53b37f606f.js b/litellm/proxy/_experimental/out/_next/static/chunks/2586-352b7c53b37f606f.js new file mode 100644 index 00000000000..d7899444899 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2586-352b7c53b37f606f.js @@ -0,0 +1,5 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2586],{12660:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},83669:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),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"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},44625:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},29271:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),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:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},41589:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={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"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},50010:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={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"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},38434:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},92403:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},62272:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),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"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},99890:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}}]},name:"picture",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},55322:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},25980:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={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"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},71891:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-.2-4.7.6-6.3 2.3L137.7 444.8a8.03 8.03 0 000 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0zm62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9zm60.16 186.23a48 48 0 1067.88-67.89 48 48 0 10-67.88 67.89zM889.7 539.8l-39.6-39.5a8.03 8.03 0 00-11.3 0l-362 361.3-237.6-237a8.03 8.03 0 00-11.3 0l-39.6 39.5a8.03 8.03 0 000 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z"}}]},name:"tags",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},85847:function(e,t,n){"use strict";n.d(t,{Z:function(){return en}});var r=n(2265),a=n(36760),s=n.n(a),i=n(31686),o=n(11993),l=n(83145),c=n(41154),u=n(26365),d=n(58525),h=n(50506),f=n(16671),p=n(32559),g=n(1119),m=n(6989),v=n(54887);function b(e,t,n,r){var a=(t-n)/(r-n),s={};switch(e){case"rtl":s.right="".concat(100*a,"%"),s.transform="translateX(50%)";break;case"btt":s.bottom="".concat(100*a,"%"),s.transform="translateY(50%)";break;case"ttb":s.top="".concat(100*a,"%"),s.transform="translateY(-50%)";break;default:s.left="".concat(100*a,"%"),s.transform="translateX(-50%)"}return s}function y(e,t){return Array.isArray(e)?e[t]:e}var w=n(95814),_=r.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}}),S=r.createContext({}),k=["prefixCls","value","valueIndex","onStartMove","onDelete","style","render","dragging","draggingDelete","onOffsetChange","onChangeComplete","onFocus","onMouseEnter"],x=r.forwardRef(function(e,t){var n,a=e.prefixCls,l=e.value,c=e.valueIndex,u=e.onStartMove,d=e.onDelete,h=e.style,f=e.render,p=e.dragging,v=e.draggingDelete,S=e.onOffsetChange,x=e.onChangeComplete,R=e.onFocus,C=e.onMouseEnter,M=(0,m.Z)(e,k),E=r.useContext(_),j=E.min,O=E.max,P=E.direction,A=E.disabled,I=E.keyboard,z=E.range,L=E.tabIndex,T=E.ariaLabelForHandle,Z=E.ariaLabelledByForHandle,N=E.ariaRequired,F=E.ariaValueTextFormatterForHandle,q=E.styles,B=E.classNames,$="".concat(a,"-handle"),D=function(e){A||u(e,c)},H=b(P,l,j,O),U={};null!==c&&(U={tabIndex:A?null:y(L,c),role:"slider","aria-valuemin":j,"aria-valuemax":O,"aria-valuenow":l,"aria-disabled":A,"aria-label":y(T,c),"aria-labelledby":y(Z,c),"aria-required":y(N,c),"aria-valuetext":null===(n=y(F,c))||void 0===n?void 0:n(l),"aria-orientation":"ltr"===P||"rtl"===P?"horizontal":"vertical",onMouseDown:D,onTouchStart:D,onFocus:function(e){null==R||R(e,c)},onMouseEnter:function(e){C(e,c)},onKeyDown:function(e){if(!A&&I){var t=null;switch(e.which||e.keyCode){case w.Z.LEFT:t="ltr"===P||"btt"===P?-1:1;break;case w.Z.RIGHT:t="ltr"===P||"btt"===P?1:-1;break;case w.Z.UP:t="ttb"!==P?1:-1;break;case w.Z.DOWN:t="ttb"!==P?-1:1;break;case w.Z.HOME:t="min";break;case w.Z.END:t="max";break;case w.Z.PAGE_UP:t=2;break;case w.Z.PAGE_DOWN:t=-2;break;case w.Z.BACKSPACE:case w.Z.DELETE:null==d||d(c)}null!==t&&(e.preventDefault(),S(t,c))}},onKeyUp:function(e){switch(e.which||e.keyCode){case w.Z.LEFT:case w.Z.RIGHT:case w.Z.UP:case w.Z.DOWN:case w.Z.HOME:case w.Z.END:case w.Z.PAGE_UP:case w.Z.PAGE_DOWN:null==x||x()}}});var W=r.createElement("div",(0,g.Z)({ref:t,className:s()($,(0,o.Z)((0,o.Z)((0,o.Z)({},"".concat($,"-").concat(c+1),null!==c&&z),"".concat($,"-dragging"),p),"".concat($,"-dragging-delete"),v),B.handle),style:(0,i.Z)((0,i.Z)((0,i.Z)({},H),h),q.handle)},U,M));return f&&(W=f(W,{index:c,prefixCls:a,value:l,dragging:p,draggingDelete:v})),W}),R=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","activeHandleRender","draggingIndex","draggingDelete","onFocus"],C=r.forwardRef(function(e,t){var n=e.prefixCls,a=e.style,s=e.onStartMove,o=e.onOffsetChange,l=e.values,c=e.handleRender,d=e.activeHandleRender,h=e.draggingIndex,f=e.draggingDelete,p=e.onFocus,b=(0,m.Z)(e,R),w=r.useRef({}),_=r.useState(!1),S=(0,u.Z)(_,2),k=S[0],C=S[1],M=r.useState(-1),E=(0,u.Z)(M,2),j=E[0],O=E[1],P=function(e){O(e),C(!0)};r.useImperativeHandle(t,function(){return{focus:function(e){var t;null===(t=w.current[e])||void 0===t||t.focus()},hideHelp:function(){(0,v.flushSync)(function(){C(!1)})}}});var A=(0,i.Z)({prefixCls:n,onStartMove:s,onOffsetChange:o,render:c,onFocus:function(e,t){P(t),null==p||p(e)},onMouseEnter:function(e,t){P(t)}},b);return r.createElement(r.Fragment,null,l.map(function(e,t){var n=h===t;return r.createElement(x,(0,g.Z)({ref:function(e){e?w.current[t]=e:delete w.current[t]},dragging:n,draggingDelete:n&&f,style:y(a,t),key:t,value:e,valueIndex:t},A))}),d&&k&&r.createElement(x,(0,g.Z)({key:"a11y"},A,{value:l[j],valueIndex:null,dragging:-1!==h,draggingDelete:f,render:d,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))}),M=function(e){var t=e.prefixCls,n=e.style,a=e.children,l=e.value,c=e.onClick,u=r.useContext(_),d=u.min,h=u.max,f=u.direction,p=u.includedStart,g=u.includedEnd,m=u.included,v="".concat(t,"-text"),y=b(f,l,d,h);return r.createElement("span",{className:s()(v,(0,o.Z)({},"".concat(v,"-active"),m&&p<=l&&l<=g)),style:(0,i.Z)((0,i.Z)({},y),n),onMouseDown:function(e){e.stopPropagation()},onClick:function(){c(l)}},a)},E=function(e){var t=e.prefixCls,n=e.marks,a=e.onClick,s="".concat(t,"-mark");return n.length?r.createElement("div",{className:s},n.map(function(e){var t=e.value,n=e.style,i=e.label;return r.createElement(M,{key:t,prefixCls:s,style:n,value:t,onClick:a},i)})):null},j=function(e){var t=e.prefixCls,n=e.value,a=e.style,l=e.activeStyle,c=r.useContext(_),u=c.min,d=c.max,h=c.direction,f=c.included,p=c.includedStart,g=c.includedEnd,m="".concat(t,"-dot"),v=f&&p<=n&&n<=g,y=(0,i.Z)((0,i.Z)({},b(h,n,u,d)),"function"==typeof a?a(n):a);return v&&(y=(0,i.Z)((0,i.Z)({},y),"function"==typeof l?l(n):l)),r.createElement("span",{className:s()(m,(0,o.Z)({},"".concat(m,"-active"),v)),style:y})},O=function(e){var t=e.prefixCls,n=e.marks,a=e.dots,s=e.style,i=e.activeStyle,o=r.useContext(_),l=o.min,c=o.max,u=o.step,d=r.useMemo(function(){var e=new Set;if(n.forEach(function(t){e.add(t.value)}),a&&null!==u)for(var t=l;t<=c;)e.add(t),t+=u;return Array.from(e)},[l,c,u,a,n]);return r.createElement("div",{className:"".concat(t,"-step")},d.map(function(e){return r.createElement(j,{prefixCls:t,key:e,value:e,style:s,activeStyle:i})}))},P=function(e){var t=e.prefixCls,n=e.style,a=e.start,l=e.end,c=e.index,u=e.onStartMove,d=e.replaceCls,h=r.useContext(_),f=h.direction,p=h.min,g=h.max,m=h.disabled,v=h.range,b=h.classNames,y="".concat(t,"-track"),w=(a-p)/(g-p),S=(l-p)/(g-p),k=function(e){!m&&u&&u(e,-1)},x={};switch(f){case"rtl":x.right="".concat(100*w,"%"),x.width="".concat(100*S-100*w,"%");break;case"btt":x.bottom="".concat(100*w,"%"),x.height="".concat(100*S-100*w,"%");break;case"ttb":x.top="".concat(100*w,"%"),x.height="".concat(100*S-100*w,"%");break;default:x.left="".concat(100*w,"%"),x.width="".concat(100*S-100*w,"%")}var R=d||s()(y,(0,o.Z)((0,o.Z)({},"".concat(y,"-").concat(c+1),null!==c&&v),"".concat(t,"-track-draggable"),u),b.track);return r.createElement("div",{className:R,style:(0,i.Z)((0,i.Z)({},x),n),onMouseDown:k,onTouchStart:k})},A=function(e){var t=e.prefixCls,n=e.style,a=e.values,o=e.startPoint,l=e.onStartMove,c=r.useContext(_),u=c.included,d=c.range,h=c.min,f=c.styles,p=c.classNames,g=r.useMemo(function(){if(!d){if(0===a.length)return[];var e=null!=o?o:h,t=a[0];return[{start:Math.min(e,t),end:Math.max(e,t)}]}for(var n=[],r=0;r130&&p=0&&en},[en,eT]),eN=r.useMemo(function(){return Object.keys(ef||{}).map(function(e){var t=ef[e],n={value:Number(e)};return t&&"object"===(0,c.Z)(t)&&!r.isValidElement(t)&&("label"in t||"style"in t)?(n.style=t.style,n.label=t.label):n.label=t,n}).filter(function(e){var t=e.label;return t||"number"==typeof t}).sort(function(e,t){return e.value-t.value})},[ef]),eF=(n=void 0===ee||ee,a=r.useCallback(function(e){return Math.max(ez,Math.min(eL,e))},[ez,eL]),g=r.useCallback(function(e){if(null!==eT){var t=ez+Math.round((a(e)-ez)/eT)*eT,n=function(e){return(String(e).split(".")[1]||"").length},r=Math.max(n(eT),n(eL),n(ez)),s=Number(t.toFixed(r));return ez<=s&&s<=eL?s:null}return null},[eT,ez,eL,a]),m=r.useCallback(function(e){var t=a(e),n=eN.map(function(e){return e.value});null!==eT&&n.push(g(e)),n.push(ez,eL);var r=n[0],s=eL-ez;return n.forEach(function(e){var n=Math.abs(t-e);n<=s&&(r=e,s=n)}),r},[ez,eL,eN,eT,a,g]),v=function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit";if("number"==typeof n){var s,i=t[r],o=i+n,c=[];eN.forEach(function(e){c.push(e.value)}),c.push(ez,eL),c.push(g(i));var u=n>0?1:-1;"unit"===a?c.push(g(i+u*eT)):c.push(g(o)),c=c.filter(function(e){return null!==e}).filter(function(e){return n<0?e<=i:e>=i}),"unit"===a&&(c=c.filter(function(e){return e!==i}));var d="unit"===a?i:o,h=Math.abs((s=c[0])-d);if(c.forEach(function(e){var t=Math.abs(e-d);t1){var f=(0,l.Z)(t);return f[r]=s,e(f,n-u,r,a)}return s}return"min"===n?ez:"max"===n?eL:void 0},b=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",a=e[n],s=v(e,t,n,r);return{value:s,changed:s!==a}},y=function(e){return null===eZ&&0===e||"number"==typeof eZ&&e3&&void 0!==arguments[3]?arguments[3]:"unit",s=e.map(m),i=s[r],o=v(s,t,r,a);if(s[r]=o,!1===n){var l=eZ||0;r>0&&s[r-1]!==i&&(s[r]=Math.max(s[r],s[r-1]+l)),r0;h-=1)for(var f=!0;y(s[h]-s[h-1])&&f;){var p=b(s,-1,h-1);s[h-1]=p.value,f=p.changed}for(var g=s.length-1;g>0;g-=1)for(var w=!0;y(s[g]-s[g-1])&&w;){var _=b(s,-1,g-1);s[g-1]=_.value,w=_.changed}for(var S=0;S=0?J+1:2;for(r=r.slice(0,s);r.length=0&&ex.current.focus(e)}e9(null)},[e5]);var e7=r.useMemo(function(){return(!eP||null!==eT)&&eP},[eP,eT]),te=(0,d.Z)(function(e,t){e3(e,t),null==K||K(eX(eV))}),tt=-1!==eQ;r.useEffect(function(){if(!tt){var e=eV.lastIndexOf(e0);ex.current.focus(e)}},[tt]);var tn=r.useMemo(function(){return(0,l.Z)(e2).sort(function(e,t){return e-t})},[e2]),tr=r.useMemo(function(){return ej?[tn[0],tn[tn.length-1]]:[ez,tn[0]]},[tn,ej,ez]),ta=(0,u.Z)(tr,2),ts=ta[0],ti=ta[1];r.useImperativeHandle(t,function(){return{focus:function(){ex.current.focus(0)},blur:function(){var e,t=document.activeElement;null!==(e=eR.current)&&void 0!==e&&e.contains(t)&&(null==t||t.blur())}}}),r.useEffect(function(){Z&&ex.current.focus(0)},[]);var to=r.useMemo(function(){return{min:ez,max:eL,direction:eC,disabled:I,keyboard:T,step:eT,included:ei,includedStart:ts,includedEnd:ti,range:ej,tabIndex:ey,ariaLabelForHandle:ew,ariaLabelledByForHandle:e_,ariaRequired:eS,ariaValueTextFormatterForHandle:ek,styles:M||{},classNames:R||{}}},[ez,eL,eC,I,T,eT,ei,ts,ti,ej,ey,ew,e_,eS,ek,M,R]);return r.createElement(_.Provider,{value:to},r.createElement("div",{ref:eR,className:s()(S,k,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(S,"-disabled"),I),"".concat(S,"-vertical"),ea),"".concat(S,"-horizontal"),!ea),"".concat(S,"-with-marks"),eN.length)),style:x,onMouseDown:function(e){e.preventDefault();var t,n=eR.current.getBoundingClientRect(),r=n.width,a=n.height,s=n.left,i=n.top,o=n.bottom,l=n.right,c=e.clientX,u=e.clientY;switch(eC){case"btt":t=(o-u)/a;break;case"ttb":t=(u-i)/a;break;case"rtl":t=(l-c)/r;break;default:t=(c-s)/r}e4(eB(ez+t*(eL-ez)),e)},id:j},r.createElement("div",{className:s()("".concat(S,"-rail"),null==R?void 0:R.rail),style:(0,i.Z)((0,i.Z)({},eu),null==M?void 0:M.rail)}),!1!==ev&&r.createElement(A,{prefixCls:S,style:el,values:eV,startPoint:eo,onStartMove:e7?te:void 0}),r.createElement(O,{prefixCls:S,marks:eN,dots:ep,style:ed,activeStyle:eh}),r.createElement(C,{ref:ex,prefixCls:S,style:ec,values:e2,draggingIndex:eQ,draggingDelete:e1,onStartMove:te,onOffsetChange:function(e,t){if(!I){var n=e$(eV,e,t);null==K||K(eX(eV)),eJ(n.values),e9(n.value)}},onFocus:N,onBlur:F,handleRender:eg,activeHandleRender:em,onChangeComplete:eG,onDelete:eO?function(e){if(!I&&eO&&!(eV.length<=eA)){var t=(0,l.Z)(eV);t.splice(e,1),null==K||K(eX(t)),eJ(t),ex.current.hideHelp(),ex.current.focus(Math.max(0,e-1))}}:void 0}),r.createElement(E,{prefixCls:S,marks:eN,onClick:e4})))}),Z=n(53346),N=n(86586);let F=(0,r.createContext)({});var q=n(28791),B=n(99981);let $=r.forwardRef((e,t)=>{let{open:n,draggingDelete:a,value:s}=e,i=(0,r.useRef)(null),o=n&&!a,l=(0,r.useRef)(null);function c(){Z.Z.cancel(l.current),l.current=null}return r.useEffect(()=>(o?l.current=(0,Z.Z)(()=>{var e;null===(e=i.current)||void 0===e||e.forceAlign(),l.current=null}):c(),c),[o,e.title,s]),r.createElement(B.Z,Object.assign({ref:(0,q.sQ)(i,t)},e,{open:o}))});var D=n(93463),H=n(54558),U=n(12918),W=n(99320),V=n(71140);let X=e=>{let{componentCls:t,antCls:n,controlSize:r,dotSize:a,marginFull:s,marginPart:i,colorFillContentHover:o,handleColorDisabled:l,calc:c,handleSize:u,handleSizeHover:d,handleActiveColor:h,handleActiveOutlineColor:f,handleLineWidth:p,handleLineWidthHover:g,motionDurationMid:m}=e;return{[t]:Object.assign(Object.assign({},(0,U.Wf)(e)),{position:"relative",height:r,margin:"".concat((0,D.bf)(i)," ").concat((0,D.bf)(s)),padding:0,cursor:"pointer",touchAction:"none","&-vertical":{margin:"".concat((0,D.bf)(s)," ").concat((0,D.bf)(i))},["".concat(t,"-rail")]:{position:"absolute",backgroundColor:e.railBg,borderRadius:e.borderRadiusXS,transition:"background-color ".concat(m)},["".concat(t,"-track,").concat(t,"-tracks")]:{position:"absolute",transition:"background-color ".concat(m)},["".concat(t,"-track")]:{backgroundColor:e.trackBg,borderRadius:e.borderRadiusXS},["".concat(t,"-track-draggable")]:{boxSizing:"content-box",backgroundClip:"content-box",border:"solid rgba(0,0,0,0)"},"&:hover":{["".concat(t,"-rail")]:{backgroundColor:e.railHoverBg},["".concat(t,"-track")]:{backgroundColor:e.trackHoverBg},["".concat(t,"-dot")]:{borderColor:o},["".concat(t,"-handle::after")]:{boxShadow:"0 0 0 ".concat((0,D.bf)(p)," ").concat(e.colorPrimaryBorderHover)},["".concat(t,"-dot-active")]:{borderColor:e.dotActiveBorderColor}},["".concat(t,"-handle")]:{position:"absolute",width:u,height:u,outline:"none",userSelect:"none","&-dragging-delete":{opacity:0},"&::before":{content:'""',position:"absolute",insetInlineStart:c(p).mul(-1).equal(),insetBlockStart:c(p).mul(-1).equal(),width:c(u).add(c(p).mul(2)).equal(),height:c(u).add(c(p).mul(2)).equal(),backgroundColor:"transparent"},"&::after":{content:'""',position:"absolute",insetBlockStart:0,insetInlineStart:0,width:u,height:u,backgroundColor:e.colorBgElevated,boxShadow:"0 0 0 ".concat((0,D.bf)(p)," ").concat(e.handleColor),outline:"0px solid transparent",borderRadius:"50%",cursor:"pointer",transition:"\n inset-inline-start ".concat(m,",\n inset-block-start ").concat(m,",\n width ").concat(m,",\n height ").concat(m,",\n box-shadow ").concat(m,",\n outline ").concat(m,"\n ")},"&:hover, &:active, &:focus":{"&::before":{insetInlineStart:c(d).sub(u).div(2).add(g).mul(-1).equal(),insetBlockStart:c(d).sub(u).div(2).add(g).mul(-1).equal(),width:c(d).add(c(g).mul(2)).equal(),height:c(d).add(c(g).mul(2)).equal()},"&::after":{boxShadow:"0 0 0 ".concat((0,D.bf)(g)," ").concat(h),outline:"6px solid ".concat(f),width:d,height:d,insetInlineStart:e.calc(u).sub(d).div(2).equal(),insetBlockStart:e.calc(u).sub(d).div(2).equal()}}},["&-lock ".concat(t,"-handle")]:{"&::before, &::after":{transition:"none"}},["".concat(t,"-mark")]:{position:"absolute",fontSize:e.fontSize},["".concat(t,"-mark-text")]:{position:"absolute",display:"inline-block",color:e.colorTextDescription,textAlign:"center",wordBreak:"keep-all",cursor:"pointer",userSelect:"none","&-active":{color:e.colorText}},["".concat(t,"-step")]:{position:"absolute",background:"transparent",pointerEvents:"none"},["".concat(t,"-dot")]:{position:"absolute",width:a,height:a,backgroundColor:e.colorBgElevated,border:"".concat((0,D.bf)(p)," solid ").concat(e.dotBorderColor),borderRadius:"50%",cursor:"pointer",transition:"border-color ".concat(e.motionDurationSlow),pointerEvents:"auto","&-active":{borderColor:e.dotActiveBorderColor}},["&".concat(t,"-disabled")]:{cursor:"not-allowed",["".concat(t,"-rail")]:{backgroundColor:"".concat(e.railBg," !important")},["".concat(t,"-track")]:{backgroundColor:"".concat(e.trackBgDisabled," !important")},["\n ".concat(t,"-dot\n ")]:{backgroundColor:e.colorBgElevated,borderColor:e.trackBgDisabled,boxShadow:"none",cursor:"not-allowed"},["".concat(t,"-handle::after")]:{backgroundColor:e.colorBgElevated,cursor:"not-allowed",width:u,height:u,boxShadow:"0 0 0 ".concat((0,D.bf)(p)," ").concat(l),insetInlineStart:0,insetBlockStart:0},["\n ".concat(t,"-mark-text,\n ").concat(t,"-dot\n ")]:{cursor:"not-allowed !important"}},["&-tooltip ".concat(n,"-tooltip-inner")]:{minWidth:"unset"}})}},J=(e,t)=>{let{componentCls:n,railSize:r,handleSize:a,dotSize:s,marginFull:i,calc:o}=e,l=t?"width":"height",c=t?"height":"width",u=t?"insetBlockStart":"insetInlineStart",d=t?"top":"insetInlineStart",h=o(r).mul(3).sub(a).div(2).equal(),f=o(a).sub(r).div(2).equal(),p=t?{borderWidth:"".concat((0,D.bf)(f)," 0"),transform:"translateY(".concat((0,D.bf)(o(f).mul(-1).equal()),")")}:{borderWidth:"0 ".concat((0,D.bf)(f)),transform:"translateX(".concat((0,D.bf)(e.calc(f).mul(-1).equal()),")")};return{[t?"paddingBlock":"paddingInline"]:r,[c]:o(r).mul(3).equal(),["".concat(n,"-rail")]:{[l]:"100%",[c]:r},["".concat(n,"-track,").concat(n,"-tracks")]:{[c]:r},["".concat(n,"-track-draggable")]:Object.assign({},p),["".concat(n,"-handle")]:{[u]:h},["".concat(n,"-mark")]:{insetInlineStart:0,top:0,[d]:o(r).mul(3).add(t?0:i).equal(),[l]:"100%"},["".concat(n,"-step")]:{insetInlineStart:0,top:0,[d]:r,[l]:"100%",[c]:r},["".concat(n,"-dot")]:{position:"absolute",[u]:o(r).sub(s).div(2).equal()}}},G=e=>{let{componentCls:t,marginPartWithMark:n}=e;return{["".concat(t,"-horizontal")]:Object.assign(Object.assign({},J(e,!0)),{["&".concat(t,"-with-marks")]:{marginBottom:n}})}},K=e=>{let{componentCls:t}=e;return{["".concat(t,"-vertical")]:Object.assign(Object.assign({},J(e,!1)),{height:"100%"})}};var Y=(0,W.I$)("Slider",e=>{let t=(0,V.IX)(e,{marginPart:e.calc(e.controlHeight).sub(e.controlSize).div(2).equal(),marginFull:e.calc(e.controlSize).div(2).equal(),marginPartWithMark:e.calc(e.controlHeightLG).sub(e.controlSize).equal()});return[X(t),G(t),K(t)]},e=>{let t=e.controlHeightLG/4,n=e.controlHeightSM/2,r=e.lineWidth+1,a=e.lineWidth+1.5,s=e.colorPrimary,i=new H.t(s).setA(.2).toRgbString();return{controlSize:t,railSize:4,handleSize:t,handleSizeHover:n,dotSize:8,handleLineWidth:r,handleLineWidthHover:a,railBg:e.colorFillTertiary,railHoverBg:e.colorFillSecondary,trackBg:e.colorPrimaryBorder,trackHoverBg:e.colorPrimaryBorderHover,handleColor:e.colorPrimaryBorder,handleActiveColor:s,handleActiveOutlineColor:i,handleColorDisabled:new H.t(e.colorTextDisabled).onBackground(e.colorBgContainer).toHexString(),dotBorderColor:e.colorBorderSecondary,dotActiveBorderColor:e.colorPrimaryBorder,trackBgDisabled:e.colorBgContainerDisabled}});function Q(){let[e,t]=r.useState(!1),n=r.useRef(null),a=()=>{Z.Z.cancel(n.current)};return r.useEffect(()=>a,[]),[e,e=>{a(),e?t(e):n.current=(0,Z.Z)(()=>{t(e)})}]}var ee=n(71744),et=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},en=r.forwardRef((e,t)=>{let{prefixCls:n,range:a,className:i,rootClassName:o,style:l,disabled:c,tooltipPrefixCls:u,tipFormatter:d,tooltipVisible:h,getTooltipPopupContainer:f,tooltipPlacement:p,tooltip:g={},onChangeComplete:m,classNames:v,styles:b}=e,y=et(e,["prefixCls","range","className","rootClassName","style","disabled","tooltipPrefixCls","tipFormatter","tooltipVisible","getTooltipPopupContainer","tooltipPlacement","tooltip","onChangeComplete","classNames","styles"]),{vertical:w}=e,{getPrefixCls:_,direction:S,className:k,style:x,classNames:R,styles:C,getPopupContainer:M}=(0,ee.dj)("slider"),E=r.useContext(N.Z),{handleRender:j,direction:O}=r.useContext(F),P="rtl"===(O||S),[A,I]=Q(),[z,L]=Q(),q=Object.assign({},g),{open:B,placement:D,getPopupContainer:H,prefixCls:U,formatter:W}=q,V=null!=B?B:h,X=(A||z)&&!1!==V,J=W||null===W?W:d||null===d?d:e=>"number"==typeof e?e.toString():"",[G,K]=Q(),en=(e,t)=>e||(t?P?"left":"right":"top"),er=_("slider",n),[ea,es,ei]=Y(er),eo=s()(i,k,R.root,null==v?void 0:v.root,o,{["".concat(er,"-rtl")]:P,["".concat(er,"-lock")]:G},es,ei);P&&!y.vertical&&(y.reverse=!y.reverse),r.useEffect(()=>{let e=()=>{(0,Z.Z)(()=>{L(!1)},1)};return document.addEventListener("mouseup",e),()=>{document.removeEventListener("mouseup",e)}},[]);let el=a&&!V,ec=j||((e,t)=>{let{index:n}=t,a=e.props;function s(e,t,n){var r,s;n&&(null===(r=y[e])||void 0===r||r.call(y,t)),null===(s=a[e])||void 0===s||s.call(a,t)}let i=Object.assign(Object.assign({},a),{onMouseEnter:e=>{I(!0),s("onMouseEnter",e)},onMouseLeave:e=>{I(!1),s("onMouseLeave",e)},onMouseDown:e=>{L(!0),K(!0),s("onMouseDown",e)},onFocus:e=>{var t;L(!0),null===(t=y.onFocus)||void 0===t||t.call(y,e),s("onFocus",e,!0)},onBlur:e=>{var t;L(!1),null===(t=y.onBlur)||void 0===t||t.call(y,e),s("onBlur",e,!0)}}),o=r.cloneElement(e,i),l=(!!V||X)&&null!==J;return el?o:r.createElement($,Object.assign({},q,{prefixCls:_("tooltip",null!=U?U:u),title:J?J(t.value):"",value:t.value,open:l,placement:en(null!=D?D:p,w),key:n,classNames:{root:"".concat(er,"-tooltip")},getPopupContainer:H||f||M}),o)}),eu=el?(e,t)=>{let n=r.cloneElement(e,{style:Object.assign(Object.assign({},e.props.style),{visibility:"hidden"})});return r.createElement($,Object.assign({},q,{prefixCls:_("tooltip",null!=U?U:u),title:J?J(t.value):"",open:null!==J&&X,placement:en(null!=D?D:p,w),key:"tooltip",classNames:{root:"".concat(er,"-tooltip")},getPopupContainer:H||f||M,draggingDelete:t.draggingDelete}),n)}:void 0,ed=Object.assign(Object.assign(Object.assign(Object.assign({},C.root),x),null==b?void 0:b.root),l),eh=Object.assign(Object.assign({},C.tracks),null==b?void 0:b.tracks),ef=s()(R.tracks,null==v?void 0:v.tracks);return ea(r.createElement(T,Object.assign({},y,{classNames:Object.assign({handle:s()(R.handle,null==v?void 0:v.handle),rail:s()(R.rail,null==v?void 0:v.rail),track:s()(R.track,null==v?void 0:v.track)},ef?{tracks:ef}:{}),styles:Object.assign({handle:Object.assign(Object.assign({},C.handle),null==b?void 0:b.handle),rail:Object.assign(Object.assign({},C.rail),null==b?void 0:b.rail),track:Object.assign(Object.assign({},C.track),null==b?void 0:b.track)},Object.keys(eh).length?{tracks:eh}:{}),step:y.step,range:a,className:eo,style:ed,disabled:null!=c?c:E,ref:t,prefixCls:er,handleRender:ec,activeHandleRender:eu,onChangeComplete:e=>{null==m||m(e),K(!1)}})))})},33145:function(e,t,n){"use strict";n.d(t,{default:function(){return a.a}});var r=n(48461),a=n.n(r)},65878:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return y}});let r=n(47043),a=n(53099),s=n(57437),i=a._(n(2265)),o=r._(n(54887)),l=r._(n(38293)),c=n(55346),u=n(90128),d=n(62589);n(31765);let h=n(25523),f=r._(n(5084)),p={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function g(e,t,n,r,a,s,i){let o=null==e?void 0: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),null==n?void 0:n.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,a=!1;n.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>a,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{a=!0,t.stopPropagation()}})}(null==r?void 0:r.current)&&r.current(e)}}))}function m(e){return i.use?{fetchPriority:e}:{fetchpriority:e}}"undefined"==typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let v=(0,i.forwardRef)((e,t)=>{let{src:n,srcSet:r,sizes:a,height:o,width:l,decoding:c,className:u,style:d,fetchPriority:h,placeholder:f,loading:p,unoptimized:v,fill:b,onLoadRef:y,onLoadingCompleteRef:w,setBlurComplete:_,setShowAltText:S,sizesInput:k,onLoad:x,onError:R,...C}=e;return(0,s.jsx)("img",{...C,...m(h),loading:p,width:l,height:o,decoding:c,"data-nimg":b?"fill":"1",className:u,style:d,sizes:a,srcSet:r,src:n,ref:(0,i.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(R&&(e.src=e.src),e.complete&&g(e,f,y,w,_,v,k))},[n,f,y,w,_,R,v,k,t]),onLoad:e=>{g(e.currentTarget,f,y,w,_,v,k)},onError:e=>{S(!0),"empty"!==f&&_(!0),R&&R(e)}})});function b(e){let{isAppRouter:t,imgAttributes:n}=e,r={as:"image",imageSrcSet:n.srcSet,imageSizes:n.sizes,crossOrigin:n.crossOrigin,referrerPolicy:n.referrerPolicy,...m(n.fetchPriority)};return t&&o.default.preload?(o.default.preload(n.src,r),null):(0,s.jsx)(l.default,{children:(0,s.jsx)("link",{rel:"preload",href:n.srcSet?void 0:n.src,...r},"__nimg-"+n.src+n.srcSet+n.sizes)})}let y=(0,i.forwardRef)((e,t)=>{let n=(0,i.useContext)(h.RouterContext),r=(0,i.useContext)(d.ImageConfigContext),a=(0,i.useMemo)(()=>{var e;let t=p||r||u.imageConfigDefault,n=[...t.deviceSizes,...t.imageSizes].sort((e,t)=>e-t),a=t.deviceSizes.sort((e,t)=>e-t),s=null==(e=t.qualities)?void 0:e.sort((e,t)=>e-t);return{...t,allSizes:n,deviceSizes:a,qualities:s}},[r]),{onLoad:o,onLoadingComplete:l}=e,g=(0,i.useRef)(o);(0,i.useEffect)(()=>{g.current=o},[o]);let m=(0,i.useRef)(l);(0,i.useEffect)(()=>{m.current=l},[l]);let[y,w]=(0,i.useState)(!1),[_,S]=(0,i.useState)(!1),{props:k,meta:x}=(0,c.getImgProps)(e,{defaultLoader:f.default,imgConf:a,blurComplete:y,showAltText:_});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v,{...k,unoptimized:x.unoptimized,placeholder:x.placeholder,fill:x.fill,onLoadRef:g,onLoadingCompleteRef:m,setBlurComplete:w,setShowAltText:S,sizesInput:e.sizes,ref:t}),x.priority?(0,s.jsx)(b,{isAppRouter:!n,imgAttributes:k}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},24601:function(){},91436:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return r}});let r=n(47043)._(n(2265)).default.createContext({})},23964:function(e,t){"use strict";function n(e){let{ampFirst:t=!1,hybrid:n=!1,hasQuery:r=!1}=void 0===e?{}:e;return t||n&&r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return n}})},55346:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return o}}),n(31765);let r=n(96496),a=n(90128);function s(e){return void 0!==e.default}function i(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 o(e,t){var n,o;let l,c,u,{src:d,sizes:h,unoptimized:f=!1,priority:p=!1,loading:g,className:m,quality:v,width:b,height:y,fill:w=!1,style:_,overrideSrc:S,onLoad:k,onLoadingComplete:x,placeholder:R="empty",blurDataURL:C,fetchPriority:M,decoding:E="async",layout:j,objectFit:O,objectPosition:P,lazyBoundary:A,lazyRoot:I,...z}=e,{imgConf:L,showAltText:T,blurComplete:Z,defaultLoader:N}=t,F=L||a.imageConfigDefault;if("allSizes"in F)l=F;else{let e=[...F.deviceSizes,...F.imageSizes].sort((e,t)=>e-t),t=F.deviceSizes.sort((e,t)=>e-t),r=null==(n=F.qualities)?void 0:n.sort((e,t)=>e-t);l={...F,allSizes:e,deviceSizes:t,qualities:r}}if(void 0===N)throw Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config");let q=z.loader||N;delete z.loader,delete z.srcSet;let B="__next_img_default"in q;if(B){if("custom"===l.loader)throw Error('Image with src "'+d+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=q;q=t=>{let{config:n,...r}=t;return e(r)}}if(j){"fill"===j&&(w=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[j];e&&(_={..._,...e});let t={responsive:"100vw",fill:"100vw"}[j];t&&!h&&(h=t)}let $="",D=i(b),H=i(y);if("object"==typeof(o=d)&&(s(o)||void 0!==o.src)){let e=s(d)?d.default:d;if(!e.src)throw 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(e));if(!e.height||!e.width)throw 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(e));if(c=e.blurWidth,u=e.blurHeight,C=C||e.blurDataURL,$=e.src,!w){if(D||H){if(D&&!H){let t=D/e.width;H=Math.round(e.height*t)}else if(!D&&H){let t=H/e.height;D=Math.round(e.width*t)}}else D=e.width,H=e.height}}let U=!p&&("lazy"===g||void 0===g);(!(d="string"==typeof d?d:$)||d.startsWith("data:")||d.startsWith("blob:"))&&(f=!0,U=!1),l.unoptimized&&(f=!0),B&&d.endsWith(".svg")&&!l.dangerouslyAllowSVG&&(f=!0),p&&(M="high");let W=i(v),V=Object.assign(w?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:O,objectPosition:P}:{},T?{}:{color:"transparent"},_),X=Z||"empty"===R?null:"blur"===R?'url("data:image/svg+xml;charset=utf-8,'+(0,r.getImageBlurSvg)({widthInt:D,heightInt:H,blurWidth:c,blurHeight:u,blurDataURL:C||"",objectFit:V.objectFit})+'")':'url("'+R+'")',J=X?{backgroundSize:V.objectFit||"cover",backgroundPosition:V.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:X}:{},G=function(e){let{config:t,src:n,unoptimized:r,width:a,quality:s,sizes:i,loader:o}=e;if(r)return{src:n,srcSet:void 0,sizes:void 0};let{widths:l,kind:c}=function(e,t,n){let{deviceSizes:r,allSizes:a}=e;if(n){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let r;r=e.exec(n);r)t.push(parseInt(r[2]));if(t.length){let e=.01*Math.min(...t);return{widths:a.filter(t=>t>=r[0]*e),kind:"w"}}return{widths:a,kind:"w"}}return"number"!=typeof t?{widths:r,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>a.find(t=>t>=e)||a[a.length-1]))],kind:"x"}}(t,a,i),u=l.length-1;return{sizes:i||"w"!==c?i:"100vw",srcSet:l.map((e,r)=>o({config:t,src:n,quality:s,width:e})+" "+("w"===c?e:r+1)+c).join(", "),src:o({config:t,src:n,quality:s,width:l[u]})}}({config:l,src:d,unoptimized:f,width:D,quality:W,sizes:h,loader:q});return{props:{...z,loading:U?"lazy":g,fetchPriority:M,width:D,height:H,decoding:E,className:m,style:{...V,...J},sizes:G.sizes,srcSet:G.srcSet,src:S||G.src},meta:{unoptimized:f,priority:p,placeholder:R,fill:w}}}},38293:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return g},defaultHead:function(){return d}});let r=n(47043),a=n(53099),s=n(57437),i=a._(n(2265)),o=r._(n(17421)),l=n(91436),c=n(48701),u=n(23964);function d(e){void 0===e&&(e=!1);let t=[(0,s.jsx)("meta",{charSet:"utf-8"})];return e||t.push((0,s.jsx)("meta",{name:"viewport",content:"width=device-width"})),t}function h(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===i.default.Fragment?e.concat(i.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}n(31765);let f=["name","httpEquiv","charSet","itemProp"];function p(e,t){let{inAmpMode:n}=t;return e.reduce(h,[]).reverse().concat(d(n).reverse()).filter(function(){let e=new Set,t=new Set,n=new Set,r={};return a=>{let s=!0,i=!1;if(a.key&&"number"!=typeof a.key&&a.key.indexOf("$")>0){i=!0;let t=a.key.slice(a.key.indexOf("$")+1);e.has(t)?s=!1:e.add(t)}switch(a.type){case"title":case"base":t.has(a.type)?s=!1:t.add(a.type);break;case"meta":for(let e=0,t=f.length;e{let r=e.key||t;if(!n&&"link"===e.type&&e.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(t=>e.props.href.startsWith(t))){let t={...e.props||{}};return t["data-href"]=t.href,t.href=void 0,t["data-optimized-fonts"]=!0,i.default.cloneElement(e,t)}return i.default.cloneElement(e,{key:r})})}let g=function(e){let{children:t}=e,n=(0,i.useContext)(l.AmpStateContext),r=(0,i.useContext)(c.HeadManagerContext);return(0,s.jsx)(o.default,{reduceComponentsToState:p,headManager:r,inAmpMode:(0,u.isInAmpMode)(n),children:t})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},96496:function(e,t){"use strict";function n(e){let{widthInt:t,heightInt:n,blurWidth:r,blurHeight:a,blurDataURL:s,objectFit:i}=e,o=r?40*r:t,l=a?40*a:n,c=o&&l?"viewBox='0 0 "+o+" "+l+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+c+"%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='"+(c?"none":"contain"===i?"xMidYMid":"cover"===i?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+s+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},62589:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return s}});let r=n(47043)._(n(2265)),a=n(90128),s=r.default.createContext(a.imageConfigDefault)},90128:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{VALID_LOADERS:function(){return n},imageConfigDefault:function(){return r}});let n=["default","imgix","cloudinary","akamai","custom"],r={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"inline",localPatterns:void 0,remotePatterns:[],qualities:void 0,unoptimized:!1}},48461:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return l},getImageProps:function(){return o}});let r=n(47043),a=n(55346),s=n(65878),i=r._(n(5084));function o(e){let{props:t}=(0,a.getImgProps)(e,{defaultLoader:i.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,n]of Object.entries(t))void 0===n&&delete t[e];return{props:t}}let l=s.Image},5084:function(e,t){"use strict";function n(e){var t;let{config:n,src:r,width:a,quality:s}=e,i=s||(null==(t=n.qualities)?void 0:t.reduce((e,t)=>Math.abs(t-75){}:r.useLayoutEffect,i=a?()=>{}:r.useEffect;function o(e){let{headManager:t,reduceComponentsToState:n}=e;function o(){if(t&&t.mountedInstances){let a=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(n(a,e))}}if(a){var l;null==t||null==(l=t.mountedInstances)||l.add(e.children),o()}return s(()=>{var n;return null==t||null==(n=t.mountedInstances)||n.add(e.children),()=>{var n;null==t||null==(n=t.mountedInstances)||n.delete(e.children)}}),s(()=>(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}},18975:function(e,t,n){"use strict";var r=n(40257);n(24601);var a=n(2265),s=a&&"object"==typeof a&&"default"in a?a:{default:a},i=void 0!==r&&r.env&&!0,o=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,n=t.name,r=void 0===n?"stylesheet":n,a=t.optimizeForSpeed,s=void 0===a?i:a;c(o(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",c("boolean"==typeof s,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=s,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t=e.prototype;return t.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()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=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,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t>>0},d={};function h(e,t){if(!t)return"jsx-"+e;var n=String(t),r=e+n;return d[r]||(d[r]="jsx-"+u(e+"-"+n)),d[r]}function f(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var n=e+t;return d[n]||(d[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),d[n]}var p=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,r=void 0===n?null:n,a=t.optimizeForSpeed,s=void 0!==a&&a;this._sheet=r||new l({name:"styled-jsx",optimizeForSpeed:s}),this._sheet.inject(),r&&"boolean"==typeof s&&(this._sheet.setOptimizeForSpeed(s),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),r=n.styleId,a=n.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var s=a.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=s,this._instancesCounts[r]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var r=this._fromServer&&this._fromServer[n];r?(r.parentNode.removeChild(r),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},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]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],r=e[1];return s.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,r=e.id;if(n){var a=h(r,n);return{styleId:a,rules:Array.isArray(t)?t.map(function(e){return f(a,e)}):[f(a,t)]}}return{styleId:h(r),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=a.createContext(null);g.displayName="StyleSheetContext";var m=s.default.useInsertionEffect||s.default.useLayoutEffect,v="undefined"!=typeof window?new p:void 0;function b(e){var t=v||a.useContext(g);return t&&("undefined"==typeof window?t.add(e):m(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}b.dynamic=function(e){return e.map(function(e){return h(e[0],e[1])}).join(" ")},t.style=b},29:function(e,t,n){"use strict";e.exports=n(18975).style},85498:function(e,t,n){"use strict";var r,a,s,i,o,l,c,u,d,h,f,p,g,m,v,b,y,w,_,S,k,x,R,C,M,E,j,O,P,A,I,z,L,T,Z,N,F,q,B,$,D,H,U,W,V,X,J,G,K;let Y,Q,ee;function et(e,t,n,r,a){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!a)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,n):a?a.value=n:t.set(e,n),n}function en(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}n.d(t,{ZP:function(){return tB}});let er=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return er=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>255*Math.random()&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^n()&15>>+e/4).toString(16))};function ea(e){return"object"==typeof e&&null!==e&&("name"in e&&"AbortError"===e.name||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}let es=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e){try{if("[object Error]"===Object.prototype.toString.call(e)){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};class ei extends Error{}class eo extends ei{constructor(e,t,n,r){super(`${eo.makeMessage(e,t,n)}`),this.status=e,this.headers=r,this.requestID=r?.get("request-id"),this.error=t}static makeMessage(e,t,n){let r=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,t,n,r){return e&&r?400===e?new ed(e,t,n,r):401===e?new eh(e,t,n,r):403===e?new ef(e,t,n,r):404===e?new ep(e,t,n,r):409===e?new eg(e,t,n,r):422===e?new em(e,t,n,r):429===e?new ev(e,t,n,r):e>=500?new eb(e,t,n,r):new eo(e,t,n,r):new ec({message:n,cause:es(t)})}}class el extends eo{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class ec extends eo{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class eu extends ec{constructor({message:e}={}){super({message:e??"Request timed out."})}}class ed extends eo{}class eh extends eo{}class ef extends eo{}class ep extends eo{}class eg extends eo{}class em extends eo{}class ev extends eo{}class eb extends eo{}let ey=/^[a-z][a-z0-9+.-]*:/i,ew=e=>ey.test(e);function e_(e){return"object"!=typeof e?{}:e??{}}let eS=(e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new ei(`${e} must be an integer`);if(t<0)throw new ei(`${e} must be a positive integer`);return t},ek=e=>{try{return JSON.parse(e)}catch(e){return}},ex=e=>new Promise(t=>setTimeout(t,e)),eR={off:0,error:200,warn:300,info:400,debug:500},eC=(e,t,n)=>{if(e){if(Object.prototype.hasOwnProperty.call(eR,e))return e;eP(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(eR))}`)}};function eM(){}function eE(e,t,n){return!t||eR[e]>eR[n]?eM:t[e].bind(t)}let ej={error:eM,warn:eM,info:eM,debug:eM},eO=new WeakMap;function eP(e){let t=e.logger,n=e.logLevel??"off";if(!t)return ej;let r=eO.get(t);if(r&&r[0]===n)return r[1];let a={error:eE("error",t,n),warn:eE("warn",t,n),info:eE("info",t,n),debug:eE("debug",t,n)};return eO.set(t,[n,a]),a}let eA=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,"x-api-key"===e.toLowerCase()||"authorization"===e.toLowerCase()||"cookie"===e.toLowerCase()||"set-cookie"===e.toLowerCase()?"***":t]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e),eI="0.54.0",ez=()=>"undefined"!=typeof window&&void 0!==window.document&&"undefined"!=typeof navigator,eL=()=>{let e="undefined"!=typeof Deno&&null!=Deno.build?"deno":"undefined"!=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":eI,"X-Stainless-OS":eZ(Deno.build.os),"X-Stainless-Arch":eT(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("undefined"!=typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eI,"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":eI,"X-Stainless-OS":eZ(globalThis.process.platform??"unknown"),"X-Stainless-Arch":eT(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=function(){if("undefined"==typeof navigator||!navigator)return null;for(let{key:e,pattern:t}of[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n){let t=n[1]||0,r=n[2]||0,a=n[3]||0;return{browser:e,version:`${t}.${r}.${a}`}}}return null}();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eI,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eI,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},eT=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",eZ=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown",eN=()=>Y??(Y=eL());function eF(...e){let t=globalThis.ReadableStream;if(void 0===t)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function eq(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return eF({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function eB(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function e$(e){if(null===e||"object"!=typeof e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}let eD=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function eH(e){let t;return(Q??(Q=(t=new globalThis.TextEncoder).encode.bind(t)))(e)}function eU(e){let t;return(ee??(ee=(t=new globalThis.TextDecoder).decode.bind(t)))(e)}class eW{constructor(){r.set(this,void 0),a.set(this,void 0),et(this,r,new Uint8Array,"f"),et(this,a,null,"f")}decode(e){let t;if(null==e)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):"string"==typeof e?eH(e):e;et(this,r,function(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}([en(this,r,"f"),n]),"f");let s=[];for(;null!=(t=function(e,t){for(let n=t??0;n({next:()=>{if(0===r.length){let r=n.next();e.push(r),t.push(r)}return r.shift()}});return[new eV(()=>r(e),this.controller),new eV(()=>r(t),this.controller)]}toReadableStream(){let e;let t=this;return eF({async start(){e=t[Symbol.asyncIterator]()},async pull(t){try{let{value:n,done:r}=await e.next();if(r)return t.close();let a=eH(JSON.stringify(n)+"\n");t.enqueue(a)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}}async function*eX(e,t){if(!e.body){if(t.abort(),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product)throw new ei("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ei("Attempted to iterate over a response with no body")}let n=new eG,r=new eW;for await(let t of eJ(eB(e.body)))for(let e of r.decode(t)){let t=n.decode(e);t&&(yield t)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*eJ(e){let t=new Uint8Array;for await(let n of e){let e;if(null==n)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):"string"==typeof n?eH(n):n,a=new Uint8Array(t.length+r.length);for(a.set(t),a.set(r,t.length),t=a;-1!==(e=function(e){for(let t=0;t0&&(yield t)}class eG{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join("\n"),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,n,r]=function(e,t){let n=e.indexOf(":");return -1!==n?[e.substring(0,n),":",e.substring(n+t.length)]:[e,"",""]}(e,":");return r.startsWith(" ")&&(r=r.substring(1)),"event"===t?this.event=r:"data"===t&&this.data.push(r),null}}async function eK(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:a,startTime:s}=t,i=await (async()=>{if(t.options.stream)return(eP(e).debug("response",n.status,n.url,n.headers,n.body),t.options.__streamClass)?t.options.__streamClass.fromSSEResponse(n,t.controller):eV.fromSSEResponse(n,t.controller);if(204===n.status)return null;if(t.options.__binaryResponse)return n;let r=n.headers.get("content-type"),a=r?.split(";")[0]?.trim();return a?.includes("application/json")||a?.endsWith("+json")?eY(await n.json(),n):await n.text()})();return eP(e).debug(`[${r}] response parsed`,eA({retryOfRequestLogID:a,url:n.url,status:n.status,body:i,durationMs:Date.now()-s})),i}function eY(e,t){return!e||"object"!=typeof e||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}class eQ extends Promise{constructor(e,t,n=eK){super(e=>{e(null)}),this.responsePromise=t,this.parseResponse=n,s.set(this,void 0),et(this,s,e,"f")}_thenUnwrap(e){return new eQ(en(this,s,"f"),this.responsePromise,async(t,n)=>eY(e(await this.parseResponse(t,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(en(this,s,"f"),e))),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}s=new WeakMap;class e0{constructor(e,t,n,r){i.set(this,void 0),et(this,i,e,"f"),this.options=r,this.response=t,this.body=n}hasNextPage(){return!!this.getPaginatedItems().length&&null!=this.nextPageRequestOptions()}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new ei("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await en(this,i,"f").requestAPIList(this.constructor,e)}async *iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async *[(i=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}}class e1 extends eQ{constructor(e,t,n){super(e,t,async(e,t)=>new n(e,t.response,await eK(e,t),t.options))}async *[Symbol.asyncIterator](){for await(let e of(await this))yield e}}class e2 extends e0{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return!1!==this.has_more&&super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let e=this.first_id;return e?{...this.options,query:{...e_(this.options.query),before_id:e}}:null}let e=this.last_id;return e?{...this.options,query:{...e_(this.options.query),after_id:e}}:null}}let e3=()=>{if("undefined"==typeof File){let{process:e}=globalThis;throw Error("`File` is not defined as a global, which is required for file uploads."+("string"==typeof e?.versions?.node&&20>parseInt(e.versions.node.split("."))?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function e4(e,t,n){return e3(),new File(e,t??"unknown_file",n)}function e6(e){return("object"==typeof e&&null!==e&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}let e8=e=>null!=e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator],e5=async(e,t)=>({...e,body:await e7(e.body,t)}),e9=new WeakMap,e7=async(e,t)=>{if(!await function(e){let t="function"==typeof e?e:e.fetch,n=e9.get(t);if(n)return n;let r=(async()=>{try{let e="Response"in t?t.Response:(await t("data:,")).constructor,n=new FormData;if(n.toString()===await new e(n).text())return!1;return!0}catch{return!0}})();return e9.set(t,r),r}(t))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(e||{}).map(([e,t])=>tr(n,e,t))),n},te=e=>e instanceof Blob&&"name"in e,tt=e=>"object"==typeof e&&null!==e&&(e instanceof Response||e8(e)||te(e)),tn=e=>{if(tt(e))return!0;if(Array.isArray(e))return e.some(tn);if(e&&"object"==typeof e){for(let t in e)if(tn(e[t]))return!0}return!1},tr=async(e,t,n)=>{if(void 0!==n){if(null==n)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)e.append(t,String(n));else if(n instanceof Response){let r={},a=n.headers.get("Content-Type");a&&(r={type:a}),e.append(t,e4([await n.blob()],e6(n),r))}else if(e8(n))e.append(t,e4([await new Response(eq(n)).blob()],e6(n)));else if(te(n))e.append(t,e4([n],e6(n),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(n=>tr(e,t+"[]",n)));else if("object"==typeof n)await Promise.all(Object.entries(n).map(([n,r])=>tr(e,`${t}[${n}]`,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}},ta=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer,ts=e=>null!=e&&"object"==typeof e&&"string"==typeof e.name&&"number"==typeof e.lastModified&&ta(e),ti=e=>null!=e&&"object"==typeof e&&"string"==typeof e.url&&"function"==typeof e.blob;async function to(e,t,n){if(e3(),e=await e,t||(t=e6(e)),ts(e))return e instanceof File&&null==t&&null==n?e:e4([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(ti(e)){let r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),e4(await tl(r),t,n)}let r=await tl(e);if(!n?.type){let e=r.find(e=>"object"==typeof e&&"type"in e&&e.type);"string"==typeof e&&(n={...n,type:e})}return e4(r,t,n)}async function tl(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(ta(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(e8(e))for await(let n of e)t.push(...await tl(n));else{let t=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${t?`; constructor: ${t}`:""}${function(e){if("object"!=typeof e||null===e)return"";let t=Object.getOwnPropertyNames(e);return`; props: [${t.map(e=>`"${e}"`).join(", ")}]`}(e)}`)}return t}class tc{constructor(e){this._client=e}}let tu=Symbol.for("brand.privateNullableHeaders"),td=Array.isArray,th=e=>{let t=new Headers,n=new Set;for(let r of e){let e=new Set;for(let[a,s]of function*(e){let t;if(!e)return;if(tu in e){let{values:t,nulls:n}=e;for(let e of(yield*t.entries(),n))yield[e,null];return}let n=!1;for(let r of(e instanceof Headers?t=e.entries():td(e)?t=e:(n=!0,t=Object.entries(e??{})),t)){let e=r[0];if("string"!=typeof e)throw TypeError("expected header name to be a string");let t=td(r[1])?r[1]:[r[1]],a=!1;for(let r of t)void 0!==r&&(n&&!a&&(a=!0,yield[e,null]),yield[e,r])}}(r)){let r=a.toLowerCase();e.has(r)||(t.delete(a),e.add(r)),null===s?(t.delete(a),n.add(r)):(t.append(a,s),n.delete(r))}}return{[tu]:!0,values:t,nulls:n}};function tf(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}let tp=((e=tf)=>function(t,...n){let r;if(1===t.length)return t[0];let a=!1,s=t.reduce((t,r,s)=>(/[?#]/.test(r)&&(a=!0),t+r+(s===n.length?"":(a?encodeURIComponent:e)(String(n[s])))),""),i=s.split(/[?#]/,1)[0],o=[],l=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;for(;null!==(r=l.exec(i));)o.push({start:r.index,length:r[0].length});if(o.length>0){let e=0,t=o.reduce((t,n)=>{let r=" ".repeat(n.start-e),a="^".repeat(n.length);return e=n.start+n.length,t+r+a},"");throw new ei(`Path parameters result in path with invalid segments: +${s} +${t}`)}return s})(tf);class tg extends tc{list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/files",e2,{query:r,...t,headers:th([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(tp`/v1/files/${e}`,{...n,headers:th([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,t={},n){let{betas:r}=t??{};return this._client.get(tp`/v1/files/${e}/content`,{...n,headers:th([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,t={},n){let{betas:r}=t??{};return this._client.get(tp`/v1/files/${e}`,{...n,headers:th([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,t){let{betas:n,...r}=e;return this._client.post("/v1/files",e5({body:r,...t,headers:th([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},t?.headers])},this._client))}}class tm extends tc{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(tp`/v1/models/${e}?beta=true`,{...n,headers:th([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/models?beta=true",e2,{query:r,...t,headers:th([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers])})}}class tv{constructor(e,t){this.iterator=e,this.controller=t}async *decoder(){let e=new eW;for await(let t of this.iterator)for(let n of e.decode(t))yield JSON.parse(n);for(let t of e.flush())yield JSON.parse(t)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,t){if(!e.body){if(t.abort(),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product)throw new ei("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ei("Attempted to iterate over a response with no body")}return new tv(eB(e.body),t)}}class tb extends tc{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/messages/batches?beta=true",{body:r,...t,headers:th([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(tp`/v1/messages/batches/${e}?beta=true`,{...n,headers:th([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",e2,{query:r,...t,headers:th([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(tp`/v1/messages/batches/${e}?beta=true`,{...n,headers:th([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,t={},n){let{betas:r}=t??{};return this._client.post(tp`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:th([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,t={},n){let r=await this.retrieve(e);if(!r.results_url)throw new ei(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{betas:a}=t??{};return this._client.get(r.results_url,{...n,headers:th([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((e,t)=>tv.fromResponse(t.response,t.controller))}}let ty=e=>{let t=0,n=[];for(;t{if(0===e.length)return e;let t=e[e.length-1];switch(t.type){case"separator":return tw(e=e.slice(0,e.length-1));case"number":let n=t.value[t.value.length-1];if("."===n||"-"===n)return tw(e=e.slice(0,e.length-1));case"string":let r=e[e.length-2];if(r?.type==="delimiter"||r?.type==="brace"&&"{"===r.value)return tw(e=e.slice(0,e.length-1));break;case"delimiter":return tw(e=e.slice(0,e.length-1))}return e},t_=e=>{let t=[];return e.map(e=>{"brace"===e.type&&("{"===e.value?t.push("}"):t.splice(t.lastIndexOf("}"),1)),"paren"===e.type&&("["===e.value?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(t=>{"}"===t?e.push({type:"brace",value:"}"}):"]"===t&&e.push({type:"paren",value:"]"})}),e},tS=e=>{let t="";return e.map(e=>{"string"===e.type?t+='"'+e.value+'"':t+=e.value}),t},tk=e=>JSON.parse(tS(t_(tw(ty(e))))),tx="__json_buf";function tR(e){return"tool_use"===e.type||"server_tool_use"===e.type||"mcp_tool_use"===e.type}class tC{constructor(){o.add(this),this.messages=[],this.receivedMessages=[],l.set(this,void 0),this.controller=new AbortController,c.set(this,void 0),u.set(this,()=>{}),d.set(this,()=>{}),h.set(this,void 0),f.set(this,()=>{}),p.set(this,()=>{}),g.set(this,{}),m.set(this,!1),v.set(this,!1),b.set(this,!1),y.set(this,!1),w.set(this,void 0),_.set(this,void 0),x.set(this,e=>{if(et(this,v,!0,"f"),ea(e)&&(e=new el),e instanceof el)return et(this,b,!0,"f"),this._emit("abort",e);if(e instanceof ei)return this._emit("error",e);if(e instanceof Error){let t=new ei(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new ei(String(e)))}),et(this,c,new Promise((e,t)=>{et(this,u,e,"f"),et(this,d,t,"f")}),"f"),et(this,h,new Promise((e,t)=>{et(this,f,e,"f"),et(this,p,t,"f")}),"f"),en(this,c,"f").catch(()=>{}),en(this,h,"f").catch(()=>{})}get response(){return en(this,w,"f")}get request_id(){return en(this,_,"f")}async withResponse(){let e=await en(this,c,"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 tC;return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,n){let r=new tC;for(let e of t.messages)r._addMessageParam(e);return r._run(()=>r._createMessage(e,{...t,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},en(this,x,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit("message",e)}async _createMessage(e,t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),en(this,o,"m",R).call(this);let{response:a,data:s}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();for await(let e of(this._connected(a),s))en(this,o,"m",C).call(this,e);if(s.controller.signal?.aborted)throw new el;en(this,o,"m",M).call(this)}_connected(e){this.ended||(et(this,w,e,"f"),et(this,_,e?.headers.get("request-id"),"f"),en(this,u,"f").call(this,e),this._emit("connect"))}get ended(){return en(this,m,"f")}get errored(){return en(this,v,"f")}get aborted(){return en(this,b,"f")}abort(){this.controller.abort()}on(e,t){return(en(this,g,"f")[e]||(en(this,g,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=en(this,g,"f")[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(en(this,g,"f")[e]||(en(this,g,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{et(this,y,!0,"f"),"error"!==e&&this.once("error",n),this.once(e,t)})}async done(){et(this,y,!0,"f"),await en(this,h,"f")}get currentMessage(){return en(this,l,"f")}async finalMessage(){return await this.done(),en(this,o,"m",S).call(this)}async finalText(){return await this.done(),en(this,o,"m",k).call(this)}_emit(e,...t){if(en(this,m,"f"))return;"end"===e&&(et(this,m,!0,"f"),en(this,f,"f").call(this));let n=en(this,g,"f")[e];if(n&&(en(this,g,"f")[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];en(this,y,"f")||n?.length||Promise.reject(e),en(this,d,"f").call(this,e),en(this,p,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];en(this,y,"f")||n?.length||Promise.reject(e),en(this,d,"f").call(this,e),en(this,p,"f").call(this,e),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",en(this,o,"m",S).call(this))}async _fromReadableStream(e,t){let n=t?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),en(this,o,"m",R).call(this),this._connected(null);let r=eV.fromReadableStream(e,this.controller);for await(let e of r)en(this,o,"m",C).call(this,e);if(r.controller.signal?.aborted)throw new el;en(this,o,"m",M).call(this)}[(l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakMap,w=new WeakMap,_=new WeakMap,x=new WeakMap,o=new WeakSet,S=function(){if(0===this.receivedMessages.length)throw new ei("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},k=function(){if(0===this.receivedMessages.length)throw new ei("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 ei("stream ended without producing a content block with type=text");return e.join(" ")},R=function(){this.ended||et(this,l,void 0,"f")},C=function(e){if(this.ended)return;let t=en(this,o,"m",E).call(this,e);switch(this._emit("streamEvent",e,t),e.type){case"content_block_delta":{let n=t.content.at(-1);switch(e.delta.type){case"text_delta":"text"===n.type&&this._emit("text",e.delta.text,n.text||"");break;case"citations_delta":"text"===n.type&&this._emit("citation",e.delta.citation,n.citations??[]);break;case"input_json_delta":tR(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break;case"thinking_delta":"thinking"===n.type&&this._emit("thinking",e.delta.thinking,n.thinking);break;case"signature_delta":"thinking"===n.type&&this._emit("signature",n.signature);break;default: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":et(this,l,t,"f")}},M=function(){if(this.ended)throw new ei("stream has ended, this shouldn't happen");let e=en(this,l,"f");if(!e)throw new ei("request ended without sending any chunks");return et(this,l,void 0,"f"),e},E=function(e){let t=en(this,l,"f");if("message_start"===e.type){if(t)throw new ei(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!t)throw new ei(`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.container=e.delta.container,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 n=t.content.at(e.index);switch(e.delta.type){case"text_delta":n?.type==="text"&&(n.text+=e.delta.text);break;case"citations_delta":n?.type==="text"&&(n.citations??(n.citations=[]),n.citations.push(e.delta.citation));break;case"input_json_delta":if(n&&tR(n)){let t=n[tx]||"";if(Object.defineProperty(n,tx,{value:t+=e.delta.partial_json,enumerable:!1,writable:!0}),t)try{n.input=tk(t)}catch(n){let e=new ei(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${n}. JSON: ${t}`);en(this,x,"f").call(this,e)}}break;case"thinking_delta":n?.type==="thinking"&&(n.thinking+=e.delta.thinking);break;case"signature_delta":n?.type==="thinking"&&(n.signature=e.delta.signature);break;default:e.delta}return t}}},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on("streamEvent",n=>{let r=t.shift();r?r.resolve(n):e.push(n)}),this.on("end",()=>{for(let e of(n=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),this.on("error",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((e,n)=>t.push({resolve:e,reject:n})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new eV(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}let tM={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192},tE={"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"};class tj extends tc{constructor(){super(...arguments),this.batches=new tb(this._client)}create(e,t){let{betas:n,...r}=e;r.model in tE&&console.warn(`The model '${r.model}' is deprecated and will reach end-of-life on ${tE[r.model]} +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=tM[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:th([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}stream(e,t){return tC.createMessage(this,e,t)}countTokens(e,t){let{betas:n,...r}=e;return this._client.post("/v1/messages/count_tokens?beta=true",{body:r,...t,headers:th([{"anthropic-beta":[...n??[],"token-counting-2024-11-01"].toString()},t?.headers])})}}tj.Batches=tb;class tO extends tc{constructor(){super(...arguments),this.models=new tm(this._client),this.messages=new tj(this._client),this.files=new tg(this._client)}}tO.Models=tm,tO.Messages=tj,tO.Files=tg;class tP extends tc{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/complete",{body:r,timeout:this._client._options.timeout??6e5,...t,headers:th([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}}let tA="__json_buf";function tI(e){return"tool_use"===e.type||"server_tool_use"===e.type}class tz{constructor(){j.add(this),this.messages=[],this.receivedMessages=[],O.set(this,void 0),this.controller=new AbortController,P.set(this,void 0),A.set(this,()=>{}),I.set(this,()=>{}),z.set(this,void 0),L.set(this,()=>{}),T.set(this,()=>{}),Z.set(this,{}),N.set(this,!1),F.set(this,!1),q.set(this,!1),B.set(this,!1),$.set(this,void 0),D.set(this,void 0),W.set(this,e=>{if(et(this,F,!0,"f"),ea(e)&&(e=new el),e instanceof el)return et(this,q,!0,"f"),this._emit("abort",e);if(e instanceof ei)return this._emit("error",e);if(e instanceof Error){let t=new ei(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new ei(String(e)))}),et(this,P,new Promise((e,t)=>{et(this,A,e,"f"),et(this,I,t,"f")}),"f"),et(this,z,new Promise((e,t)=>{et(this,L,e,"f"),et(this,T,t,"f")}),"f"),en(this,P,"f").catch(()=>{}),en(this,z,"f").catch(()=>{})}get response(){return en(this,$,"f")}get request_id(){return en(this,D,"f")}async withResponse(){let e=await en(this,P,"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 tz;return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,n){let r=new tz;for(let e of t.messages)r._addMessageParam(e);return r._run(()=>r._createMessage(e,{...t,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},en(this,W,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit("message",e)}async _createMessage(e,t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),en(this,j,"m",V).call(this);let{response:a,data:s}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();for await(let e of(this._connected(a),s))en(this,j,"m",X).call(this,e);if(s.controller.signal?.aborted)throw new el;en(this,j,"m",J).call(this)}_connected(e){this.ended||(et(this,$,e,"f"),et(this,D,e?.headers.get("request-id"),"f"),en(this,A,"f").call(this,e),this._emit("connect"))}get ended(){return en(this,N,"f")}get errored(){return en(this,F,"f")}get aborted(){return en(this,q,"f")}abort(){this.controller.abort()}on(e,t){return(en(this,Z,"f")[e]||(en(this,Z,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=en(this,Z,"f")[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(en(this,Z,"f")[e]||(en(this,Z,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{et(this,B,!0,"f"),"error"!==e&&this.once("error",n),this.once(e,t)})}async done(){et(this,B,!0,"f"),await en(this,z,"f")}get currentMessage(){return en(this,O,"f")}async finalMessage(){return await this.done(),en(this,j,"m",H).call(this)}async finalText(){return await this.done(),en(this,j,"m",U).call(this)}_emit(e,...t){if(en(this,N,"f"))return;"end"===e&&(et(this,N,!0,"f"),en(this,L,"f").call(this));let n=en(this,Z,"f")[e];if(n&&(en(this,Z,"f")[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];en(this,B,"f")||n?.length||Promise.reject(e),en(this,I,"f").call(this,e),en(this,T,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];en(this,B,"f")||n?.length||Promise.reject(e),en(this,I,"f").call(this,e),en(this,T,"f").call(this,e),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",en(this,j,"m",H).call(this))}async _fromReadableStream(e,t){let n=t?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),en(this,j,"m",V).call(this),this._connected(null);let r=eV.fromReadableStream(e,this.controller);for await(let e of r)en(this,j,"m",X).call(this,e);if(r.controller.signal?.aborted)throw new el;en(this,j,"m",J).call(this)}[(O=new WeakMap,P=new WeakMap,A=new WeakMap,I=new WeakMap,z=new WeakMap,L=new WeakMap,T=new WeakMap,Z=new WeakMap,N=new WeakMap,F=new WeakMap,q=new WeakMap,B=new WeakMap,$=new WeakMap,D=new WeakMap,W=new WeakMap,j=new WeakSet,H=function(){if(0===this.receivedMessages.length)throw new ei("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},U=function(){if(0===this.receivedMessages.length)throw new ei("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 ei("stream ended without producing a content block with type=text");return e.join(" ")},V=function(){this.ended||et(this,O,void 0,"f")},X=function(e){if(this.ended)return;let t=en(this,j,"m",G).call(this,e);switch(this._emit("streamEvent",e,t),e.type){case"content_block_delta":{let n=t.content.at(-1);switch(e.delta.type){case"text_delta":"text"===n.type&&this._emit("text",e.delta.text,n.text||"");break;case"citations_delta":"text"===n.type&&this._emit("citation",e.delta.citation,n.citations??[]);break;case"input_json_delta":tI(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break;case"thinking_delta":"thinking"===n.type&&this._emit("thinking",e.delta.thinking,n.thinking);break;case"signature_delta":"thinking"===n.type&&this._emit("signature",n.signature);break;default: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":et(this,O,t,"f")}},J=function(){if(this.ended)throw new ei("stream has ended, this shouldn't happen");let e=en(this,O,"f");if(!e)throw new ei("request ended without sending any chunks");return et(this,O,void 0,"f"),e},G=function(e){let t=en(this,O,"f");if("message_start"===e.type){if(t)throw new ei(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!t)throw new ei(`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 n=t.content.at(e.index);switch(e.delta.type){case"text_delta":n?.type==="text"&&(n.text+=e.delta.text);break;case"citations_delta":n?.type==="text"&&(n.citations??(n.citations=[]),n.citations.push(e.delta.citation));break;case"input_json_delta":if(n&&tI(n)){let t=n[tA]||"";Object.defineProperty(n,tA,{value:t+=e.delta.partial_json,enumerable:!1,writable:!0}),t&&(n.input=tk(t))}break;case"thinking_delta":n?.type==="thinking"&&(n.thinking+=e.delta.thinking);break;case"signature_delta":n?.type==="thinking"&&(n.signature=e.delta.signature);break;default:e.delta}return t}}},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on("streamEvent",n=>{let r=t.shift();r?r.resolve(n):e.push(n)}),this.on("end",()=>{for(let e of(n=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),this.on("error",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((e,n)=>t.push({resolve:e,reject:n})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new eV(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}class tL extends tc{create(e,t){return this._client.post("/v1/messages/batches",{body:e,...t})}retrieve(e,t){return this._client.get(tp`/v1/messages/batches/${e}`,t)}list(e={},t){return this._client.getAPIList("/v1/messages/batches",e2,{query:e,...t})}delete(e,t){return this._client.delete(tp`/v1/messages/batches/${e}`,t)}cancel(e,t){return this._client.post(tp`/v1/messages/batches/${e}/cancel`,t)}async results(e,t){let n=await this.retrieve(e);if(!n.results_url)throw new ei(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...t,headers:th([{Accept:"application/binary"},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((e,t)=>tv.fromResponse(t.response,t.controller))}}class tT extends tc{constructor(){super(...arguments),this.batches=new tL(this._client)}create(e,t){e.model in tZ&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${tZ[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let n=this._client._options.timeout;if(!e.stream&&null==n){let t=tM[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,t)}return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...t,stream:e.stream??!1})}stream(e,t){return tz.createMessage(this,e,t)}countTokens(e,t){return this._client.post("/v1/messages/count_tokens",{body:e,...t})}}let tZ={"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"};tT.Batches=tL;class tN extends tc{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(tp`/v1/models/${e}`,{...n,headers:th([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/models",e2,{query:r,...t,headers:th([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers])})}}let tF=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 tq{constructor({baseURL:e=tF("ANTHROPIC_BASE_URL"),apiKey:t=tF("ANTHROPIC_API_KEY")??null,authToken:n=tF("ANTHROPIC_AUTH_TOKEN")??null,...r}={}){K.set(this,void 0);let a={apiKey:t,authToken:n,...r,baseURL:e||"https://api.anthropic.com"};if(!a.dangerouslyAllowBrowser&&ez())throw new ei("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??tB.DEFAULT_TIMEOUT,this.logger=a.logger??console;let s="warn";this.logLevel=s,this.logLevel=eC(a.logLevel,"ClientOptions.logLevel",this)??eC(tF("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??s,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??function(){if("undefined"!=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`")}(),et(this,K,eD,"f"),this._options=a,this.apiKey=t,this.authToken=n}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 th([this.apiKeyAuth(e),this.bearerAuth(e)])}apiKeyAuth(e){if(null!=this.apiKey)return th([{"X-Api-Key":this.apiKey}])}bearerAuth(e){if(null!=this.authToken)return th([{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 ei(`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 ${eI}`}defaultIdempotencyKey(){return`stainless-node-retry-${er()}`}makeStatusError(e,t,n,r){return eo.generate(e,t,n,r)}buildURL(e,t){let n=new URL(ew(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)&&(n.search=this.stringifyQuery(t)),n.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new ei("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:n}){}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,n){return this.request(Promise.resolve(n).then(n=>({method:e,path:t,...n})))}request(e,t=null){return new eQ(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,n){let r=await e,a=r.maxRetries??this.maxRetries;null==t&&(t=a),await this.prepareOptions(r);let{req:s,url:i,timeout:o}=this.buildRequest(r,{retryCount:a-t});await this.prepareRequest(s,{url:i,options:r});let l="log_"+(16777216*Math.random()|0).toString(16).padStart(6,"0"),c=void 0===n?"":`, retryOf: ${n}`,u=Date.now();if(eP(this).debug(`[${l}] sending request`,eA({retryOfRequestLogID:n,method:r.method,url:i,options:r,headers:s.headers})),r.signal?.aborted)throw new el;let d=new AbortController,h=await this.fetchWithTimeout(i,s,o,d).catch(es),f=Date.now();if(h instanceof Error){let e=`retrying, ${t} attempts remaining`;if(r.signal?.aborted)throw new el;let a=ea(h)||/timed? ?out/i.test(String(h)+("cause"in h?String(h.cause):""));if(t)return eP(this).info(`[${l}] connection ${a?"timed out":"failed"} - ${e}`),eP(this).debug(`[${l}] connection ${a?"timed out":"failed"} (${e})`,eA({retryOfRequestLogID:n,url:i,durationMs:f-u,message:h.message})),this.retryRequest(r,t,n??l);if(eP(this).info(`[${l}] connection ${a?"timed out":"failed"} - error; no more retries left`),eP(this).debug(`[${l}] connection ${a?"timed out":"failed"} (error; no more retries left)`,eA({retryOfRequestLogID:n,url:i,durationMs:f-u,message:h.message})),a)throw new eu;throw new ec({cause:h})}let p=[...h.headers.entries()].filter(([e])=>"request-id"===e).map(([e,t])=>", "+e+": "+JSON.stringify(t)).join(""),g=`[${l}${c}${p}] ${s.method} ${i} ${h.ok?"succeeded":"failed"} with status ${h.status} in ${f-u}ms`;if(!h.ok){let e=this.shouldRetry(h);if(t&&e){let e=`retrying, ${t} attempts remaining`;return await e$(h.body),eP(this).info(`${g} - ${e}`),eP(this).debug(`[${l}] response error (${e})`,eA({retryOfRequestLogID:n,url:h.url,status:h.status,headers:h.headers,durationMs:f-u})),this.retryRequest(r,t,n??l,h.headers)}let a=e?"error; no more retries left":"error; not retryable";eP(this).info(`${g} - ${a}`);let s=await h.text().catch(e=>es(e).message),i=ek(s),o=i?void 0:s;throw eP(this).debug(`[${l}] response error (${a})`,eA({retryOfRequestLogID:n,url:h.url,status:h.status,headers:h.headers,message:o,durationMs:Date.now()-u})),this.makeStatusError(h.status,i,o,h.headers)}return eP(this).info(g),eP(this).debug(`[${l}] response start`,eA({retryOfRequestLogID:n,url:h.url,status:h.status,headers:h.headers,durationMs:f-u})),{response:h,options:r,controller:d,requestLogID:l,retryOfRequestLogID:n,startTime:u}}getAPIList(e,t,n){return this.requestAPIList(t,{method:"get",path:e,...n})}requestAPIList(e,t){return new e1(this,this.makeRequest(t,null,void 0),e)}async fetchWithTimeout(e,t,n,r){let{signal:a,method:s,...i}=t||{};a&&a.addEventListener("abort",()=>r.abort());let o=setTimeout(()=>r.abort(),n),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};s&&(c.method=s.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,n,r){let a;let s=r?.get("retry-after-ms");if(s){let e=parseFloat(s);Number.isNaN(e)||(a=e)}let i=r?.get("retry-after");if(i&&!a){let e=parseFloat(i);a=Number.isNaN(e)?Date.parse(i)-Date.now():1e3*e}if(!(a&&0<=a&&a<6e4)){let n=e.maxRetries??this.maxRetries;a=this.calculateDefaultRetryTimeoutMillis(t,n)}return await ex(a),this.makeRequest(e,t-1,n)}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 ei("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 n={...e},{method:r,path:a,query:s}=n,i=this.buildURL(a,s);"timeout"in n&&eS("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:o,body:l}=this.buildBody({options:n}),c=this.buildHeaders({options:e,method:r,bodyHeaders:o,retryCount:t});return{req:{method:r,headers:c,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&l instanceof globalThis.ReadableStream&&{duplex:"half"},...l&&{body:l},...this.fetchOptions??{},...n.fetchOptions??{}},url:i,timeout:n.timeout}}buildHeaders({options:e,method:t,bodyHeaders:n,retryCount:r}){let a={};this.idempotencyHeader&&"get"!==t&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),a[this.idempotencyHeader]=e.idempotencyKey);let s=th([a,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...eN(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(s),s.values}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=th([t]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||"string"==typeof e&&n.values.has("content-type")||e instanceof Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:"object"==typeof e&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&"function"==typeof e.next)?{bodyHeaders:void 0,body:eq(e)}:en(this,K,"f").call(this,{body:e,headers:n})}}K=new WeakMap,tq.Anthropic=tq,tq.HUMAN_PROMPT="\n\nHuman:",tq.AI_PROMPT="\n\nAssistant:",tq.DEFAULT_TIMEOUT=6e5,tq.AnthropicError=ei,tq.APIError=eo,tq.APIConnectionError=ec,tq.APIConnectionTimeoutError=eu,tq.APIUserAbortError=el,tq.NotFoundError=ep,tq.ConflictError=eg,tq.RateLimitError=ev,tq.BadRequestError=ed,tq.AuthenticationError=eh,tq.InternalServerError=eb,tq.PermissionDeniedError=ef,tq.UnprocessableEntityError=em,tq.toFile=to;class tB extends tq{constructor(){super(...arguments),this.completions=new tP(this),this.messages=new tT(this),this.models=new tN(this),this.beta=new tO(this)}}tB.Completions=tP,tB.Messages=tT,tB.Models=tN,tB.Beta=tO;let{HUMAN_PROMPT:t$,AI_PROMPT:tD}=tB},93837:function(e,t,n){"use strict";let r;n.d(t,{Z:function(){return o}});var a={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let s=new Uint8Array(16),i=[];for(let e=0;e<256;++e)i.push((e+256).toString(16).slice(1));var o=function(e,t,n){if(a.randomUUID&&!t&&!e)return a.randomUUID();let o=(e=e||{}).random??e.rng?.()??function(){if(!r){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(s)}();if(o.length<16)throw Error("Random bytes length must be >= 16");if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){if((n=n||0)<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=o[e];return t}return function(e,t=0){return(i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]).toLowerCase()}(o)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2618-9664f16de6c32740.js b/litellm/proxy/_experimental/out/_next/static/chunks/2618-9664f16de6c32740.js new file mode 100644 index 00000000000..d2c8f75b36a --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2618-9664f16de6c32740.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2618],{49096:function(e,r,o){o.d(r,{ZD:function(){return n}});var t=o(61994);let l=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=e=>{let r=function(){for(var r,o,l=arguments.length,n=Array(l),a=0;a{let t=Object.fromEntries(Object.entries(e||{}).filter(e=>{let[r]=e;return!["class","className"].includes(r)}));return r(o.map(e=>e(t)),null==e?void 0:e.class,null==e?void 0:e.className)}},cva:e=>o=>{var t;if((null==e?void 0:e.variants)==null)return r(null==e?void 0:e.base,null==o?void 0:o.class,null==o?void 0:o.className);let{variants:n,defaultVariants:a}=e,s=Object.keys(n).map(e=>{let r=null==o?void 0:o[e],t=null==a?void 0:a[e],s=l(r)||l(t);return n[e][s]}),i={...a,...o&&Object.entries(o).reduce((e,r)=>{let[o,t]=r;return void 0===t?e:{...e,[o]:t}},{})},d=null==e?void 0:null===(t=e.compoundVariants)||void 0===t?void 0:t.reduce((e,r)=>{let{class:o,className:t,...l}=r;return Object.entries(l).every(e=>{let[r,o]=e,t=i[r];return Array.isArray(o)?o.includes(t):t===o})?[...e,o,t]:e},[]);return r(null==e?void 0:e.base,s,d,null==o?void 0:o.class,null==o?void 0:o.className)},cx:r}},{compose:a,cva:s,cx:i}=n()},53335:function(e,r,o){o.d(r,{m6:function(){return ev}});let t=(e,r)=>{let o=Array(e.length+r.length);for(let r=0;r({classGroupId:e,validator:r}),n=(e=new Map,r=null,o)=>({nextPart:e,validators:r,classGroupId:o}),a=[],s=e=>{let r=c(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:l}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return d(e);let o=e.split("-"),t=""===o[0]&&o.length>1?1:0;return i(o,t,r)},getConflictingClassGroupIds:(e,r)=>{if(r){let r=l[e],n=o[e];return r?n?t(n,r):r:n||a}return o[e]||a}}},i=(e,r,o)=>{if(0==e.length-r)return o.classGroupId;let t=e[r],l=o.nextPart.get(t);if(l){let o=i(e,r+1,l);if(o)return o}let n=o.validators;if(null===n)return;let a=0===r?e.join("-"):e.slice(r).join("-"),s=n.length;for(let e=0;e-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{let r=e.slice(1,-1),o=r.indexOf(":"),t=r.slice(0,o);return t?"arbitrary.."+t:void 0})(),c=e=>{let{theme:r,classGroups:o}=e;return m(o,r)},m=(e,r)=>{let o=n();for(let t in e)p(e[t],o,t,r);return o},p=(e,r,o,t)=>{let l=e.length;for(let n=0;n{if("string"==typeof e){b(e,r,o);return}if("function"==typeof e){f(e,r,o,t);return}g(e,r,o,t)},b=(e,r,o)=>{(""===e?r:h(r,e)).classGroupId=o},f=(e,r,o,t)=>{if(k(e)){p(e(t),r,o,t);return}null===r.validators&&(r.validators=[]),r.validators.push(l(o,e))},g=(e,r,o,t)=>{let l=Object.entries(e),n=l.length;for(let e=0;e{let o=e,t=r.split("-"),l=t.length;for(let e=0;e"isThemeGetter"in e&&!0===e.isThemeGetter,v=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let r=0,o=Object.create(null),t=Object.create(null),l=(l,n)=>{o[l]=n,++r>e&&(r=0,t=o,o=Object.create(null))};return{get(e){let r=o[e];return void 0!==r?r:void 0!==(r=t[e])?(l(e,r),r):void 0},set(e,r){e in o?o[e]=r:l(e,r)}}},x=[],w=(e,r,o,t,l)=>({modifiers:e,hasImportantModifier:r,baseClassName:o,maybePostfixModifierPosition:t,isExternal:l}),y=e=>{let{prefix:r,experimentalParseClassName:o}=e,t=e=>{let r;let o=[],t=0,l=0,n=0,a=e.length;for(let s=0;sn?r-n:void 0)};if(r){let e=r+":",o=t;t=r=>r.startsWith(e)?o(r.slice(e.length)):w(x,!1,r,void 0,!0)}if(o){let e=t;t=r=>o({className:r,parseClassName:e})}return t},z=e=>{let r=new Map;return e.orderSensitiveModifiers.forEach((e,o)=>{r.set(e,1e6+o)}),e=>{let o=[],t=[];for(let l=0;l0&&(t.sort(),o.push(...t),t=[]),o.push(n)):t.push(n)}return t.length>0&&(t.sort(),o.push(...t)),o}},j=e=>({cache:v(e.cacheSize),parseClassName:y(e),sortModifiers:z(e),...s(e)}),N=/\s+/,O=(e,r)=>{let{parseClassName:o,getClassGroupId:t,getConflictingClassGroupIds:l,sortModifiers:n}=r,a=[],s=e.trim().split(N),i="";for(let e=s.length-1;e>=0;e-=1){let r=s[e],{isExternal:d,modifiers:c,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:u}=o(r);if(d){i=r+(i.length>0?" "+i:i);continue}let b=!!u,f=t(b?p.substring(0,u):p);if(!f){if(!b||!(f=t(p))){i=r+(i.length>0?" "+i:i);continue}b=!1}let g=0===c.length?"":1===c.length?c[0]:n(c).join(":"),h=m?g+"!":g,k=h+f;if(a.indexOf(k)>-1)continue;a.push(k);let v=l(f,b);for(let e=0;e0?" "+i:i)}return i},C=(...e)=>{let r,o,t=0,l="";for(;t{let r;if("string"==typeof e)return e;let o="";for(let t=0;t{let r=r=>r[e]||W;return r.isThemeGetter=!0,r},I=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,M=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_=/^\d+\/\d+$/,A=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,E=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,S=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,P=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,T=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,q=e=>_.test(e),D=e=>!!e&&!Number.isNaN(Number(e)),V=e=>!!e&&Number.isInteger(Number(e)),Z=e=>e.endsWith("%")&&D(e.slice(0,-1)),B=e=>A.test(e),F=()=>!0,H=e=>E.test(e)&&!S.test(e),J=()=>!1,K=e=>P.test(e),L=e=>T.test(e),Q=e=>!U(e)&&!et(e),R=e=>ec(e,eb,J),U=e=>I.test(e),X=e=>ec(e,ef,H),Y=e=>ec(e,eg,D),ee=e=>ec(e,ep,J),er=e=>ec(e,eu,L),eo=e=>ec(e,ek,K),et=e=>M.test(e),el=e=>em(e,ef),en=e=>em(e,eh),ea=e=>em(e,ep),es=e=>em(e,eb),ei=e=>em(e,eu),ed=e=>em(e,ek,!0),ec=(e,r,o)=>{let t=I.exec(e);return!!t&&(t[1]?r(t[1]):o(t[2]))},em=(e,r,o=!1)=>{let t=M.exec(e);return!!t&&(t[1]?r(t[1]):o)},ep=e=>"position"===e||"percentage"===e,eu=e=>"image"===e||"url"===e,eb=e=>"length"===e||"size"===e||"bg-size"===e,ef=e=>"length"===e,eg=e=>"number"===e,eh=e=>"family-name"===e,ek=e=>"shadow"===e,ev=((e,...r)=>{let o,t,l,n;let a=e=>{let r=t(e);if(r)return r;let n=O(e,o);return l(e,n),n};return n=s=>(t=(o=j(r.reduce((e,r)=>r(e),e()))).cache.get,l=o.cache.set,n=a,a(s)),(...e)=>n(C(...e))})(()=>{let e=$("color"),r=$("font"),o=$("text"),t=$("font-weight"),l=$("tracking"),n=$("leading"),a=$("breakpoint"),s=$("container"),i=$("spacing"),d=$("radius"),c=$("shadow"),m=$("inset-shadow"),p=$("text-shadow"),u=$("drop-shadow"),b=$("blur"),f=$("perspective"),g=$("aspect"),h=$("ease"),k=$("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...x(),et,U],y=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],j=()=>[et,U,i],N=()=>[q,"full","auto",...j()],O=()=>[V,"none","subgrid",et,U],C=()=>["auto",{span:["full",V,et,U]},V,et,U],G=()=>[V,"auto",et,U],W=()=>["auto","min","max","fr",et,U],I=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],M=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...j()],A=()=>[q,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],E=()=>[e,et,U],S=()=>[...x(),ea,ee,{position:[et,U]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",es,R,{size:[et,U]}],H=()=>[Z,el,X],J=()=>["","none","full",d,et,U],K=()=>["",D,el,X],L=()=>["solid","dashed","dotted","double"],ec=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],em=()=>[D,Z,ea,ee],ep=()=>["","none",b,et,U],eu=()=>["none",D,et,U],eb=()=>["none",D,et,U],ef=()=>[D,et,U],eg=()=>[q,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[B],breakpoint:[B],color:[F],container:[B],"drop-shadow":[B],ease:["in","out","in-out"],font:[Q],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[B],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[B],shadow:[B],spacing:["px",D],text:[B],"text-shadow":[B],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",q,U,et,g]}],container:["container"],columns:[{columns:[D,U,et,s]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:y()}],"overflow-x":[{"overflow-x":y()}],"overflow-y":[{"overflow-y":y()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{start:N()}],end:[{end:N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[V,"auto",et,U]}],basis:[{basis:[q,"full","auto",s,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[D,q,"auto","initial","none",U]}],grow:[{grow:["",D,et,U]}],shrink:[{shrink:["",D,et,U]}],order:[{order:[V,"first","last","none",et,U]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:C()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:C()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...M(),"normal"]}],"justify-self":[{"justify-self":["auto",...M()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...M(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...M(),{baseline:["","last"]}]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...M(),"baseline"]}],"place-self":[{"place-self":["auto",...M()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],w:[{w:[s,"screen",...A()]}],"min-w":[{"min-w":[s,"screen","none",...A()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",o,el,X]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[t,et,Y]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Z,U]}],"font-family":[{font:[en,U,r]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,et,U]}],"line-clamp":[{"line-clamp":[D,"none",et,Y]}],leading:[{leading:[n,...j()]}],"list-image":[{"list-image":["none",et,U]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",et,U]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:[D,"from-font","auto",et,X]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[D,"auto",et,U]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",et,U]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",et,U]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:S()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},V,et,U],radial:["",et,U],conic:[V,et,U]},ei,er]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...L(),"hidden","none"]}],"divide-style":[{divide:[...L(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...L(),"none","hidden"]}],"outline-offset":[{"outline-offset":[D,et,U]}],"outline-w":[{outline:["",D,el,X]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",c,ed,eo]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",m,ed,eo]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[D,X]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",p,ed,eo]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[D,et,U]}],"mix-blend":[{"mix-blend":[...ec(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ec()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[D]}],"mask-image-linear-from-pos":[{"mask-linear-from":em()}],"mask-image-linear-to-pos":[{"mask-linear-to":em()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":em()}],"mask-image-t-to-pos":[{"mask-t-to":em()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":em()}],"mask-image-r-to-pos":[{"mask-r-to":em()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":em()}],"mask-image-b-to-pos":[{"mask-b-to":em()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":em()}],"mask-image-l-to-pos":[{"mask-l-to":em()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":em()}],"mask-image-x-to-pos":[{"mask-x-to":em()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":em()}],"mask-image-y-to-pos":[{"mask-y-to":em()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[et,U]}],"mask-image-radial-from-pos":[{"mask-radial-from":em()}],"mask-image-radial-to-pos":[{"mask-radial-to":em()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[D]}],"mask-image-conic-from-pos":[{"mask-conic-from":em()}],"mask-image-conic-to-pos":[{"mask-conic-to":em()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:S()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",et,U]}],filter:[{filter:["","none",et,U]}],blur:[{blur:ep()}],brightness:[{brightness:[D,et,U]}],contrast:[{contrast:[D,et,U]}],"drop-shadow":[{"drop-shadow":["","none",u,ed,eo]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",D,et,U]}],"hue-rotate":[{"hue-rotate":[D,et,U]}],invert:[{invert:["",D,et,U]}],saturate:[{saturate:[D,et,U]}],sepia:[{sepia:["",D,et,U]}],"backdrop-filter":[{"backdrop-filter":["","none",et,U]}],"backdrop-blur":[{"backdrop-blur":ep()}],"backdrop-brightness":[{"backdrop-brightness":[D,et,U]}],"backdrop-contrast":[{"backdrop-contrast":[D,et,U]}],"backdrop-grayscale":[{"backdrop-grayscale":["",D,et,U]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[D,et,U]}],"backdrop-invert":[{"backdrop-invert":["",D,et,U]}],"backdrop-opacity":[{"backdrop-opacity":[D,et,U]}],"backdrop-saturate":[{"backdrop-saturate":[D,et,U]}],"backdrop-sepia":[{"backdrop-sepia":["",D,et,U]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",et,U]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[D,"initial",et,U]}],ease:[{ease:["linear","initial",h,et,U]}],delay:[{delay:[D,et,U]}],animate:[{animate:["none",k,et,U]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,et,U]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:eu()}],"rotate-x":[{"rotate-x":eu()}],"rotate-y":[{"rotate-y":eu()}],"rotate-z":[{"rotate-z":eu()}],scale:[{scale:eb()}],"scale-x":[{"scale-x":eb()}],"scale-y":[{"scale-y":eb()}],"scale-z":[{"scale-z":eb()}],"scale-3d":["scale-3d"],skew:[{skew:ef()}],"skew-x":[{"skew-x":ef()}],"skew-y":[{"skew-y":ef()}],transform:[{transform:[et,U,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:eg()}],"translate-x":[{"translate-x":eg()}],"translate-y":[{"translate-y":eg()}],"translate-z":[{"translate-z":eg()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",et,U]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",et,U]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[D,el,X,Y]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2831-780a653f6bb335ce.js b/litellm/proxy/_experimental/out/_next/static/chunks/2831-780a653f6bb335ce.js deleted file mode 100644 index 2d00ff62ec4..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2831-780a653f6bb335ce.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2831],{34310:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1119),i=r(2265),s={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"},a=r(55015),o=i.forwardRef(function(e,t){return i.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:s}))})},35829:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(5853),i=r(26898),s=r(13241),a=r(1153),o=r(2265);let u=o.forwardRef((e,t)=>{let{color:r,children:u,className:l}=e,c=(0,n._T)(e,["color","children","className"]);return o.createElement("p",Object.assign({ref:t,className:(0,s.q)("font-semibold text-tremor-metric",r?(0,a.bM)(r,i.K.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",l)},c),u)});u.displayName="Metric"},15452:function(e,t){var r,n,i;n=[],void 0!==(i="function"==typeof(r=function e(){var t,r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r?r:{},n=!r.document&&!!r.postMessage,i=r.IS_PAPA_WORKER||!1,s={},a=0,o={};function u(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 d(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,i)r.postMessage({results:s,workerId:o.WORKER_ID,finished:n});else if(k(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||!n||!k(this._config.complete)||s&&s.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),n||s&&s.meta.paused||this._nextChunk(),s}this._halted=!0},this._sendError=function(e){k(this._config.error)?this._config.error(e):i&&this._config.error&&r.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function l(e){var t;(e=e||{}).chunkSize||(e.chunkSize=o.RemoteChunkSize),u.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=v(this._chunkLoaded,this),t.onerror=v(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e,r,i=this._config.downloadRequestHeaders;for(r in i)t.setRequestHeader(r,i[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 c(e){(e=e||{}).chunkSize||(e.chunkSize=o.LocalChunkSize),u.call(this,e);var t,r,n="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,r=e.slice||e.webkitSlice||e.mozSlice,n?((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 h(e){var t;u.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){u.call(this,e=e||{});var t=[],r=!0,n=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.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=v(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=v(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=v(function(){this._streamCleanUp(),n=!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 d(e){var t,r,n,i,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)))$/,u=this,l=0,c=0,h=!1,f=!1,d=[],y={data:[],errors:[],meta:{}};function g(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function b(){if(y&&n&&(C("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),n=!1),e.skipEmptyLines&&(y.data=y.data.filter(function(e){return!g(e)})),v()){if(y){if(Array.isArray(y.data[0])){for(var t,r=0;v()&&r=d.length?"__parsed_extra":d[i]:o,l=u=e.transform?e.transform(u,o):u,(e.dynamicTypingFunction&&void 0===e.dynamicTyping[r]&&(e.dynamicTyping[r]=e.dynamicTypingFunction(r)),!0===(e.dynamicTyping[r]||e.dynamicTyping))?"true"===l||"TRUE"===l||"false"!==l&&"FALSE"!==l&&((e=>{if(s.test(e)&&-9007199254740992<(e=parseFloat(e))&&e<9007199254740992)return 1})(l)?parseFloat(l):a.test(l)?new Date(l):""===l?null:l):l);"__parsed_extra"===o?(n[o]=n[o]||[],n[o].push(u)):n[o]=u}return e.header&&(i>d.length?C("FieldMismatch","TooManyFields","Too many fields: expected "+d.length+" fields but parsed "+i,c+r):ie.preview?r.abort():(y.data=y.data[0],i(y,u))))}),this.parse=function(i,s,a){var u=e.quoteChar||'"',u=(e.newline||(e.newline=this.guessLineEndings(i,u)),n=!1,e.delimiter?k(e.delimiter)&&(e.delimiter=e.delimiter(i),y.meta.delimiter=e.delimiter):((u=((t,r,n,i,s)=>{var a,u,l,c;s=s||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var h=0;h=r.length/2?"\r\n":"\r"}}function p(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){var t=(e=e||{}).delimiter,r=e.newline,n=e.comments,i=e.step,s=e.preview,a=e.fastMode,u=null,l=!1,c=null==e.quoteChar?'"':e.quoteChar,h=c;if(void 0!==e.escapeChar&&(h=e.escapeChar),("string"!=typeof t||-1=s)return N(!0);break}E.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:w.length,index:f}),q++}}else if(n&&0===O.length&&o.substring(f,f+v)===n){if(-1===A)return N();f=A+_,A=o.indexOf(r,f),P=o.indexOf(t,f)}else if(-1!==P&&(P=s)return N(!0)}return I();function j(e){w.push(e),x=f}function F(e){return -1!==e&&(e=o.substring(q+1,e))&&""===e.trim()?e.length:0}function I(e){return y||(void 0===e&&(e=o.substring(f)),O.push(e),f=g,j(O),C&&L()),N()}function M(e){f=e,j(O),O=[],A=o.indexOf(r,f)}function N(n){if(e.header&&!m&&w.length&&!l){var i=w[0],s=Object.create(null),a=new Set(i);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||(i=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||(l=t.skipEmptyLines),"string"==typeof t.newline&&(s=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");c=t.columns}void 0!==t.escapeChar&&(u=t.escapeChar+a),t.escapeFormulae instanceof RegExp?h=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(h=/^[=+\-@\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 d(null,e,l);if("object"==typeof e[0])return d(c||Object.keys(e[0]),e,l)}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])),d(e.fields||[],e.data||[],l);throw Error("Unable to serialize unrecognized input");function d(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=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,a),n=i.default.Children.only(t);return i.default.cloneElement(n,l(l({},r),{},{onClick:this.onClick}))}}],function(e,t){for(var r=0;r"boolean"==typeof e||e instanceof Boolean,s=e=>"number"==typeof e||e instanceof Number,a=e=>"bigint"==typeof e||e instanceof BigInt,o=e=>!!e&&e instanceof Date,u=e=>"string"==typeof e||e instanceof String,l=e=>Array.isArray(e),c=e=>"object"==typeof e&&null!==e,h=e=>!!e&&e instanceof Object&&"function"==typeof e;function f(e,t){return void 0===t&&(t=!1),!e||t?`"${e}"`:e}function d(e){let{field:t,value:r,data:i,lastElement:s,openBracket:a,closeBracket:o,level:u,style:l,shouldExpandNode:c,clickToExpandNode:h,outerRef:d,beforeExpandChange:p}=e,m=(0,n.useRef)(!1),[y,b]=(0,n.useState)(()=>c(u,r,t)),_=(0,n.useRef)(null);(0,n.useEffect)(()=>{m.current?b(c(u,r,t)):m.current=!0},[c]);let v=(0,n.useId)();if(0===i.length)return function(e){let{field:t,openBracket:r,closeBracket:i,lastElement:s,style:a}=e;return(0,n.createElement)("div",{className:a.basicChildStyle,role:"treeitem","aria-selected":void 0},(t||""===t)&&(0,n.createElement)("span",{className:a.label},f(t,a.quotesForFieldNames),":"),(0,n.createElement)("span",{className:a.punctuation},r),(0,n.createElement)("span",{className:a.punctuation},i),!s&&(0,n.createElement)("span",{className:a.punctuation},","))}({field:t,openBracket:a,closeBracket:o,lastElement:s,style:l});let k=y?l.collapseIcon:l.expandIcon,C=y?l.ariaLables.collapseJson:l.ariaLables.expandJson,w=u+1,E=i.length-1,O=e=>{y!==e&&(!p||p({level:u,value:r,field:t,newExpandValue:e}))&&b(e)},x=e=>{if("ArrowRight"===e.key||"ArrowLeft"===e.key)e.preventDefault(),O("ArrowRight"===e.key);else if("ArrowUp"===e.key||"ArrowDown"===e.key){e.preventDefault();let t="ArrowUp"===e.key?-1:1;if(!d.current)return;let r=d.current.querySelectorAll("[role=button]"),n=-1;for(let e=0;e{var e;O(!y);let t=_.current;if(!t)return;let r=null===(e=d.current)||void 0===e?void 0:e.querySelector('[role=button][tabindex="0"]');r&&(r.tabIndex=-1),t.tabIndex=0,t.focus()};return(0,n.createElement)("div",{className:l.basicChildStyle,role:"treeitem","aria-expanded":y,"aria-selected":void 0},(0,n.createElement)("span",{className:k,onClick:R,onKeyDown:x,role:"button","aria-label":C,"aria-expanded":y,"aria-controls":y?v:void 0,ref:_,tabIndex:0===u?0:-1}),(t||""===t)&&(h?(0,n.createElement)("span",{className:l.clickableLabel,onClick:R,onKeyDown:x},f(t,l.quotesForFieldNames),":"):(0,n.createElement)("span",{className:l.label},f(t,l.quotesForFieldNames),":")),(0,n.createElement)("span",{className:l.punctuation},a),y?(0,n.createElement)("ul",{id:v,role:"group",className:l.childFieldsContainer},i.map((e,t)=>(0,n.createElement)(g,{key:e[0]||t,field:e[0],value:e[1],style:l,lastElement:t===E,level:w,shouldExpandNode:c,clickToExpandNode:h,beforeExpandChange:p,outerRef:d}))):(0,n.createElement)("span",{className:l.collapsedContent,onClick:R,onKeyDown:x}),(0,n.createElement)("span",{className:l.punctuation},o),!s&&(0,n.createElement)("span",{className:l.punctuation},","))}function p(e){let{field:t,value:r,style:n,lastElement:i,shouldExpandNode:s,clickToExpandNode:a,level:o,outerRef:u,beforeExpandChange:l}=e;return d({field:t,value:r,lastElement:i||!1,level:o,openBracket:"{",closeBracket:"}",style:n,shouldExpandNode:s,clickToExpandNode:a,data:Object.keys(r).map(e=>[e,r[e]]),outerRef:u,beforeExpandChange:l})}function m(e){let{field:t,value:r,style:n,lastElement:i,level:s,shouldExpandNode:a,clickToExpandNode:o,outerRef:u,beforeExpandChange:l}=e;return d({field:t,value:r,lastElement:i||!1,level:s,openBracket:"[",closeBracket:"]",style:n,shouldExpandNode:a,clickToExpandNode:o,data:r.map(e=>[void 0,e]),outerRef:u,beforeExpandChange:l})}function y(e){let t,{field:r,value:l,style:c,lastElement:d}=e,p=c.otherValue;if(null===l)t="null",p=c.nullValue;else if(void 0===l)t="undefined",p=c.undefinedValue;else if(u(l)){var m;m=!c.noQuotesForStringValues,t=c.stringifyStringValues?JSON.stringify(l):m?`"${l}"`:l,p=c.stringValue}else i(l)?(t=l?"true":"false",p=c.booleanValue):s(l)?(t=l.toString(),p=c.numberValue):a(l)?(t=`${l.toString()}n`,p=c.numberValue):t=o(l)?l.toISOString():h(l)?"function() { }":l.toString();return(0,n.createElement)("div",{className:c.basicChildStyle,role:"treeitem","aria-selected":void 0},(r||""===r)&&(0,n.createElement)("span",{className:c.label},f(r,c.quotesForFieldNames),":"),(0,n.createElement)("span",{className:p},t),!d&&(0,n.createElement)("span",{className:c.punctuation},","))}function g(e){let t=e.value;return l(t)?(0,n.createElement)(m,Object.assign({},e)):!c(t)||o(t)||h(t)?(0,n.createElement)(y,Object.assign({},e)):(0,n.createElement)(p,Object.assign({},e))}let b={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},_=()=>!0,v=e=>{let{data:t,style:r=b,shouldExpandNode:i=_,clickToExpandNode:s=!1,beforeExpandChange:a,compactTopLevel:o,...u}=e,l=(0,n.useRef)(null);return(0,n.createElement)("div",Object.assign({"aria-label":"JSON view"},u,{className:r.container,ref:l,role:"tree"}),o&&c(t)?Object.entries(t).map(e=>{let[t,o]=e;return(0,n.createElement)(g,{key:t,field:t,value:o,style:{...b,...r},lastElement:!0,level:1,shouldExpandNode:i,clickToExpandNode:s,beforeExpandChange:a,outerRef:l})}):(0,n.createElement)(g,{value:t,style:{...b,...r},lastElement:!0,level:0,shouldExpandNode:i,clickToExpandNode:s,outerRef:l,beforeExpandChange:a}))}},52621:function(){},44643:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=i},88532:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=i},71157:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=i},2894:function(e,t,r){"use strict";r.d(t,{R:function(){return o},m:function(){return a}});var n=r(18238),i=r(7989),s=r(11255),a=class extends i.F{#e;#t;#r;#n;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||o(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,s.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});let n="pending"===this.state.status,i=!this.#n.canStart();try{if(n)t();else{this.#i({type:"pending",variables:e,isPaused:i}),await this.#r.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:i})}let s=await this.#n.start();return await this.#r.config.onSuccess?.(s,e,this.state.context,this,r),await this.options.onSuccess?.(s,e,this.state.context,r),await this.#r.config.onSettled?.(s,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(s,null,e,this.state.context,r),this.#i({type:"success",data:s}),s}catch(t){try{throw await this.#r.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#r.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#i({type:"error",error:t})}}finally{this.#r.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.Vr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21623:function(e,t,r){"use strict";r.d(t,{S:function(){return m}});var n=r(45345),i=r(21733),s=r(18238),a=r(24112),o=class extends a.l{constructor(e={}){super(),this.config=e,this.#s=new Map}#s;build(e,t,r){let s=t.queryKey,a=t.queryHash??(0,n.Rm)(s,t),o=this.get(a);return o||(o=new i.A({client:e,queryKey:s,queryHash:a,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){this.#s.has(e.queryHash)||(this.#s.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#s.get(e.queryHash);t&&(e.destroy(),t===e&&this.#s.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){s.Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#s.get(e)}getAll(){return[...this.#s.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n._x)(e,t)):t}notify(e){s.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){s.Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){s.Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},u=r(2894),l=class extends a.l{constructor(e={}){super(),this.config=e,this.#a=new Set,this.#o=new Map,this.#u=0}#a;#o;#u;build(e,t,r){let n=new u.m({client:e,mutationCache:this,mutationId:++this.#u,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#a.add(e);let t=c(e);if("string"==typeof t){let r=this.#o.get(t);r?r.push(e):this.#o.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#a.delete(e)){let t=c(e);if("string"==typeof t){let r=this.#o.get(t);if(r){if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#o.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=c(e);if("string"!=typeof t)return!0;{let r=this.#o.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=c(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#o.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){s.Vr.batch(()=>{this.#a.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#a.clear(),this.#o.clear()})}getAll(){return Array.from(this.#a)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.X7)(e,t))}notify(e){s.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return s.Vr.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.ZT))))}};function c(e){return e.options.scope?.id}var h=r(87045),f=r(57853);function d(e){return{onFetch:(t,r)=>{let i=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],u={pages:[],pageParams:[]},l=0,c=async()=>{let r=!1,c=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)})},h=(0,n.cG)(t.options,t.fetchOptions),f=async(e,i,s)=>{if(r)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:i,direction:s?"backward":"forward",meta:t.options.meta};return c(e),e})(),o=await h(a),{maxPages:u}=t.options,l=s?n.Ht:n.VX;return{pages:l(e.pages,o,u),pageParams:l(e.pageParams,i,u)}};if(s&&a.length){let e="backward"===s,t={pages:a,pageParams:o},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:p)(i,t);u=await f(t,r,e)}else{let t=e??a.length;do{let e=0===l?o[0]??i.initialPageParam:p(i,u);if(l>0&&null==e)break;u=await f(u,e),l++}while(lt.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=c}}}function p(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var m=class{#l;#r;#c;#h;#f;#d;#p;#m;constructor(e={}){this.#l=e.queryCache||new o,this.#r=e.mutationCache||new l,this.#c=e.defaultOptions||{},this.#h=new Map,this.#f=new Map,this.#d=0}mount(){this.#d++,1===this.#d&&(this.#p=h.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#l.onFocus())}),this.#m=f.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#l.onOnline())}))}unmount(){this.#d--,0===this.#d&&(this.#p?.(),this.#p=void 0,this.#m?.(),this.#m=void 0)}isFetching(e){return this.#l.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#r.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#l.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#l.build(this,t),i=r.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,n.KC)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#l.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let i=this.defaultQueryOptions({queryKey:e}),s=this.#l.get(i.queryHash),a=s?.state.data,o=(0,n.SE)(t,a);if(void 0!==o)return this.#l.build(this,i).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return s.Vr.batch(()=>this.#l.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#l.get(t.queryHash)?.state}removeQueries(e){let t=this.#l;s.Vr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#l;return s.Vr.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(s.Vr.batch(()=>this.#l.findAll(e).map(e=>e.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e,t={}){return s.Vr.batch(()=>(this.#l.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(s.Vr.batch(()=>this.#l.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(n.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#l.build(this,t);return r.isStaleByTime((0,n.KC)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.ZT).catch(n.ZT)}fetchInfiniteQuery(e){return e.behavior=d(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(e){return e.behavior=d(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return f.N.isOnline()?this.#r.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#l}getMutationCache(){return this.#r}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#h.set((0,n.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#h.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#f.set((0,n.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#f.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#l.clear(),this.#r.clear()}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2843-eda3a290faa906b3.js b/litellm/proxy/_experimental/out/_next/static/chunks/2843-eda3a290faa906b3.js new file mode 100644 index 00000000000..d53877ceeb0 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2843-eda3a290faa906b3.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2843],{33866:function(e,t,n){n.d(t,{Z:function(){return B}});var o=n(2265),a=n(36760),c=n.n(a),r=n(66632),i=n(93350),l=n(19722),s=n(71744),d=n(93463),u=n(12918),m=n(18536),b=n(71140),p=n(99320);let g=new d.E4("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),f=new d.E4("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),v=new d.E4("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),h=new d.E4("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),y=new d.E4("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),x=new d.E4("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),C=e=>{let{componentCls:t,iconCls:n,antCls:o,badgeShadowSize:a,textFontSize:c,textFontSizeSM:r,statusSize:i,dotSize:l,textFontWeight:s,indicatorHeight:b,indicatorHeightSM:p,marginXS:C,calc:O}=e,N="".concat(o,"-scroll-number"),E=(0,m.Z)(e,(e,n)=>{let{darkColor:o}=n;return{["&".concat(t," ").concat(t,"-color-").concat(e)]:{background:o,["&:not(".concat(t,"-count)")]:{color:o},"a:hover &":{background:o}}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,["".concat(t,"-count")]:{display:"inline-flex",justifyContent:"center",zIndex:e.indicatorZIndex,minWidth:b,height:b,color:e.badgeTextColor,fontWeight:s,fontSize:c,lineHeight:(0,d.bf)(b),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:O(b).div(2).equal(),boxShadow:"0 0 0 ".concat((0,d.bf)(a)," ").concat(e.badgeShadowColor),transition:"background ".concat(e.motionDurationMid),a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},["".concat(t,"-count-sm")]:{minWidth:p,height:p,fontSize:r,lineHeight:(0,d.bf)(p),borderRadius:O(p).div(2).equal()},["".concat(t,"-multiple-words")]:{padding:"0 ".concat((0,d.bf)(e.paddingXS)),bdi:{unicodeBidi:"plaintext"}},["".concat(t,"-dot")]:{zIndex:e.indicatorZIndex,width:l,minWidth:l,height:l,background:e.badgeColor,borderRadius:"100%",boxShadow:"0 0 0 ".concat((0,d.bf)(a)," ").concat(e.badgeShadowColor)},["".concat(t,"-count, ").concat(t,"-dot, ").concat(N,"-custom-component")]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",["&".concat(n,"-spin")]:{animationName:x,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},["&".concat(t,"-status")]:{lineHeight:"inherit",verticalAlign:"baseline",["".concat(t,"-status-dot")]:{position:"relative",top:-1,display:"inline-block",width:i,height:i,verticalAlign:"middle",borderRadius:"50%"},["".concat(t,"-status-success")]:{backgroundColor:e.colorSuccess},["".concat(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:a,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:g,animationDuration:e.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},["".concat(t,"-status-default")]:{backgroundColor:e.colorTextPlaceholder},["".concat(t,"-status-error")]:{backgroundColor:e.colorError},["".concat(t,"-status-warning")]:{backgroundColor:e.colorWarning},["".concat(t,"-status-text")]:{marginInlineStart:C,color:e.colorText,fontSize:e.fontSize}}}),E),{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:f,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["".concat(t,"-zoom-leave")]:{animationName:v,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["&".concat(t,"-not-a-wrapper")]:{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:h,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["".concat(t,"-zoom-leave")]:{animationName:y,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["&:not(".concat(t,"-status)")]:{verticalAlign:"middle"},["".concat(N,"-custom-component, ").concat(t,"-count")]:{transform:"none"},["".concat(N,"-custom-component, ").concat(N)]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[N]:{overflow:"hidden",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseOutBack),["".concat(N,"-only")]:{position:"relative",display:"inline-block",height:b,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseOutBack),WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",["> p".concat(N,"-only-unit")]:{height:b,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},["".concat(N,"-symbol")]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",["".concat(t,"-count, ").concat(t,"-dot, ").concat(N,"-custom-component")]:{transform:"translate(-50%, -50%)"}}})}},O=e=>{let{fontHeight:t,lineWidth:n,marginXS:o,colorBorderBg:a}=e,c=e.colorTextLightSolid,r=e.colorError,i=e.colorErrorHover;return(0,b.IX)(e,{badgeFontHeight:t,badgeShadowSize:n,badgeTextColor:c,badgeColor:r,badgeColorHover:i,badgeShadowColor:a,badgeProcessingDuration:"1.2s",badgeRibbonOffset:o,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},N=e=>{let{fontSize:t,lineHeight:n,fontSizeSM:o,lineWidth:a}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*n)-2*a,indicatorHeightSM:t,dotSize:o/2,textFontSize:o,textFontSizeSM:o,textFontWeight:"normal",statusSize:o/2}};var E=(0,p.I$)("Badge",e=>C(O(e)),N);let I=e=>{let{antCls:t,badgeFontHeight:n,marginXS:o,badgeRibbonOffset:a,calc:c}=e,r="".concat(t,"-ribbon"),i=(0,m.Z)(e,(e,t)=>{let{darkColor:n}=t;return{["&".concat(r,"-color-").concat(e)]:{background:n,color:n}}});return{["".concat(t,"-ribbon-wrapper")]:{position:"relative"},[r]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"absolute",top:o,padding:"0 ".concat((0,d.bf)(e.paddingXS)),color:e.colorPrimary,lineHeight:(0,d.bf)(n),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,["".concat(r,"-text")]:{color:e.badgeTextColor},["".concat(r,"-corner")]:{position:"absolute",top:"100%",width:a,height:a,color:"currentcolor",border:"".concat((0,d.bf)(c(a).div(2).equal())," solid"),transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),i),{["&".concat(r,"-placement-end")]:{insetInlineEnd:c(a).mul(-1).equal(),borderEndEndRadius:0,["".concat(r,"-corner")]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},["&".concat(r,"-placement-start")]:{insetInlineStart:c(a).mul(-1).equal(),borderEndStartRadius:0,["".concat(r,"-corner")]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}};var w=(0,p.I$)(["Badge","Ribbon"],e=>I(O(e)),N);let k=e=>{let t;let{prefixCls:n,value:a,current:r,offset:i=0}=e;return i&&(t={position:"absolute",top:"".concat(i,"00%"),left:0}),o.createElement("span",{style:t,className:c()("".concat(n,"-only-unit"),{current:r})},a)};var j=e=>{let t,n;let{prefixCls:a,count:c,value:r}=e,i=Number(r),l=Math.abs(c),[s,d]=o.useState(i),[u,m]=o.useState(l),b=()=>{d(i),m(l)};if(o.useEffect(()=>{let e=setTimeout(b,1e3);return()=>clearTimeout(e)},[i]),s===i||Number.isNaN(i)||Number.isNaN(s))t=[o.createElement(k,Object.assign({},e,{key:i,current:!0}))],n={transition:"none"};else{t=[];let a=i+10,c=[];for(let e=i;e<=a;e+=1)c.push(e);let r=ue%10===s);t=(r<0?c.slice(0,d+1):c.slice(d)).map((t,n)=>o.createElement(k,Object.assign({},e,{key:t,value:t%10,offset:r<0?n-d:n,current:n===d}))),n={transform:"translateY(".concat(-function(e,t,n){let o=e,a=0;for(;(o+10)%10!==t;)o+=n,a+=n;return a}(s,i,r),"00%)")}}return o.createElement("span",{className:"".concat(a,"-only"),style:n,onTransitionEnd:b},t)},S=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let Z=o.forwardRef((e,t)=>{let{prefixCls:n,count:a,className:r,motionClassName:i,style:d,title:u,show:m,component:b="sup",children:p}=e,g=S(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:f}=o.useContext(s.E_),v=f("scroll-number",n),h=Object.assign(Object.assign({},g),{"data-show":m,style:d,className:c()(v,r,i),title:u}),y=a;if(a&&Number(a)%1==0){let e=String(a).split("");y=o.createElement("bdi",null,e.map((t,n)=>o.createElement(j,{prefixCls:v,count:Number(a),value:t,key:e.length-n})))}return((null==d?void 0:d.borderColor)&&(h.style=Object.assign(Object.assign({},d),{boxShadow:"0 0 0 1px ".concat(d.borderColor," inset")})),p)?(0,l.Tm)(p,e=>({className:c()("".concat(v,"-custom-component"),null==e?void 0:e.className,i)})):o.createElement(b,Object.assign({},h,{ref:t}),y)});var P=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let R=o.forwardRef((e,t)=>{var n,a,d,u,m;let{prefixCls:b,scrollNumberPrefixCls:p,children:g,status:f,text:v,color:h,count:y=null,overflowCount:x=99,dot:C=!1,size:O="default",title:N,offset:I,style:w,className:k,rootClassName:j,classNames:S,styles:R,showZero:B=!1}=e,T=P(e,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:M,direction:A,badge:z}=o.useContext(s.E_),D=M("badge",b),[W,F,H]=E(D),K=y>x?"".concat(x,"+"):y,_="0"===K||0===K||"0"===v||0===v,q=null===y||_&&!B,X=(null!=f||null!=h)&&q,L=null!=f||!_,G=C&&!_,V=G?"":K,$=(0,o.useMemo)(()=>((null==V||""===V)&&(null==v||""===v)||_&&!B)&&!G,[V,_,B,G,v]),Y=(0,o.useRef)(y);$||(Y.current=y);let Q=Y.current,J=(0,o.useRef)(V);$||(J.current=V);let U=J.current,ee=(0,o.useRef)(G);$||(ee.current=G);let et=(0,o.useMemo)(()=>{if(!I)return Object.assign(Object.assign({},null==z?void 0:z.style),w);let e={marginTop:I[1]};return"rtl"===A?e.left=Number.parseInt(I[0],10):e.right=-Number.parseInt(I[0],10),Object.assign(Object.assign(Object.assign({},e),null==z?void 0:z.style),w)},[A,I,w,null==z?void 0:z.style]),en=null!=N?N:"string"==typeof Q||"number"==typeof Q?Q:void 0,eo=!$&&(0===v?B:!!v&&!0!==v),ea=eo?o.createElement("span",{className:"".concat(D,"-status-text")},v):null,ec=Q&&"object"==typeof Q?(0,l.Tm)(Q,e=>({style:Object.assign(Object.assign({},et),e.style)})):void 0,er=(0,i.o2)(h,!1),ei=c()(null==S?void 0:S.indicator,null===(n=null==z?void 0:z.classNames)||void 0===n?void 0:n.indicator,{["".concat(D,"-status-dot")]:X,["".concat(D,"-status-").concat(f)]:!!f,["".concat(D,"-color-").concat(h)]:er}),el={};h&&!er&&(el.color=h,el.background=h);let es=c()(D,{["".concat(D,"-status")]:X,["".concat(D,"-not-a-wrapper")]:!g,["".concat(D,"-rtl")]:"rtl"===A},k,j,null==z?void 0:z.className,null===(a=null==z?void 0:z.classNames)||void 0===a?void 0:a.root,null==S?void 0:S.root,F,H);if(!g&&X&&(v||L||!q)){let e=et.color;return W(o.createElement("span",Object.assign({},T,{className:es,style:Object.assign(Object.assign(Object.assign({},null==R?void 0:R.root),null===(d=null==z?void 0:z.styles)||void 0===d?void 0:d.root),et)}),o.createElement("span",{className:ei,style:Object.assign(Object.assign(Object.assign({},null==R?void 0:R.indicator),null===(u=null==z?void 0:z.styles)||void 0===u?void 0:u.indicator),el)}),eo&&o.createElement("span",{style:{color:e},className:"".concat(D,"-status-text")},v)))}return W(o.createElement("span",Object.assign({ref:t},T,{className:es,style:Object.assign(Object.assign({},null===(m=null==z?void 0:z.styles)||void 0===m?void 0:m.root),null==R?void 0:R.root)}),g,o.createElement(r.ZP,{visible:!$,motionName:"".concat(D,"-zoom"),motionAppear:!1,motionDeadline:1e3},e=>{var t,n;let{className:a}=e,r=M("scroll-number",p),i=ee.current,l=c()(null==S?void 0:S.indicator,null===(t=null==z?void 0:z.classNames)||void 0===t?void 0:t.indicator,{["".concat(D,"-dot")]:i,["".concat(D,"-count")]:!i,["".concat(D,"-count-sm")]:"small"===O,["".concat(D,"-multiple-words")]:!i&&U&&U.toString().length>1,["".concat(D,"-status-").concat(f)]:!!f,["".concat(D,"-color-").concat(h)]:er}),s=Object.assign(Object.assign(Object.assign({},null==R?void 0:R.indicator),null===(n=null==z?void 0:z.styles)||void 0===n?void 0:n.indicator),et);return h&&!er&&((s=s||{}).background=h),o.createElement(Z,{prefixCls:r,show:!$,motionClassName:a,className:l,count:U,title:en,style:s,key:"scrollNumber"},ec)}),ea))});R.Ribbon=e=>{let{className:t,prefixCls:n,style:a,color:r,children:l,text:d,placement:u="end",rootClassName:m}=e,{getPrefixCls:b,direction:p}=o.useContext(s.E_),g=b("ribbon",n),f="".concat(g,"-wrapper"),[v,h,y]=w(g,f),x=(0,i.o2)(r,!1),C=c()(g,"".concat(g,"-placement-").concat(u),{["".concat(g,"-rtl")]:"rtl"===p,["".concat(g,"-color-").concat(r)]:x},t),O={},N={};return r&&!x&&(O.background=r,N.color=r),v(o.createElement("div",{className:c()(f,m,h,y)},l,o.createElement("div",{className:c()(C,h),style:Object.assign(Object.assign({},O),a)},o.createElement("span",{className:"".concat(g,"-text")},d),o.createElement("div",{className:"".concat(g,"-corner"),style:N}))))};var B=R},44851:function(e,t,n){n.d(t,{default:function(){return q}});var o=n(2265),a=n(77565),c=n(36760),r=n.n(c),i=n(1119),l=n(83145),s=n(26365),d=n(41154),u=n(50506),m=n(32559),b=n(6989),p=n(45287),g=n(31686),f=n(11993),v=n(66632),h=n(95814),y=o.forwardRef(function(e,t){var n=e.prefixCls,a=e.forceRender,c=e.className,i=e.style,l=e.children,d=e.isActive,u=e.role,m=e.classNames,b=e.styles,p=o.useState(d||a),g=(0,s.Z)(p,2),v=g[0],h=g[1];return(o.useEffect(function(){(a||d)&&h(!0)},[a,d]),v)?o.createElement("div",{ref:t,className:r()("".concat(n,"-content"),(0,f.Z)((0,f.Z)({},"".concat(n,"-content-active"),d),"".concat(n,"-content-inactive"),!d),c),style:i,role:u},o.createElement("div",{className:r()("".concat(n,"-content-box"),null==m?void 0:m.body),style:null==b?void 0:b.body},l)):null});y.displayName="PanelContent";var x=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],C=o.forwardRef(function(e,t){var n=e.showArrow,a=e.headerClass,c=e.isActive,l=e.onItemClick,s=e.forceRender,d=e.className,u=e.classNames,m=void 0===u?{}:u,p=e.styles,C=void 0===p?{}:p,O=e.prefixCls,N=e.collapsible,E=e.accordion,I=e.panelKey,w=e.extra,k=e.header,j=e.expandIcon,S=e.openMotion,Z=e.destroyInactivePanel,P=e.children,R=(0,b.Z)(e,x),B="disabled"===N,T=(0,f.Z)((0,f.Z)((0,f.Z)({onClick:function(){null==l||l(I)},onKeyDown:function(e){("Enter"===e.key||e.keyCode===h.Z.ENTER||e.which===h.Z.ENTER)&&(null==l||l(I))},role:E?"tab":"button"},"aria-expanded",c),"aria-disabled",B),"tabIndex",B?-1:0),M="function"==typeof j?j(e):o.createElement("i",{className:"arrow"}),A=M&&o.createElement("div",(0,i.Z)({className:"".concat(O,"-expand-icon")},["header","icon"].includes(N)?T:{}),M),z=r()("".concat(O,"-item"),(0,f.Z)((0,f.Z)({},"".concat(O,"-item-active"),c),"".concat(O,"-item-disabled"),B),d),D=r()(a,"".concat(O,"-header"),(0,f.Z)({},"".concat(O,"-collapsible-").concat(N),!!N),m.header),W=(0,g.Z)({className:D,style:C.header},["header","icon"].includes(N)?{}:T);return o.createElement("div",(0,i.Z)({},R,{ref:t,className:z}),o.createElement("div",W,(void 0===n||n)&&A,o.createElement("span",(0,i.Z)({className:"".concat(O,"-header-text")},"header"===N?T:{}),k),null!=w&&"boolean"!=typeof w&&o.createElement("div",{className:"".concat(O,"-extra")},w)),o.createElement(v.ZP,(0,i.Z)({visible:c,leavedClassName:"".concat(O,"-content-hidden")},S,{forceRender:s,removeOnLeave:Z}),function(e,t){var n=e.className,a=e.style;return o.createElement(y,{ref:t,prefixCls:O,className:n,classNames:m,style:a,styles:C,isActive:c,forceRender:s,role:E?"tabpanel":void 0},P)}))}),O=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],N=function(e,t){var n=t.prefixCls,a=t.accordion,c=t.collapsible,r=t.destroyInactivePanel,l=t.onItemClick,s=t.activeKey,d=t.openMotion,u=t.expandIcon;return e.map(function(e,t){var m=e.children,p=e.label,g=e.key,f=e.collapsible,v=e.onItemClick,h=e.destroyInactivePanel,y=(0,b.Z)(e,O),x=String(null!=g?g:t),N=null!=f?f:c,E=!1;return E=a?s[0]===x:s.indexOf(x)>-1,o.createElement(C,(0,i.Z)({},y,{prefixCls:n,key:x,panelKey:x,isActive:E,accordion:a,openMotion:d,expandIcon:u,header:p,collapsible:N,onItemClick:function(e){"disabled"!==N&&(l(e),null==v||v(e))},destroyInactivePanel:null!=h?h:r}),m)})},E=function(e,t,n){if(!e)return null;var a=n.prefixCls,c=n.accordion,r=n.collapsible,i=n.destroyInactivePanel,l=n.onItemClick,s=n.activeKey,d=n.openMotion,u=n.expandIcon,m=e.key||String(t),b=e.props,p=b.header,g=b.headerClass,f=b.destroyInactivePanel,v=b.collapsible,h=b.onItemClick,y=!1;y=c?s[0]===m:s.indexOf(m)>-1;var x=null!=v?v:r,C={key:m,panelKey:m,header:p,headerClass:g,isActive:y,prefixCls:a,destroyInactivePanel:null!=f?f:i,openMotion:d,accordion:c,children:e.props.children,onItemClick:function(e){"disabled"!==x&&(l(e),null==h||h(e))},expandIcon:u,collapsible:x};return"string"==typeof e.type?e:(Object.keys(C).forEach(function(e){void 0===C[e]&&delete C[e]}),o.cloneElement(e,C))},I=n(18242);function w(e){var t=e;if(!Array.isArray(t)){var n=(0,d.Z)(t);t="number"===n||"string"===n?[t]:[]}return t.map(function(e){return String(e)})}var k=Object.assign(o.forwardRef(function(e,t){var n,a=e.prefixCls,c=void 0===a?"rc-collapse":a,d=e.destroyInactivePanel,b=e.style,g=e.accordion,f=e.className,v=e.children,h=e.collapsible,y=e.openMotion,x=e.expandIcon,C=e.activeKey,O=e.defaultActiveKey,k=e.onChange,j=e.items,S=r()(c,f),Z=(0,u.Z)([],{value:C,onChange:function(e){return null==k?void 0:k(e)},defaultValue:O,postState:w}),P=(0,s.Z)(Z,2),R=P[0],B=P[1];(0,m.ZP)(!v,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var T=(n={prefixCls:c,accordion:g,openMotion:y,expandIcon:x,collapsible:h,destroyInactivePanel:void 0!==d&&d,onItemClick:function(e){return B(function(){return g?R[0]===e?[]:[e]:R.indexOf(e)>-1?R.filter(function(t){return t!==e}):[].concat((0,l.Z)(R),[e])})},activeKey:R},Array.isArray(j)?N(j,n):(0,p.Z)(v).map(function(e,t){return E(e,t,n)}));return o.createElement("div",(0,i.Z)({ref:t,className:S,style:b,role:g?"tablist":void 0},(0,I.Z)(e,{aria:!0,data:!0})),T)}),{Panel:C});k.Panel;var j=n(18694),S=n(68710),Z=n(19722),P=n(71744),R=n(33759);let B=o.forwardRef((e,t)=>{let{getPrefixCls:n}=o.useContext(P.E_),{prefixCls:a,className:c,showArrow:i=!0}=e,l=n("collapse",a),s=r()({["".concat(l,"-no-arrow")]:!i},c);return o.createElement(k.Panel,Object.assign({ref:t},e,{prefixCls:l,className:s}))});var T=n(93463),M=n(12918),A=n(63074),z=n(99320),D=n(71140);let W=e=>{let{componentCls:t,contentBg:n,padding:o,headerBg:a,headerPadding:c,collapseHeaderPaddingSM:r,collapseHeaderPaddingLG:i,collapsePanelBorderRadius:l,lineWidth:s,lineType:d,colorBorder:u,colorText:m,colorTextHeading:b,colorTextDisabled:p,fontSizeLG:g,lineHeight:f,lineHeightLG:v,marginSM:h,paddingSM:y,paddingLG:x,paddingXS:C,motionDurationSlow:O,fontSizeIcon:N,contentPadding:E,fontHeight:I,fontHeightLG:w}=e,k="".concat((0,T.bf)(s)," ").concat(d," ").concat(u);return{[t]:Object.assign(Object.assign({},(0,M.Wf)(e)),{backgroundColor:a,border:k,borderRadius:l,"&-rtl":{direction:"rtl"},["& > ".concat(t,"-item")]:{borderBottom:k,"&:first-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"".concat((0,T.bf)(l)," ").concat((0,T.bf)(l)," 0 0")}},"&:last-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"0 0 ".concat((0,T.bf)(l)," ").concat((0,T.bf)(l))}},["> ".concat(t,"-header")]:Object.assign(Object.assign({position:"relative",display:"flex",flexWrap:"nowrap",alignItems:"flex-start",padding:c,color:b,lineHeight:f,cursor:"pointer",transition:"all ".concat(O,", visibility 0s")},(0,M.Qy)(e)),{["> ".concat(t,"-header-text")]:{flex:"auto"},["".concat(t,"-expand-icon")]:{height:I,display:"flex",alignItems:"center",paddingInlineEnd:h},["".concat(t,"-arrow")]:Object.assign(Object.assign({},(0,M.Ro)()),{fontSize:N,transition:"transform ".concat(O),svg:{transition:"transform ".concat(O)}}),["".concat(t,"-header-text")]:{marginInlineEnd:"auto"}}),["".concat(t,"-collapsible-header")]:{cursor:"default",["".concat(t,"-header-text")]:{flex:"none",cursor:"pointer"},["".concat(t,"-expand-icon")]:{cursor:"pointer"}},["".concat(t,"-collapsible-icon")]:{cursor:"unset",["".concat(t,"-expand-icon")]:{cursor:"pointer"}}},["".concat(t,"-content")]:{color:m,backgroundColor:n,borderTop:k,["& > ".concat(t,"-content-box")]:{padding:E},"&-hidden":{display:"none"}},"&-small":{["> ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{padding:r,paddingInlineStart:C,["> ".concat(t,"-expand-icon")]:{marginInlineStart:e.calc(y).sub(C).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:y}}},"&-large":{["> ".concat(t,"-item")]:{fontSize:g,lineHeight:v,["> ".concat(t,"-header")]:{padding:i,paddingInlineStart:o,["> ".concat(t,"-expand-icon")]:{height:w,marginInlineStart:e.calc(x).sub(o).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:x}}},["".concat(t,"-item:last-child")]:{borderBottom:0,["> ".concat(t,"-content")]:{borderRadius:"0 0 ".concat((0,T.bf)(l)," ").concat((0,T.bf)(l))}},["& ".concat(t,"-item-disabled > ").concat(t,"-header")]:{"\n &,\n & > .arrow\n ":{color:p,cursor:"not-allowed"}},["&".concat(t,"-icon-position-end")]:{["& > ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{["".concat(t,"-expand-icon")]:{order:1,paddingInlineEnd:0,paddingInlineStart:h}}}}})}},F=e=>{let{componentCls:t}=e,n="> ".concat(t,"-item > ").concat(t,"-header ").concat(t,"-arrow");return{["".concat(t,"-rtl")]:{[n]:{transform:"rotate(180deg)"}}}},H=e=>{let{componentCls:t,headerBg:n,borderlessContentPadding:o,borderlessContentBg:a,colorBorder:c}=e;return{["".concat(t,"-borderless")]:{backgroundColor:n,border:0,["> ".concat(t,"-item")]:{borderBottom:"1px solid ".concat(c)},["\n > ".concat(t,"-item:last-child,\n > ").concat(t,"-item:last-child ").concat(t,"-header\n ")]:{borderRadius:0},["> ".concat(t,"-item:last-child")]:{borderBottom:0},["> ".concat(t,"-item > ").concat(t,"-content")]:{backgroundColor:a,borderTop:0},["> ".concat(t,"-item > ").concat(t,"-content > ").concat(t,"-content-box")]:{padding:o}}}},K=e=>{let{componentCls:t,paddingSM:n}=e;return{["".concat(t,"-ghost")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-item")]:{borderBottom:0,["> ".concat(t,"-content")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-content-box")]:{paddingBlock:n}}}}}};var _=(0,z.I$)("Collapse",e=>{let t=(0,D.IX)(e,{collapseHeaderPaddingSM:"".concat((0,T.bf)(e.paddingXS)," ").concat((0,T.bf)(e.paddingSM)),collapseHeaderPaddingLG:"".concat((0,T.bf)(e.padding)," ").concat((0,T.bf)(e.paddingLG)),collapsePanelBorderRadius:e.borderRadiusLG});return[W(t),H(t),K(t),F(t),(0,A.Z)(t)]},e=>({headerPadding:"".concat(e.paddingSM,"px ").concat(e.padding,"px"),headerBg:e.colorFillAlter,contentPadding:"".concat(e.padding,"px 16px"),contentBg:e.colorBgContainer,borderlessContentPadding:"".concat(e.paddingXXS,"px 16px ").concat(e.padding,"px"),borderlessContentBg:"transparent"})),q=Object.assign(o.forwardRef((e,t)=>{let{getPrefixCls:n,direction:c,expandIcon:i,className:l,style:s}=(0,P.dj)("collapse"),{prefixCls:d,className:u,rootClassName:m,style:b,bordered:g=!0,ghost:f,size:v,expandIconPosition:h="start",children:y,destroyInactivePanel:x,destroyOnHidden:C,expandIcon:O}=e,N=(0,R.Z)(e=>{var t;return null!==(t=null!=v?v:e)&&void 0!==t?t:"middle"}),E=n("collapse",d),I=n(),[w,B,T]=_(E),M=o.useMemo(()=>"left"===h?"start":"right"===h?"end":h,[h]),A=null!=O?O:i,z=o.useCallback(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="function"==typeof A?A(e):o.createElement(a.Z,{rotate:e.isActive?"rtl"===c?-90:90:void 0,"aria-label":e.isActive?"expanded":"collapsed"});return(0,Z.Tm)(t,()=>{var e;return{className:r()(null===(e=t.props)||void 0===e?void 0:e.className,"".concat(E,"-arrow"))}})},[A,E,c]),D=r()("".concat(E,"-icon-position-").concat(M),{["".concat(E,"-borderless")]:!g,["".concat(E,"-rtl")]:"rtl"===c,["".concat(E,"-ghost")]:!!f,["".concat(E,"-").concat(N)]:"middle"!==N},l,u,m,B,T),W=o.useMemo(()=>Object.assign(Object.assign({},(0,S.Z)(I)),{motionAppear:!1,leavedClassName:"".concat(E,"-content-hidden")}),[I,E]),F=o.useMemo(()=>y?(0,p.Z)(y).map((e,t)=>{var n,o;let a=e.props;if(null==a?void 0:a.disabled){let c=null!==(n=e.key)&&void 0!==n?n:String(t),r=Object.assign(Object.assign({},(0,j.Z)(e.props,["disabled"])),{key:c,collapsible:null!==(o=a.collapsible)&&void 0!==o?o:"disabled"});return(0,Z.Tm)(e,r)}return e}):null,[y]);return w(o.createElement(k,Object.assign({ref:t,openMotion:W},(0,j.Z)(e,["rootClassName"]),{expandIcon:z,prefixCls:E,className:D,style:Object.assign(Object.assign({},s),b),destroyInactivePanel:null!=C?C:x}),F))}),{Panel:B})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3367-58830187e9e5b9fa.js b/litellm/proxy/_experimental/out/_next/static/chunks/3367-33bb84b3d3d247b2.js similarity index 98% rename from litellm/proxy/_experimental/out/_next/static/chunks/3367-58830187e9e5b9fa.js rename to litellm/proxy/_experimental/out/_next/static/chunks/3367-33bb84b3d3d247b2.js index ab13c388e33..23daac359dc 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3367-58830187e9e5b9fa.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/3367-33bb84b3d3d247b2.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3367],{39760:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(1119),o=t(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},l=t(55015),u=o.forwardRef(function(e,n){return o.createElement(l.Z,(0,r.Z)({},e,{ref:n,icon:i}))})},71030:function(e,n,t){t.d(n,{Z:function(){return C}});var r=t(1119),o=t(11993),i=t(26365),l=t(6989),u=t(97821),a=t(36760),c=t.n(a),s=t(28791),f=t(2265),d=t(95814),p=t(53346),v=d.Z.ESC,m=d.Z.TAB,b=(0,f.forwardRef)(function(e,n){var t=e.overlay,r=e.arrow,o=e.prefixCls,i=(0,f.useMemo)(function(){return"function"==typeof t?t():t},[t]),l=(0,s.sQ)(n,(0,s.C4)(i));return f.createElement(f.Fragment,null,r&&f.createElement("div",{className:"".concat(o,"-arrow")}),f.cloneElement(i,{ref:(0,s.Yr)(i)?l:void 0}))}),y={adjustX:1,adjustY:1},h=[0,0],g={topLeft:{points:["bl","tl"],overflow:y,offset:[0,-4],targetOffset:h},top:{points:["bc","tc"],overflow:y,offset:[0,-4],targetOffset:h},topRight:{points:["br","tr"],overflow:y,offset:[0,-4],targetOffset:h},bottomLeft:{points:["tl","bl"],overflow:y,offset:[0,4],targetOffset:h},bottom:{points:["tc","bc"],overflow:y,offset:[0,4],targetOffset:h},bottomRight:{points:["tr","br"],overflow:y,offset:[0,4],targetOffset:h}},Z=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"],C=f.forwardRef(function(e,n){var t,a,d,y,h,C,E,w,k,M,R,x,N,P,S=e.arrow,I=void 0!==S&&S,K=e.prefixCls,O=void 0===K?"rc-dropdown":K,A=e.transitionName,T=e.animation,L=e.align,D=e.placement,_=e.placements,V=e.getPopupContainer,z=e.showAction,F=e.hideAction,j=e.overlayClassName,B=e.overlayStyle,W=e.visible,H=e.trigger,Y=void 0===H?["hover"]:H,q=e.autoFocus,X=e.overlay,G=e.children,Q=e.onVisibleChange,U=(0,l.Z)(e,Z),J=f.useState(),$=(0,i.Z)(J,2),ee=$[0],en=$[1],et="visible"in e?W:ee,er=f.useRef(null),eo=f.useRef(null),ei=f.useRef(null);f.useImperativeHandle(n,function(){return er.current});var el=function(e){en(e),null==Q||Q(e)};a=(t={visible:et,triggerRef:ei,onVisibleChange:el,autoFocus:q,overlayRef:eo}).visible,d=t.triggerRef,y=t.onVisibleChange,h=t.autoFocus,C=t.overlayRef,E=f.useRef(!1),w=function(){if(a){var e,n;null===(e=d.current)||void 0===e||null===(n=e.focus)||void 0===n||n.call(e),null==y||y(!1)}},k=function(){var e;return null!==(e=C.current)&&void 0!==e&&!!e.focus&&(C.current.focus(),E.current=!0,!0)},M=function(e){switch(e.keyCode){case v:w();break;case m:var n=!1;E.current||(n=k()),n?e.preventDefault():w()}},f.useEffect(function(){return a?(window.addEventListener("keydown",M),h&&(0,p.Z)(k,3),function(){window.removeEventListener("keydown",M),E.current=!1}):function(){E.current=!1}},[a]);var eu=function(){return f.createElement(b,{ref:eo,overlay:X,prefixCls:O,arrow:I})},ea=f.cloneElement(G,{className:c()(null===(P=G.props)||void 0===P?void 0:P.className,et&&(void 0!==(R=e.openClassName)?R:"".concat(O,"-open"))),ref:(0,s.Yr)(G)?(0,s.sQ)(ei,(0,s.C4)(G)):void 0}),ec=F;return ec||-1===Y.indexOf("contextMenu")||(ec=["click"]),f.createElement(u.Z,(0,r.Z)({builtinPlacements:void 0===_?g:_},U,{prefixCls:O,ref:er,popupClassName:c()(j,(0,o.Z)({},"".concat(O,"-show-arrow"),I)),popupStyle:B,action:Y,showAction:z,hideAction:ec,popupPlacement:void 0===D?"bottomLeft":D,popupAlign:L,popupTransitionName:A,popupAnimation:T,popupVisible:et,stretch:(x=e.minOverlayWidthMatchTrigger,N=e.alignPoint,"minOverlayWidthMatchTrigger"in e?x:!N)?"minWidth":"",popup:"function"==typeof X?eu:eu(),onPopupVisibleChange:el,onPopupClick:function(n){var t=e.onOverlayClick;en(!1),t&&t(n)},getPopupContainer:V}),ea)})},33082:function(e,n,t){t.d(n,{iz:function(){return eO},ck:function(){return ev},BW:function(){return eL},sN:function(){return ev},Wd:function(){return eI},ZP:function(){return ej},Xl:function(){return x}});var r=t(1119),o=t(11993),i=t(31686),l=t(83145),u=t(26365),a=t(6989),c=t(36760),s=t.n(c),f=t(1699),d=t(50506),p=t(16671),v=t(32559),m=t(2265),b=t(54887),y=m.createContext(null);function h(e,n){return void 0===e?null:"".concat(e,"-").concat(n)}function g(e){return h(m.useContext(y),e)}var Z=t(6397),C=["children","locked"],E=m.createContext(null);function w(e){var n=e.children,t=e.locked,r=(0,a.Z)(e,C),o=m.useContext(E),l=(0,Z.Z)(function(){var e;return e=(0,i.Z)({},o),Object.keys(r).forEach(function(n){var t=r[n];void 0!==t&&(e[n]=t)}),e},[o,r],function(e,n){return!t&&(e[0]!==n[0]||!(0,p.Z)(e[1],n[1],!0))});return m.createElement(E.Provider,{value:l},n)}var k=m.createContext(null);function M(){return m.useContext(k)}var R=m.createContext([]);function x(e){var n=m.useContext(R);return m.useMemo(function(){return void 0!==e?[].concat((0,l.Z)(n),[e]):n},[n,e])}var N=m.createContext(null),P=m.createContext({}),S=t(2857);function I(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,S.Z)(e)){var t=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(t)||e.isContentEditable||"a"===t&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),i=Number(o),l=null;return o&&!Number.isNaN(i)?l=i:r&&null===l&&(l=0),r&&e.disabled&&(l=null),null!==l&&(l>=0||n&&l<0)}return!1}var K=t(95814),O=t(53346),A=K.Z.LEFT,T=K.Z.RIGHT,L=K.Z.UP,D=K.Z.DOWN,_=K.Z.ENTER,V=K.Z.ESC,z=K.Z.HOME,F=K.Z.END,j=[L,D,A,T];function B(e,n){return(function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(0,l.Z)(e.querySelectorAll("*")).filter(function(e){return I(e,n)});return I(e,n)&&t.unshift(e),t})(e,!0).filter(function(e){return n.has(e)})}function W(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;var o=B(e,n),i=o.length,l=o.findIndex(function(e){return t===e});return r<0?-1===l?l=i-1:l-=1:r>0&&(l+=1),o[l=(l+i)%i]}var H=function(e,n){var t=new Set,r=new Map,o=new Map;return e.forEach(function(e){var i=document.querySelector("[data-menu-id='".concat(h(n,e),"']"));i&&(t.add(i),o.set(i,e),r.set(e,i))}),{elements:t,key2element:r,element2key:o}},Y="__RC_UTIL_PATH_SPLIT__",q=function(e){return e.join(Y)},X="rc-menu-more";function G(e){var n=m.useRef(e);n.current=e;var t=m.useCallback(function(){for(var e,t=arguments.length,r=Array(t),o=0;o1&&(k.motionAppear=!1);var M=k.onVisibleChanged;return(k.onVisibleChanged=function(e){return b.current||e||Z(!0),null==M?void 0:M(e)},g)?null:m.createElement(w,{mode:a,locked:!b.current},m.createElement(eR.ZP,(0,r.Z)({visible:C},k,{forceRender:f,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(e){var t=e.className,r=e.style;return m.createElement(eb,{id:n,className:t,style:r},l)}))}var eN=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],eP=["active"],eS=m.forwardRef(function(e,n){var t=e.style,l=e.className,c=e.title,d=e.eventKey,p=(e.warnKey,e.disabled),v=e.internalPopupClose,b=e.children,y=e.itemIcon,h=e.expandIcon,Z=e.popupClassName,C=e.popupOffset,k=e.popupStyle,M=e.onClick,R=e.onMouseEnter,S=e.onMouseLeave,I=e.onTitleClick,K=e.onTitleMouseEnter,O=e.onTitleMouseLeave,A=(0,a.Z)(e,eN),T=g(d),L=m.useContext(E),D=L.prefixCls,_=L.mode,V=L.openKeys,z=L.disabled,F=L.overflowDisabled,j=L.activeKey,B=L.selectedKeys,W=L.itemIcon,H=L.expandIcon,Y=L.onItemClick,q=L.onOpenChange,X=L.onActive,Q=m.useContext(P)._internalRenderSubMenuItem,U=m.useContext(N).isSubPathKey,J=x(),$="".concat(D,"-submenu"),ee=z||p,en=m.useRef(),et=m.useRef(),er=null!=h?h:H,eu=V.includes(d),ec=!F&&eu,es=U(B,d),ef=eo(d,ee,K,O),ed=ef.active,ep=(0,a.Z)(ef,eP),ev=m.useState(!1),em=(0,u.Z)(ev,2),ey=em[0],eh=em[1],eg=function(e){ee||eh(e)},eZ=m.useMemo(function(){return ed||"inline"!==_&&(ey||U([j],d))},[_,ed,j,ey,d,U]),eC=ei(J.length),eE=G(function(e){null==M||M(ea(e)),Y(e)}),ew=T&&"".concat(T,"-popup"),ek=m.useMemo(function(){return m.createElement(el,{icon:"horizontal"!==_?er:void 0,props:(0,i.Z)((0,i.Z)({},e),{},{isOpen:ec,isSubMenu:!0})},m.createElement("i",{className:"".concat($,"-arrow")}))},[_,er,e,ec,$]),eR=m.createElement("div",(0,r.Z)({role:"menuitem",style:eC,className:"".concat($,"-title"),tabIndex:ee?null:-1,ref:en,title:"string"==typeof c?c:null,"data-menu-id":F&&T?null:T,"aria-expanded":ec,"aria-haspopup":!0,"aria-controls":ew,"aria-disabled":ee,onClick:function(e){ee||(null==I||I({key:d,domEvent:e}),"inline"===_&&q(d,!eu))},onFocus:function(){X(d)}},ep),c,ek),eS=m.useRef(_);if("inline"!==_&&J.length>1?eS.current="vertical":eS.current=_,!F){var eI=eS.current;eR=m.createElement(eM,{mode:eI,prefixCls:$,visible:!v&&ec&&"inline"!==_,popupClassName:Z,popupOffset:C,popupStyle:k,popup:m.createElement(w,{mode:"horizontal"===eI?"vertical":eI},m.createElement(eb,{id:ew,ref:et},b)),disabled:ee,onVisibleChange:function(e){"inline"!==_&&q(d,e)}},eR)}var eK=m.createElement(f.Z.Item,(0,r.Z)({ref:n,role:"none"},A,{component:"li",style:t,className:s()($,"".concat($,"-").concat(_),l,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat($,"-open"),ec),"".concat($,"-active"),eZ),"".concat($,"-selected"),es),"".concat($,"-disabled"),ee)),onMouseEnter:function(e){eg(!0),null==R||R({key:d,domEvent:e})},onMouseLeave:function(e){eg(!1),null==S||S({key:d,domEvent:e})}}),eR,!F&&m.createElement(ex,{id:ew,open:ec,keyPath:J},b));return Q&&(eK=Q(eK,e,{selected:es,active:eZ,open:ec,disabled:ee})),m.createElement(w,{onItemClick:eE,mode:"horizontal"===_?"vertical":_,itemIcon:null!=y?y:W,expandIcon:er},eK)}),eI=m.forwardRef(function(e,n){var t,o=e.eventKey,i=e.children,l=x(o),u=eh(i,l),a=M();return m.useEffect(function(){if(a)return a.registerPath(o,l),function(){a.unregisterPath(o,l)}},[l]),t=a?u:m.createElement(eS,(0,r.Z)({ref:n},e),u),m.createElement(R.Provider,{value:l},t)}),eK=t(41154);function eO(e){var n=e.className,t=e.style,r=m.useContext(E).prefixCls;return M()?null:m.createElement("li",{role:"separator",className:s()("".concat(r,"-item-divider"),n),style:t})}var eA=["className","title","eventKey","children"],eT=m.forwardRef(function(e,n){var t=e.className,o=e.title,i=(e.eventKey,e.children),l=(0,a.Z)(e,eA),u=m.useContext(E).prefixCls,c="".concat(u,"-item-group");return m.createElement("li",(0,r.Z)({ref:n,role:"presentation"},l,{onClick:function(e){return e.stopPropagation()},className:s()(c,t)}),m.createElement("div",{role:"presentation",className:"".concat(c,"-title"),title:"string"==typeof o?o:void 0},o),m.createElement("ul",{role:"group",className:"".concat(c,"-list")},i))}),eL=m.forwardRef(function(e,n){var t=e.eventKey,o=eh(e.children,x(t));return M()?o:m.createElement(eT,(0,r.Z)({ref:n},(0,et.Z)(e,["warnKey"])),o)}),eD=["label","children","key","type","extra"];function e_(e,n,t,o,l){var u=e,c=(0,i.Z)({divider:eO,item:ev,group:eL,submenu:eI},o);return n&&(u=function e(n,t,o){var i=t.item,l=t.group,u=t.submenu,c=t.divider;return(n||[]).map(function(n,s){if(n&&"object"===(0,eK.Z)(n)){var f=n.label,d=n.children,p=n.key,v=n.type,b=n.extra,y=(0,a.Z)(n,eD),h=null!=p?p:"tmp-".concat(s);return d||"group"===v?"group"===v?m.createElement(l,(0,r.Z)({key:h},y,{title:f}),e(d,t,o)):m.createElement(u,(0,r.Z)({key:h},y,{title:f}),e(d,t,o)):"divider"===v?m.createElement(c,(0,r.Z)({key:h},y)):m.createElement(i,(0,r.Z)({key:h},y,{extra:b}),f,(!!b||0===b)&&m.createElement("span",{className:"".concat(o,"-item-extra")},b))}return null}).filter(function(e){return e})}(n,c,l)),eh(u,t)}var eV=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],ez=[],eF=m.forwardRef(function(e,n){var t,c,v,h,g,Z,C,E,M,R,x,S,I,K,J,$,ee,en,et,er,eo,ei,el,eu,ec,es,ef=e.prefixCls,ed=void 0===ef?"rc-menu":ef,ep=e.rootClassName,em=e.style,eb=e.className,ey=e.tabIndex,eh=e.items,eg=e.children,eZ=e.direction,eC=e.id,eE=e.mode,ew=void 0===eE?"vertical":eE,ek=e.inlineCollapsed,eM=e.disabled,eR=e.disabledOverflow,ex=e.subMenuOpenDelay,eN=e.subMenuCloseDelay,eP=e.forceSubMenuRender,eS=e.defaultOpenKeys,eK=e.openKeys,eO=e.activeKey,eA=e.defaultActiveFirst,eT=e.selectable,eL=void 0===eT||eT,eD=e.multiple,eF=void 0!==eD&&eD,ej=e.defaultSelectedKeys,eB=e.selectedKeys,eW=e.onSelect,eH=e.onDeselect,eY=e.inlineIndent,eq=e.motion,eX=e.defaultMotions,eG=e.triggerSubMenuAction,eQ=e.builtinPlacements,eU=e.itemIcon,eJ=e.expandIcon,e$=e.overflowedIndicator,e0=void 0===e$?"...":e$,e1=e.overflowedIndicatorPopupClassName,e2=e.getPopupContainer,e6=e.onClick,e5=e.onOpenChange,e9=e.onKeyDown,e3=(e.openAnimation,e.openTransitionName,e._internalRenderMenuItem),e4=e._internalRenderSubMenuItem,e8=e._internalComponents,e7=(0,a.Z)(e,eV),ne=m.useMemo(function(){return[e_(eg,eh,ez,e8,ed),e_(eg,eh,ez,{},ed)]},[eg,eh,e8]),nn=(0,u.Z)(ne,2),nt=nn[0],nr=nn[1],no=m.useState(!1),ni=(0,u.Z)(no,2),nl=ni[0],nu=ni[1],na=m.useRef(),nc=(t=(0,d.Z)(eC,{value:eC}),v=(c=(0,u.Z)(t,2))[0],h=c[1],m.useEffect(function(){U+=1;var e="".concat(Q,"-").concat(U);h("rc-menu-uuid-".concat(e))},[]),v),ns="rtl"===eZ,nf=(0,d.Z)(eS,{value:eK,postState:function(e){return e||ez}}),nd=(0,u.Z)(nf,2),np=nd[0],nv=nd[1],nm=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function t(){nv(e),null==e5||e5(e)}n?(0,b.flushSync)(t):t()},nb=m.useState(np),ny=(0,u.Z)(nb,2),nh=ny[0],ng=ny[1],nZ=m.useRef(!1),nC=m.useMemo(function(){return("inline"===ew||"vertical"===ew)&&ek?["vertical",ek]:[ew,!1]},[ew,ek]),nE=(0,u.Z)(nC,2),nw=nE[0],nk=nE[1],nM="inline"===nw,nR=m.useState(nw),nx=(0,u.Z)(nR,2),nN=nx[0],nP=nx[1],nS=m.useState(nk),nI=(0,u.Z)(nS,2),nK=nI[0],nO=nI[1];m.useEffect(function(){nP(nw),nO(nk),nZ.current&&(nM?nv(nh):nm(ez))},[nw,nk]);var nA=m.useState(0),nT=(0,u.Z)(nA,2),nL=nT[0],nD=nT[1],n_=nL>=nt.length-1||"horizontal"!==nN||eR;m.useEffect(function(){nM&&ng(np)},[np]),m.useEffect(function(){return nZ.current=!0,function(){nZ.current=!1}},[]);var nV=(g=m.useState({}),Z=(0,u.Z)(g,2)[1],C=(0,m.useRef)(new Map),E=(0,m.useRef)(new Map),M=m.useState([]),x=(R=(0,u.Z)(M,2))[0],S=R[1],I=(0,m.useRef)(0),K=(0,m.useRef)(!1),J=function(){K.current||Z({})},$=(0,m.useCallback)(function(e,n){var t,r=q(n);E.current.set(r,e),C.current.set(e,r),I.current+=1;var o=I.current;t=function(){o===I.current&&J()},Promise.resolve().then(t)},[]),ee=(0,m.useCallback)(function(e,n){var t=q(n);E.current.delete(t),C.current.delete(e)},[]),en=(0,m.useCallback)(function(e){S(e)},[]),et=(0,m.useCallback)(function(e,n){var t=(C.current.get(e)||"").split(Y);return n&&x.includes(t[0])&&t.unshift(X),t},[x]),er=(0,m.useCallback)(function(e,n){return e.filter(function(e){return void 0!==e}).some(function(e){return et(e,!0).includes(n)})},[et]),eo=(0,m.useCallback)(function(e){var n="".concat(C.current.get(e)).concat(Y),t=new Set;return(0,l.Z)(E.current.keys()).forEach(function(e){e.startsWith(n)&&t.add(E.current.get(e))}),t},[]),m.useEffect(function(){return function(){K.current=!0}},[]),{registerPath:$,unregisterPath:ee,refreshOverflowKeys:en,isSubPathKey:er,getKeyPath:et,getKeys:function(){var e=(0,l.Z)(C.current.keys());return x.length&&e.push(X),e},getSubPathKeys:eo}),nz=nV.registerPath,nF=nV.unregisterPath,nj=nV.refreshOverflowKeys,nB=nV.isSubPathKey,nW=nV.getKeyPath,nH=nV.getKeys,nY=nV.getSubPathKeys,nq=m.useMemo(function(){return{registerPath:nz,unregisterPath:nF}},[nz,nF]),nX=m.useMemo(function(){return{isSubPathKey:nB}},[nB]);m.useEffect(function(){nj(n_?ez:nt.slice(nL+1).map(function(e){return e.key}))},[nL,n_]);var nG=(0,d.Z)(eO||eA&&(null===(es=nt[0])||void 0===es?void 0:es.key),{value:eO}),nQ=(0,u.Z)(nG,2),nU=nQ[0],nJ=nQ[1],n$=G(function(e){nJ(e)}),n0=G(function(){nJ(void 0)});(0,m.useImperativeHandle)(n,function(){return{list:na.current,focus:function(e){var n,t,r=H(nH(),nc),o=r.elements,i=r.key2element,l=r.element2key,u=B(na.current,o),a=null!=nU?nU:u[0]?l.get(u[0]):null===(n=nt.find(function(e){return!e.props.disabled}))||void 0===n?void 0:n.key,c=i.get(a);a&&c&&(null==c||null===(t=c.focus)||void 0===t||t.call(c,e))}}});var n1=(0,d.Z)(ej||[],{value:eB,postState:function(e){return Array.isArray(e)?e:null==e?ez:[e]}}),n2=(0,u.Z)(n1,2),n6=n2[0],n5=n2[1],n9=function(e){if(eL){var n,t=e.key,r=n6.includes(t);n5(n=eF?r?n6.filter(function(e){return e!==t}):[].concat((0,l.Z)(n6),[t]):[t]);var o=(0,i.Z)((0,i.Z)({},e),{},{selectedKeys:n});r?null==eH||eH(o):null==eW||eW(o)}!eF&&np.length&&"inline"!==nN&&nm(ez)},n3=G(function(e){null==e6||e6(ea(e)),n9(e)}),n4=G(function(e,n){var t=np.filter(function(n){return n!==e});if(n)t.push(e);else if("inline"!==nN){var r=nY(e);t=t.filter(function(e){return!r.has(e)})}(0,p.Z)(np,t,!0)||nm(t,!0)}),n8=(ei=function(e,n){var t=null!=n?n:!np.includes(e);n4(e,t)},el=m.useRef(),(eu=m.useRef()).current=nU,ec=function(){O.Z.cancel(el.current)},m.useEffect(function(){return function(){ec()}},[]),function(e){var n=e.which;if([].concat(j,[_,V,z,F]).includes(n)){var t=nH(),r=H(t,nc),i=r,l=i.elements,u=i.key2element,a=i.element2key,c=function(e,n){for(var t=e||document.activeElement;t;){if(n.has(t))return t;t=t.parentElement}return null}(u.get(nU),l),s=a.get(c),f=function(e,n,t,r){var i,l="prev",u="next",a="children",c="parent";if("inline"===e&&r===_)return{inlineTrigger:!0};var s=(0,o.Z)((0,o.Z)({},L,l),D,u),f=(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},A,t?u:l),T,t?l:u),D,a),_,a),d=(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},L,l),D,u),_,a),V,c),A,t?a:c),T,t?c:a);switch(null===(i=({inline:s,horizontal:f,vertical:d,inlineSub:s,horizontalSub:d,verticalSub:d})["".concat(e).concat(n?"":"Sub")])||void 0===i?void 0:i[r]){case l:return{offset:-1,sibling:!0};case u:return{offset:1,sibling:!0};case c:return{offset:-1,sibling:!1};case a:return{offset:1,sibling:!1};default:return null}}(nN,1===nW(s,!0).length,ns,n);if(!f&&n!==z&&n!==F)return;(j.includes(n)||[z,F].includes(n))&&e.preventDefault();var d=function(e){if(e){var n=e,t=e.querySelector("a");null!=t&&t.getAttribute("href")&&(n=t);var r=a.get(e);nJ(r),ec(),el.current=(0,O.Z)(function(){eu.current===r&&n.focus()})}};if([z,F].includes(n)||f.sibling||!c){var p,v=B(p=c&&"inline"!==nN?function(e){for(var n=e;n;){if(n.getAttribute("data-menu-list"))return n;n=n.parentElement}return null}(c):na.current,l);d(n===z?v[0]:n===F?v[v.length-1]:W(p,l,c,f.offset))}else if(f.inlineTrigger)ei(s);else if(f.offset>0)ei(s,!0),ec(),el.current=(0,O.Z)(function(){r=H(t,nc);var e=c.getAttribute("aria-controls");d(W(document.getElementById(e),r.elements))},5);else if(f.offset<0){var m=nW(s,!0),b=m[m.length-2],y=u.get(b);ei(b,!1),d(y)}}null==e9||e9(e)});m.useEffect(function(){nu(!0)},[]);var n7=m.useMemo(function(){return{_internalRenderMenuItem:e3,_internalRenderSubMenuItem:e4}},[e3,e4]),te="horizontal"!==nN||eR?nt:nt.map(function(e,n){return m.createElement(w,{key:e.key,overflowDisabled:n>nL},e)}),tn=m.createElement(f.Z,(0,r.Z)({id:eC,ref:na,prefixCls:"".concat(ed,"-overflow"),component:"ul",itemComponent:ev,className:s()(ed,"".concat(ed,"-root"),"".concat(ed,"-").concat(nN),eb,(0,o.Z)((0,o.Z)({},"".concat(ed,"-inline-collapsed"),nK),"".concat(ed,"-rtl"),ns),ep),dir:eZ,style:em,role:"menu",tabIndex:void 0===ey?0:ey,data:te,renderRawItem:function(e){return e},renderRawRest:function(e){var n=e.length,t=n?nt.slice(-n):null;return m.createElement(eI,{eventKey:X,title:e0,disabled:n_,internalPopupClose:0===n,popupClassName:e1},t)},maxCount:"horizontal"!==nN||eR?f.Z.INVALIDATE:f.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){nD(e)},onKeyDown:n8},e7));return m.createElement(P.Provider,{value:n7},m.createElement(y.Provider,{value:nc},m.createElement(w,{prefixCls:ed,rootClassName:ep,mode:nN,openKeys:np,rtl:ns,disabled:eM,motion:nl?eq:null,defaultMotions:nl?eX:null,activeKey:nU,onActive:n$,onInactive:n0,selectedKeys:n6,inlineIndent:void 0===eY?24:eY,subMenuOpenDelay:void 0===ex?.1:ex,subMenuCloseDelay:void 0===eN?.1:eN,forceSubMenuRender:eP,builtinPlacements:eQ,triggerSubMenuAction:void 0===eG?"hover":eG,getPopupContainer:e2,itemIcon:eU,expandIcon:eJ,onItemClick:n3,onOpenChange:n4},m.createElement(N.Provider,{value:nX},tn),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(k.Provider,{value:nq},nr)))))});eF.Item=ev,eF.SubMenu=eI,eF.ItemGroup=eL,eF.Divider=eO;var ej=eF}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3367],{60440:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(1119),o=t(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},l=t(55015),u=o.forwardRef(function(e,n){return o.createElement(l.Z,(0,r.Z)({},e,{ref:n,icon:i}))})},71030:function(e,n,t){t.d(n,{Z:function(){return C}});var r=t(1119),o=t(11993),i=t(26365),l=t(6989),u=t(97821),a=t(36760),c=t.n(a),s=t(28791),f=t(2265),d=t(95814),p=t(53346),v=d.Z.ESC,m=d.Z.TAB,b=(0,f.forwardRef)(function(e,n){var t=e.overlay,r=e.arrow,o=e.prefixCls,i=(0,f.useMemo)(function(){return"function"==typeof t?t():t},[t]),l=(0,s.sQ)(n,(0,s.C4)(i));return f.createElement(f.Fragment,null,r&&f.createElement("div",{className:"".concat(o,"-arrow")}),f.cloneElement(i,{ref:(0,s.Yr)(i)?l:void 0}))}),y={adjustX:1,adjustY:1},h=[0,0],g={topLeft:{points:["bl","tl"],overflow:y,offset:[0,-4],targetOffset:h},top:{points:["bc","tc"],overflow:y,offset:[0,-4],targetOffset:h},topRight:{points:["br","tr"],overflow:y,offset:[0,-4],targetOffset:h},bottomLeft:{points:["tl","bl"],overflow:y,offset:[0,4],targetOffset:h},bottom:{points:["tc","bc"],overflow:y,offset:[0,4],targetOffset:h},bottomRight:{points:["tr","br"],overflow:y,offset:[0,4],targetOffset:h}},Z=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"],C=f.forwardRef(function(e,n){var t,a,d,y,h,C,E,w,k,M,R,x,N,P,S=e.arrow,I=void 0!==S&&S,K=e.prefixCls,O=void 0===K?"rc-dropdown":K,A=e.transitionName,T=e.animation,L=e.align,D=e.placement,_=e.placements,V=e.getPopupContainer,z=e.showAction,F=e.hideAction,j=e.overlayClassName,B=e.overlayStyle,W=e.visible,H=e.trigger,Y=void 0===H?["hover"]:H,q=e.autoFocus,X=e.overlay,G=e.children,Q=e.onVisibleChange,U=(0,l.Z)(e,Z),J=f.useState(),$=(0,i.Z)(J,2),ee=$[0],en=$[1],et="visible"in e?W:ee,er=f.useRef(null),eo=f.useRef(null),ei=f.useRef(null);f.useImperativeHandle(n,function(){return er.current});var el=function(e){en(e),null==Q||Q(e)};a=(t={visible:et,triggerRef:ei,onVisibleChange:el,autoFocus:q,overlayRef:eo}).visible,d=t.triggerRef,y=t.onVisibleChange,h=t.autoFocus,C=t.overlayRef,E=f.useRef(!1),w=function(){if(a){var e,n;null===(e=d.current)||void 0===e||null===(n=e.focus)||void 0===n||n.call(e),null==y||y(!1)}},k=function(){var e;return null!==(e=C.current)&&void 0!==e&&!!e.focus&&(C.current.focus(),E.current=!0,!0)},M=function(e){switch(e.keyCode){case v:w();break;case m:var n=!1;E.current||(n=k()),n?e.preventDefault():w()}},f.useEffect(function(){return a?(window.addEventListener("keydown",M),h&&(0,p.Z)(k,3),function(){window.removeEventListener("keydown",M),E.current=!1}):function(){E.current=!1}},[a]);var eu=function(){return f.createElement(b,{ref:eo,overlay:X,prefixCls:O,arrow:I})},ea=f.cloneElement(G,{className:c()(null===(P=G.props)||void 0===P?void 0:P.className,et&&(void 0!==(R=e.openClassName)?R:"".concat(O,"-open"))),ref:(0,s.Yr)(G)?(0,s.sQ)(ei,(0,s.C4)(G)):void 0}),ec=F;return ec||-1===Y.indexOf("contextMenu")||(ec=["click"]),f.createElement(u.Z,(0,r.Z)({builtinPlacements:void 0===_?g:_},U,{prefixCls:O,ref:er,popupClassName:c()(j,(0,o.Z)({},"".concat(O,"-show-arrow"),I)),popupStyle:B,action:Y,showAction:z,hideAction:ec,popupPlacement:void 0===D?"bottomLeft":D,popupAlign:L,popupTransitionName:A,popupAnimation:T,popupVisible:et,stretch:(x=e.minOverlayWidthMatchTrigger,N=e.alignPoint,"minOverlayWidthMatchTrigger"in e?x:!N)?"minWidth":"",popup:"function"==typeof X?eu:eu(),onPopupVisibleChange:el,onPopupClick:function(n){var t=e.onOverlayClick;en(!1),t&&t(n)},getPopupContainer:V}),ea)})},33082:function(e,n,t){t.d(n,{iz:function(){return eO},ck:function(){return ev},BW:function(){return eL},sN:function(){return ev},Wd:function(){return eI},ZP:function(){return ej},Xl:function(){return x}});var r=t(1119),o=t(11993),i=t(31686),l=t(83145),u=t(26365),a=t(6989),c=t(36760),s=t.n(c),f=t(1699),d=t(50506),p=t(16671),v=t(32559),m=t(2265),b=t(54887),y=m.createContext(null);function h(e,n){return void 0===e?null:"".concat(e,"-").concat(n)}function g(e){return h(m.useContext(y),e)}var Z=t(6397),C=["children","locked"],E=m.createContext(null);function w(e){var n=e.children,t=e.locked,r=(0,a.Z)(e,C),o=m.useContext(E),l=(0,Z.Z)(function(){var e;return e=(0,i.Z)({},o),Object.keys(r).forEach(function(n){var t=r[n];void 0!==t&&(e[n]=t)}),e},[o,r],function(e,n){return!t&&(e[0]!==n[0]||!(0,p.Z)(e[1],n[1],!0))});return m.createElement(E.Provider,{value:l},n)}var k=m.createContext(null);function M(){return m.useContext(k)}var R=m.createContext([]);function x(e){var n=m.useContext(R);return m.useMemo(function(){return void 0!==e?[].concat((0,l.Z)(n),[e]):n},[n,e])}var N=m.createContext(null),P=m.createContext({}),S=t(2857);function I(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,S.Z)(e)){var t=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(t)||e.isContentEditable||"a"===t&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),i=Number(o),l=null;return o&&!Number.isNaN(i)?l=i:r&&null===l&&(l=0),r&&e.disabled&&(l=null),null!==l&&(l>=0||n&&l<0)}return!1}var K=t(95814),O=t(53346),A=K.Z.LEFT,T=K.Z.RIGHT,L=K.Z.UP,D=K.Z.DOWN,_=K.Z.ENTER,V=K.Z.ESC,z=K.Z.HOME,F=K.Z.END,j=[L,D,A,T];function B(e,n){return(function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(0,l.Z)(e.querySelectorAll("*")).filter(function(e){return I(e,n)});return I(e,n)&&t.unshift(e),t})(e,!0).filter(function(e){return n.has(e)})}function W(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;var o=B(e,n),i=o.length,l=o.findIndex(function(e){return t===e});return r<0?-1===l?l=i-1:l-=1:r>0&&(l+=1),o[l=(l+i)%i]}var H=function(e,n){var t=new Set,r=new Map,o=new Map;return e.forEach(function(e){var i=document.querySelector("[data-menu-id='".concat(h(n,e),"']"));i&&(t.add(i),o.set(i,e),r.set(e,i))}),{elements:t,key2element:r,element2key:o}},Y="__RC_UTIL_PATH_SPLIT__",q=function(e){return e.join(Y)},X="rc-menu-more";function G(e){var n=m.useRef(e);n.current=e;var t=m.useCallback(function(){for(var e,t=arguments.length,r=Array(t),o=0;o1&&(k.motionAppear=!1);var M=k.onVisibleChanged;return(k.onVisibleChanged=function(e){return b.current||e||Z(!0),null==M?void 0:M(e)},g)?null:m.createElement(w,{mode:a,locked:!b.current},m.createElement(eR.ZP,(0,r.Z)({visible:C},k,{forceRender:f,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(e){var t=e.className,r=e.style;return m.createElement(eb,{id:n,className:t,style:r},l)}))}var eN=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],eP=["active"],eS=m.forwardRef(function(e,n){var t=e.style,l=e.className,c=e.title,d=e.eventKey,p=(e.warnKey,e.disabled),v=e.internalPopupClose,b=e.children,y=e.itemIcon,h=e.expandIcon,Z=e.popupClassName,C=e.popupOffset,k=e.popupStyle,M=e.onClick,R=e.onMouseEnter,S=e.onMouseLeave,I=e.onTitleClick,K=e.onTitleMouseEnter,O=e.onTitleMouseLeave,A=(0,a.Z)(e,eN),T=g(d),L=m.useContext(E),D=L.prefixCls,_=L.mode,V=L.openKeys,z=L.disabled,F=L.overflowDisabled,j=L.activeKey,B=L.selectedKeys,W=L.itemIcon,H=L.expandIcon,Y=L.onItemClick,q=L.onOpenChange,X=L.onActive,Q=m.useContext(P)._internalRenderSubMenuItem,U=m.useContext(N).isSubPathKey,J=x(),$="".concat(D,"-submenu"),ee=z||p,en=m.useRef(),et=m.useRef(),er=null!=h?h:H,eu=V.includes(d),ec=!F&&eu,es=U(B,d),ef=eo(d,ee,K,O),ed=ef.active,ep=(0,a.Z)(ef,eP),ev=m.useState(!1),em=(0,u.Z)(ev,2),ey=em[0],eh=em[1],eg=function(e){ee||eh(e)},eZ=m.useMemo(function(){return ed||"inline"!==_&&(ey||U([j],d))},[_,ed,j,ey,d,U]),eC=ei(J.length),eE=G(function(e){null==M||M(ea(e)),Y(e)}),ew=T&&"".concat(T,"-popup"),ek=m.useMemo(function(){return m.createElement(el,{icon:"horizontal"!==_?er:void 0,props:(0,i.Z)((0,i.Z)({},e),{},{isOpen:ec,isSubMenu:!0})},m.createElement("i",{className:"".concat($,"-arrow")}))},[_,er,e,ec,$]),eR=m.createElement("div",(0,r.Z)({role:"menuitem",style:eC,className:"".concat($,"-title"),tabIndex:ee?null:-1,ref:en,title:"string"==typeof c?c:null,"data-menu-id":F&&T?null:T,"aria-expanded":ec,"aria-haspopup":!0,"aria-controls":ew,"aria-disabled":ee,onClick:function(e){ee||(null==I||I({key:d,domEvent:e}),"inline"===_&&q(d,!eu))},onFocus:function(){X(d)}},ep),c,ek),eS=m.useRef(_);if("inline"!==_&&J.length>1?eS.current="vertical":eS.current=_,!F){var eI=eS.current;eR=m.createElement(eM,{mode:eI,prefixCls:$,visible:!v&&ec&&"inline"!==_,popupClassName:Z,popupOffset:C,popupStyle:k,popup:m.createElement(w,{mode:"horizontal"===eI?"vertical":eI},m.createElement(eb,{id:ew,ref:et},b)),disabled:ee,onVisibleChange:function(e){"inline"!==_&&q(d,e)}},eR)}var eK=m.createElement(f.Z.Item,(0,r.Z)({ref:n,role:"none"},A,{component:"li",style:t,className:s()($,"".concat($,"-").concat(_),l,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat($,"-open"),ec),"".concat($,"-active"),eZ),"".concat($,"-selected"),es),"".concat($,"-disabled"),ee)),onMouseEnter:function(e){eg(!0),null==R||R({key:d,domEvent:e})},onMouseLeave:function(e){eg(!1),null==S||S({key:d,domEvent:e})}}),eR,!F&&m.createElement(ex,{id:ew,open:ec,keyPath:J},b));return Q&&(eK=Q(eK,e,{selected:es,active:eZ,open:ec,disabled:ee})),m.createElement(w,{onItemClick:eE,mode:"horizontal"===_?"vertical":_,itemIcon:null!=y?y:W,expandIcon:er},eK)}),eI=m.forwardRef(function(e,n){var t,o=e.eventKey,i=e.children,l=x(o),u=eh(i,l),a=M();return m.useEffect(function(){if(a)return a.registerPath(o,l),function(){a.unregisterPath(o,l)}},[l]),t=a?u:m.createElement(eS,(0,r.Z)({ref:n},e),u),m.createElement(R.Provider,{value:l},t)}),eK=t(41154);function eO(e){var n=e.className,t=e.style,r=m.useContext(E).prefixCls;return M()?null:m.createElement("li",{role:"separator",className:s()("".concat(r,"-item-divider"),n),style:t})}var eA=["className","title","eventKey","children"],eT=m.forwardRef(function(e,n){var t=e.className,o=e.title,i=(e.eventKey,e.children),l=(0,a.Z)(e,eA),u=m.useContext(E).prefixCls,c="".concat(u,"-item-group");return m.createElement("li",(0,r.Z)({ref:n,role:"presentation"},l,{onClick:function(e){return e.stopPropagation()},className:s()(c,t)}),m.createElement("div",{role:"presentation",className:"".concat(c,"-title"),title:"string"==typeof o?o:void 0},o),m.createElement("ul",{role:"group",className:"".concat(c,"-list")},i))}),eL=m.forwardRef(function(e,n){var t=e.eventKey,o=eh(e.children,x(t));return M()?o:m.createElement(eT,(0,r.Z)({ref:n},(0,et.Z)(e,["warnKey"])),o)}),eD=["label","children","key","type","extra"];function e_(e,n,t,o,l){var u=e,c=(0,i.Z)({divider:eO,item:ev,group:eL,submenu:eI},o);return n&&(u=function e(n,t,o){var i=t.item,l=t.group,u=t.submenu,c=t.divider;return(n||[]).map(function(n,s){if(n&&"object"===(0,eK.Z)(n)){var f=n.label,d=n.children,p=n.key,v=n.type,b=n.extra,y=(0,a.Z)(n,eD),h=null!=p?p:"tmp-".concat(s);return d||"group"===v?"group"===v?m.createElement(l,(0,r.Z)({key:h},y,{title:f}),e(d,t,o)):m.createElement(u,(0,r.Z)({key:h},y,{title:f}),e(d,t,o)):"divider"===v?m.createElement(c,(0,r.Z)({key:h},y)):m.createElement(i,(0,r.Z)({key:h},y,{extra:b}),f,(!!b||0===b)&&m.createElement("span",{className:"".concat(o,"-item-extra")},b))}return null}).filter(function(e){return e})}(n,c,l)),eh(u,t)}var eV=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],ez=[],eF=m.forwardRef(function(e,n){var t,c,v,h,g,Z,C,E,M,R,x,S,I,K,J,$,ee,en,et,er,eo,ei,el,eu,ec,es,ef=e.prefixCls,ed=void 0===ef?"rc-menu":ef,ep=e.rootClassName,em=e.style,eb=e.className,ey=e.tabIndex,eh=e.items,eg=e.children,eZ=e.direction,eC=e.id,eE=e.mode,ew=void 0===eE?"vertical":eE,ek=e.inlineCollapsed,eM=e.disabled,eR=e.disabledOverflow,ex=e.subMenuOpenDelay,eN=e.subMenuCloseDelay,eP=e.forceSubMenuRender,eS=e.defaultOpenKeys,eK=e.openKeys,eO=e.activeKey,eA=e.defaultActiveFirst,eT=e.selectable,eL=void 0===eT||eT,eD=e.multiple,eF=void 0!==eD&&eD,ej=e.defaultSelectedKeys,eB=e.selectedKeys,eW=e.onSelect,eH=e.onDeselect,eY=e.inlineIndent,eq=e.motion,eX=e.defaultMotions,eG=e.triggerSubMenuAction,eQ=e.builtinPlacements,eU=e.itemIcon,eJ=e.expandIcon,e$=e.overflowedIndicator,e0=void 0===e$?"...":e$,e1=e.overflowedIndicatorPopupClassName,e2=e.getPopupContainer,e6=e.onClick,e5=e.onOpenChange,e9=e.onKeyDown,e4=(e.openAnimation,e.openTransitionName,e._internalRenderMenuItem),e3=e._internalRenderSubMenuItem,e8=e._internalComponents,e7=(0,a.Z)(e,eV),ne=m.useMemo(function(){return[e_(eg,eh,ez,e8,ed),e_(eg,eh,ez,{},ed)]},[eg,eh,e8]),nn=(0,u.Z)(ne,2),nt=nn[0],nr=nn[1],no=m.useState(!1),ni=(0,u.Z)(no,2),nl=ni[0],nu=ni[1],na=m.useRef(),nc=(t=(0,d.Z)(eC,{value:eC}),v=(c=(0,u.Z)(t,2))[0],h=c[1],m.useEffect(function(){U+=1;var e="".concat(Q,"-").concat(U);h("rc-menu-uuid-".concat(e))},[]),v),ns="rtl"===eZ,nf=(0,d.Z)(eS,{value:eK,postState:function(e){return e||ez}}),nd=(0,u.Z)(nf,2),np=nd[0],nv=nd[1],nm=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function t(){nv(e),null==e5||e5(e)}n?(0,b.flushSync)(t):t()},nb=m.useState(np),ny=(0,u.Z)(nb,2),nh=ny[0],ng=ny[1],nZ=m.useRef(!1),nC=m.useMemo(function(){return("inline"===ew||"vertical"===ew)&&ek?["vertical",ek]:[ew,!1]},[ew,ek]),nE=(0,u.Z)(nC,2),nw=nE[0],nk=nE[1],nM="inline"===nw,nR=m.useState(nw),nx=(0,u.Z)(nR,2),nN=nx[0],nP=nx[1],nS=m.useState(nk),nI=(0,u.Z)(nS,2),nK=nI[0],nO=nI[1];m.useEffect(function(){nP(nw),nO(nk),nZ.current&&(nM?nv(nh):nm(ez))},[nw,nk]);var nA=m.useState(0),nT=(0,u.Z)(nA,2),nL=nT[0],nD=nT[1],n_=nL>=nt.length-1||"horizontal"!==nN||eR;m.useEffect(function(){nM&&ng(np)},[np]),m.useEffect(function(){return nZ.current=!0,function(){nZ.current=!1}},[]);var nV=(g=m.useState({}),Z=(0,u.Z)(g,2)[1],C=(0,m.useRef)(new Map),E=(0,m.useRef)(new Map),M=m.useState([]),x=(R=(0,u.Z)(M,2))[0],S=R[1],I=(0,m.useRef)(0),K=(0,m.useRef)(!1),J=function(){K.current||Z({})},$=(0,m.useCallback)(function(e,n){var t,r=q(n);E.current.set(r,e),C.current.set(e,r),I.current+=1;var o=I.current;t=function(){o===I.current&&J()},Promise.resolve().then(t)},[]),ee=(0,m.useCallback)(function(e,n){var t=q(n);E.current.delete(t),C.current.delete(e)},[]),en=(0,m.useCallback)(function(e){S(e)},[]),et=(0,m.useCallback)(function(e,n){var t=(C.current.get(e)||"").split(Y);return n&&x.includes(t[0])&&t.unshift(X),t},[x]),er=(0,m.useCallback)(function(e,n){return e.filter(function(e){return void 0!==e}).some(function(e){return et(e,!0).includes(n)})},[et]),eo=(0,m.useCallback)(function(e){var n="".concat(C.current.get(e)).concat(Y),t=new Set;return(0,l.Z)(E.current.keys()).forEach(function(e){e.startsWith(n)&&t.add(E.current.get(e))}),t},[]),m.useEffect(function(){return function(){K.current=!0}},[]),{registerPath:$,unregisterPath:ee,refreshOverflowKeys:en,isSubPathKey:er,getKeyPath:et,getKeys:function(){var e=(0,l.Z)(C.current.keys());return x.length&&e.push(X),e},getSubPathKeys:eo}),nz=nV.registerPath,nF=nV.unregisterPath,nj=nV.refreshOverflowKeys,nB=nV.isSubPathKey,nW=nV.getKeyPath,nH=nV.getKeys,nY=nV.getSubPathKeys,nq=m.useMemo(function(){return{registerPath:nz,unregisterPath:nF}},[nz,nF]),nX=m.useMemo(function(){return{isSubPathKey:nB}},[nB]);m.useEffect(function(){nj(n_?ez:nt.slice(nL+1).map(function(e){return e.key}))},[nL,n_]);var nG=(0,d.Z)(eO||eA&&(null===(es=nt[0])||void 0===es?void 0:es.key),{value:eO}),nQ=(0,u.Z)(nG,2),nU=nQ[0],nJ=nQ[1],n$=G(function(e){nJ(e)}),n0=G(function(){nJ(void 0)});(0,m.useImperativeHandle)(n,function(){return{list:na.current,focus:function(e){var n,t,r=H(nH(),nc),o=r.elements,i=r.key2element,l=r.element2key,u=B(na.current,o),a=null!=nU?nU:u[0]?l.get(u[0]):null===(n=nt.find(function(e){return!e.props.disabled}))||void 0===n?void 0:n.key,c=i.get(a);a&&c&&(null==c||null===(t=c.focus)||void 0===t||t.call(c,e))}}});var n1=(0,d.Z)(ej||[],{value:eB,postState:function(e){return Array.isArray(e)?e:null==e?ez:[e]}}),n2=(0,u.Z)(n1,2),n6=n2[0],n5=n2[1],n9=function(e){if(eL){var n,t=e.key,r=n6.includes(t);n5(n=eF?r?n6.filter(function(e){return e!==t}):[].concat((0,l.Z)(n6),[t]):[t]);var o=(0,i.Z)((0,i.Z)({},e),{},{selectedKeys:n});r?null==eH||eH(o):null==eW||eW(o)}!eF&&np.length&&"inline"!==nN&&nm(ez)},n4=G(function(e){null==e6||e6(ea(e)),n9(e)}),n3=G(function(e,n){var t=np.filter(function(n){return n!==e});if(n)t.push(e);else if("inline"!==nN){var r=nY(e);t=t.filter(function(e){return!r.has(e)})}(0,p.Z)(np,t,!0)||nm(t,!0)}),n8=(ei=function(e,n){var t=null!=n?n:!np.includes(e);n3(e,t)},el=m.useRef(),(eu=m.useRef()).current=nU,ec=function(){O.Z.cancel(el.current)},m.useEffect(function(){return function(){ec()}},[]),function(e){var n=e.which;if([].concat(j,[_,V,z,F]).includes(n)){var t=nH(),r=H(t,nc),i=r,l=i.elements,u=i.key2element,a=i.element2key,c=function(e,n){for(var t=e||document.activeElement;t;){if(n.has(t))return t;t=t.parentElement}return null}(u.get(nU),l),s=a.get(c),f=function(e,n,t,r){var i,l="prev",u="next",a="children",c="parent";if("inline"===e&&r===_)return{inlineTrigger:!0};var s=(0,o.Z)((0,o.Z)({},L,l),D,u),f=(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},A,t?u:l),T,t?l:u),D,a),_,a),d=(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},L,l),D,u),_,a),V,c),A,t?a:c),T,t?c:a);switch(null===(i=({inline:s,horizontal:f,vertical:d,inlineSub:s,horizontalSub:d,verticalSub:d})["".concat(e).concat(n?"":"Sub")])||void 0===i?void 0:i[r]){case l:return{offset:-1,sibling:!0};case u:return{offset:1,sibling:!0};case c:return{offset:-1,sibling:!1};case a:return{offset:1,sibling:!1};default:return null}}(nN,1===nW(s,!0).length,ns,n);if(!f&&n!==z&&n!==F)return;(j.includes(n)||[z,F].includes(n))&&e.preventDefault();var d=function(e){if(e){var n=e,t=e.querySelector("a");null!=t&&t.getAttribute("href")&&(n=t);var r=a.get(e);nJ(r),ec(),el.current=(0,O.Z)(function(){eu.current===r&&n.focus()})}};if([z,F].includes(n)||f.sibling||!c){var p,v=B(p=c&&"inline"!==nN?function(e){for(var n=e;n;){if(n.getAttribute("data-menu-list"))return n;n=n.parentElement}return null}(c):na.current,l);d(n===z?v[0]:n===F?v[v.length-1]:W(p,l,c,f.offset))}else if(f.inlineTrigger)ei(s);else if(f.offset>0)ei(s,!0),ec(),el.current=(0,O.Z)(function(){r=H(t,nc);var e=c.getAttribute("aria-controls");d(W(document.getElementById(e),r.elements))},5);else if(f.offset<0){var m=nW(s,!0),b=m[m.length-2],y=u.get(b);ei(b,!1),d(y)}}null==e9||e9(e)});m.useEffect(function(){nu(!0)},[]);var n7=m.useMemo(function(){return{_internalRenderMenuItem:e4,_internalRenderSubMenuItem:e3}},[e4,e3]),te="horizontal"!==nN||eR?nt:nt.map(function(e,n){return m.createElement(w,{key:e.key,overflowDisabled:n>nL},e)}),tn=m.createElement(f.Z,(0,r.Z)({id:eC,ref:na,prefixCls:"".concat(ed,"-overflow"),component:"ul",itemComponent:ev,className:s()(ed,"".concat(ed,"-root"),"".concat(ed,"-").concat(nN),eb,(0,o.Z)((0,o.Z)({},"".concat(ed,"-inline-collapsed"),nK),"".concat(ed,"-rtl"),ns),ep),dir:eZ,style:em,role:"menu",tabIndex:void 0===ey?0:ey,data:te,renderRawItem:function(e){return e},renderRawRest:function(e){var n=e.length,t=n?nt.slice(-n):null;return m.createElement(eI,{eventKey:X,title:e0,disabled:n_,internalPopupClose:0===n,popupClassName:e1},t)},maxCount:"horizontal"!==nN||eR?f.Z.INVALIDATE:f.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){nD(e)},onKeyDown:n8},e7));return m.createElement(P.Provider,{value:n7},m.createElement(y.Provider,{value:nc},m.createElement(w,{prefixCls:ed,rootClassName:ep,mode:nN,openKeys:np,rtl:ns,disabled:eM,motion:nl?eq:null,defaultMotions:nl?eX:null,activeKey:nU,onActive:n$,onInactive:n0,selectedKeys:n6,inlineIndent:void 0===eY?24:eY,subMenuOpenDelay:void 0===ex?.1:ex,subMenuCloseDelay:void 0===eN?.1:eN,forceSubMenuRender:eP,builtinPlacements:eQ,triggerSubMenuAction:void 0===eG?"hover":eG,getPopupContainer:e2,itemIcon:eU,expandIcon:eJ,onItemClick:n4,onOpenChange:n3},m.createElement(N.Provider,{value:nX},tn),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(k.Provider,{value:nq},nr)))))});eF.Item=ev,eF.SubMenu=eI,eF.ItemGroup=eL,eF.Divider=eO;var ej=eF}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3621-a18bc79bfe63668e.js b/litellm/proxy/_experimental/out/_next/static/chunks/3621-a18bc79bfe63668e.js new file mode 100644 index 00000000000..55758d3dd65 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/3621-a18bc79bfe63668e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3621,5945],{45246:function(e,t,n){n.d(t,{Z:function(){return c}});var a=n(1119),o=n(2265),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,a.Z)({},e,{ref:t,icon:r}))})},89245:function(e,t,n){n.d(t,{Z:function(){return c}});var a=n(1119),o=n(2265),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,a.Z)({},e,{ref:t,icon:r}))})},78355:function(e,t,n){n.d(t,{Z:function(){return c}});var a=n(1119),o=n(2265),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,a.Z)({},e,{ref:t,icon:r}))})},8881:function(e,t,n){n.d(t,{Z:function(){return c}});var a=n(1119),o=n(2265),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-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,a.Z)({},e,{ref:t,icon:r}))})},59664:function(e,t,n){n.d(t,{Z:function(){return j}});var a=n(5853),o=n(2265),r=n(47625),i=n(93765),c=n(54061),l=n(97059),s=n(62994),d=n(25311),u=(0,i.z)({chartName:"LineChart",GraphicalChild:c.x,axisComponents:[{axisType:"xAxis",AxisComp:l.K},{axisType:"yAxis",AxisComp:s.B}],formatAxisMap:d.t9}),m=n(56940),p=n(26680),f=n(8147),g=n(22190),b=n(81889),v=n(65278),h=n(98593),y=n(92666),x=n(32644),k=n(7084),O=n(26898),w=n(13241),E=n(1153);let j=o.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:d,colors:j=O.s,valueFormatter:S=E.Cj,startEndOnly:C=!1,showXAxis:L=!0,showYAxis:N=!0,yAxisWidth:z=56,intervalType:Z="equidistantPreserveStart",animationDuration:T=900,showAnimation:P=!1,showTooltip:M=!0,showLegend:A=!0,showGridLines:W=!0,autoMinValue:B=!1,curveType:R="linear",minValue:G,maxValue:H,connectNulls:I=!1,allowDecimals:K=!0,noDataText:D,className:V,onValueChange:F,enableLegendSlider:q=!1,customTooltip:_,rotateLabelX:X,padding:Y=L||N?{left:20,right:20}:{left:0,right:0},tickGap:$=5,xAxisLabel:U,yAxisLabel:J}=e,Q=(0,a._T)(e,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","padding","tickGap","xAxisLabel","yAxisLabel"]),[ee,et]=(0,o.useState)(60),[en,ea]=(0,o.useState)(void 0),[eo,er]=(0,o.useState)(void 0),ei=(0,x.me)(i,j),ec=(0,x.i4)(B,G,H),el=!!F;function es(e){el&&(e===eo&&!en||(0,x.FB)(n,e)&&en&&en.dataKey===e?(er(void 0),null==F||F(null)):(er(e),null==F||F({eventType:"category",categoryClicked:e})),ea(void 0))}return o.createElement("div",Object.assign({ref:t,className:(0,w.q)("w-full h-80",V)},Q),o.createElement(r.h,{className:"h-full w-full"},(null==n?void 0:n.length)?o.createElement(u,{data:n,onClick:el&&(eo||en)?()=>{ea(void 0),er(void 0),null==F||F(null)}:void 0,margin:{bottom:U?30:void 0,left:J?20:void 0,right:J?5:void 0,top:5}},W?o.createElement(m.q,{className:(0,w.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,o.createElement(l.K,{padding:Y,hide:!L,dataKey:d,interval:C?"preserveStartEnd":Z,tick:{transform:"translate(0, 6)"},ticks:C?[n[0][d],n[n.length-1][d]]:void 0,fill:"",stroke:"",className:(0,w.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:$,angle:null==X?void 0:X.angle,dy:null==X?void 0:X.verticalShift,height:null==X?void 0:X.xAxisHeight},U&&o.createElement(p._,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},U)),o.createElement(s.B,{width:z,hide:!N,axisLine:!1,tickLine:!1,type:"number",domain:ec,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,w.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:S,allowDecimals:K},J&&o.createElement(p._,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},J)),o.createElement(f.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:M?e=>{let{active:t,payload:n,label:a}=e;return _?o.createElement(_,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=ei.get(e.dataKey))&&void 0!==t?t:k.fr.Gray})}),active:t,label:a}):o.createElement(h.ZP,{active:t,payload:n,label:a,valueFormatter:S,categoryColors:ei})}:o.createElement(o.Fragment,null),position:{y:0}}),A?o.createElement(g.D,{verticalAlign:"top",height:ee,content:e=>{let{payload:t}=e;return(0,v.Z)({payload:t},ei,et,eo,el?e=>es(e):void 0,q)}}):null,i.map(e=>{var t;return o.createElement(c.x,{className:(0,w.q)((0,E.bM)(null!==(t=ei.get(e))&&void 0!==t?t:k.fr.Gray,O.K.text).strokeColor),strokeOpacity:en||eo&&eo!==e?.3:1,activeDot:e=>{var t;let{cx:a,cy:r,stroke:i,strokeLinecap:c,strokeLinejoin:l,strokeWidth:s,dataKey:d}=e;return o.createElement(b.o,{className:(0,w.q)("stroke-tremor-background dark:stroke-dark-tremor-background",F?"cursor-pointer":"",(0,E.bM)(null!==(t=ei.get(d))&&void 0!==t?t:k.fr.Gray,O.K.text).fillColor),cx:a,cy:r,r:5,fill:"",stroke:i,strokeLinecap:c,strokeLinejoin:l,strokeWidth:s,onClick:(t,a)=>{a.stopPropagation(),el&&(e.index===(null==en?void 0:en.index)&&e.dataKey===(null==en?void 0:en.dataKey)||(0,x.FB)(n,e.dataKey)&&eo&&eo===e.dataKey?(er(void 0),ea(void 0),null==F||F(null)):(er(e.dataKey),ea({index:e.index,dataKey:e.dataKey}),null==F||F(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var a;let{stroke:r,strokeLinecap:i,strokeLinejoin:c,strokeWidth:l,cx:s,cy:d,dataKey:u,index:m}=t;return(0,x.FB)(n,e)&&!(en||eo&&eo!==e)||(null==en?void 0:en.index)===m&&(null==en?void 0:en.dataKey)===e?o.createElement(b.o,{key:m,cx:s,cy:d,r:5,stroke:r,fill:"",strokeLinecap:i,strokeLinejoin:c,strokeWidth:l,className:(0,w.q)("stroke-tremor-background dark:stroke-dark-tremor-background",F?"cursor-pointer":"",(0,E.bM)(null!==(a=ei.get(u))&&void 0!==a?a:k.fr.Gray,O.K.text).fillColor)}):o.createElement(o.Fragment,{key:m})},key:e,name:e,type:R,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:P,animationDuration:T,connectNulls:I})}),F?i.map(e=>o.createElement(c.x,{className:(0,w.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:R,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:I,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;es(n)}})):null):o.createElement(y.Z,{noDataText:D})))});j.displayName="LineChart"},5945:function(e,t,n){n.d(t,{Z:function(){return Z}});var a=n(2265),o=n(36760),r=n.n(o),i=n(18694),c=n(71744),l=n(33759),s=n(50337),d=n(65869),u=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(e);ot.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]]);return n},m=e=>{var{prefixCls:t,className:n,hoverable:o=!0}=e,i=u(e,["prefixCls","className","hoverable"]);let{getPrefixCls:l}=a.useContext(c.E_),s=l("card",t),d=r()("".concat(s,"-grid"),n,{["".concat(s,"-grid-hoverable")]:o});return a.createElement("div",Object.assign({},i,{className:d}))},p=n(93463),f=n(12918),g=n(99320),b=n(71140);let v=e=>{let{antCls:t,componentCls:n,headerHeight:a,headerPadding:o,tabsMarginBottom:r}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:a,marginBottom:-1,padding:"0 ".concat((0,p.bf)(o)),color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:"".concat((0,p.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary),borderRadius:"".concat((0,p.bf)(e.borderRadiusLG)," ").concat((0,p.bf)(e.borderRadiusLG)," 0 0")},(0,f.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},f.vS),{["\n > ".concat(n,"-typography,\n > ").concat(n,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(t,"-tabs-top")]:{clear:"both",marginBottom:r,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:"".concat((0,p.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary)}}})},h=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:a,lineWidth:o}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:"\n ".concat((0,p.bf)(o)," 0 0 0 ").concat(n,",\n 0 ").concat((0,p.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,p.bf)(o)," ").concat((0,p.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,p.bf)(o)," 0 0 0 ").concat(n," inset,\n 0 ").concat((0,p.bf)(o)," 0 0 ").concat(n," inset;\n "),transition:"all ".concat(e.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:a}}},y=e=>{let{componentCls:t,iconCls:n,actionsLiMargin:a,cardActionsIconSize:o,colorBorderSecondary:r,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:"".concat((0,p.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(r),display:"flex",borderRadius:"0 0 ".concat((0,p.bf)(e.borderRadiusLG)," ").concat((0,p.bf)(e.borderRadiusLG))},(0,f.dF)()),{"& > li":{margin:a,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 ".concat(e.motionDurationMid)},["a:not(".concat(t,"-btn), > ").concat(n)]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:(0,p.bf)(e.fontHeight),transition:"color ".concat(e.motionDurationMid),"&:hover":{color:e.colorPrimary}},["> ".concat(n)]:{fontSize:o,lineHeight:(0,p.bf)(e.calc(o).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,p.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(r)}}})},x=e=>Object.assign(Object.assign({margin:"".concat((0,p.bf)(e.calc(e.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,f.dF)()),{"&-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},f.vS),"&-description":{color:e.colorTextDescription}}),k=e=>{let{componentCls:t,colorFillAlter:n,headerPadding:a,bodyPadding:o}=e;return{["".concat(t,"-head")]:{padding:"0 ".concat((0,p.bf)(a)),background:n,"&-title":{fontSize:e.fontSize}},["".concat(t,"-body")]:{padding:"".concat((0,p.bf)(e.padding)," ").concat((0,p.bf)(o))}}},O=e=>{let{componentCls:t}=e;return{overflow:"hidden",["".concat(t,"-body")]:{userSelect:"none"}}},w=e=>{let{componentCls:t,cardShadow:n,cardHeadPadding:a,colorBorderSecondary:o,boxShadowTertiary:r,bodyPadding:i,extraColor:c}=e;return{[t]:Object.assign(Object.assign({},(0,f.Wf)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,["&:not(".concat(t,"-bordered)")]:{boxShadow:r},["".concat(t,"-head")]:v(e),["".concat(t,"-extra")]:{marginInlineStart:"auto",color:c,fontWeight:"normal",fontSize:e.fontSize},["".concat(t,"-body")]:{padding:i,borderRadius:"0 0 ".concat((0,p.bf)(e.borderRadiusLG)," ").concat((0,p.bf)(e.borderRadiusLG))},["".concat(t,"-grid")]:h(e),["".concat(t,"-cover")]:{"> *":{display:"block",width:"100%",borderRadius:"".concat((0,p.bf)(e.borderRadiusLG)," ").concat((0,p.bf)(e.borderRadiusLG)," 0 0")}},["".concat(t,"-actions")]:y(e),["".concat(t,"-meta")]:x(e)}),["".concat(t,"-bordered")]:{border:"".concat((0,p.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(o),["".concat(t,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(t,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(e.motionDurationMid,", border-color ").concat(e.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:n}},["".concat(t,"-contain-grid")]:{borderRadius:"".concat((0,p.bf)(e.borderRadiusLG)," ").concat((0,p.bf)(e.borderRadiusLG)," 0 0 "),["".concat(t,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(t,"-loading) ").concat(t,"-body")]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},["".concat(t,"-contain-tabs")]:{["> div".concat(t,"-head")]:{minHeight:0,["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:a}}},["".concat(t,"-type-inner")]:k(e),["".concat(t,"-loading")]:O(e),["".concat(t,"-rtl")]:{direction:"rtl"}}},E=e=>{let{componentCls:t,bodyPaddingSM:n,headerPaddingSM:a,headerHeightSM:o,headerFontSizeSM:r}=e;return{["".concat(t,"-small")]:{["> ".concat(t,"-head")]:{minHeight:o,padding:"0 ".concat((0,p.bf)(a)),fontSize:r,["> ".concat(t,"-head-wrapper")]:{["> ".concat(t,"-extra")]:{fontSize:e.fontSize}}},["> ".concat(t,"-body")]:{padding:n}},["".concat(t,"-small").concat(t,"-contain-tabs")]:{["> ".concat(t,"-head")]:{["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var j=(0,g.I$)("Card",e=>{let t=(0,b.IX)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[w(t),E(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:"".concat(e.paddingSM,"px 0"),tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:null!==(t=e.bodyPadding)&&void 0!==t?t:e.paddingLG,headerPadding:null!==(n=e.headerPadding)&&void 0!==n?n:e.paddingLG}}),S=n(56250),C=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(e);ot.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]]);return n};let L=e=>{let{actionClasses:t,actions:n=[],actionStyle:o}=e;return a.createElement("ul",{className:t,style:o},n.map((e,t)=>a.createElement("li",{style:{width:"".concat(100/n.length,"%")},key:"action-".concat(t)},a.createElement("span",null,e))))},N=a.forwardRef((e,t)=>{let n;let{prefixCls:o,className:u,rootClassName:p,style:f,extra:g,headStyle:b={},bodyStyle:v={},title:h,loading:y,bordered:x,variant:k,size:O,type:w,cover:E,actions:N,tabList:z,children:Z,activeTabKey:T,defaultActiveTabKey:P,tabBarExtraContent:M,hoverable:A,tabProps:W={},classNames:B,styles:R}=e,G=C(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:H,direction:I,card:K}=a.useContext(c.E_),[D]=(0,S.Z)("card",k,x),V=e=>{var t;return r()(null===(t=null==K?void 0:K.classNames)||void 0===t?void 0:t[e],null==B?void 0:B[e])},F=e=>{var t;return Object.assign(Object.assign({},null===(t=null==K?void 0:K.styles)||void 0===t?void 0:t[e]),null==R?void 0:R[e])},q=a.useMemo(()=>{let e=!1;return a.Children.forEach(Z,t=>{(null==t?void 0:t.type)===m&&(e=!0)}),e},[Z]),_=H("card",o),[X,Y,$]=j(_),U=a.createElement(s.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},Z),J=void 0!==T,Q=Object.assign(Object.assign({},W),{[J?"activeKey":"defaultActiveKey"]:J?T:P,tabBarExtraContent:M}),ee=(0,l.Z)(O),et=ee&&"default"!==ee?ee:"large",en=z?a.createElement(d.default,Object.assign({size:et},Q,{className:"".concat(_,"-head-tabs"),onChange:t=>{var n;null===(n=e.onTabChange)||void 0===n||n.call(e,t)},items:z.map(e=>{var{tab:t}=e;return Object.assign({label:t},C(e,["tab"]))})})):null;if(h||g||en){let e=r()("".concat(_,"-head"),V("header")),t=r()("".concat(_,"-head-title"),V("title")),o=r()("".concat(_,"-extra"),V("extra")),i=Object.assign(Object.assign({},b),F("header"));n=a.createElement("div",{className:e,style:i},a.createElement("div",{className:"".concat(_,"-head-wrapper")},h&&a.createElement("div",{className:t,style:F("title")},h),g&&a.createElement("div",{className:o,style:F("extra")},g)),en)}let ea=r()("".concat(_,"-cover"),V("cover")),eo=E?a.createElement("div",{className:ea,style:F("cover")},E):null,er=r()("".concat(_,"-body"),V("body")),ei=Object.assign(Object.assign({},v),F("body")),ec=a.createElement("div",{className:er,style:ei},y?U:Z),el=r()("".concat(_,"-actions"),V("actions")),es=(null==N?void 0:N.length)?a.createElement(L,{actionClasses:el,actionStyle:F("actions"),actions:N}):null,ed=(0,i.Z)(G,["onTabChange"]),eu=r()(_,null==K?void 0:K.className,{["".concat(_,"-loading")]:y,["".concat(_,"-bordered")]:"borderless"!==D,["".concat(_,"-hoverable")]:A,["".concat(_,"-contain-grid")]:q,["".concat(_,"-contain-tabs")]:null==z?void 0:z.length,["".concat(_,"-").concat(ee)]:ee,["".concat(_,"-type-").concat(w)]:!!w,["".concat(_,"-rtl")]:"rtl"===I},u,p,Y,$),em=Object.assign(Object.assign({},null==K?void 0:K.style),f);return X(a.createElement("div",Object.assign({ref:t},ed,{className:eu,style:em}),n,eo,ec,es))});var z=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(e);ot.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]]);return n};N.Grid=m,N.Meta=e=>{let{prefixCls:t,className:n,avatar:o,title:i,description:l}=e,s=z(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:d}=a.useContext(c.E_),u=d("card",t),m=r()("".concat(u,"-meta"),n),p=o?a.createElement("div",{className:"".concat(u,"-meta-avatar")},o):null,f=i?a.createElement("div",{className:"".concat(u,"-meta-title")},i):null,g=l?a.createElement("div",{className:"".concat(u,"-meta-description")},l):null,b=f||g?a.createElement("div",{className:"".concat(u,"-meta-detail")},f,g):null;return a.createElement("div",Object.assign({},s,{className:m}),p,b)};var Z=N},69410:function(e,t,n){var a=n(54998);t.Z=a.Z},867:function(e,t,n){n.d(t,{Z:function(){return j}});var a=n(2265),o=n(54537),r=n(36760),i=n.n(r),c=n(50506),l=n(18694),s=n(71744),d=n(79326),u=n(59367),m=n(92570),p=n(5545),f=n(51248),g=n(55274),b=n(37381),v=n(20435),h=n(99320);let y=e=>{let{componentCls:t,iconCls:n,antCls:a,zIndexPopup:o,colorText:r,colorWarning:i,marginXXS:c,marginXS:l,fontSize:s,fontWeightStrong:d,colorTextHeading:u}=e;return{[t]:{zIndex:o,["&".concat(a,"-popover")]:{fontSize:s},["".concat(t,"-message")]:{marginBottom:l,display:"flex",flexWrap:"nowrap",alignItems:"start",["> ".concat(t,"-message-icon ").concat(n)]:{color:i,fontSize:s,lineHeight:1,marginInlineEnd:l},["".concat(t,"-title")]:{fontWeight:d,color:u,"&:only-child":{fontWeight:"normal"}},["".concat(t,"-description")]:{marginTop:c,color:r}},["".concat(t,"-buttons")]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:l}}}}};var x=(0,h.I$)("Popconfirm",e=>y(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1}),k=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(e);ot.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]]);return n};let O=e=>{let{prefixCls:t,okButtonProps:n,cancelButtonProps:r,title:i,description:c,cancelText:l,okText:d,okType:v="primary",icon:h=a.createElement(o.Z,null),showCancel:y=!0,close:x,onConfirm:k,onCancel:O,onPopupClick:w}=e,{getPrefixCls:E}=a.useContext(s.E_),[j]=(0,g.Z)("Popconfirm",b.Z.Popconfirm),S=(0,m.Z)(i),C=(0,m.Z)(c);return a.createElement("div",{className:"".concat(t,"-inner-content"),onClick:w},a.createElement("div",{className:"".concat(t,"-message")},h&&a.createElement("span",{className:"".concat(t,"-message-icon")},h),a.createElement("div",{className:"".concat(t,"-message-text")},S&&a.createElement("div",{className:"".concat(t,"-title")},S),C&&a.createElement("div",{className:"".concat(t,"-description")},C))),a.createElement("div",{className:"".concat(t,"-buttons")},y&&a.createElement(p.ZP,Object.assign({onClick:O,size:"small"},r),l||(null==j?void 0:j.cancelText)),a.createElement(u.Z,{buttonProps:Object.assign(Object.assign({size:"small"},(0,f.nx)(v)),n),actionFn:k,close:x,prefixCls:E("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},d||(null==j?void 0:j.okText))))};var w=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(e);ot.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]]);return n};let E=a.forwardRef((e,t)=>{var n,r;let{prefixCls:u,placement:m="top",trigger:p="click",okType:f="primary",icon:g=a.createElement(o.Z,null),children:b,overlayClassName:v,onOpenChange:h,onVisibleChange:y,overlayStyle:k,styles:E,classNames:j}=e,S=w(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:C,className:L,style:N,classNames:z,styles:Z}=(0,s.dj)("popconfirm"),[T,P]=(0,c.Z)(!1,{value:null!==(n=e.open)&&void 0!==n?n:e.visible,defaultValue:null!==(r=e.defaultOpen)&&void 0!==r?r:e.defaultVisible}),M=(e,t)=>{P(e,!0),null==y||y(e),null==h||h(e,t)},A=C("popconfirm",u),W=i()(A,L,v,z.root,null==j?void 0:j.root),B=i()(z.body,null==j?void 0:j.body),[R]=x(A);return R(a.createElement(d.Z,Object.assign({},(0,l.Z)(S,["title"]),{trigger:p,placement:m,onOpenChange:(t,n)=>{let{disabled:a=!1}=e;a||M(t,n)},open:T,ref:t,classNames:{root:W,body:B},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},Z.root),N),k),null==E?void 0:E.root),body:Object.assign(Object.assign({},Z.body),null==E?void 0:E.body)},content:a.createElement(O,Object.assign({okType:f,icon:g},e,{prefixCls:A,close:e=>{M(!1,e)},onConfirm:t=>{var n;return null===(n=e.onConfirm)||void 0===n?void 0:n.call(void 0,t)},onCancel:t=>{var n;M(!1,t),null===(n=e.onCancel)||void 0===n||n.call(void 0,t)}})),"data-popover-inject":!0}),b))});E._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,placement:n,className:o,style:r}=e,c=k(e,["prefixCls","placement","className","style"]),{getPrefixCls:l}=a.useContext(s.E_),d=l("popconfirm",t),[u]=x(d);return u(a.createElement(v.ZP,{placement:n,className:i()(d,o),style:r,content:a.createElement(O,Object.assign({prefixCls:d},c))}))};var j=E},47451:function(e,t,n){var a=n(77774);t.Z=a.Z},87769:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("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"}]])},42208:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("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"}]])},15731:function(e,t,n){var a=n(2265);let o=a.forwardRef(function(e,t){return a.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),a.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"}))});t.Z=o},45589:function(e,t,n){var a=n(2265);let o=a.forwardRef(function(e,t){return a.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),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"}))});t.Z=o},53410:function(e,t,n){var a=n(2265);let o=a.forwardRef(function(e,t){return a.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),a.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"}))});t.Z=o},91126:function(e,t,n){var a=n(2265);let o=a.forwardRef(function(e,t){return a.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),a.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"}),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3705-05649f5df18d8716.js b/litellm/proxy/_experimental/out/_next/static/chunks/3705-124a560b74decaa8.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/3705-05649f5df18d8716.js rename to litellm/proxy/_experimental/out/_next/static/chunks/3705-124a560b74decaa8.js index 7d1ccec065b..71279395fe9 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3705-05649f5df18d8716.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/3705-124a560b74decaa8.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3705],{15327:function(e,t,n){n.d(t,{Z:function(){return l}});var o=n(1119),a=n(2265),c={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"},r=n(55015),l=a.forwardRef(function(e,t){return a.createElement(r.Z,(0,o.Z)({},e,{ref:t,icon:c}))})},73705:function(e,t,n){n.d(t,{Z:function(){return _}});var o=n(2265),a=n(15327),c=n(77565),r=n(36760),l=n.n(r),i=n(71030),d=n(58525),s=n(50506),u=n(18694),m=n(62236),p=e=>"object"!=typeof e&&"function"!=typeof e||null===e,g=n(92736),b=n(93942),f=n(19722),v=n(13613),h=n(95140),y=n(71744),I=n(64024),x=n(60985),w=n(88208),S=n(84951),C=n(93463),O=n(12918),B=n(18544),k=n(29382),j=n(691),E=n(88260),z=n(34442),N=n(99320),H=n(71140),T=e=>{let{componentCls:t,menuCls:n,colorError:o,colorTextLightSolid:a}=e,c="".concat(n,"-item");return{["".concat(t,", ").concat(t,"-menu-submenu")]:{["".concat(n," ").concat(c)]:{["&".concat(c,"-danger:not(").concat(c,"-disabled)")]:{color:o,"&:hover":{color:a,backgroundColor:o}}}}}};let P=e=>{let{componentCls:t,menuCls:n,zIndexPopup:o,dropdownArrowDistance:a,sizePopupArrow:c,antCls:r,iconCls:l,motionDurationMid:i,paddingBlock:d,fontSize:s,dropdownEdgeChildPadding:u,colorTextDisabled:m,fontSizeIcon:p,controlPaddingHorizontal:g,colorBgElevated:b}=e;return[{[t]:{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:o,display:"block","&::before":{position:"absolute",insetBlock:e.calc(c).div(2).sub(a).equal(),zIndex:-9999,opacity:1e-4,content:'""'},"&-menu-vertical":{maxHeight:"100vh",overflowY:"auto"},["&-trigger".concat(r,"-btn")]:{["& > ".concat(l,"-down, & > ").concat(r,"-btn-icon > ").concat(l,"-down")]:{fontSize:p}},["".concat(t,"-wrap")]:{position:"relative",["".concat(r,"-btn > ").concat(l,"-down")]:{fontSize:p},["".concat(l,"-down::before")]:{transition:"transform ".concat(i)}},["".concat(t,"-wrap-open")]:{["".concat(l,"-down::before")]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},["&".concat(r,"-slide-down-enter").concat(r,"-slide-down-enter-active").concat(t,"-placement-bottomLeft,\n &").concat(r,"-slide-down-appear").concat(r,"-slide-down-appear-active").concat(t,"-placement-bottomLeft,\n &").concat(r,"-slide-down-enter").concat(r,"-slide-down-enter-active").concat(t,"-placement-bottom,\n &").concat(r,"-slide-down-appear").concat(r,"-slide-down-appear-active").concat(t,"-placement-bottom,\n &").concat(r,"-slide-down-enter").concat(r,"-slide-down-enter-active").concat(t,"-placement-bottomRight,\n &").concat(r,"-slide-down-appear").concat(r,"-slide-down-appear-active").concat(t,"-placement-bottomRight")]:{animationName:B.fJ},["&".concat(r,"-slide-up-enter").concat(r,"-slide-up-enter-active").concat(t,"-placement-topLeft,\n &").concat(r,"-slide-up-appear").concat(r,"-slide-up-appear-active").concat(t,"-placement-topLeft,\n &").concat(r,"-slide-up-enter").concat(r,"-slide-up-enter-active").concat(t,"-placement-top,\n &").concat(r,"-slide-up-appear").concat(r,"-slide-up-appear-active").concat(t,"-placement-top,\n &").concat(r,"-slide-up-enter").concat(r,"-slide-up-enter-active").concat(t,"-placement-topRight,\n &").concat(r,"-slide-up-appear").concat(r,"-slide-up-appear-active").concat(t,"-placement-topRight")]:{animationName:B.Qt},["&".concat(r,"-slide-down-leave").concat(r,"-slide-down-leave-active").concat(t,"-placement-bottomLeft,\n &").concat(r,"-slide-down-leave").concat(r,"-slide-down-leave-active").concat(t,"-placement-bottom,\n &").concat(r,"-slide-down-leave").concat(r,"-slide-down-leave-active").concat(t,"-placement-bottomRight")]:{animationName:B.Uw},["&".concat(r,"-slide-up-leave").concat(r,"-slide-up-leave-active").concat(t,"-placement-topLeft,\n &").concat(r,"-slide-up-leave").concat(r,"-slide-up-leave-active").concat(t,"-placement-top,\n &").concat(r,"-slide-up-leave").concat(r,"-slide-up-leave-active").concat(t,"-placement-topRight")]:{animationName:B.ly}}},(0,E.ZP)(e,b,{arrowPlacement:{top:!0,bottom:!0}}),{["".concat(t," ").concat(n)]:{position:"relative",margin:0},["".concat(n,"-submenu-popup")]:{position:"absolute",zIndex:o,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},["".concat(t,", ").concat(t,"-menu-submenu")]:Object.assign(Object.assign({},(0,O.Wf)(e)),{[n]:Object.assign(Object.assign({padding:u,listStyleType:"none",backgroundColor:b,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary},(0,O.Qy)(e)),{"&:empty":{padding:0,boxShadow:"none"},["".concat(n,"-item-group-title")]:{padding:"".concat((0,C.bf)(d)," ").concat((0,C.bf)(g)),color:e.colorTextDescription,transition:"all ".concat(i)},["".concat(n,"-item")]:{position:"relative",display:"flex",alignItems:"center"},["".concat(n,"-item-icon")]:{minWidth:s,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},["".concat(n,"-title-content")]:{flex:"auto","&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},"> a":{color:"inherit",transition:"all ".concat(i),"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}},["".concat(n,"-item-extra")]:{paddingInlineStart:e.padding,marginInlineStart:"auto",fontSize:e.fontSizeSM,color:e.colorTextDescription}},["".concat(n,"-item, ").concat(n,"-submenu-title")]:Object.assign(Object.assign({display:"flex",margin:0,padding:"".concat((0,C.bf)(d)," ").concat((0,C.bf)(g)),color:e.colorText,fontWeight:"normal",fontSize:s,lineHeight:e.lineHeight,cursor:"pointer",transition:"all ".concat(i),borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover}},(0,O.Qy)(e)),{"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:m,cursor:"not-allowed","&:hover":{color:m,backgroundColor:b,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:"".concat((0,C.bf)(e.marginXXS)," 0"),overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},["".concat(t,"-menu-submenu-expand-icon")]:{position:"absolute",insetInlineEnd:e.paddingXS,["".concat(t,"-menu-submenu-arrow-icon")]:{marginInlineEnd:"0 !important",color:e.colorIcon,fontSize:p,fontStyle:"normal"}}}),["".concat(n,"-item-group-list")]:{margin:"0 ".concat((0,C.bf)(e.marginXS)),padding:0,listStyle:"none"},["".concat(n,"-submenu-title")]:{paddingInlineEnd:e.calc(g).add(e.fontSizeSM).equal()},["".concat(n,"-submenu-vertical")]:{position:"relative"},["".concat(n,"-submenu").concat(n,"-submenu-disabled ").concat(t,"-menu-submenu-title")]:{["&, ".concat(t,"-menu-submenu-arrow-icon")]:{color:m,backgroundColor:b,cursor:"not-allowed"}},["".concat(n,"-submenu-selected ").concat(t,"-menu-submenu-title")]:{color:e.colorPrimary}})})},[(0,B.oN)(e,"slide-up"),(0,B.oN)(e,"slide-down"),(0,k.Fm)(e,"move-up"),(0,k.Fm)(e,"move-down"),(0,j._y)(e,"zoom-big")]]};var R=(0,N.I$)("Dropdown",e=>{let{marginXXS:t,sizePopupArrow:n,paddingXXS:o,componentCls:a}=e,c=(0,H.IX)(e,{menuCls:"".concat(a,"-menu"),dropdownArrowDistance:e.calc(n).div(2).add(t).equal(),dropdownEdgeChildPadding:o});return[P(c),T(c)]},e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2},(0,E.wZ)({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0})),(0,z.w)(e)),{resetStyle:!1});let Z=e=>{var t;let{menu:n,arrow:r,prefixCls:b,children:C,trigger:O,disabled:B,dropdownRender:k,popupRender:j,getPopupContainer:E,overlayClassName:z,rootClassName:N,overlayStyle:H,open:T,onOpenChange:P,visible:Z,onVisibleChange:M,mouseEnterDelay:D=.15,mouseLeaveDelay:A=.1,autoAdjustOverflow:W=!0,placement:L="",overlay:G,transitionName:X,destroyOnHidden:_,destroyPopupOnHide:q}=e,{getPopupContainer:F,getPrefixCls:Y,direction:V,dropdown:$}=o.useContext(y.E_),J=j||k;(0,v.ln)("Dropdown");let Q=o.useMemo(()=>{let e=Y();return void 0!==X?X:L.includes("top")?"".concat(e,"-slide-down"):"".concat(e,"-slide-up")},[Y,L,X]),U=o.useMemo(()=>L?L.includes("Center")?L.slice(0,L.indexOf("Center")):L:"rtl"===V?"bottomRight":"bottomLeft",[L,V]),K=Y("dropdown",b),ee=(0,I.Z)(K),[et,en,eo]=R(K,ee),[,ea]=(0,S.ZP)(),ec=o.Children.only(p(C)?o.createElement("span",null,C):C),er=(0,f.Tm)(ec,{className:l()("".concat(K,"-trigger"),{["".concat(K,"-rtl")]:"rtl"===V},ec.props.className),disabled:null!==(t=ec.props.disabled)&&void 0!==t?t:B}),el=B?[]:O,ei=!!(null==el?void 0:el.includes("contextMenu")),[ed,es]=(0,s.Z)(!1,{value:null!=T?T:Z}),eu=(0,d.Z)(e=>{null==P||P(e,{source:"trigger"}),null==M||M(e),es(e)}),em=l()(z,N,en,eo,ee,null==$?void 0:$.className,{["".concat(K,"-rtl")]:"rtl"===V}),ep=(0,g.Z)({arrowPointAtCenter:"object"==typeof r&&r.pointAtCenter,autoAdjustOverflow:W,offset:ea.marginXXS,arrowWidth:r?ea.sizePopupArrow:0,borderRadius:ea.borderRadius}),eg=(0,d.Z)(()=>{null!=n&&n.selectable&&null!=n&&n.multiple||(null==P||P(!1,{source:"menu"}),es(!1))}),[eb,ef]=(0,m.Cn)("Dropdown",null==H?void 0:H.zIndex),ev=o.createElement(i.Z,Object.assign({alignPoint:ei},(0,u.Z)(e,["rootClassName"]),{mouseEnterDelay:D,mouseLeaveDelay:A,visible:ed,builtinPlacements:ep,arrow:!!r,overlayClassName:em,prefixCls:K,getPopupContainer:E||F,transitionName:Q,trigger:el,overlay:()=>{let e;return e=(null==n?void 0:n.items)?o.createElement(x.Z,Object.assign({},n)):"function"==typeof G?G():G,J&&(e=J(e)),e=o.Children.only("string"==typeof e?o.createElement("span",null,e):e),o.createElement(w.J,{prefixCls:"".concat(K,"-menu"),rootClassName:l()(eo,ee),expandIcon:o.createElement("span",{className:"".concat(K,"-menu-submenu-arrow")},"rtl"===V?o.createElement(a.Z,{className:"".concat(K,"-menu-submenu-arrow-icon")}):o.createElement(c.Z,{className:"".concat(K,"-menu-submenu-arrow-icon")})),mode:"vertical",selectable:!1,onClick:eg,validator:e=>{let{mode:t}=e}},e)},placement:U,onVisibleChange:eu,overlayStyle:Object.assign(Object.assign(Object.assign({},null==$?void 0:$.style),H),{zIndex:eb}),autoDestroy:null!=_?_:q}),er);return eb&&(ev=o.createElement(h.Z.Provider,{value:ef},ev)),et(ev)},M=(0,b.Z)(Z,"align",void 0,"dropdown",e=>e);Z._InternalPanelDoNotUseOrYouWillBeFired=e=>o.createElement(M,Object.assign({},e),o.createElement("span",null));var D=n(39760),A=n(5545),W=n(58760),L=n(77685),G=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let X=e=>{let{getPopupContainer:t,getPrefixCls:n,direction:a}=o.useContext(y.E_),{prefixCls:c,type:r="default",danger:i,disabled:d,loading:s,onClick:u,htmlType:m,children:p,className:g,menu:b,arrow:f,autoFocus:v,overlay:h,trigger:I,align:x,open:w,onOpenChange:S,placement:C,getPopupContainer:O,href:B,icon:k=o.createElement(D.Z,null),title:j,buttonsRender:E=e=>e,mouseEnterDelay:z,mouseLeaveDelay:N,overlayClassName:H,overlayStyle:T,destroyOnHidden:P,destroyPopupOnHide:R,dropdownRender:M,popupRender:X}=e,_=G(e,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyOnHidden","destroyPopupOnHide","dropdownRender","popupRender"]),q=n("dropdown",c),F={menu:b,arrow:f,autoFocus:v,align:x,disabled:d,trigger:d?[]:I,onOpenChange:S,getPopupContainer:O||t,mouseEnterDelay:z,mouseLeaveDelay:N,overlayClassName:H,overlayStyle:T,destroyOnHidden:P,popupRender:X||M},{compactSize:Y,compactItemClassnames:V}=(0,L.ri)(q,a),$=l()("".concat(q,"-button"),V,g);"destroyPopupOnHide"in e&&(F.destroyPopupOnHide=R),"overlay"in e&&(F.overlay=h),"open"in e&&(F.open=w),"placement"in e?F.placement=C:F.placement="rtl"===a?"bottomLeft":"bottomRight";let[J,Q]=E([o.createElement(A.ZP,{type:r,danger:i,disabled:d,loading:s,onClick:u,htmlType:m,href:B,title:j},p),o.createElement(A.ZP,{type:r,danger:i,icon:k})]);return o.createElement(W.Z.Compact,Object.assign({className:$,size:Y,block:!0},_),J,o.createElement(Z,Object.assign({},F),Q))};X.__ANT_BUTTON=!0,Z.Button=X;var _=Z},32186:function(e,t,n){let o;n.d(t,{D:function(){return S},Z:function(){return O}});var a=n(2265),c=n(1119),r={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},l=n(55015),i=a.forwardRef(function(e,t){return a.createElement(l.Z,(0,c.Z)({},e,{ref:t,icon:r}))}),d=n(15327),s=n(77565),u=n(36760),m=n.n(u),p=n(18694),g=n(16774),b=n(71744),f=n(80856),v=n(93463),h=n(25437),y=(0,n(99320).I$)(["Layout","Sider"],e=>{let{componentCls:t,siderBg:n,motionDurationMid:o,motionDurationSlow:a,antCls:c,triggerHeight:r,triggerColor:l,triggerBg:i,headerHeight:d,zeroTriggerWidth:s,zeroTriggerHeight:u,borderRadiusLG:m,lightSiderBg:p,lightTriggerColor:g,lightTriggerBg:b,bodyBg:f}=e;return{[t]:{position:"relative",minWidth:0,background:n,transition:"all ".concat(o,", background 0s"),"&-has-trigger":{paddingBottom:r},"&-right":{order:1},["".concat(t,"-children")]:{height:"100%",marginTop:-.1,paddingTop:.1,["".concat(c,"-menu").concat(c,"-menu-inline-collapsed")]:{width:"auto"}},["&-zero-width ".concat(t,"-children")]:{overflow:"hidden"},["".concat(t,"-trigger")]:{position:"fixed",bottom:0,zIndex:1,height:r,color:l,lineHeight:(0,v.bf)(r),textAlign:"center",background:i,cursor:"pointer",transition:"all ".concat(o)},["".concat(t,"-zero-width-trigger")]:{position:"absolute",top:d,insetInlineEnd:e.calc(s).mul(-1).equal(),zIndex:1,width:s,height:u,color:l,fontSize:e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:n,borderRadius:"0 ".concat((0,v.bf)(m)," ").concat((0,v.bf)(m)," 0"),cursor:"pointer",transition:"background ".concat(a," ease"),"&::after":{position:"absolute",inset:0,background:"transparent",transition:"all ".concat(a),content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:e.calc(s).mul(-1).equal(),borderRadius:"".concat((0,v.bf)(m)," 0 0 ").concat((0,v.bf)(m))}},"&-light":{background:p,["".concat(t,"-trigger")]:{color:g,background:b},["".concat(t,"-zero-width-trigger")]:{color:g,background:b,border:"1px solid ".concat(f),borderInlineStart:0}}}}},h.eh,{deprecatedTokens:h.jn}),I=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let x={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},w=e=>!Number.isNaN(Number.parseFloat(e))&&Number.isFinite(Number(e)),S=a.createContext({}),C=(o=0,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return o+=1,"".concat(e).concat(o)});var O=a.forwardRef((e,t)=>{let{prefixCls:n,className:o,trigger:c,children:r,defaultCollapsed:l=!1,theme:u="dark",style:v={},collapsible:h=!1,reverseArrow:O=!1,width:B=200,collapsedWidth:k=80,zeroWidthTriggerStyle:j,breakpoint:E,onCollapse:z,onBreakpoint:N}=e,H=I(e,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:T}=(0,a.useContext)(f.V),[P,R]=(0,a.useState)("collapsed"in e?e.collapsed:l),[Z,M]=(0,a.useState)(!1);(0,a.useEffect)(()=>{"collapsed"in e&&R(e.collapsed)},[e.collapsed]);let D=(t,n)=>{"collapsed"in e||R(t),null==z||z(t,n)},{getPrefixCls:A,direction:W}=(0,a.useContext)(b.E_),L=A("layout-sider",n),[G,X,_]=y(L),q=(0,a.useRef)(null);q.current=e=>{M(e.matches),null==N||N(e.matches),P!==e.matches&&D(e.matches,"responsive")},(0,a.useEffect)(()=>{let e;function t(e){var t;return null===(t=q.current)||void 0===t?void 0:t.call(q,e)}return void 0!==(null==window?void 0:window.matchMedia)&&E&&E in x&&(e=window.matchMedia("screen and (max-width: ".concat(x[E],")")),(0,g.x)(e,t),t(e)),()=>{(0,g.h)(e,t)}},[E]),(0,a.useEffect)(()=>{let e=C("ant-sider-");return T.addSider(e),()=>T.removeSider(e)},[]);let F=()=>{D(!P,"clickTrigger")},Y=(0,p.Z)(H,["collapsed"]),V=P?k:B,$=w(V)?"".concat(V,"px"):String(V),J=0===Number.parseFloat(String(k||0))?a.createElement("span",{onClick:F,className:m()("".concat(L,"-zero-width-trigger"),"".concat(L,"-zero-width-trigger-").concat(O?"right":"left")),style:j},c||a.createElement(i,null)):null,Q="rtl"===W==!O,U={expanded:Q?a.createElement(s.Z,null):a.createElement(d.Z,null),collapsed:Q?a.createElement(d.Z,null):a.createElement(s.Z,null)}[P?"collapsed":"expanded"],K=null!==c?J||a.createElement("div",{className:"".concat(L,"-trigger"),onClick:F,style:{width:$}},c||U):null,ee=Object.assign(Object.assign({},v),{flex:"0 0 ".concat($),maxWidth:$,minWidth:$,width:$}),et=m()(L,"".concat(L,"-").concat(u),{["".concat(L,"-collapsed")]:!!P,["".concat(L,"-has-trigger")]:h&&null!==c&&!J,["".concat(L,"-below")]:!!Z,["".concat(L,"-zero-width")]:0===Number.parseFloat($)},o,X,_),en=a.useMemo(()=>({siderCollapsed:P}),[P]);return G(a.createElement(S.Provider,{value:en},a.createElement("aside",Object.assign({className:et},Y,{style:ee,ref:t}),a.createElement("div",{className:"".concat(L,"-children")},r),h||Z&&J?K:null)))})},80856:function(e,t,n){n.d(t,{V:function(){return o}});let o=n(2265).createContext({siderHook:{addSider:()=>null,removeSider:()=>null}})},25437:function(e,t,n){n.d(t,{eh:function(){return c},jn:function(){return r}});var o=n(93463),a=n(99320);let c=e=>{let{colorBgLayout:t,controlHeight:n,controlHeightLG:o,colorText:a,controlHeightSM:c,marginXXS:r,colorTextLightSolid:l,colorBgContainer:i}=e,d=1.25*o;return{colorBgHeader:"#001529",colorBgBody:t,colorBgTrigger:"#002140",bodyBg:t,headerBg:"#001529",headerHeight:2*n,headerPadding:"0 ".concat(d,"px"),headerColor:a,footerPadding:"".concat(c,"px ").concat(d,"px"),footerBg:t,siderBg:"#001529",triggerHeight:o+2*r,triggerBg:"#002140",triggerColor:l,zeroTriggerWidth:o,zeroTriggerHeight:o,lightSiderBg:i,lightTriggerBg:i,lightTriggerColor:a}},r=[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]];t.ZP=(0,a.I$)("Layout",e=>{let{antCls:t,componentCls:n,colorText:a,footerBg:c,headerHeight:r,headerPadding:l,headerColor:i,footerPadding:d,fontSize:s,bodyBg:u,headerBg:m}=e;return{[n]:{display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:u,"&, *":{boxSizing:"border-box"},["&".concat(n,"-has-sider")]:{flexDirection:"row",["> ".concat(n,", > ").concat(n,"-content")]:{width:0}},["".concat(n,"-header, &").concat(n,"-footer")]:{flex:"0 0 auto"},"&-rtl":{direction:"rtl"}},["".concat(n,"-header")]:{height:r,padding:l,color:i,lineHeight:(0,o.bf)(r),background:m,["".concat(t,"-menu")]:{lineHeight:"inherit"}},["".concat(n,"-footer")]:{padding:d,color:a,fontSize:s,background:c},["".concat(n,"-content")]:{flex:"auto",color:a,minHeight:0}}},c,{deprecatedTokens:r})},88208:function(e,t,n){n.d(t,{J:function(){return i}});var o=n(2265),a=n(28791),c=n(391),r=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let l=o.createContext(null),i=o.forwardRef((e,t)=>{let{children:n}=e,i=r(e,["children"]),d=o.useContext(l),s=o.useMemo(()=>Object.assign(Object.assign({},d),i),[d,i.prefixCls,i.mode,i.selectable,i.rootClassName]),u=(0,a.t4)(n),m=(0,a.x1)(t,u?(0,a.C4)(n):null);return o.createElement(l.Provider,{value:s},o.createElement(c.Z,{space:!0},u?o.cloneElement(n,{ref:m}):n))});t.Z=l},60985:function(e,t,n){n.d(t,{Z:function(){return Y}});var o=n(2265),a=n(33082),c=n(32186),r=n(39760),l=n(36760),i=n.n(l),d=n(58525),s=n(18694),u=n(68710),m=n(19722),p=n(71744),g=n(64024);let b=(0,o.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var f=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n},v=e=>{let{prefixCls:t,className:n,dashed:c}=e,r=f(e,["prefixCls","className","dashed"]),{getPrefixCls:l}=o.useContext(p.E_),d=l("menu",t),s=i()({["".concat(d,"-item-divider-dashed")]:!!c},n);return o.createElement(a.iz,Object.assign({className:s},r))},h=n(45287),y=n(99981),I=e=>{var t;let{className:n,children:r,icon:l,title:d,danger:u,extra:p}=e,{prefixCls:g,firstLevel:f,direction:v,disableMenuItemTitleTooltip:I,inlineCollapsed:x}=o.useContext(b),{siderCollapsed:w}=o.useContext(c.D),S=d;void 0===d?S=f?r:"":!1===d&&(S="");let C={title:S};w||x||(C.title=null,C.open=!1);let O=(0,h.Z)(r).length,B=o.createElement(a.ck,Object.assign({},(0,s.Z)(e,["title","icon","danger"]),{className:i()({["".concat(g,"-item-danger")]:u,["".concat(g,"-item-only-child")]:(l?O+1:O)===1},n),title:"string"==typeof d?d:void 0}),(0,m.Tm)(l,{className:i()(o.isValidElement(l)?null===(t=l.props)||void 0===t?void 0:t.className:void 0,"".concat(g,"-item-icon"))}),(e=>{let t=null==r?void 0:r[0],n=o.createElement("span",{className:i()("".concat(g,"-title-content"),{["".concat(g,"-title-content-with-extra")]:!!p||0===p})},r);return(!l||o.isValidElement(r)&&"span"===r.type)&&r&&e&&f&&"string"==typeof t?o.createElement("div",{className:"".concat(g,"-inline-collapsed-noicon")},t.charAt(0)):n})(x));return I||(B=o.createElement(y.Z,Object.assign({},C,{placement:"rtl"===v?"left":"right",classNames:{root:"".concat(g,"-inline-collapsed-tooltip")}}),B)),B},x=n(88208),w=n(93463),S=n(54558),C=n(12918),O=n(63074),B=n(18544),k=n(691),j=n(99320),E=n(71140),z=e=>{let{componentCls:t,motionDurationSlow:n,horizontalLineHeight:o,colorSplit:a,lineWidth:c,lineType:r,itemPaddingInline:l}=e;return{["".concat(t,"-horizontal")]:{lineHeight:o,border:0,borderBottom:"".concat((0,w.bf)(c)," ").concat(r," ").concat(a),boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},["".concat(t,"-item, ").concat(t,"-submenu")]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:l},["> ".concat(t,"-item:hover,\n > ").concat(t,"-item-active,\n > ").concat(t,"-submenu ").concat(t,"-submenu-title:hover")]:{backgroundColor:"transparent"},["".concat(t,"-item, ").concat(t,"-submenu-title")]:{transition:["border-color ".concat(n),"background ".concat(n)].join(",")},["".concat(t,"-submenu-arrow")]:{display:"none"}}}},N=e=>{let{componentCls:t,menuArrowOffset:n,calc:o}=e;return{["".concat(t,"-rtl")]:{direction:"rtl"},["".concat(t,"-submenu-rtl")]:{transformOrigin:"100% 0"},["".concat(t,"-rtl").concat(t,"-vertical,\n ").concat(t,"-submenu-rtl ").concat(t,"-vertical")]:{["".concat(t,"-submenu-arrow")]:{"&::before":{transform:"rotate(-45deg) translateY(".concat((0,w.bf)(o(n).mul(-1).equal()),")")},"&::after":{transform:"rotate(45deg) translateY(".concat((0,w.bf)(n),")")}}}}};let H=e=>(0,C.oN)(e);var T=(e,t)=>{let{componentCls:n,itemColor:o,itemSelectedColor:a,subMenuItemSelectedColor:c,groupTitleColor:r,itemBg:l,subMenuItemBg:i,itemSelectedBg:d,activeBarHeight:s,activeBarWidth:u,activeBarBorderWidth:m,motionDurationSlow:p,motionEaseInOut:g,motionEaseOut:b,itemPaddingInline:f,motionDurationMid:v,itemHoverColor:h,lineType:y,colorSplit:I,itemDisabledColor:x,dangerItemColor:S,dangerItemHoverColor:C,dangerItemSelectedColor:O,dangerItemActiveBg:B,dangerItemSelectedBg:k,popupBg:j,itemHoverBg:E,itemActiveBg:z,menuSubMenuBg:N,horizontalItemSelectedColor:T,horizontalItemSelectedBg:P,horizontalItemBorderRadius:R,horizontalItemHoverBg:Z}=e;return{["".concat(n,"-").concat(t,", ").concat(n,"-").concat(t," > ").concat(n)]:{color:o,background:l,["&".concat(n,"-root:focus-visible")]:Object.assign({},H(e)),["".concat(n,"-item")]:{"&-group-title, &-extra":{color:r}},["".concat(n,"-submenu-selected > ").concat(n,"-submenu-title")]:{color:c},["".concat(n,"-item, ").concat(n,"-submenu-title")]:{color:o,["&:not(".concat(n,"-item-disabled):focus-visible")]:Object.assign({},H(e))},["".concat(n,"-item-disabled, ").concat(n,"-submenu-disabled")]:{color:"".concat(x," !important")},["".concat(n,"-item:not(").concat(n,"-item-selected):not(").concat(n,"-submenu-selected)")]:{["&:hover, > ".concat(n,"-submenu-title:hover")]:{color:h}},["&:not(".concat(n,"-horizontal)")]:{["".concat(n,"-item:not(").concat(n,"-item-selected)")]:{"&:hover":{backgroundColor:E},"&:active":{backgroundColor:z}},["".concat(n,"-submenu-title")]:{"&:hover":{backgroundColor:E},"&:active":{backgroundColor:z}}},["".concat(n,"-item-danger")]:{color:S,["&".concat(n,"-item:hover")]:{["&:not(".concat(n,"-item-selected):not(").concat(n,"-submenu-selected)")]:{color:C}},["&".concat(n,"-item:active")]:{background:B}},["".concat(n,"-item a")]:{"&, &:hover":{color:"inherit"}},["".concat(n,"-item-selected")]:{color:a,["&".concat(n,"-item-danger")]:{color:O},"a, a:hover":{color:"inherit"}},["& ".concat(n,"-item-selected")]:{backgroundColor:d,["&".concat(n,"-item-danger")]:{backgroundColor:k}},["&".concat(n,"-submenu > ").concat(n)]:{backgroundColor:N},["&".concat(n,"-popup > ").concat(n)]:{backgroundColor:j},["&".concat(n,"-submenu-popup > ").concat(n)]:{backgroundColor:j},["&".concat(n,"-horizontal")]:Object.assign(Object.assign({},"dark"===t?{borderBottom:0}:{}),{["> ".concat(n,"-item, > ").concat(n,"-submenu")]:{top:m,marginTop:e.calc(m).mul(-1).equal(),marginBottom:0,borderRadius:R,"&::after":{position:"absolute",insetInline:f,bottom:0,borderBottom:"".concat((0,w.bf)(s)," solid transparent"),transition:"border-color ".concat(p," ").concat(g),content:'""'},"&:hover, &-active, &-open":{background:Z,"&::after":{borderBottomWidth:s,borderBottomColor:T}},"&-selected":{color:T,backgroundColor:P,"&:hover":{backgroundColor:P},"&::after":{borderBottomWidth:s,borderBottomColor:T}}}}),["&".concat(n,"-root")]:{["&".concat(n,"-inline, &").concat(n,"-vertical")]:{borderInlineEnd:"".concat((0,w.bf)(m)," ").concat(y," ").concat(I)}},["&".concat(n,"-inline")]:{["".concat(n,"-sub").concat(n,"-inline")]:{background:i},["".concat(n,"-item")]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:"".concat((0,w.bf)(u)," solid ").concat(a),transform:"scaleY(0.0001)",opacity:0,transition:["transform ".concat(v," ").concat(b),"opacity ".concat(v," ").concat(b)].join(","),content:'""'},["&".concat(n,"-item-danger")]:{"&::after":{borderInlineEndColor:O}}},["".concat(n,"-selected, ").concat(n,"-item-selected")]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:["transform ".concat(v," ").concat(g),"opacity ".concat(v," ").concat(g)].join(",")}}}}}};let P=e=>{let{componentCls:t,itemHeight:n,itemMarginInline:o,padding:a,menuArrowSize:c,marginXS:r,itemMarginBlock:l,itemWidth:i,itemPaddingInline:d}=e,s=e.calc(c).add(a).add(r).equal();return{["".concat(t,"-item")]:{position:"relative",overflow:"hidden"},["".concat(t,"-item, ").concat(t,"-submenu-title")]:{height:n,lineHeight:(0,w.bf)(n),paddingInline:d,overflow:"hidden",textOverflow:"ellipsis",marginInline:o,marginBlock:l,width:i},["> ".concat(t,"-item,\n > ").concat(t,"-submenu > ").concat(t,"-submenu-title")]:{height:n,lineHeight:(0,w.bf)(n)},["".concat(t,"-item-group-list ").concat(t,"-submenu-title,\n ").concat(t,"-submenu-title")]:{paddingInlineEnd:s}}};var R=e=>{let{componentCls:t,iconCls:n,itemHeight:o,colorTextLightSolid:a,dropdownWidth:c,controlHeightLG:r,motionEaseOut:l,paddingXL:i,itemMarginInline:d,fontSizeLG:s,motionDurationFast:u,motionDurationSlow:m,paddingXS:p,boxShadowSecondary:g,collapsedWidth:b,collapsedIconSize:f}=e,v={height:o,lineHeight:(0,w.bf)(o),listStylePosition:"inside",listStyleType:"disc"};return[{[t]:{"&-inline, &-vertical":Object.assign({["&".concat(t,"-root")]:{boxShadow:"none"}},P(e))},["".concat(t,"-submenu-popup")]:{["".concat(t,"-vertical")]:Object.assign(Object.assign({},P(e)),{boxShadow:g})}},{["".concat(t,"-submenu-popup ").concat(t,"-vertical").concat(t,"-sub")]:{minWidth:c,maxHeight:"calc(100vh - ".concat((0,w.bf)(e.calc(r).mul(2.5).equal()),")"),padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{["".concat(t,"-inline")]:{width:"100%",["&".concat(t,"-root")]:{["".concat(t,"-item, ").concat(t,"-submenu-title")]:{display:"flex",alignItems:"center",transition:["border-color ".concat(m),"background ".concat(m),"padding ".concat(u," ").concat(l)].join(","),["> ".concat(t,"-title-content")]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},["".concat(t,"-sub").concat(t,"-inline")]:{padding:0,border:0,borderRadius:0,boxShadow:"none",["& > ".concat(t,"-submenu > ").concat(t,"-submenu-title")]:v,["& ".concat(t,"-item-group-title")]:{paddingInlineStart:i}},["".concat(t,"-item")]:v}},{["".concat(t,"-inline-collapsed")]:{width:b,["&".concat(t,"-root")]:{["".concat(t,"-item, ").concat(t,"-submenu ").concat(t,"-submenu-title")]:{["> ".concat(t,"-inline-collapsed-noicon")]:{fontSize:s,textAlign:"center"}}},["> ".concat(t,"-item,\n > ").concat(t,"-item-group > ").concat(t,"-item-group-list > ").concat(t,"-item,\n > ").concat(t,"-item-group > ").concat(t,"-item-group-list > ").concat(t,"-submenu > ").concat(t,"-submenu-title,\n > ").concat(t,"-submenu > ").concat(t,"-submenu-title")]:{insetInlineStart:0,paddingInline:"calc(50% - ".concat((0,w.bf)(e.calc(f).div(2).equal())," - ").concat((0,w.bf)(d),")"),textOverflow:"clip",["\n ".concat(t,"-submenu-arrow,\n ").concat(t,"-submenu-expand-icon\n ")]:{opacity:0},["".concat(t,"-item-icon, ").concat(n)]:{margin:0,fontSize:f,lineHeight:(0,w.bf)(o),"+ span":{display:"inline-block",opacity:0}}},["".concat(t,"-item-icon, ").concat(n)]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",["".concat(t,"-item-icon, ").concat(n)]:{display:"none"},"a, a:hover":{color:a}},["".concat(t,"-item-group-title")]:Object.assign(Object.assign({},C.vS),{paddingInline:p})}}]};let Z=e=>{let{componentCls:t,motionDurationSlow:n,motionDurationMid:o,motionEaseInOut:a,motionEaseOut:c,iconCls:r,iconSize:l,iconMarginInlineEnd:i}=e;return{["".concat(t,"-item, ").concat(t,"-submenu-title")]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:["border-color ".concat(n),"background ".concat(n),"padding calc(".concat(n," + 0.1s) ").concat(a)].join(","),["".concat(t,"-item-icon, ").concat(r)]:{minWidth:l,fontSize:l,transition:["font-size ".concat(o," ").concat(c),"margin ".concat(n," ").concat(a),"color ".concat(n)].join(","),"+ span":{marginInlineStart:i,opacity:1,transition:["opacity ".concat(n," ").concat(a),"margin ".concat(n),"color ".concat(n)].join(",")}},["".concat(t,"-item-icon")]:Object.assign({},(0,C.Ro)()),["&".concat(t,"-item-only-child")]:{["> ".concat(r,", > ").concat(t,"-item-icon")]:{marginInlineEnd:0}}},["".concat(t,"-item-disabled, ").concat(t,"-submenu-disabled")]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important",cursor:"not-allowed",pointerEvents:"none"},["> ".concat(t,"-submenu-title")]:{color:"inherit !important",cursor:"not-allowed"}}}},M=e=>{let{componentCls:t,motionDurationSlow:n,motionEaseInOut:o,borderRadius:a,menuArrowSize:c,menuArrowOffset:r}=e;return{["".concat(t,"-submenu")]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:e.margin,width:c,color:"currentcolor",transform:"translateY(-50%)",transition:"transform ".concat(n," ").concat(o,", opacity ").concat(n)},"&-arrow":{"&::before, &::after":{position:"absolute",width:e.calc(c).mul(.6).equal(),height:e.calc(c).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:a,transition:["background ".concat(n," ").concat(o),"transform ".concat(n," ").concat(o),"top ".concat(n," ").concat(o),"color ".concat(n," ").concat(o)].join(","),content:'""'},"&::before":{transform:"rotate(45deg) translateY(".concat((0,w.bf)(e.calc(r).mul(-1).equal()),")")},"&::after":{transform:"rotate(-45deg) translateY(".concat((0,w.bf)(r),")")}}}}},D=e=>{let{antCls:t,componentCls:n,fontSize:o,motionDurationSlow:a,motionDurationMid:c,motionEaseInOut:r,paddingXS:l,padding:i,colorSplit:d,lineWidth:s,zIndexPopup:u,borderRadiusLG:m,subMenuItemBorderRadius:p,menuArrowSize:g,menuArrowOffset:b,lineType:f,groupTitleLineHeight:v,groupTitleFontSize:h}=e;return[{"":{[n]:Object.assign(Object.assign({},(0,C.dF)()),{"&-hidden":{display:"none"}})},["".concat(n,"-submenu-hidden")]:{display:"none"}},{[n]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,C.Wf)(e)),(0,C.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:o,lineHeight:0,listStyle:"none",outline:"none",transition:"width ".concat(a," cubic-bezier(0.2, 0, 0, 1) 0s"),"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",["".concat(n,"-item")]:{flex:"none"}},["".concat(n,"-item, ").concat(n,"-submenu, ").concat(n,"-submenu-title")]:{borderRadius:e.itemBorderRadius},["".concat(n,"-item-group-title")]:{padding:"".concat((0,w.bf)(l)," ").concat((0,w.bf)(i)),fontSize:h,lineHeight:v,transition:"all ".concat(a)},["&-horizontal ".concat(n,"-submenu")]:{transition:["border-color ".concat(a," ").concat(r),"background ".concat(a," ").concat(r)].join(",")},["".concat(n,"-submenu, ").concat(n,"-submenu-inline")]:{transition:["border-color ".concat(a," ").concat(r),"background ".concat(a," ").concat(r),"padding ".concat(c," ").concat(r)].join(",")},["".concat(n,"-submenu ").concat(n,"-sub")]:{cursor:"initial",transition:["background ".concat(a," ").concat(r),"padding ".concat(a," ").concat(r)].join(",")},["".concat(n,"-title-content")]:{transition:"color ".concat(a),"&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},["> ".concat(t,"-typography-ellipsis-single-line")]:{display:"inline",verticalAlign:"unset"},["".concat(n,"-item-extra")]:{marginInlineStart:"auto",paddingInlineStart:e.padding}},["".concat(n,"-item a")]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},["".concat(n,"-item-divider")]:{overflow:"hidden",lineHeight:0,borderColor:d,borderStyle:f,borderWidth:0,borderTopWidth:s,marginBlock:s,padding:0,"&-dashed":{borderStyle:"dashed"}}}),Z(e)),{["".concat(n,"-item-group")]:{["".concat(n,"-item-group-list")]:{margin:0,padding:0,["".concat(n,"-item, ").concat(n,"-submenu-title")]:{paddingInline:"".concat((0,w.bf)(e.calc(o).mul(2).equal())," ").concat((0,w.bf)(i))}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:u,borderRadius:m,boxShadow:"none",transformOrigin:"0 0",["&".concat(n,"-submenu")]:{background:"transparent"},"&::before":{position:"absolute",inset:0,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'},["> ".concat(n)]:Object.assign(Object.assign(Object.assign({borderRadius:m},Z(e)),M(e)),{["".concat(n,"-item, ").concat(n,"-submenu > ").concat(n,"-submenu-title")]:{borderRadius:p},["".concat(n,"-submenu-title::after")]:{transition:"transform ".concat(a," ").concat(r)}})},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:e.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:e.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:e.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:e.paddingXS}}}),M(e)),{["&-inline-collapsed ".concat(n,"-submenu-arrow,\n &-inline ").concat(n,"-submenu-arrow")]:{"&::before":{transform:"rotate(-45deg) translateX(".concat((0,w.bf)(b),")")},"&::after":{transform:"rotate(45deg) translateX(".concat((0,w.bf)(e.calc(b).mul(-1).equal()),")")}},["".concat(n,"-submenu-open").concat(n,"-submenu-inline > ").concat(n,"-submenu-title > ").concat(n,"-submenu-arrow")]:{transform:"translateY(".concat((0,w.bf)(e.calc(g).mul(.2).mul(-1).equal()),")"),"&::after":{transform:"rotate(-45deg) translateX(".concat((0,w.bf)(e.calc(b).mul(-1).equal()),")")},"&::before":{transform:"rotate(45deg) translateX(".concat((0,w.bf)(b),")")}}})},{["".concat(t,"-layout-header")]:{[n]:{lineHeight:"inherit"}}}]},A=e=>{var t,n,o;let{colorPrimary:a,colorError:c,colorTextDisabled:r,colorErrorBg:l,colorText:i,colorTextDescription:d,colorBgContainer:s,colorFillAlter:u,colorFillContent:m,lineWidth:p,lineWidthBold:g,controlItemBgActive:b,colorBgTextHover:f,controlHeightLG:v,lineHeight:h,colorBgElevated:y,marginXXS:I,padding:x,fontSize:w,controlHeightSM:C,fontSizeLG:O,colorTextLightSolid:B,colorErrorHover:k}=e,j=null!==(t=e.activeBarWidth)&&void 0!==t?t:0,E=null!==(n=e.activeBarBorderWidth)&&void 0!==n?n:p,z=null!==(o=e.itemMarginInline)&&void 0!==o?o:e.marginXXS,N=new S.t(B).setA(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,itemBorderRadius:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,subMenuItemBorderRadius:e.borderRadiusSM,colorItemText:i,itemColor:i,colorItemTextHover:i,itemHoverColor:i,colorItemTextHoverHorizontal:a,horizontalItemHoverColor:a,colorGroupTitle:d,groupTitleColor:d,colorItemTextSelected:a,itemSelectedColor:a,subMenuItemSelectedColor:a,colorItemTextSelectedHorizontal:a,horizontalItemSelectedColor:a,colorItemBg:s,itemBg:s,colorItemBgHover:f,itemHoverBg:f,colorItemBgActive:m,itemActiveBg:b,colorSubItemBg:u,subMenuItemBg:u,colorItemBgSelected:b,itemSelectedBg:b,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:j,colorActiveBarHeight:g,activeBarHeight:g,colorActiveBarBorderSize:p,activeBarBorderWidth:E,colorItemTextDisabled:r,itemDisabledColor:r,colorDangerItemText:c,dangerItemColor:c,colorDangerItemTextHover:c,dangerItemHoverColor:c,colorDangerItemTextSelected:c,dangerItemSelectedColor:c,colorDangerItemBgActive:l,dangerItemActiveBg:l,colorDangerItemBgSelected:l,dangerItemSelectedBg:l,itemMarginInline:z,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:v,groupTitleLineHeight:h,collapsedWidth:2*v,popupBg:y,itemMarginBlock:I,itemPaddingInline:x,horizontalLineHeight:"".concat(1.15*v,"px"),iconSize:w,iconMarginInlineEnd:C-w,collapsedIconSize:O,groupTitleFontSize:w,darkItemDisabledColor:new S.t(B).setA(.25).toRgbString(),darkItemColor:N,darkDangerItemColor:c,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:B,darkItemSelectedBg:a,darkDangerItemSelectedBg:c,darkItemHoverBg:"transparent",darkGroupTitleColor:N,darkItemHoverColor:B,darkDangerItemHoverColor:k,darkDangerItemSelectedColor:B,darkDangerItemActiveBg:c,itemWidth:j?"calc(100% + ".concat(E,"px)"):"calc(100% - ".concat(2*z,"px)")}};var W=n(62236),L=e=>{var t;let n;let{popupClassName:c,icon:r,title:l,theme:d}=e,u=o.useContext(b),{prefixCls:p,inlineCollapsed:g,theme:f}=u,v=(0,a.Xl)();if(r){let e=o.isValidElement(l)&&"span"===l.type;n=o.createElement(o.Fragment,null,(0,m.Tm)(r,{className:i()(o.isValidElement(r)?null===(t=r.props)||void 0===t?void 0:t.className:void 0,"".concat(p,"-item-icon"))}),e?l:o.createElement("span",{className:"".concat(p,"-title-content")},l))}else n=g&&!v.length&&l&&"string"==typeof l?o.createElement("div",{className:"".concat(p,"-inline-collapsed-noicon")},l.charAt(0)):o.createElement("span",{className:"".concat(p,"-title-content")},l);let h=o.useMemo(()=>Object.assign(Object.assign({},u),{firstLevel:!1}),[u]),[y]=(0,W.Cn)("Menu");return o.createElement(b.Provider,{value:h},o.createElement(a.Wd,Object.assign({},(0,s.Z)(e,["icon"]),{title:n,popupClassName:i()(p,c,"".concat(p,"-").concat(d||f)),popupStyle:Object.assign({zIndex:y},e.popupStyle)})))},G=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};function X(e){return null===e||!1===e}let _={item:I,submenu:L,divider:v},q=(0,o.forwardRef)((e,t)=>{var n;let c=o.useContext(x.Z),l=c||{},{getPrefixCls:f,getPopupContainer:v,direction:h,menu:y}=o.useContext(p.E_),I=f(),{prefixCls:w,className:S,style:C,theme:H="light",expandIcon:P,_internalDisableMenuItemTitleTooltip:Z,inlineCollapsed:M,siderCollapsed:W,rootClassName:L,mode:q,selectable:F,onClick:Y,overflowedIndicatorPopupClassName:V}=e,$=G(e,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),J=(0,s.Z)($,["collapsedWidth"]);null===(n=l.validator)||void 0===n||n.call(l,{mode:q});let Q=(0,d.Z)(function(){for(var e,t=arguments.length,n=Array(t),o=0;o1&&void 0!==arguments[1]?arguments[1]:e,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return(0,j.I$)("Menu",e=>{let{colorBgElevated:t,controlHeightLG:n,fontSize:o,darkItemColor:a,darkDangerItemColor:c,darkItemBg:r,darkSubMenuItemBg:l,darkItemSelectedColor:i,darkItemSelectedBg:d,darkDangerItemSelectedBg:s,darkItemHoverBg:u,darkGroupTitleColor:m,darkItemHoverColor:p,darkItemDisabledColor:g,darkDangerItemHoverColor:b,darkDangerItemSelectedColor:f,darkDangerItemActiveBg:v,popupBg:h,darkPopupBg:y}=e,I=e.calc(o).div(7).mul(5).equal(),x=(0,E.IX)(e,{menuArrowSize:I,menuHorizontalHeight:e.calc(n).mul(1.15).equal(),menuArrowOffset:e.calc(I).mul(.25).equal(),menuSubMenuBg:t,calc:e.calc,popupBg:h}),w=(0,E.IX)(x,{itemColor:a,itemHoverColor:p,groupTitleColor:m,itemSelectedColor:i,subMenuItemSelectedColor:i,itemBg:r,popupBg:y,subMenuItemBg:l,itemActiveBg:"transparent",itemSelectedBg:d,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:u,itemDisabledColor:g,dangerItemColor:c,dangerItemHoverColor:b,dangerItemSelectedColor:f,dangerItemActiveBg:v,dangerItemSelectedBg:s,menuSubMenuBg:l,horizontalItemSelectedColor:i,horizontalItemSelectedBg:d});return[D(x),z(x),R(x),T(x,"light"),T(w,"dark"),N(x),(0,O.Z)(x),(0,B.oN)(x,"slide-up"),(0,B.oN)(x,"slide-down"),(0,k._y)(x,"zoom-big")]},A,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:n,unitless:{groupTitleLineHeight:!0}})(e,t)}(en,eo,!c),el=i()("".concat(en,"-").concat(H),null==y?void 0:y.className,S),ei=o.useMemo(()=>{var e,t;if("function"==typeof P||X(P))return P||null;if("function"==typeof l.expandIcon||X(l.expandIcon))return l.expandIcon||null;if("function"==typeof(null==y?void 0:y.expandIcon)||X(null==y?void 0:y.expandIcon))return(null==y?void 0:y.expandIcon)||null;let n=null!==(e=null!=P?P:null==l?void 0:l.expandIcon)&&void 0!==e?e:null==y?void 0:y.expandIcon;return(0,m.Tm)(n,{className:i()("".concat(en,"-submenu-expand-icon"),o.isValidElement(n)?null===(t=n.props)||void 0===t?void 0:t.className:void 0)})},[P,null==l?void 0:l.expandIcon,null==y?void 0:y.expandIcon,en]),ed=o.useMemo(()=>({prefixCls:en,inlineCollapsed:ee||!1,direction:h,firstLevel:!0,theme:H,mode:U,disableMenuItemTitleTooltip:Z}),[en,ee,h,Z,H]);return ea(o.createElement(x.Z.Provider,{value:null},o.createElement(b.Provider,{value:ed},o.createElement(a.ZP,Object.assign({getPopupContainer:v,overflowedIndicator:o.createElement(r.Z,null),overflowedIndicatorPopupClassName:i()(en,"".concat(en,"-").concat(H),V),mode:U,selectable:K,onClick:Q},J,{inlineCollapsed:ee,style:Object.assign(Object.assign({},null==y?void 0:y.style),C),className:el,prefixCls:en,direction:h,defaultMotions:et,expandIcon:ei,ref:t,rootClassName:i()(L,ec,l.rootClassName,er,eo),_internalComponents:_})))))}),F=(0,o.forwardRef)((e,t)=>{let n=(0,o.useRef)(null),a=o.useContext(c.D);return(0,o.useImperativeHandle)(t,()=>({menu:n.current,focus:e=>{var t;null===(t=n.current)||void 0===t||t.focus(e)}})),o.createElement(q,Object.assign({ref:n},e,a))});F.Item=I,F.SubMenu=L,F.Divider=v,F.ItemGroup=a.BW;var Y=F},58760:function(e,t,n){n.d(t,{Z:function(){return B}});var o=n(2265),a=n(36760),c=n.n(a),r=n(45287);function l(e){return["small","middle","large"].includes(e)}function i(e){return!!e&&"number"==typeof e&&!Number.isNaN(e)}var d=n(71744),s=n(77685),u=n(17691),m=n(99320);let p=e=>{let{componentCls:t,borderRadius:n,paddingSM:o,colorBorder:a,paddingXS:c,fontSizeLG:r,fontSizeSM:l,borderRadiusLG:i,borderRadiusSM:d,colorBgContainerDisabled:s,lineWidth:m}=e;return{[t]:[{display:"inline-flex",alignItems:"center",gap:0,paddingInline:o,margin:0,background:s,borderWidth:m,borderStyle:"solid",borderColor:a,borderRadius:n,"&-large":{fontSize:r,borderRadius:i},"&-small":{paddingInline:c,borderRadius:d,fontSize:l},"&-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,u.c)(e,{focus:!1})]}};var g=(0,m.I$)(["Space","Addon"],e=>[p(e)]),b=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let f=o.forwardRef((e,t)=>{let{className:n,children:a,style:r,prefixCls:l}=e,i=b(e,["className","children","style","prefixCls"]),{getPrefixCls:u,direction:m}=o.useContext(d.E_),p=u("space-addon",l),[f,v,h]=g(p),{compactItemClassnames:y,compactSize:I}=(0,s.ri)(p,m),x=c()(p,v,y,h,{["".concat(p,"-").concat(I)]:I},n);return f(o.createElement("div",Object.assign({ref:t,className:x,style:r},i),a))}),v=o.createContext({latestIndex:0}),h=v.Provider;var y=e=>{let{className:t,index:n,children:a,split:c,style:r}=e,{latestIndex:l}=o.useContext(v);return null==a?null:o.createElement(o.Fragment,null,o.createElement("div",{className:t,style:r},a),n{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"}},["".concat(t,"-item:empty")]:{display:"none"},["".concat(t,"-item > ").concat(n,"-badge-not-a-wrapper:only-child")]:{display:"block"}}}},w=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}}}};var S=(0,m.I$)("Space",e=>{let t=(0,I.IX)(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[x(t),w(t)]},()=>({}),{resetStyle:!1}),C=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let O=o.forwardRef((e,t)=>{var n;let{getPrefixCls:a,direction:s,size:u,className:m,style:p,classNames:g,styles:b}=(0,d.dj)("space"),{size:f=null!=u?u:"small",align:v,className:I,rootClassName:x,children:w,direction:O="horizontal",prefixCls:B,split:k,style:j,wrap:E=!1,classNames:z,styles:N}=e,H=C(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[T,P]=Array.isArray(f)?f:[f,f],R=l(P),Z=l(T),M=i(P),D=i(T),A=(0,r.Z)(w,{keepEmpty:!0}),W=void 0===v&&"horizontal"===O?"center":v,L=a("space",B),[G,X,_]=S(L),q=c()(L,m,X,"".concat(L,"-").concat(O),{["".concat(L,"-rtl")]:"rtl"===s,["".concat(L,"-align-").concat(W)]:W,["".concat(L,"-gap-row-").concat(P)]:R,["".concat(L,"-gap-col-").concat(T)]:Z},I,x,_),F=c()("".concat(L,"-item"),null!==(n=null==z?void 0:z.item)&&void 0!==n?n:g.item),Y=Object.assign(Object.assign({},b.item),null==N?void 0:N.item),V=A.map((e,t)=>{let n=(null==e?void 0:e.key)||"".concat(F,"-").concat(t);return o.createElement(y,{className:F,key:n,index:t,split:k,style:Y},e)}),$=o.useMemo(()=>({latestIndex:A.reduce((e,t,n)=>null!=t?n:e,0)}),[A]);if(0===A.length)return null;let J={};return E&&(J.flexWrap="wrap"),!Z&&D&&(J.columnGap=T),!R&&M&&(J.rowGap=P),G(o.createElement("div",Object.assign({ref:t,className:q,style:Object.assign(Object.assign(Object.assign({},J),p),j)},H),o.createElement(h,{value:$},V)))});O.Compact=s.ZP,O.Addon=f;var B=O}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3705],{15327:function(e,t,n){n.d(t,{Z:function(){return l}});var o=n(1119),a=n(2265),c={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"},r=n(55015),l=a.forwardRef(function(e,t){return a.createElement(r.Z,(0,o.Z)({},e,{ref:t,icon:c}))})},73705:function(e,t,n){n.d(t,{Z:function(){return _}});var o=n(2265),a=n(15327),c=n(77565),r=n(36760),l=n.n(r),i=n(71030),d=n(58525),s=n(50506),u=n(18694),m=n(62236),p=e=>"object"!=typeof e&&"function"!=typeof e||null===e,g=n(92736),b=n(93942),f=n(19722),v=n(13613),h=n(95140),y=n(71744),I=n(64024),x=n(60985),w=n(88208),S=n(84951),C=n(93463),O=n(12918),B=n(18544),k=n(29382),j=n(691),E=n(88260),z=n(34442),N=n(99320),H=n(71140),T=e=>{let{componentCls:t,menuCls:n,colorError:o,colorTextLightSolid:a}=e,c="".concat(n,"-item");return{["".concat(t,", ").concat(t,"-menu-submenu")]:{["".concat(n," ").concat(c)]:{["&".concat(c,"-danger:not(").concat(c,"-disabled)")]:{color:o,"&:hover":{color:a,backgroundColor:o}}}}}};let P=e=>{let{componentCls:t,menuCls:n,zIndexPopup:o,dropdownArrowDistance:a,sizePopupArrow:c,antCls:r,iconCls:l,motionDurationMid:i,paddingBlock:d,fontSize:s,dropdownEdgeChildPadding:u,colorTextDisabled:m,fontSizeIcon:p,controlPaddingHorizontal:g,colorBgElevated:b}=e;return[{[t]:{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:o,display:"block","&::before":{position:"absolute",insetBlock:e.calc(c).div(2).sub(a).equal(),zIndex:-9999,opacity:1e-4,content:'""'},"&-menu-vertical":{maxHeight:"100vh",overflowY:"auto"},["&-trigger".concat(r,"-btn")]:{["& > ".concat(l,"-down, & > ").concat(r,"-btn-icon > ").concat(l,"-down")]:{fontSize:p}},["".concat(t,"-wrap")]:{position:"relative",["".concat(r,"-btn > ").concat(l,"-down")]:{fontSize:p},["".concat(l,"-down::before")]:{transition:"transform ".concat(i)}},["".concat(t,"-wrap-open")]:{["".concat(l,"-down::before")]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},["&".concat(r,"-slide-down-enter").concat(r,"-slide-down-enter-active").concat(t,"-placement-bottomLeft,\n &").concat(r,"-slide-down-appear").concat(r,"-slide-down-appear-active").concat(t,"-placement-bottomLeft,\n &").concat(r,"-slide-down-enter").concat(r,"-slide-down-enter-active").concat(t,"-placement-bottom,\n &").concat(r,"-slide-down-appear").concat(r,"-slide-down-appear-active").concat(t,"-placement-bottom,\n &").concat(r,"-slide-down-enter").concat(r,"-slide-down-enter-active").concat(t,"-placement-bottomRight,\n &").concat(r,"-slide-down-appear").concat(r,"-slide-down-appear-active").concat(t,"-placement-bottomRight")]:{animationName:B.fJ},["&".concat(r,"-slide-up-enter").concat(r,"-slide-up-enter-active").concat(t,"-placement-topLeft,\n &").concat(r,"-slide-up-appear").concat(r,"-slide-up-appear-active").concat(t,"-placement-topLeft,\n &").concat(r,"-slide-up-enter").concat(r,"-slide-up-enter-active").concat(t,"-placement-top,\n &").concat(r,"-slide-up-appear").concat(r,"-slide-up-appear-active").concat(t,"-placement-top,\n &").concat(r,"-slide-up-enter").concat(r,"-slide-up-enter-active").concat(t,"-placement-topRight,\n &").concat(r,"-slide-up-appear").concat(r,"-slide-up-appear-active").concat(t,"-placement-topRight")]:{animationName:B.Qt},["&".concat(r,"-slide-down-leave").concat(r,"-slide-down-leave-active").concat(t,"-placement-bottomLeft,\n &").concat(r,"-slide-down-leave").concat(r,"-slide-down-leave-active").concat(t,"-placement-bottom,\n &").concat(r,"-slide-down-leave").concat(r,"-slide-down-leave-active").concat(t,"-placement-bottomRight")]:{animationName:B.Uw},["&".concat(r,"-slide-up-leave").concat(r,"-slide-up-leave-active").concat(t,"-placement-topLeft,\n &").concat(r,"-slide-up-leave").concat(r,"-slide-up-leave-active").concat(t,"-placement-top,\n &").concat(r,"-slide-up-leave").concat(r,"-slide-up-leave-active").concat(t,"-placement-topRight")]:{animationName:B.ly}}},(0,E.ZP)(e,b,{arrowPlacement:{top:!0,bottom:!0}}),{["".concat(t," ").concat(n)]:{position:"relative",margin:0},["".concat(n,"-submenu-popup")]:{position:"absolute",zIndex:o,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},["".concat(t,", ").concat(t,"-menu-submenu")]:Object.assign(Object.assign({},(0,O.Wf)(e)),{[n]:Object.assign(Object.assign({padding:u,listStyleType:"none",backgroundColor:b,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary},(0,O.Qy)(e)),{"&:empty":{padding:0,boxShadow:"none"},["".concat(n,"-item-group-title")]:{padding:"".concat((0,C.bf)(d)," ").concat((0,C.bf)(g)),color:e.colorTextDescription,transition:"all ".concat(i)},["".concat(n,"-item")]:{position:"relative",display:"flex",alignItems:"center"},["".concat(n,"-item-icon")]:{minWidth:s,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},["".concat(n,"-title-content")]:{flex:"auto","&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},"> a":{color:"inherit",transition:"all ".concat(i),"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}},["".concat(n,"-item-extra")]:{paddingInlineStart:e.padding,marginInlineStart:"auto",fontSize:e.fontSizeSM,color:e.colorTextDescription}},["".concat(n,"-item, ").concat(n,"-submenu-title")]:Object.assign(Object.assign({display:"flex",margin:0,padding:"".concat((0,C.bf)(d)," ").concat((0,C.bf)(g)),color:e.colorText,fontWeight:"normal",fontSize:s,lineHeight:e.lineHeight,cursor:"pointer",transition:"all ".concat(i),borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover}},(0,O.Qy)(e)),{"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:m,cursor:"not-allowed","&:hover":{color:m,backgroundColor:b,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:"".concat((0,C.bf)(e.marginXXS)," 0"),overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},["".concat(t,"-menu-submenu-expand-icon")]:{position:"absolute",insetInlineEnd:e.paddingXS,["".concat(t,"-menu-submenu-arrow-icon")]:{marginInlineEnd:"0 !important",color:e.colorIcon,fontSize:p,fontStyle:"normal"}}}),["".concat(n,"-item-group-list")]:{margin:"0 ".concat((0,C.bf)(e.marginXS)),padding:0,listStyle:"none"},["".concat(n,"-submenu-title")]:{paddingInlineEnd:e.calc(g).add(e.fontSizeSM).equal()},["".concat(n,"-submenu-vertical")]:{position:"relative"},["".concat(n,"-submenu").concat(n,"-submenu-disabled ").concat(t,"-menu-submenu-title")]:{["&, ".concat(t,"-menu-submenu-arrow-icon")]:{color:m,backgroundColor:b,cursor:"not-allowed"}},["".concat(n,"-submenu-selected ").concat(t,"-menu-submenu-title")]:{color:e.colorPrimary}})})},[(0,B.oN)(e,"slide-up"),(0,B.oN)(e,"slide-down"),(0,k.Fm)(e,"move-up"),(0,k.Fm)(e,"move-down"),(0,j._y)(e,"zoom-big")]]};var R=(0,N.I$)("Dropdown",e=>{let{marginXXS:t,sizePopupArrow:n,paddingXXS:o,componentCls:a}=e,c=(0,H.IX)(e,{menuCls:"".concat(a,"-menu"),dropdownArrowDistance:e.calc(n).div(2).add(t).equal(),dropdownEdgeChildPadding:o});return[P(c),T(c)]},e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2},(0,E.wZ)({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0})),(0,z.w)(e)),{resetStyle:!1});let Z=e=>{var t;let{menu:n,arrow:r,prefixCls:b,children:C,trigger:O,disabled:B,dropdownRender:k,popupRender:j,getPopupContainer:E,overlayClassName:z,rootClassName:N,overlayStyle:H,open:T,onOpenChange:P,visible:Z,onVisibleChange:M,mouseEnterDelay:D=.15,mouseLeaveDelay:A=.1,autoAdjustOverflow:W=!0,placement:L="",overlay:G,transitionName:X,destroyOnHidden:_,destroyPopupOnHide:q}=e,{getPopupContainer:F,getPrefixCls:Y,direction:V,dropdown:$}=o.useContext(y.E_),J=j||k;(0,v.ln)("Dropdown");let Q=o.useMemo(()=>{let e=Y();return void 0!==X?X:L.includes("top")?"".concat(e,"-slide-down"):"".concat(e,"-slide-up")},[Y,L,X]),U=o.useMemo(()=>L?L.includes("Center")?L.slice(0,L.indexOf("Center")):L:"rtl"===V?"bottomRight":"bottomLeft",[L,V]),K=Y("dropdown",b),ee=(0,I.Z)(K),[et,en,eo]=R(K,ee),[,ea]=(0,S.ZP)(),ec=o.Children.only(p(C)?o.createElement("span",null,C):C),er=(0,f.Tm)(ec,{className:l()("".concat(K,"-trigger"),{["".concat(K,"-rtl")]:"rtl"===V},ec.props.className),disabled:null!==(t=ec.props.disabled)&&void 0!==t?t:B}),el=B?[]:O,ei=!!(null==el?void 0:el.includes("contextMenu")),[ed,es]=(0,s.Z)(!1,{value:null!=T?T:Z}),eu=(0,d.Z)(e=>{null==P||P(e,{source:"trigger"}),null==M||M(e),es(e)}),em=l()(z,N,en,eo,ee,null==$?void 0:$.className,{["".concat(K,"-rtl")]:"rtl"===V}),ep=(0,g.Z)({arrowPointAtCenter:"object"==typeof r&&r.pointAtCenter,autoAdjustOverflow:W,offset:ea.marginXXS,arrowWidth:r?ea.sizePopupArrow:0,borderRadius:ea.borderRadius}),eg=(0,d.Z)(()=>{null!=n&&n.selectable&&null!=n&&n.multiple||(null==P||P(!1,{source:"menu"}),es(!1))}),[eb,ef]=(0,m.Cn)("Dropdown",null==H?void 0:H.zIndex),ev=o.createElement(i.Z,Object.assign({alignPoint:ei},(0,u.Z)(e,["rootClassName"]),{mouseEnterDelay:D,mouseLeaveDelay:A,visible:ed,builtinPlacements:ep,arrow:!!r,overlayClassName:em,prefixCls:K,getPopupContainer:E||F,transitionName:Q,trigger:el,overlay:()=>{let e;return e=(null==n?void 0:n.items)?o.createElement(x.Z,Object.assign({},n)):"function"==typeof G?G():G,J&&(e=J(e)),e=o.Children.only("string"==typeof e?o.createElement("span",null,e):e),o.createElement(w.J,{prefixCls:"".concat(K,"-menu"),rootClassName:l()(eo,ee),expandIcon:o.createElement("span",{className:"".concat(K,"-menu-submenu-arrow")},"rtl"===V?o.createElement(a.Z,{className:"".concat(K,"-menu-submenu-arrow-icon")}):o.createElement(c.Z,{className:"".concat(K,"-menu-submenu-arrow-icon")})),mode:"vertical",selectable:!1,onClick:eg,validator:e=>{let{mode:t}=e}},e)},placement:U,onVisibleChange:eu,overlayStyle:Object.assign(Object.assign(Object.assign({},null==$?void 0:$.style),H),{zIndex:eb}),autoDestroy:null!=_?_:q}),er);return eb&&(ev=o.createElement(h.Z.Provider,{value:ef},ev)),et(ev)},M=(0,b.Z)(Z,"align",void 0,"dropdown",e=>e);Z._InternalPanelDoNotUseOrYouWillBeFired=e=>o.createElement(M,Object.assign({},e),o.createElement("span",null));var D=n(60440),A=n(5545),W=n(58760),L=n(77685),G=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let X=e=>{let{getPopupContainer:t,getPrefixCls:n,direction:a}=o.useContext(y.E_),{prefixCls:c,type:r="default",danger:i,disabled:d,loading:s,onClick:u,htmlType:m,children:p,className:g,menu:b,arrow:f,autoFocus:v,overlay:h,trigger:I,align:x,open:w,onOpenChange:S,placement:C,getPopupContainer:O,href:B,icon:k=o.createElement(D.Z,null),title:j,buttonsRender:E=e=>e,mouseEnterDelay:z,mouseLeaveDelay:N,overlayClassName:H,overlayStyle:T,destroyOnHidden:P,destroyPopupOnHide:R,dropdownRender:M,popupRender:X}=e,_=G(e,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyOnHidden","destroyPopupOnHide","dropdownRender","popupRender"]),q=n("dropdown",c),F={menu:b,arrow:f,autoFocus:v,align:x,disabled:d,trigger:d?[]:I,onOpenChange:S,getPopupContainer:O||t,mouseEnterDelay:z,mouseLeaveDelay:N,overlayClassName:H,overlayStyle:T,destroyOnHidden:P,popupRender:X||M},{compactSize:Y,compactItemClassnames:V}=(0,L.ri)(q,a),$=l()("".concat(q,"-button"),V,g);"destroyPopupOnHide"in e&&(F.destroyPopupOnHide=R),"overlay"in e&&(F.overlay=h),"open"in e&&(F.open=w),"placement"in e?F.placement=C:F.placement="rtl"===a?"bottomLeft":"bottomRight";let[J,Q]=E([o.createElement(A.ZP,{type:r,danger:i,disabled:d,loading:s,onClick:u,htmlType:m,href:B,title:j},p),o.createElement(A.ZP,{type:r,danger:i,icon:k})]);return o.createElement(W.Z.Compact,Object.assign({className:$,size:Y,block:!0},_),J,o.createElement(Z,Object.assign({},F),Q))};X.__ANT_BUTTON=!0,Z.Button=X;var _=Z},32186:function(e,t,n){let o;n.d(t,{D:function(){return S},Z:function(){return O}});var a=n(2265),c=n(1119),r={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},l=n(55015),i=a.forwardRef(function(e,t){return a.createElement(l.Z,(0,c.Z)({},e,{ref:t,icon:r}))}),d=n(15327),s=n(77565),u=n(36760),m=n.n(u),p=n(18694),g=n(16774),b=n(71744),f=n(80856),v=n(93463),h=n(25437),y=(0,n(99320).I$)(["Layout","Sider"],e=>{let{componentCls:t,siderBg:n,motionDurationMid:o,motionDurationSlow:a,antCls:c,triggerHeight:r,triggerColor:l,triggerBg:i,headerHeight:d,zeroTriggerWidth:s,zeroTriggerHeight:u,borderRadiusLG:m,lightSiderBg:p,lightTriggerColor:g,lightTriggerBg:b,bodyBg:f}=e;return{[t]:{position:"relative",minWidth:0,background:n,transition:"all ".concat(o,", background 0s"),"&-has-trigger":{paddingBottom:r},"&-right":{order:1},["".concat(t,"-children")]:{height:"100%",marginTop:-.1,paddingTop:.1,["".concat(c,"-menu").concat(c,"-menu-inline-collapsed")]:{width:"auto"}},["&-zero-width ".concat(t,"-children")]:{overflow:"hidden"},["".concat(t,"-trigger")]:{position:"fixed",bottom:0,zIndex:1,height:r,color:l,lineHeight:(0,v.bf)(r),textAlign:"center",background:i,cursor:"pointer",transition:"all ".concat(o)},["".concat(t,"-zero-width-trigger")]:{position:"absolute",top:d,insetInlineEnd:e.calc(s).mul(-1).equal(),zIndex:1,width:s,height:u,color:l,fontSize:e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:n,borderRadius:"0 ".concat((0,v.bf)(m)," ").concat((0,v.bf)(m)," 0"),cursor:"pointer",transition:"background ".concat(a," ease"),"&::after":{position:"absolute",inset:0,background:"transparent",transition:"all ".concat(a),content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:e.calc(s).mul(-1).equal(),borderRadius:"".concat((0,v.bf)(m)," 0 0 ").concat((0,v.bf)(m))}},"&-light":{background:p,["".concat(t,"-trigger")]:{color:g,background:b},["".concat(t,"-zero-width-trigger")]:{color:g,background:b,border:"1px solid ".concat(f),borderInlineStart:0}}}}},h.eh,{deprecatedTokens:h.jn}),I=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let x={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},w=e=>!Number.isNaN(Number.parseFloat(e))&&Number.isFinite(Number(e)),S=a.createContext({}),C=(o=0,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return o+=1,"".concat(e).concat(o)});var O=a.forwardRef((e,t)=>{let{prefixCls:n,className:o,trigger:c,children:r,defaultCollapsed:l=!1,theme:u="dark",style:v={},collapsible:h=!1,reverseArrow:O=!1,width:B=200,collapsedWidth:k=80,zeroWidthTriggerStyle:j,breakpoint:E,onCollapse:z,onBreakpoint:N}=e,H=I(e,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:T}=(0,a.useContext)(f.V),[P,R]=(0,a.useState)("collapsed"in e?e.collapsed:l),[Z,M]=(0,a.useState)(!1);(0,a.useEffect)(()=>{"collapsed"in e&&R(e.collapsed)},[e.collapsed]);let D=(t,n)=>{"collapsed"in e||R(t),null==z||z(t,n)},{getPrefixCls:A,direction:W}=(0,a.useContext)(b.E_),L=A("layout-sider",n),[G,X,_]=y(L),q=(0,a.useRef)(null);q.current=e=>{M(e.matches),null==N||N(e.matches),P!==e.matches&&D(e.matches,"responsive")},(0,a.useEffect)(()=>{let e;function t(e){var t;return null===(t=q.current)||void 0===t?void 0:t.call(q,e)}return void 0!==(null==window?void 0:window.matchMedia)&&E&&E in x&&(e=window.matchMedia("screen and (max-width: ".concat(x[E],")")),(0,g.x)(e,t),t(e)),()=>{(0,g.h)(e,t)}},[E]),(0,a.useEffect)(()=>{let e=C("ant-sider-");return T.addSider(e),()=>T.removeSider(e)},[]);let F=()=>{D(!P,"clickTrigger")},Y=(0,p.Z)(H,["collapsed"]),V=P?k:B,$=w(V)?"".concat(V,"px"):String(V),J=0===Number.parseFloat(String(k||0))?a.createElement("span",{onClick:F,className:m()("".concat(L,"-zero-width-trigger"),"".concat(L,"-zero-width-trigger-").concat(O?"right":"left")),style:j},c||a.createElement(i,null)):null,Q="rtl"===W==!O,U={expanded:Q?a.createElement(s.Z,null):a.createElement(d.Z,null),collapsed:Q?a.createElement(d.Z,null):a.createElement(s.Z,null)}[P?"collapsed":"expanded"],K=null!==c?J||a.createElement("div",{className:"".concat(L,"-trigger"),onClick:F,style:{width:$}},c||U):null,ee=Object.assign(Object.assign({},v),{flex:"0 0 ".concat($),maxWidth:$,minWidth:$,width:$}),et=m()(L,"".concat(L,"-").concat(u),{["".concat(L,"-collapsed")]:!!P,["".concat(L,"-has-trigger")]:h&&null!==c&&!J,["".concat(L,"-below")]:!!Z,["".concat(L,"-zero-width")]:0===Number.parseFloat($)},o,X,_),en=a.useMemo(()=>({siderCollapsed:P}),[P]);return G(a.createElement(S.Provider,{value:en},a.createElement("aside",Object.assign({className:et},Y,{style:ee,ref:t}),a.createElement("div",{className:"".concat(L,"-children")},r),h||Z&&J?K:null)))})},80856:function(e,t,n){n.d(t,{V:function(){return o}});let o=n(2265).createContext({siderHook:{addSider:()=>null,removeSider:()=>null}})},25437:function(e,t,n){n.d(t,{eh:function(){return c},jn:function(){return r}});var o=n(93463),a=n(99320);let c=e=>{let{colorBgLayout:t,controlHeight:n,controlHeightLG:o,colorText:a,controlHeightSM:c,marginXXS:r,colorTextLightSolid:l,colorBgContainer:i}=e,d=1.25*o;return{colorBgHeader:"#001529",colorBgBody:t,colorBgTrigger:"#002140",bodyBg:t,headerBg:"#001529",headerHeight:2*n,headerPadding:"0 ".concat(d,"px"),headerColor:a,footerPadding:"".concat(c,"px ").concat(d,"px"),footerBg:t,siderBg:"#001529",triggerHeight:o+2*r,triggerBg:"#002140",triggerColor:l,zeroTriggerWidth:o,zeroTriggerHeight:o,lightSiderBg:i,lightTriggerBg:i,lightTriggerColor:a}},r=[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]];t.ZP=(0,a.I$)("Layout",e=>{let{antCls:t,componentCls:n,colorText:a,footerBg:c,headerHeight:r,headerPadding:l,headerColor:i,footerPadding:d,fontSize:s,bodyBg:u,headerBg:m}=e;return{[n]:{display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:u,"&, *":{boxSizing:"border-box"},["&".concat(n,"-has-sider")]:{flexDirection:"row",["> ".concat(n,", > ").concat(n,"-content")]:{width:0}},["".concat(n,"-header, &").concat(n,"-footer")]:{flex:"0 0 auto"},"&-rtl":{direction:"rtl"}},["".concat(n,"-header")]:{height:r,padding:l,color:i,lineHeight:(0,o.bf)(r),background:m,["".concat(t,"-menu")]:{lineHeight:"inherit"}},["".concat(n,"-footer")]:{padding:d,color:a,fontSize:s,background:c},["".concat(n,"-content")]:{flex:"auto",color:a,minHeight:0}}},c,{deprecatedTokens:r})},88208:function(e,t,n){n.d(t,{J:function(){return i}});var o=n(2265),a=n(28791),c=n(391),r=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let l=o.createContext(null),i=o.forwardRef((e,t)=>{let{children:n}=e,i=r(e,["children"]),d=o.useContext(l),s=o.useMemo(()=>Object.assign(Object.assign({},d),i),[d,i.prefixCls,i.mode,i.selectable,i.rootClassName]),u=(0,a.t4)(n),m=(0,a.x1)(t,u?(0,a.C4)(n):null);return o.createElement(l.Provider,{value:s},o.createElement(c.Z,{space:!0},u?o.cloneElement(n,{ref:m}):n))});t.Z=l},60985:function(e,t,n){n.d(t,{Z:function(){return Y}});var o=n(2265),a=n(33082),c=n(32186),r=n(60440),l=n(36760),i=n.n(l),d=n(58525),s=n(18694),u=n(68710),m=n(19722),p=n(71744),g=n(64024);let b=(0,o.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var f=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n},v=e=>{let{prefixCls:t,className:n,dashed:c}=e,r=f(e,["prefixCls","className","dashed"]),{getPrefixCls:l}=o.useContext(p.E_),d=l("menu",t),s=i()({["".concat(d,"-item-divider-dashed")]:!!c},n);return o.createElement(a.iz,Object.assign({className:s},r))},h=n(45287),y=n(99981),I=e=>{var t;let{className:n,children:r,icon:l,title:d,danger:u,extra:p}=e,{prefixCls:g,firstLevel:f,direction:v,disableMenuItemTitleTooltip:I,inlineCollapsed:x}=o.useContext(b),{siderCollapsed:w}=o.useContext(c.D),S=d;void 0===d?S=f?r:"":!1===d&&(S="");let C={title:S};w||x||(C.title=null,C.open=!1);let O=(0,h.Z)(r).length,B=o.createElement(a.ck,Object.assign({},(0,s.Z)(e,["title","icon","danger"]),{className:i()({["".concat(g,"-item-danger")]:u,["".concat(g,"-item-only-child")]:(l?O+1:O)===1},n),title:"string"==typeof d?d:void 0}),(0,m.Tm)(l,{className:i()(o.isValidElement(l)?null===(t=l.props)||void 0===t?void 0:t.className:void 0,"".concat(g,"-item-icon"))}),(e=>{let t=null==r?void 0:r[0],n=o.createElement("span",{className:i()("".concat(g,"-title-content"),{["".concat(g,"-title-content-with-extra")]:!!p||0===p})},r);return(!l||o.isValidElement(r)&&"span"===r.type)&&r&&e&&f&&"string"==typeof t?o.createElement("div",{className:"".concat(g,"-inline-collapsed-noicon")},t.charAt(0)):n})(x));return I||(B=o.createElement(y.Z,Object.assign({},C,{placement:"rtl"===v?"left":"right",classNames:{root:"".concat(g,"-inline-collapsed-tooltip")}}),B)),B},x=n(88208),w=n(93463),S=n(54558),C=n(12918),O=n(63074),B=n(18544),k=n(691),j=n(99320),E=n(71140),z=e=>{let{componentCls:t,motionDurationSlow:n,horizontalLineHeight:o,colorSplit:a,lineWidth:c,lineType:r,itemPaddingInline:l}=e;return{["".concat(t,"-horizontal")]:{lineHeight:o,border:0,borderBottom:"".concat((0,w.bf)(c)," ").concat(r," ").concat(a),boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},["".concat(t,"-item, ").concat(t,"-submenu")]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:l},["> ".concat(t,"-item:hover,\n > ").concat(t,"-item-active,\n > ").concat(t,"-submenu ").concat(t,"-submenu-title:hover")]:{backgroundColor:"transparent"},["".concat(t,"-item, ").concat(t,"-submenu-title")]:{transition:["border-color ".concat(n),"background ".concat(n)].join(",")},["".concat(t,"-submenu-arrow")]:{display:"none"}}}},N=e=>{let{componentCls:t,menuArrowOffset:n,calc:o}=e;return{["".concat(t,"-rtl")]:{direction:"rtl"},["".concat(t,"-submenu-rtl")]:{transformOrigin:"100% 0"},["".concat(t,"-rtl").concat(t,"-vertical,\n ").concat(t,"-submenu-rtl ").concat(t,"-vertical")]:{["".concat(t,"-submenu-arrow")]:{"&::before":{transform:"rotate(-45deg) translateY(".concat((0,w.bf)(o(n).mul(-1).equal()),")")},"&::after":{transform:"rotate(45deg) translateY(".concat((0,w.bf)(n),")")}}}}};let H=e=>(0,C.oN)(e);var T=(e,t)=>{let{componentCls:n,itemColor:o,itemSelectedColor:a,subMenuItemSelectedColor:c,groupTitleColor:r,itemBg:l,subMenuItemBg:i,itemSelectedBg:d,activeBarHeight:s,activeBarWidth:u,activeBarBorderWidth:m,motionDurationSlow:p,motionEaseInOut:g,motionEaseOut:b,itemPaddingInline:f,motionDurationMid:v,itemHoverColor:h,lineType:y,colorSplit:I,itemDisabledColor:x,dangerItemColor:S,dangerItemHoverColor:C,dangerItemSelectedColor:O,dangerItemActiveBg:B,dangerItemSelectedBg:k,popupBg:j,itemHoverBg:E,itemActiveBg:z,menuSubMenuBg:N,horizontalItemSelectedColor:T,horizontalItemSelectedBg:P,horizontalItemBorderRadius:R,horizontalItemHoverBg:Z}=e;return{["".concat(n,"-").concat(t,", ").concat(n,"-").concat(t," > ").concat(n)]:{color:o,background:l,["&".concat(n,"-root:focus-visible")]:Object.assign({},H(e)),["".concat(n,"-item")]:{"&-group-title, &-extra":{color:r}},["".concat(n,"-submenu-selected > ").concat(n,"-submenu-title")]:{color:c},["".concat(n,"-item, ").concat(n,"-submenu-title")]:{color:o,["&:not(".concat(n,"-item-disabled):focus-visible")]:Object.assign({},H(e))},["".concat(n,"-item-disabled, ").concat(n,"-submenu-disabled")]:{color:"".concat(x," !important")},["".concat(n,"-item:not(").concat(n,"-item-selected):not(").concat(n,"-submenu-selected)")]:{["&:hover, > ".concat(n,"-submenu-title:hover")]:{color:h}},["&:not(".concat(n,"-horizontal)")]:{["".concat(n,"-item:not(").concat(n,"-item-selected)")]:{"&:hover":{backgroundColor:E},"&:active":{backgroundColor:z}},["".concat(n,"-submenu-title")]:{"&:hover":{backgroundColor:E},"&:active":{backgroundColor:z}}},["".concat(n,"-item-danger")]:{color:S,["&".concat(n,"-item:hover")]:{["&:not(".concat(n,"-item-selected):not(").concat(n,"-submenu-selected)")]:{color:C}},["&".concat(n,"-item:active")]:{background:B}},["".concat(n,"-item a")]:{"&, &:hover":{color:"inherit"}},["".concat(n,"-item-selected")]:{color:a,["&".concat(n,"-item-danger")]:{color:O},"a, a:hover":{color:"inherit"}},["& ".concat(n,"-item-selected")]:{backgroundColor:d,["&".concat(n,"-item-danger")]:{backgroundColor:k}},["&".concat(n,"-submenu > ").concat(n)]:{backgroundColor:N},["&".concat(n,"-popup > ").concat(n)]:{backgroundColor:j},["&".concat(n,"-submenu-popup > ").concat(n)]:{backgroundColor:j},["&".concat(n,"-horizontal")]:Object.assign(Object.assign({},"dark"===t?{borderBottom:0}:{}),{["> ".concat(n,"-item, > ").concat(n,"-submenu")]:{top:m,marginTop:e.calc(m).mul(-1).equal(),marginBottom:0,borderRadius:R,"&::after":{position:"absolute",insetInline:f,bottom:0,borderBottom:"".concat((0,w.bf)(s)," solid transparent"),transition:"border-color ".concat(p," ").concat(g),content:'""'},"&:hover, &-active, &-open":{background:Z,"&::after":{borderBottomWidth:s,borderBottomColor:T}},"&-selected":{color:T,backgroundColor:P,"&:hover":{backgroundColor:P},"&::after":{borderBottomWidth:s,borderBottomColor:T}}}}),["&".concat(n,"-root")]:{["&".concat(n,"-inline, &").concat(n,"-vertical")]:{borderInlineEnd:"".concat((0,w.bf)(m)," ").concat(y," ").concat(I)}},["&".concat(n,"-inline")]:{["".concat(n,"-sub").concat(n,"-inline")]:{background:i},["".concat(n,"-item")]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:"".concat((0,w.bf)(u)," solid ").concat(a),transform:"scaleY(0.0001)",opacity:0,transition:["transform ".concat(v," ").concat(b),"opacity ".concat(v," ").concat(b)].join(","),content:'""'},["&".concat(n,"-item-danger")]:{"&::after":{borderInlineEndColor:O}}},["".concat(n,"-selected, ").concat(n,"-item-selected")]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:["transform ".concat(v," ").concat(g),"opacity ".concat(v," ").concat(g)].join(",")}}}}}};let P=e=>{let{componentCls:t,itemHeight:n,itemMarginInline:o,padding:a,menuArrowSize:c,marginXS:r,itemMarginBlock:l,itemWidth:i,itemPaddingInline:d}=e,s=e.calc(c).add(a).add(r).equal();return{["".concat(t,"-item")]:{position:"relative",overflow:"hidden"},["".concat(t,"-item, ").concat(t,"-submenu-title")]:{height:n,lineHeight:(0,w.bf)(n),paddingInline:d,overflow:"hidden",textOverflow:"ellipsis",marginInline:o,marginBlock:l,width:i},["> ".concat(t,"-item,\n > ").concat(t,"-submenu > ").concat(t,"-submenu-title")]:{height:n,lineHeight:(0,w.bf)(n)},["".concat(t,"-item-group-list ").concat(t,"-submenu-title,\n ").concat(t,"-submenu-title")]:{paddingInlineEnd:s}}};var R=e=>{let{componentCls:t,iconCls:n,itemHeight:o,colorTextLightSolid:a,dropdownWidth:c,controlHeightLG:r,motionEaseOut:l,paddingXL:i,itemMarginInline:d,fontSizeLG:s,motionDurationFast:u,motionDurationSlow:m,paddingXS:p,boxShadowSecondary:g,collapsedWidth:b,collapsedIconSize:f}=e,v={height:o,lineHeight:(0,w.bf)(o),listStylePosition:"inside",listStyleType:"disc"};return[{[t]:{"&-inline, &-vertical":Object.assign({["&".concat(t,"-root")]:{boxShadow:"none"}},P(e))},["".concat(t,"-submenu-popup")]:{["".concat(t,"-vertical")]:Object.assign(Object.assign({},P(e)),{boxShadow:g})}},{["".concat(t,"-submenu-popup ").concat(t,"-vertical").concat(t,"-sub")]:{minWidth:c,maxHeight:"calc(100vh - ".concat((0,w.bf)(e.calc(r).mul(2.5).equal()),")"),padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{["".concat(t,"-inline")]:{width:"100%",["&".concat(t,"-root")]:{["".concat(t,"-item, ").concat(t,"-submenu-title")]:{display:"flex",alignItems:"center",transition:["border-color ".concat(m),"background ".concat(m),"padding ".concat(u," ").concat(l)].join(","),["> ".concat(t,"-title-content")]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},["".concat(t,"-sub").concat(t,"-inline")]:{padding:0,border:0,borderRadius:0,boxShadow:"none",["& > ".concat(t,"-submenu > ").concat(t,"-submenu-title")]:v,["& ".concat(t,"-item-group-title")]:{paddingInlineStart:i}},["".concat(t,"-item")]:v}},{["".concat(t,"-inline-collapsed")]:{width:b,["&".concat(t,"-root")]:{["".concat(t,"-item, ").concat(t,"-submenu ").concat(t,"-submenu-title")]:{["> ".concat(t,"-inline-collapsed-noicon")]:{fontSize:s,textAlign:"center"}}},["> ".concat(t,"-item,\n > ").concat(t,"-item-group > ").concat(t,"-item-group-list > ").concat(t,"-item,\n > ").concat(t,"-item-group > ").concat(t,"-item-group-list > ").concat(t,"-submenu > ").concat(t,"-submenu-title,\n > ").concat(t,"-submenu > ").concat(t,"-submenu-title")]:{insetInlineStart:0,paddingInline:"calc(50% - ".concat((0,w.bf)(e.calc(f).div(2).equal())," - ").concat((0,w.bf)(d),")"),textOverflow:"clip",["\n ".concat(t,"-submenu-arrow,\n ").concat(t,"-submenu-expand-icon\n ")]:{opacity:0},["".concat(t,"-item-icon, ").concat(n)]:{margin:0,fontSize:f,lineHeight:(0,w.bf)(o),"+ span":{display:"inline-block",opacity:0}}},["".concat(t,"-item-icon, ").concat(n)]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",["".concat(t,"-item-icon, ").concat(n)]:{display:"none"},"a, a:hover":{color:a}},["".concat(t,"-item-group-title")]:Object.assign(Object.assign({},C.vS),{paddingInline:p})}}]};let Z=e=>{let{componentCls:t,motionDurationSlow:n,motionDurationMid:o,motionEaseInOut:a,motionEaseOut:c,iconCls:r,iconSize:l,iconMarginInlineEnd:i}=e;return{["".concat(t,"-item, ").concat(t,"-submenu-title")]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:["border-color ".concat(n),"background ".concat(n),"padding calc(".concat(n," + 0.1s) ").concat(a)].join(","),["".concat(t,"-item-icon, ").concat(r)]:{minWidth:l,fontSize:l,transition:["font-size ".concat(o," ").concat(c),"margin ".concat(n," ").concat(a),"color ".concat(n)].join(","),"+ span":{marginInlineStart:i,opacity:1,transition:["opacity ".concat(n," ").concat(a),"margin ".concat(n),"color ".concat(n)].join(",")}},["".concat(t,"-item-icon")]:Object.assign({},(0,C.Ro)()),["&".concat(t,"-item-only-child")]:{["> ".concat(r,", > ").concat(t,"-item-icon")]:{marginInlineEnd:0}}},["".concat(t,"-item-disabled, ").concat(t,"-submenu-disabled")]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important",cursor:"not-allowed",pointerEvents:"none"},["> ".concat(t,"-submenu-title")]:{color:"inherit !important",cursor:"not-allowed"}}}},M=e=>{let{componentCls:t,motionDurationSlow:n,motionEaseInOut:o,borderRadius:a,menuArrowSize:c,menuArrowOffset:r}=e;return{["".concat(t,"-submenu")]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:e.margin,width:c,color:"currentcolor",transform:"translateY(-50%)",transition:"transform ".concat(n," ").concat(o,", opacity ").concat(n)},"&-arrow":{"&::before, &::after":{position:"absolute",width:e.calc(c).mul(.6).equal(),height:e.calc(c).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:a,transition:["background ".concat(n," ").concat(o),"transform ".concat(n," ").concat(o),"top ".concat(n," ").concat(o),"color ".concat(n," ").concat(o)].join(","),content:'""'},"&::before":{transform:"rotate(45deg) translateY(".concat((0,w.bf)(e.calc(r).mul(-1).equal()),")")},"&::after":{transform:"rotate(-45deg) translateY(".concat((0,w.bf)(r),")")}}}}},D=e=>{let{antCls:t,componentCls:n,fontSize:o,motionDurationSlow:a,motionDurationMid:c,motionEaseInOut:r,paddingXS:l,padding:i,colorSplit:d,lineWidth:s,zIndexPopup:u,borderRadiusLG:m,subMenuItemBorderRadius:p,menuArrowSize:g,menuArrowOffset:b,lineType:f,groupTitleLineHeight:v,groupTitleFontSize:h}=e;return[{"":{[n]:Object.assign(Object.assign({},(0,C.dF)()),{"&-hidden":{display:"none"}})},["".concat(n,"-submenu-hidden")]:{display:"none"}},{[n]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,C.Wf)(e)),(0,C.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:o,lineHeight:0,listStyle:"none",outline:"none",transition:"width ".concat(a," cubic-bezier(0.2, 0, 0, 1) 0s"),"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",["".concat(n,"-item")]:{flex:"none"}},["".concat(n,"-item, ").concat(n,"-submenu, ").concat(n,"-submenu-title")]:{borderRadius:e.itemBorderRadius},["".concat(n,"-item-group-title")]:{padding:"".concat((0,w.bf)(l)," ").concat((0,w.bf)(i)),fontSize:h,lineHeight:v,transition:"all ".concat(a)},["&-horizontal ".concat(n,"-submenu")]:{transition:["border-color ".concat(a," ").concat(r),"background ".concat(a," ").concat(r)].join(",")},["".concat(n,"-submenu, ").concat(n,"-submenu-inline")]:{transition:["border-color ".concat(a," ").concat(r),"background ".concat(a," ").concat(r),"padding ".concat(c," ").concat(r)].join(",")},["".concat(n,"-submenu ").concat(n,"-sub")]:{cursor:"initial",transition:["background ".concat(a," ").concat(r),"padding ".concat(a," ").concat(r)].join(",")},["".concat(n,"-title-content")]:{transition:"color ".concat(a),"&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},["> ".concat(t,"-typography-ellipsis-single-line")]:{display:"inline",verticalAlign:"unset"},["".concat(n,"-item-extra")]:{marginInlineStart:"auto",paddingInlineStart:e.padding}},["".concat(n,"-item a")]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},["".concat(n,"-item-divider")]:{overflow:"hidden",lineHeight:0,borderColor:d,borderStyle:f,borderWidth:0,borderTopWidth:s,marginBlock:s,padding:0,"&-dashed":{borderStyle:"dashed"}}}),Z(e)),{["".concat(n,"-item-group")]:{["".concat(n,"-item-group-list")]:{margin:0,padding:0,["".concat(n,"-item, ").concat(n,"-submenu-title")]:{paddingInline:"".concat((0,w.bf)(e.calc(o).mul(2).equal())," ").concat((0,w.bf)(i))}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:u,borderRadius:m,boxShadow:"none",transformOrigin:"0 0",["&".concat(n,"-submenu")]:{background:"transparent"},"&::before":{position:"absolute",inset:0,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'},["> ".concat(n)]:Object.assign(Object.assign(Object.assign({borderRadius:m},Z(e)),M(e)),{["".concat(n,"-item, ").concat(n,"-submenu > ").concat(n,"-submenu-title")]:{borderRadius:p},["".concat(n,"-submenu-title::after")]:{transition:"transform ".concat(a," ").concat(r)}})},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:e.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:e.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:e.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:e.paddingXS}}}),M(e)),{["&-inline-collapsed ".concat(n,"-submenu-arrow,\n &-inline ").concat(n,"-submenu-arrow")]:{"&::before":{transform:"rotate(-45deg) translateX(".concat((0,w.bf)(b),")")},"&::after":{transform:"rotate(45deg) translateX(".concat((0,w.bf)(e.calc(b).mul(-1).equal()),")")}},["".concat(n,"-submenu-open").concat(n,"-submenu-inline > ").concat(n,"-submenu-title > ").concat(n,"-submenu-arrow")]:{transform:"translateY(".concat((0,w.bf)(e.calc(g).mul(.2).mul(-1).equal()),")"),"&::after":{transform:"rotate(-45deg) translateX(".concat((0,w.bf)(e.calc(b).mul(-1).equal()),")")},"&::before":{transform:"rotate(45deg) translateX(".concat((0,w.bf)(b),")")}}})},{["".concat(t,"-layout-header")]:{[n]:{lineHeight:"inherit"}}}]},A=e=>{var t,n,o;let{colorPrimary:a,colorError:c,colorTextDisabled:r,colorErrorBg:l,colorText:i,colorTextDescription:d,colorBgContainer:s,colorFillAlter:u,colorFillContent:m,lineWidth:p,lineWidthBold:g,controlItemBgActive:b,colorBgTextHover:f,controlHeightLG:v,lineHeight:h,colorBgElevated:y,marginXXS:I,padding:x,fontSize:w,controlHeightSM:C,fontSizeLG:O,colorTextLightSolid:B,colorErrorHover:k}=e,j=null!==(t=e.activeBarWidth)&&void 0!==t?t:0,E=null!==(n=e.activeBarBorderWidth)&&void 0!==n?n:p,z=null!==(o=e.itemMarginInline)&&void 0!==o?o:e.marginXXS,N=new S.t(B).setA(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,itemBorderRadius:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,subMenuItemBorderRadius:e.borderRadiusSM,colorItemText:i,itemColor:i,colorItemTextHover:i,itemHoverColor:i,colorItemTextHoverHorizontal:a,horizontalItemHoverColor:a,colorGroupTitle:d,groupTitleColor:d,colorItemTextSelected:a,itemSelectedColor:a,subMenuItemSelectedColor:a,colorItemTextSelectedHorizontal:a,horizontalItemSelectedColor:a,colorItemBg:s,itemBg:s,colorItemBgHover:f,itemHoverBg:f,colorItemBgActive:m,itemActiveBg:b,colorSubItemBg:u,subMenuItemBg:u,colorItemBgSelected:b,itemSelectedBg:b,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:j,colorActiveBarHeight:g,activeBarHeight:g,colorActiveBarBorderSize:p,activeBarBorderWidth:E,colorItemTextDisabled:r,itemDisabledColor:r,colorDangerItemText:c,dangerItemColor:c,colorDangerItemTextHover:c,dangerItemHoverColor:c,colorDangerItemTextSelected:c,dangerItemSelectedColor:c,colorDangerItemBgActive:l,dangerItemActiveBg:l,colorDangerItemBgSelected:l,dangerItemSelectedBg:l,itemMarginInline:z,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:v,groupTitleLineHeight:h,collapsedWidth:2*v,popupBg:y,itemMarginBlock:I,itemPaddingInline:x,horizontalLineHeight:"".concat(1.15*v,"px"),iconSize:w,iconMarginInlineEnd:C-w,collapsedIconSize:O,groupTitleFontSize:w,darkItemDisabledColor:new S.t(B).setA(.25).toRgbString(),darkItemColor:N,darkDangerItemColor:c,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:B,darkItemSelectedBg:a,darkDangerItemSelectedBg:c,darkItemHoverBg:"transparent",darkGroupTitleColor:N,darkItemHoverColor:B,darkDangerItemHoverColor:k,darkDangerItemSelectedColor:B,darkDangerItemActiveBg:c,itemWidth:j?"calc(100% + ".concat(E,"px)"):"calc(100% - ".concat(2*z,"px)")}};var W=n(62236),L=e=>{var t;let n;let{popupClassName:c,icon:r,title:l,theme:d}=e,u=o.useContext(b),{prefixCls:p,inlineCollapsed:g,theme:f}=u,v=(0,a.Xl)();if(r){let e=o.isValidElement(l)&&"span"===l.type;n=o.createElement(o.Fragment,null,(0,m.Tm)(r,{className:i()(o.isValidElement(r)?null===(t=r.props)||void 0===t?void 0:t.className:void 0,"".concat(p,"-item-icon"))}),e?l:o.createElement("span",{className:"".concat(p,"-title-content")},l))}else n=g&&!v.length&&l&&"string"==typeof l?o.createElement("div",{className:"".concat(p,"-inline-collapsed-noicon")},l.charAt(0)):o.createElement("span",{className:"".concat(p,"-title-content")},l);let h=o.useMemo(()=>Object.assign(Object.assign({},u),{firstLevel:!1}),[u]),[y]=(0,W.Cn)("Menu");return o.createElement(b.Provider,{value:h},o.createElement(a.Wd,Object.assign({},(0,s.Z)(e,["icon"]),{title:n,popupClassName:i()(p,c,"".concat(p,"-").concat(d||f)),popupStyle:Object.assign({zIndex:y},e.popupStyle)})))},G=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};function X(e){return null===e||!1===e}let _={item:I,submenu:L,divider:v},q=(0,o.forwardRef)((e,t)=>{var n;let c=o.useContext(x.Z),l=c||{},{getPrefixCls:f,getPopupContainer:v,direction:h,menu:y}=o.useContext(p.E_),I=f(),{prefixCls:w,className:S,style:C,theme:H="light",expandIcon:P,_internalDisableMenuItemTitleTooltip:Z,inlineCollapsed:M,siderCollapsed:W,rootClassName:L,mode:q,selectable:F,onClick:Y,overflowedIndicatorPopupClassName:V}=e,$=G(e,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),J=(0,s.Z)($,["collapsedWidth"]);null===(n=l.validator)||void 0===n||n.call(l,{mode:q});let Q=(0,d.Z)(function(){for(var e,t=arguments.length,n=Array(t),o=0;o1&&void 0!==arguments[1]?arguments[1]:e,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return(0,j.I$)("Menu",e=>{let{colorBgElevated:t,controlHeightLG:n,fontSize:o,darkItemColor:a,darkDangerItemColor:c,darkItemBg:r,darkSubMenuItemBg:l,darkItemSelectedColor:i,darkItemSelectedBg:d,darkDangerItemSelectedBg:s,darkItemHoverBg:u,darkGroupTitleColor:m,darkItemHoverColor:p,darkItemDisabledColor:g,darkDangerItemHoverColor:b,darkDangerItemSelectedColor:f,darkDangerItemActiveBg:v,popupBg:h,darkPopupBg:y}=e,I=e.calc(o).div(7).mul(5).equal(),x=(0,E.IX)(e,{menuArrowSize:I,menuHorizontalHeight:e.calc(n).mul(1.15).equal(),menuArrowOffset:e.calc(I).mul(.25).equal(),menuSubMenuBg:t,calc:e.calc,popupBg:h}),w=(0,E.IX)(x,{itemColor:a,itemHoverColor:p,groupTitleColor:m,itemSelectedColor:i,subMenuItemSelectedColor:i,itemBg:r,popupBg:y,subMenuItemBg:l,itemActiveBg:"transparent",itemSelectedBg:d,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:u,itemDisabledColor:g,dangerItemColor:c,dangerItemHoverColor:b,dangerItemSelectedColor:f,dangerItemActiveBg:v,dangerItemSelectedBg:s,menuSubMenuBg:l,horizontalItemSelectedColor:i,horizontalItemSelectedBg:d});return[D(x),z(x),R(x),T(x,"light"),T(w,"dark"),N(x),(0,O.Z)(x),(0,B.oN)(x,"slide-up"),(0,B.oN)(x,"slide-down"),(0,k._y)(x,"zoom-big")]},A,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:n,unitless:{groupTitleLineHeight:!0}})(e,t)}(en,eo,!c),el=i()("".concat(en,"-").concat(H),null==y?void 0:y.className,S),ei=o.useMemo(()=>{var e,t;if("function"==typeof P||X(P))return P||null;if("function"==typeof l.expandIcon||X(l.expandIcon))return l.expandIcon||null;if("function"==typeof(null==y?void 0:y.expandIcon)||X(null==y?void 0:y.expandIcon))return(null==y?void 0:y.expandIcon)||null;let n=null!==(e=null!=P?P:null==l?void 0:l.expandIcon)&&void 0!==e?e:null==y?void 0:y.expandIcon;return(0,m.Tm)(n,{className:i()("".concat(en,"-submenu-expand-icon"),o.isValidElement(n)?null===(t=n.props)||void 0===t?void 0:t.className:void 0)})},[P,null==l?void 0:l.expandIcon,null==y?void 0:y.expandIcon,en]),ed=o.useMemo(()=>({prefixCls:en,inlineCollapsed:ee||!1,direction:h,firstLevel:!0,theme:H,mode:U,disableMenuItemTitleTooltip:Z}),[en,ee,h,Z,H]);return ea(o.createElement(x.Z.Provider,{value:null},o.createElement(b.Provider,{value:ed},o.createElement(a.ZP,Object.assign({getPopupContainer:v,overflowedIndicator:o.createElement(r.Z,null),overflowedIndicatorPopupClassName:i()(en,"".concat(en,"-").concat(H),V),mode:U,selectable:K,onClick:Q},J,{inlineCollapsed:ee,style:Object.assign(Object.assign({},null==y?void 0:y.style),C),className:el,prefixCls:en,direction:h,defaultMotions:et,expandIcon:ei,ref:t,rootClassName:i()(L,ec,l.rootClassName,er,eo),_internalComponents:_})))))}),F=(0,o.forwardRef)((e,t)=>{let n=(0,o.useRef)(null),a=o.useContext(c.D);return(0,o.useImperativeHandle)(t,()=>({menu:n.current,focus:e=>{var t;null===(t=n.current)||void 0===t||t.focus(e)}})),o.createElement(q,Object.assign({ref:n},e,a))});F.Item=I,F.SubMenu=L,F.Divider=v,F.ItemGroup=a.BW;var Y=F},58760:function(e,t,n){n.d(t,{Z:function(){return B}});var o=n(2265),a=n(36760),c=n.n(a),r=n(45287);function l(e){return["small","middle","large"].includes(e)}function i(e){return!!e&&"number"==typeof e&&!Number.isNaN(e)}var d=n(71744),s=n(77685),u=n(17691),m=n(99320);let p=e=>{let{componentCls:t,borderRadius:n,paddingSM:o,colorBorder:a,paddingXS:c,fontSizeLG:r,fontSizeSM:l,borderRadiusLG:i,borderRadiusSM:d,colorBgContainerDisabled:s,lineWidth:m}=e;return{[t]:[{display:"inline-flex",alignItems:"center",gap:0,paddingInline:o,margin:0,background:s,borderWidth:m,borderStyle:"solid",borderColor:a,borderRadius:n,"&-large":{fontSize:r,borderRadius:i},"&-small":{paddingInline:c,borderRadius:d,fontSize:l},"&-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,u.c)(e,{focus:!1})]}};var g=(0,m.I$)(["Space","Addon"],e=>[p(e)]),b=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let f=o.forwardRef((e,t)=>{let{className:n,children:a,style:r,prefixCls:l}=e,i=b(e,["className","children","style","prefixCls"]),{getPrefixCls:u,direction:m}=o.useContext(d.E_),p=u("space-addon",l),[f,v,h]=g(p),{compactItemClassnames:y,compactSize:I}=(0,s.ri)(p,m),x=c()(p,v,y,h,{["".concat(p,"-").concat(I)]:I},n);return f(o.createElement("div",Object.assign({ref:t,className:x,style:r},i),a))}),v=o.createContext({latestIndex:0}),h=v.Provider;var y=e=>{let{className:t,index:n,children:a,split:c,style:r}=e,{latestIndex:l}=o.useContext(v);return null==a?null:o.createElement(o.Fragment,null,o.createElement("div",{className:t,style:r},a),n{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"}},["".concat(t,"-item:empty")]:{display:"none"},["".concat(t,"-item > ").concat(n,"-badge-not-a-wrapper:only-child")]:{display:"block"}}}},w=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}}}};var S=(0,m.I$)("Space",e=>{let t=(0,I.IX)(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[x(t),w(t)]},()=>({}),{resetStyle:!1}),C=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let O=o.forwardRef((e,t)=>{var n;let{getPrefixCls:a,direction:s,size:u,className:m,style:p,classNames:g,styles:b}=(0,d.dj)("space"),{size:f=null!=u?u:"small",align:v,className:I,rootClassName:x,children:w,direction:O="horizontal",prefixCls:B,split:k,style:j,wrap:E=!1,classNames:z,styles:N}=e,H=C(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[T,P]=Array.isArray(f)?f:[f,f],R=l(P),Z=l(T),M=i(P),D=i(T),A=(0,r.Z)(w,{keepEmpty:!0}),W=void 0===v&&"horizontal"===O?"center":v,L=a("space",B),[G,X,_]=S(L),q=c()(L,m,X,"".concat(L,"-").concat(O),{["".concat(L,"-rtl")]:"rtl"===s,["".concat(L,"-align-").concat(W)]:W,["".concat(L,"-gap-row-").concat(P)]:R,["".concat(L,"-gap-col-").concat(T)]:Z},I,x,_),F=c()("".concat(L,"-item"),null!==(n=null==z?void 0:z.item)&&void 0!==n?n:g.item),Y=Object.assign(Object.assign({},b.item),null==N?void 0:N.item),V=A.map((e,t)=>{let n=(null==e?void 0:e.key)||"".concat(F,"-").concat(t);return o.createElement(y,{className:F,key:n,index:t,split:k,style:Y},e)}),$=o.useMemo(()=>({latestIndex:A.reduce((e,t,n)=>null!=t?n:e,0)}),[A]);if(0===A.length)return null;let J={};return E&&(J.flexWrap="wrap"),!Z&&D&&(J.columnGap=T),!R&&M&&(J.rowGap=P),G(o.createElement("div",Object.assign({ref:t,className:q,style:Object.assign(Object.assign(Object.assign({},J),p),j)},H),o.createElement(h,{value:$},V)))});O.Compact=s.ZP,O.Addon=f;var B=O}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3801-3f7b66ca5919fd60.js b/litellm/proxy/_experimental/out/_next/static/chunks/3801-3f7b66ca5919fd60.js deleted file mode 100644 index 5e4ad1a6f89..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3801-3f7b66ca5919fd60.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3801],{12363:function(e,s,a){a.d(s,{d:function(){return r},n:function(){return l}});var t=a(2265);let l=()=>{let[e,s]=(0,t.useState)("http://localhost:4000");return(0,t.useEffect)(()=>{{let{protocol:e,host:a}=window.location;s("".concat(e,"//").concat(a))}},[]),e},r=25},30841:function(e,s,a){a.d(s,{IE:function(){return r},LO:function(){return l},cT:function(){return n}});var t=a(19250);let l=async e=>{if(!e)return[];try{let{aliases:s}=await (0,t.keyAliasesCall)(e);return Array.from(new Set((s||[]).filter(Boolean)))}catch(e){return console.error("Error fetching all key aliases:",e),[]}},r=async(e,s)=>{if(!e)return[];try{let a=[],l=1,r=!0;for(;r;){let n=await (0,t.teamListCall)(e,s||null,null);a=[...a,...n],l{if(!e)return[];try{let s=[],a=1,l=!0;for(;l;){let r=await (0,t.organizationListCall)(e);s=[...s,...r],a{let{options:s,onApplyFilters:a,onResetFilters:d,initialValues:m={},buttonLabel:u="Filters"}=e,[x,h]=(0,l.useState)(!1),[g,p]=(0,l.useState)(m),[f,j]=(0,l.useState)({}),[v,b]=(0,l.useState)({}),[y,N]=(0,l.useState)({}),[w,k]=(0,l.useState)({}),_=(0,l.useCallback)(c()(async(e,s)=>{if(s.isSearchable&&s.searchFn){b(e=>({...e,[s.name]:!0}));try{let a=await s.searchFn(e);j(e=>({...e,[s.name]:a}))}catch(e){console.error("Error searching:",e),j(e=>({...e,[s.name]:[]}))}finally{b(e=>({...e,[s.name]:!1}))}}},300),[]),S=(0,l.useCallback)(async e=>{if(e.isSearchable&&e.searchFn&&!w[e.name]){b(s=>({...s,[e.name]:!0})),k(s=>({...s,[e.name]:!0}));try{let s=await e.searchFn("");j(a=>({...a,[e.name]:s}))}catch(s){console.error("Error loading initial options:",s),j(s=>({...s,[e.name]:[]}))}finally{b(s=>({...s,[e.name]:!1}))}}},[w]);(0,l.useEffect)(()=>{x&&s.forEach(e=>{e.isSearchable&&!w[e.name]&&S(e)})},[x,s,S,w]);let C=(e,s)=>{let t={...g,[e]:s};p(t),a(t)},L=(e,s)=>{e&&s.isSearchable&&!w[s.name]&&S(s)};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)(r.ZP,{icon:(0,t.jsx)(o.Z,{className:"h-4 w-4"}),onClick:()=>h(!x),className:"flex items-center gap-2",children:u}),(0,t.jsx)(r.ZP,{onClick:()=>{let e={};s.forEach(s=>{e[s.name]=""}),p(e),d()},children:"Reset Filters"})]}),x&&(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","Key Hash","Model"].map(e=>{let a=s.find(s=>s.label===e||s.name===e);return a?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("label",{className:"text-sm text-gray-600",children:a.label||a.name}),a.isSearchable?(0,t.jsx)(n.default,{showSearch:!0,className:"w-full",placeholder:"Search ".concat(a.label||a.name,"..."),value:g[a.name]||void 0,onChange:e=>C(a.name,e),onDropdownVisibleChange:e=>L(e,a),onSearch:e=>{N(s=>({...s,[a.name]:e})),a.searchFn&&_(e,a)},filterOption:!1,loading:v[a.name],options:f[a.name]||[],allowClear:!0,notFoundContent:v[a.name]?"Loading...":"No results found"}):a.options?(0,t.jsx)(n.default,{className:"w-full",placeholder:"Select ".concat(a.label||a.name,"..."),value:g[a.name]||void 0,onChange:e=>C(a.name,e),allowClear:!0,children:a.options.map(e=>(0,t.jsx)(n.default.Option,{value:e.value,children:e.label},e.value))}):(0,t.jsx)(i.default,{className:"w-full",placeholder:"Enter ".concat(a.label||a.name,"..."),value:g[a.name]||"",onChange:e=>C(a.name,e.target.value),allowClear:!0})]},a.name):null})})]})}},33801:function(e,s,a){a.d(s,{I:function(){return eg},Z:function(){return eh}});var t=a(57437),l=a(77398),r=a.n(l),n=a(11713),i=a(2265),o=a(29827),d=a(19250),c=a(12322),m=a(42673),u=a(99981);let x=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"}},h=e=>{let{utcTime:s}=e;return(0,t.jsx)("span",{style:{fontFamily:"monospace",width:"180px",display:"inline-block"},children:x(s)})};var g=a(41649),p=a(78489),f=a(59872);let j=(e,s)=>{var a,t;return(null===(t=e.metadata)||void 0===t?void 0:null===(a=t.mcp_tool_call_metadata)||void 0===a?void 0:a.mcp_server_logo_url)?e.metadata.mcp_tool_call_metadata.mcp_server_logo_url:s?(0,m.dr)(s).logo:""},v=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,t.jsx)(()=>{let[e,a]=i.useState(s.getIsExpanded()),l=i.useCallback(()=>{a(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,t.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,t.jsx)("svg",{className:"w-4 h-4 transform transition-transform duration-75 ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,t.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Time",accessorKey:"startTime",cell:e=>(0,t.jsx)(h,{utcTime:e.getValue()})},{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 ".concat(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()||""),a=e.row.original.onSessionClick;return(0,t.jsx)(u.Z,{title:String(e.getValue()||""),children:(0,t.jsx)(p.Z,{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:()=>null==a?void 0:a(s),children:String(e.getValue()||"")})})}},{header:"Request ID",accessorKey:"request_id",cell:e=>(0,t.jsx)(u.Z,{title:String(e.getValue()||""),children:(0,t.jsx)("span",{className:"font-mono text-xs max-w-[15ch] truncate block",children:String(e.getValue()||"")})})},{header:"Cost",accessorKey:"spend",cell:e=>(0,t.jsxs)("span",{children:["$",(0,f.pw)(e.getValue()||0,6)]})},{header:"Duration (s)",accessorKey:"duration",cell:e=>(0,t.jsx)(u.Z,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Team Name",accessorKey:"metadata.user_api_key_team_alias",cell:e=>(0,t.jsx)(u.Z,{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)(u.Z,{title:s,children:(0,t.jsx)("span",{className:"font-mono max-w-[15ch] truncate block cursor-pointer hover:text-blue-600",onClick:()=>null==a?void 0:a(s),children:s})})}},{header:"Key Name",accessorKey:"metadata.user_api_key_alias",cell:e=>(0,t.jsx)(u.Z,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Model",accessorKey:"model",cell:e=>{let s=e.row.original,a=s.custom_llm_provider,l=String(e.getValue()||"");return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,t.jsx)("img",{src:j(s,a),alt:"",className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)(u.Z,{title:l,children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:l})})]})}},{header:"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)(u.Z,{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)(u.Z,{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),l=a[0],r=a.slice(1);return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:(0,t.jsx)(u.Z,{title:(0,t.jsx)("div",{className:"flex flex-col gap-1",children:a.map(e=>{let[s,a]=e;return(0,t.jsxs)("span",{children:[s,": ",String(a)]},s)})}),children:(0,t.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[l[0],": ",String(l[1]),r.length>0&&" +".concat(r.length)]})})})}}],b=e=>(0,t.jsx)(g.Z,{color:"gray",className:"flex items-center gap-1",children:(0,t.jsx)("span",{className:"whitespace-nowrap text-xs",children:e})}),y=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,t.jsx)(()=>{let[e,a]=i.useState(s.getIsExpanded()),l=i.useCallback(()=>{a(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,t.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,t.jsx)("svg",{className:"w-4 h-4 transform transition-transform ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,t.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Timestamp",accessorKey:"updated_at",cell:e=>(0,t.jsx)(h,{utcTime:e.getValue()})},{header:"Table Name",accessorKey:"table_name",cell:e=>{let s=e.getValue(),a=s;switch(s){case"LiteLLM_VerificationToken":a="Keys";break;case"LiteLLM_TeamTable":a="Teams";break;case"LiteLLM_OrganizationTable":a="Organizations";break;case"LiteLLM_UserTable":a="Users";break;case"LiteLLM_ProxyModelTable":a="Models";break;default:a=s}return(0,t.jsx)("span",{children:a})}},{header:"Action",accessorKey:"action",cell:e=>(0,t.jsx)("span",{children:b(e.getValue())})},{header:"Changed By",accessorKey:"changed_by",cell:e=>{let s=e.row.original.changed_by,a=e.row.original.changed_by_api_key;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"font-medium",children:s}),a&&(0,t.jsx)(u.Z,{title:a,children:(0,t.jsxs)("div",{className:"text-xs text-muted-foreground max-w-[15ch] truncate",children:[" ",a]})})]})}},{header:"Affected Item ID",accessorKey:"object_id",cell:e=>(0,t.jsx)(()=>{let s=e.getValue(),[a,l]=(0,i.useState)(!1);if(!s)return(0,t.jsx)(t.Fragment,{children:"-"});let r=async()=>{try{await navigator.clipboard.writeText(String(s)),l(!0),setTimeout(()=>l(!1),1500)}catch(e){console.error("Failed to copy object ID: ",e)}};return(0,t.jsx)(u.Z,{title:a?"Copied!":String(s),children:(0,t.jsx)("span",{className:"max-w-[20ch] truncate block cursor-pointer hover:text-blue-600",onClick:r,children:String(s)})})},{})}],N=async(e,s,a,t)=>{console.log("prefetchLogDetails called with",e.length,"logs");let l=e.map(e=>{if(e.request_id)return console.log("Prefetching details for request_id:",e.request_id),t.prefetchQuery({queryKey:["logDetails",e.request_id,s],queryFn:async()=>{console.log("Fetching details for",e.request_id);let t=await (0,d.uiSpendLogDetailsCall)(a,e.request_id,s);return console.log("Received details for",e.request_id,":",t?"success":"failed"),t},staleTime:6e5,gcTime:6e5})});try{let e=await Promise.all(l);return console.log("All prefetch promises completed:",e.length),e}catch(e){throw console.error("Error in prefetchLogDetails:",e),e}};var w=a(9114),k=a(86669);function _(e){let{row:s,hasMessages:a,hasResponse:l,hasError:r,errorInfo:n,getRawRequest:i,formattedResponse:o}=e,d=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let a=document.execCommand("copy");if(document.body.removeChild(s),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},c=async()=>{await d(JSON.stringify(i(),null,2))?w.Z.success("Request copied to clipboard"):w.Z.fromBackend("Failed to copy request")},m=async()=>{await d(JSON.stringify(o(),null,2))?w.Z.success("Response copied to clipboard"):w.Z.fromBackend("Failed to copy response")};return(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 w-full max-w-full overflow-hidden box-border",children:[(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Request"}),(0,t.jsx)("button",{onClick:c,className:"p-1 hover:bg-gray-200 rounded",title:"Copy request",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,t.jsx)("div",{className:"p-4 overflow-auto max-h-96 w-full max-w-full box-border",children:(0,t.jsx)(k.gc,{data:i(),style:k.jF,clickToExpandNode:!0})})]}),(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,t.jsxs)("h3",{className:"text-lg font-medium",children:["Response",r&&(0,t.jsxs)("span",{className:"ml-2 text-sm text-red-600",children:["• HTTP code ",(null==n?void 0:n.error_code)||400]})]}),(0,t.jsx)("button",{onClick:m,className:"p-1 hover:bg-gray-200 rounded",title:"Copy response",disabled:!l,children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,t.jsx)("div",{className:"p-4 overflow-auto max-h-96 w-full max-w-full box-border",children:l?(0,t.jsx)(k.gc,{data:o(),style:k.jF,clickToExpandNode:!0}):(0,t.jsx)("div",{className:"text-gray-500 text-sm italic text-center py-4",children:"Response data not available"})})]})]})}a(52621);let S=e=>{var s;let{errorInfo:a}=e,[l,r]=i.useState({}),[n,o]=i.useState(!1),d=e=>{r(s=>({...s,[e]:!s[e]}))},c=a.traceback&&(s=a.traceback)?Array.from(s.matchAll(/File "([^"]+)", line (\d+)/g)).map(e=>{let a=e[1],t=e[2],l=a.split("/").pop()||a,r=e.index||0,n=s.indexOf('File "',r+1),i=n>-1?s.substring(r,n).trim():s.substring(r).trim(),o=i.split("\n"),d="";return o.length>1&&(d=o[o.length-1].trim()),{filePath:a,fileName:l,lineNumber:t,code:d,inFunction:i.includes(" in ")?i.split(" in ")[1].split("\n")[0]:""}}):[];return(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsx)("div",{className:"p-4 border-b",children:(0,t.jsxs)("h3",{className:"text-lg font-medium flex items-center text-red-600",children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,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"})}),"Error Details"]})}),(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"bg-red-50 rounded-md p-4 mb-4",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"text-red-800 font-medium w-20",children:"Type:"}),(0,t.jsx)("span",{className:"text-red-700",children:a.error_class||"Unknown Error"})]}),(0,t.jsxs)("div",{className:"flex mt-2",children:[(0,t.jsx)("span",{className:"text-red-800 font-medium w-20 flex-shrink-0",children:"Message:"}),(0,t.jsx)("span",{className:"text-red-700 break-words whitespace-pre-wrap",children:a.error_message||"Unknown error occurred"})]})]}),a.traceback&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsx)("h4",{className:"font-medium",children:"Traceback"}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsx)("button",{onClick:()=>{let e=!n;if(o(e),c.length>0){let s={};c.forEach((a,t)=>{s[t]=e}),r(s)}},className:"text-gray-500 hover:text-gray-700 flex items-center text-sm",children:n?"Collapse All":"Expand All"}),(0,t.jsxs)("button",{onClick:()=>navigator.clipboard.writeText(a.traceback||""),className:"text-gray-500 hover:text-gray-700 flex items-center",title:"Copy traceback",children:[(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),(0,t.jsx)("span",{className:"ml-1",children:"Copy"})]})]})]}),(0,t.jsx)("div",{className:"bg-white rounded-md border border-gray-200 overflow-hidden shadow-sm",children:c.map((e,s)=>(0,t.jsxs)("div",{className:"border-b border-gray-200 last:border-b-0",children:[(0,t.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between cursor-pointer hover:bg-gray-50",onClick:()=>d(s),children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"text-gray-400 mr-2 w-12 text-right",children:e.lineNumber}),(0,t.jsx)("span",{className:"text-gray-600 font-medium",children:e.fileName}),(0,t.jsx)("span",{className:"text-gray-500 mx-1",children:"in"}),(0,t.jsx)("span",{className:"text-indigo-600 font-medium",children:e.inFunction||e.fileName})]}),(0,t.jsx)("svg",{className:"w-5 h-5 text-gray-500 transition-transform ".concat(l[s]?"transform rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(l[s]||!1)&&e.code&&(0,t.jsx)("div",{className:"px-12 py-2 font-mono text-sm text-gray-800 bg-gray-50 overflow-x-auto border-t border-gray-100",children:e.code})]},s))})]})]})]})};var C=a(20347);let L=e=>{let{show:s}=e;return s?(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:"]}),(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:\n store_model_in_db: true\n 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};var M=a(94292),T=a(12514),E=a(35829),D=a(84264),A=a(96761),I=a(10900),R=a(5545),O=a(30401),H=a(78867);let q=e=>{let{sessionId:s,logs:a,onBack:l}=e,[r,n]=(0,i.useState)(null),[o,d]=(0,i.useState)({}),m=a.reduce((e,s)=>e+(s.spend||0),0),x=a.reduce((e,s)=>e+(s.total_tokens||0),0),h=a.reduce((e,s)=>{var a,t;return e+((null===(t=s.metadata)||void 0===t?void 0:null===(a=t.additional_usage_values)||void 0===a?void 0:a.cache_read_input_tokens)||0)},0),g=a.reduce((e,s)=>{var a,t;return e+((null===(t=s.metadata)||void 0===t?void 0:null===(a=t.additional_usage_values)||void 0===a?void 0:a.cache_creation_input_tokens)||0)},0),j=x+h+g,b=a.length>0?new Date(a[0].startTime):new Date;(((a.length>0?new Date(a[a.length-1].endTime):new Date).getTime()-b.getTime())/1e3).toFixed(2),a.map(e=>({time:new Date(e.startTime).toISOString(),tokens:e.total_tokens||0,cost:e.spend||0}));let y=async(e,s)=>{await (0,f.vQ)(e)&&(d(e=>({...e,[s]:!0})),setTimeout(()=>{d(e=>({...e,[s]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)(p.Z,{icon:I.Z,variant:"light",onClick:l,className:"mb-4",children:"Back to All Logs"}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold text-gray-900",children:"Session Details"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)("p",{className:"text-sm text-gray-500 font-mono",children:s}),(0,t.jsx)(R.ZP,{type:"text",size:"small",icon:o["session-id"]?(0,t.jsx)(O.Z,{size:12}):(0,t.jsx)(H.Z,{size:12}),onClick:()=>y(s,"session-id"),className:"left-2 z-10 transition-all duration-200 ".concat(o["session-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,t.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/ui_logs_sessions",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:text-blue-800 flex items-center gap-1",children:["Get started with session management here",(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:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,t.jsxs)(T.Z,{children:[(0,t.jsx)(D.Z,{children:"Total Requests"}),(0,t.jsx)(E.Z,{children:a.length})]}),(0,t.jsxs)(T.Z,{children:[(0,t.jsx)(D.Z,{children:"Total Cost"}),(0,t.jsxs)(E.Z,{children:["$",(0,f.pw)(m,6)]})]}),(0,t.jsx)(u.Z,{title:(0,t.jsxs)("div",{className:"text-white min-w-[200px]",children:[(0,t.jsx)("div",{className:"text-lg font-medium mb-3",children:"Usage breakdown"}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-base font-medium mb-2",children:"Input usage:"}),(0,t.jsxs)("div",{className:"space-y-2 text-sm text-gray-300",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"input:"}),(0,t.jsx)("span",{className:"ml-8",children:(0,f.pw)(a.reduce((e,s)=>e+(s.prompt_tokens||0),0))})]}),h>0&&(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"input_cached_tokens:"}),(0,t.jsx)("span",{className:"ml-8",children:(0,f.pw)(h)})]}),g>0&&(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"input_cache_creation_tokens:"}),(0,t.jsx)("span",{className:"ml-8",children:(0,f.pw)(g)})]})]})]}),(0,t.jsxs)("div",{className:"border-t border-gray-600 pt-3",children:[(0,t.jsx)("div",{className:"text-base font-medium mb-2",children:"Output usage:"}),(0,t.jsx)("div",{className:"space-y-2 text-sm text-gray-300",children:(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"output:"}),(0,t.jsx)("span",{className:"ml-8",children:(0,f.pw)(a.reduce((e,s)=>e+(s.completion_tokens||0),0))})]})})]}),(0,t.jsx)("div",{className:"border-t border-gray-600 pt-3",children:(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-base font-medium",children:"Total usage:"}),(0,t.jsx)("span",{className:"text-sm text-gray-300",children:(0,f.pw)(j)})]})})]})]}),placement:"top",overlayStyle:{minWidth:"300px"},children:(0,t.jsxs)(T.Z,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(D.Z,{children:"Total Tokens"}),(0,t.jsx)("span",{className:"text-gray-400 text-sm",children:"ⓘ"})]}),(0,t.jsx)(E.Z,{children:(0,f.pw)(j)})]})})]}),(0,t.jsx)(A.Z,{children:"Session Logs"}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(c.w,{columns:v,data:a,renderSubComponent:eg,getRowCanExpand:()=>!0,loadingMessage:"Loading logs...",noDataMessage:"No logs found"})})]})};function F(e){let{data:s}=e,[a,l]=(0,i.useState)(!0),[r,n]=(0,i.useState)({});if(!s||0===s.length)return null;let o=e=>new Date(1e3*e).toLocaleString(),d=(e,s)=>"".concat(((s-e)*1e3).toFixed(2),"ms"),c=(e,s)=>{let a="".concat(e,"-").concat(s);n(e=>({...e,[a]:!e[a]}))};return(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>l(!a),children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 text-gray-600 transition-transform ".concat(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)("h3",{className:"text-lg font-medium",children:"Vector Store Requests"})]}),(0,t.jsx)("span",{className:"text-sm text-gray-500",children:a?"Click to collapse":"Click to expand"})]}),a&&(0,t.jsx)("div",{className:"p-4",children:s.map((e,s)=>(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,m.dr)(e.custom_llm_provider);return(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)("img",{src:s,alt:"".concat(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:o(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:o(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:d(e.start_time,e.end_time)})]})]})]})}),(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,a)=>{let l=r["".concat(s,"-").concat(a)]||!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:()=>c(s,a),children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(l?"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 ",a+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)})]})]})]}),l&&(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))})]},a)})})]},s))})]})}let Y=e=>e>=.8?"text-green-600":"text-yellow-600";var K=e=>{let{entities:s}=e,[a,l]=(0,i.useState)(!0),[r,n]=(0,i.useState)({}),o=e=>{n(s=>({...s,[e]:!s[e]}))};return s&&0!==s.length?(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"flex items-center mb-2 cursor-pointer",onClick:()=>l(!a),children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(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 (",s.length,")"]})]}),a&&(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>{let a=r[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:()=>o(s),children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(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 ".concat(Y(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:Y(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};let P=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"slate";return(0,t.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block ".concat({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})},Z=e=>e?P("detected","red"):P("not detected","slate"),U=e=>{let{title:s,count:a,defaultOpen:l=!0,right:r,children:n}=e,[o,d]=(0,i.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:()=>d(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 ".concat(o?"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:[s," ","number"==typeof a&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal",children:["(",a,")"]})]})]}),(0,t.jsx)("div",{children:r})]}),o&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:n})]})},V=e=>{let{label:s,children:a,mono:l}=e;return(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:s}),(0,t.jsx)("span",{className:l?"font-mono text-sm break-all":"",children:a})]})},B=()=>(0,t.jsx)("div",{className:"my-3 border-t"});var W=e=>{var s,a,l,r,n,i,o,d,c,m;let{response:u}=e;if(!u)return null;let x=null!==(n=null!==(r=u.outputs)&&void 0!==r?r:u.output)&&void 0!==n?n:[],h="GUARDRAIL_INTERVENED"===u.action?"red":"green",g=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(null===(s=u.guardrailCoverage)||void 0===s?void 0:s.textCharacters)&&P("text guarded ".concat(null!==(i=u.guardrailCoverage.textCharacters.guarded)&&void 0!==i?i:0,"/").concat(null!==(o=u.guardrailCoverage.textCharacters.total)&&void 0!==o?o:0),"blue"),(null===(a=u.guardrailCoverage)||void 0===a?void 0:a.images)&&P("images guarded ".concat(null!==(d=u.guardrailCoverage.images.guarded)&&void 0!==d?d:0,"/").concat(null!==(c=u.guardrailCoverage.images.total)&&void 0!==c?c:0),"blue")]}),p=u.usage&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(u.usage).map(e=>{let[s,a]=e;return"number"==typeof a?(0,t.jsxs)("span",{className:"px-2 py-1 bg-slate-100 text-slate-800 rounded-md text-xs font-medium",children:[s,": ",a]},s):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)(V,{label:"Action:",children:P(null!==(m=u.action)&&void 0!==m?m:"N/A",h)}),u.actionReason&&(0,t.jsx)(V,{label:"Action Reason:",children:u.actionReason}),u.blockedResponse&&(0,t.jsx)(V,{label:"Blocked Response:",children:(0,t.jsx)("span",{className:"italic",children:u.blockedResponse})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{label:"Coverage:",children:g}),(0,t.jsx)(V,{label:"Usage:",children:p})]})]}),x.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B,{}),(0,t.jsx)("h4",{className:"font-medium mb-2",children:"Outputs"}),(0,t.jsx)("div",{className:"space-y-2",children:x.map((e,s)=>{var a;return(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsx)("div",{className:"text-sm whitespace-pre-wrap",children:null!==(a=e.text)&&void 0!==a?a:(0,t.jsx)("em",{children:"(non-text output)"})})},s)})})]})]}),(null===(l=u.assessments)||void 0===l?void 0:l.length)?(0,t.jsx)("div",{className:"space-y-3",children:u.assessments.map((e,s)=>{var a,l,r,n,i,o,d,c,m,u,x,h,g,p,f,j,v,b,y,N,w,k,_,S;let C=(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.wordPolicy&&P("word","slate"),e.contentPolicy&&P("content","slate"),e.topicPolicy&&P("topic","slate"),e.sensitiveInformationPolicy&&P("sensitive-info","slate"),e.contextualGroundingPolicy&&P("contextual-grounding","slate"),e.automatedReasoningPolicy&&P("automated-reasoning","slate")]});return(0,t.jsxs)(U,{title:"Assessment #".concat(s+1),defaultOpen:!0,right:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(null===(a=e.invocationMetrics)||void 0===a?void 0:a.guardrailProcessingLatency)!=null&&P("".concat(e.invocationMetrics.guardrailProcessingLatency," ms"),"amber"),C]}),children:[e.wordPolicy&&(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Word Policy"}),(null!==(j=null===(l=e.wordPolicy.customWords)||void 0===l?void 0:l.length)&&void 0!==j?j:0)>0&&(0,t.jsx)(U,{title:"Custom Words",defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:e.wordPolicy.customWords.map((e,s)=>{var a;return(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:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-mono text-sm break-all",children:e.match})]}),Z(e.detected)]},s)})})}),(null!==(v=null===(r=e.wordPolicy.managedWordLists)||void 0===r?void 0:r.length)&&void 0!==v?v:0)>0&&(0,t.jsx)(U,{title:"Managed Word Lists",defaultOpen:!1,children:(0,t.jsx)("div",{className:"space-y-2",children:e.wordPolicy.managedWordLists.map((e,s)=>{var a;return(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:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-mono text-sm break-all",children:e.match}),e.type&&P(e.type,"slate")]}),Z(e.detected)]},s)})})})]}),(null===(i=e.contentPolicy)||void 0===i?void 0:null===(n=i.filters)||void 0===n?void 0:n.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)=>{var a,l,r,n;return(0,t.jsxs)("tr",{className:"border-t",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(a=e.type)&&void 0!==a?a:"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:P(null!==(l=e.action)&&void 0!==l?l:"—",e.detected?"red":"slate")}),(0,t.jsx)("td",{className:"py-1 pr-4",children:Z(e.detected)}),(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(r=e.filterStrength)&&void 0!==r?r:"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(n=e.confidence)&&void 0!==n?n:"—"})]},s)})})]})})]}):null,(null===(d=e.contextualGroundingPolicy)||void 0===d?void 0:null===(o=d.filters)||void 0===o?void 0:o.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)=>{var a,l,r,n;return(0,t.jsxs)("tr",{className:"border-t",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(a=e.type)&&void 0!==a?a:"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:P(null!==(l=e.action)&&void 0!==l?l:"—",e.detected?"red":"slate")}),(0,t.jsx)("td",{className:"py-1 pr-4",children:Z(e.detected)}),(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(r=e.score)&&void 0!==r?r:"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(n=e.threshold)&&void 0!==n?n:"—"})]},s)})})]})})]}):null,e.sensitiveInformationPolicy&&(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Sensitive Information"}),(null!==(b=null===(c=e.sensitiveInformationPolicy.piiEntities)||void 0===c?void 0:c.length)&&void 0!==b?b:0)>0&&(0,t.jsx)(U,{title:"PII Entities",defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:e.sensitiveInformationPolicy.piiEntities.map((e,s)=>{var a;return(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:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),e.type&&P(e.type,"slate"),(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e.match})]}),Z(e.detected)]},s)})})}),(null!==(y=null===(m=e.sensitiveInformationPolicy.regexes)||void 0===m?void 0:m.length)&&void 0!==y?y:0)>0&&(0,t.jsx)(U,{title:"Custom Regexes",defaultOpen:!1,children:(0,t.jsx)("div",{className:"space-y-2",children:e.sensitiveInformationPolicy.regexes.map((e,s)=>{var a,l;return(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:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-medium",children:null!==(l=e.name)&&void 0!==l?l:"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:[Z(e.detected),e.match&&(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e.match})]})]},s)})})})]}),(null===(x=e.topicPolicy)||void 0===x?void 0:null===(u=x.topics)||void 0===u?void 0:u.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)=>{var a,l;return(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:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-medium",children:null!==(l=e.name)&&void 0!==l?l:"topic"}),e.type&&P(e.type,"slate"),Z(e.detected)]})},s)})})]}):null,e.invocationMetrics&&(0,t.jsx)(U,{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)(V,{label:"Latency (ms)",children:null!==(N=e.invocationMetrics.guardrailProcessingLatency)&&void 0!==N?N:"—"}),(0,t.jsx)(V,{label:"Coverage:",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(null===(h=e.invocationMetrics.guardrailCoverage)||void 0===h?void 0:h.textCharacters)&&P("text ".concat(null!==(w=e.invocationMetrics.guardrailCoverage.textCharacters.guarded)&&void 0!==w?w:0,"/").concat(null!==(k=e.invocationMetrics.guardrailCoverage.textCharacters.total)&&void 0!==k?k:0),"blue"),(null===(g=e.invocationMetrics.guardrailCoverage)||void 0===g?void 0:g.images)&&P("images ".concat(null!==(_=e.invocationMetrics.guardrailCoverage.images.guarded)&&void 0!==_?_:0,"/").concat(null!==(S=e.invocationMetrics.guardrailCoverage.images.total)&&void 0!==S?S:0),"blue")]})})]}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsx)(V,{label:"Usage:",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.invocationMetrics.usage&&Object.entries(e.invocationMetrics.usage).map(e=>{let[s,a]=e;return"number"==typeof a?(0,t.jsxs)("span",{className:"px-2 py-1 bg-slate-100 text-slate-800 rounded-md text-xs font-medium",children:[s,": ",a]},s):null})})})})]})}),(null===(f=e.automatedReasoningPolicy)||void 0===f?void 0:null===(p=f.findings)||void 0===p?void 0:p.length)?(0,t.jsx)(U,{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)(U,{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(u,null,2)})})]})};let z=e=>new Date(1e3*e).toLocaleString(),J=e=>{var s,a;let{entry:l,index:r,total:n}=e,i=null!==(s=l.guardrail_provider)&&void 0!==s?s:"presidio",o=null!==(a=l.guardrail_status)&&void 0!==a?a:"unknown",d="success"===o.toLowerCase(),c=l.masked_entity_count||{},m=Object.values(c).reduce((e,s)=>e+("number"==typeof s?s:0),0),x=l.guardrail_response,h=Array.isArray(x)?x:[],g="bedrock"!==i||null===x||"object"!=typeof x||Array.isArray(x)?void 0:x;return(0,t.jsxs)("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[n>1&&(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("h4",{className:"text-base font-semibold",children:["Guardrail #",r+1,(0,t.jsx)("span",{className:"ml-2 font-mono text-sm text-gray-600",children:l.guardrail_name})]}),(0,t.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-600 rounded-md text-xs capitalize",children:i})]}),(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)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail Name:"}),(0,t.jsx)("span",{className:"font-mono break-words",children:l.guardrail_name})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Mode:"}),(0,t.jsx)("span",{className:"font-mono break-words",children:l.guardrail_mode})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,t.jsx)(u.Z,{title:d?null:"Guardrail failed to run.",placement:"top",arrow:!0,destroyTooltipOnHide:!0,children:(0,t.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block ".concat(d?"bg-green-100 text-green-800":"bg-red-100 text-red-800 cursor-help"),children:o})})]})]}),(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:z(l.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:z(l.end_time)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,t.jsxs)("span",{children:[l.duration.toFixed(4),"s"]})]})]})]}),m>0&&(0,t.jsxs)("div",{className:"mt-4 pt-4 border-t",children:[(0,t.jsx)("h5",{className:"font-medium mb-2",children:"Masked Entity Summary"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(c).map(e=>{let[s,a]=e;return(0,t.jsxs)("span",{className:"px-3 py-1.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[s,": ",a]},s)})})]}),"presidio"===i&&h.length>0&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(K,{entities:h})}),"bedrock"===i&&g&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(W,{response:g})})]})};var G=e=>{let{data:s}=e,a=Array.isArray(s)?s.filter(e=>!!e):s?[s]:[],[l,r]=(0,i.useState)(!0),n=1===a.length?a[0].guardrail_name:"".concat(a.length," guardrails"),o=Array.from(new Set(a.map(e=>e.guardrail_status))).every(e=>"success"===(null!=e?e:"").toLowerCase()),d=a.reduce((e,s)=>e+Object.values(s.masked_entity_count||{}).reduce((e,s)=>e+("number"==typeof s?s:0),0),0);return 0===a.length?null:(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>r(!l),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-5 h-5 text-gray-600 transition-transform ".concat(l?"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)("h3",{className:"text-lg font-medium",children:"Guardrail Information"}),(0,t.jsx)(u.Z,{title:o?null:"Guardrail failed to run.",placement:"top",arrow:!0,destroyTooltipOnHide:!0,children:(0,t.jsx)("span",{className:"ml-2 px-2 py-1 rounded-md text-xs font-medium inline-block ".concat(o?"bg-green-100 text-green-800":"bg-red-100 text-red-800 cursor-help"),children:o?"success":"failure"})}),(0,t.jsx)("span",{className:"ml-2 font-mono text-sm text-gray-600",children:n}),d>0&&(0,t.jsxs)("span",{className:"ml-2 px-2 py-1 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[d," masked ",1===d?"entity":"entities"]})]}),(0,t.jsx)("span",{className:"text-sm text-gray-500",children:l?"Click to collapse":"Click to expand"})]}),l&&(0,t.jsx)("div",{className:"p-4 space-y-6",children:a.map((e,s)=>{var l;return(0,t.jsx)(J,{entry:e,index:s,total:a.length},"".concat(null!==(l=e.guardrail_name)&&void 0!==l?l:"guardrail","-").concat(s))})})]})},Q=a(23048),$=a(30841),X=a(7310),ee=a.n(X),es=a(12363);let ea={TEAM_ID:"Team ID",KEY_HASH:"Key Hash",REQUEST_ID:"Request ID",MODEL:"Model",USER_ID:"User ID",END_USER:"End User",STATUS:"Status",KEY_ALIAS:"Key Alias"};var et=a(59341),el=a(12485),er=a(18135),en=a(35242),ei=a(29706),eo=a(77991),ed=a(92280);let ec="".concat("../ui/assets/","audit-logs-preview.png");function em(e){let{userID:s,userRole:a,token:l,accessToken:o,isActive:m,premiumUser:u,allTeams:x}=e,[h,g]=(0,i.useState)(r()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),p=(0,i.useRef)(null),j=(0,i.useRef)(null),[v,b]=(0,i.useState)(1),[N]=(0,i.useState)(50),[w,k]=(0,i.useState)({}),[_,S]=(0,i.useState)(""),[C,L]=(0,i.useState)(""),[M,T]=(0,i.useState)(""),[E,D]=(0,i.useState)("all"),[A,I]=(0,i.useState)("all"),[R,O]=(0,i.useState)(!1),[H,q]=(0,i.useState)(!1),F=(0,n.a)({queryKey:["all_audit_logs",o,l,a,s,h],queryFn:async()=>{if(!o||!l||!a||!s)return[];let e=r()(h).utc().format("YYYY-MM-DD HH:mm:ss"),t=r()().utc().format("YYYY-MM-DD HH:mm:ss"),n=[],i=1,c=1;do{let s=await (0,d.uiAuditLogsCall)(o,e,t,i,50);n=n.concat(s.audit_logs),c=s.total_pages,i++}while(i<=c);return n},enabled:!!o&&!!l&&!!a&&!!s&&m,refetchInterval:5e3,refetchIntervalInBackground:!0}),Y=(0,i.useCallback)(async e=>{if(o)try{let s=(await (0,d.keyListCall)(o,null,null,e,null,null,1,10)).keys.find(s=>s.key_alias===e);s?L(s.token):L("")}catch(e){console.error("Error fetching key hash for alias:",e),L("")}},[o]);(0,i.useEffect)(()=>{if(!o)return;let e=!1,s=!1;w["Team ID"]?_!==w["Team ID"]&&(S(w["Team ID"]),e=!0):""!==_&&(S(""),e=!0),w["Key Hash"]?C!==w["Key Hash"]&&(L(w["Key Hash"]),s=!0):w["Key Alias"]?Y(w["Key Alias"]):""!==C&&(L(""),s=!0),(e||s)&&b(1)},[w,o,Y,_,C]),(0,i.useEffect)(()=>{b(1)},[_,C,h,M,E,A]),(0,i.useEffect)(()=>{function e(e){p.current&&!p.current.contains(e.target)&&O(!1),j.current&&!j.current.contains(e.target)&&q(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let K=(0,i.useMemo)(()=>F.data?F.data.filter(e=>{var s,a,t,l,r,n,i;let o=!0,d=!0,c=!0,m=!0,u=!0;if(_){let r="string"==typeof e.before_value?null===(s=JSON.parse(e.before_value))||void 0===s?void 0:s.team_id:null===(a=e.before_value)||void 0===a?void 0:a.team_id,n="string"==typeof e.updated_values?null===(t=JSON.parse(e.updated_values))||void 0===t?void 0:t.team_id:null===(l=e.updated_values)||void 0===l?void 0:l.team_id;o=r===_||n===_}if(C)try{let s="string"==typeof e.before_value?JSON.parse(e.before_value):e.before_value,a="string"==typeof e.updated_values?JSON.parse(e.updated_values):e.updated_values,t=null==s?void 0:s.token,l=null==a?void 0:a.token;d="string"==typeof t&&t.includes(C)||"string"==typeof l&&l.includes(C)}catch(e){d=!1}if(M&&(c=null===(r=e.object_id)||void 0===r?void 0:r.toLowerCase().includes(M.toLowerCase())),"all"!==E&&(m=(null===(n=e.action)||void 0===n?void 0:n.toLowerCase())===E.toLowerCase()),"all"!==A){let s="";switch(A){case"keys":s="litellm_verificationtoken";break;case"teams":s="litellm_teamtable";break;case"users":s="litellm_usertable";break;default:s=A}u=(null===(i=e.table_name)||void 0===i?void 0:i.toLowerCase())===s}return o&&d&&c&&m&&u}):[],[F.data,_,C,M,E,A]),P=K.length,Z=Math.ceil(P/N)||1,U=(0,i.useMemo)(()=>{let e=(v-1)*N,s=e+N;return K.slice(e,s)},[K,v,N]),V=!F.data||0===F.data.length,B=(0,i.useCallback)(e=>{let{row:s}=e;return(0,t.jsx)(e=>{let{rowData:s}=e,{before_value:a,updated_values:l,table_name:r,action:n}=s,i=(e,s)=>{if(!e||0===Object.keys(e).length)return(0,t.jsx)(ed.x,{children:"N/A"});if(s){let s=Object.keys(e),a=["token","spend","max_budget"];if(s.every(e=>a.includes(e))&&s.length>0)return(0,t.jsxs)("div",{children:[s.includes("token")&&(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Token:"})," ",e.token||"N/A"]}),s.includes("spend")&&(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Spend:"})," ",void 0!==e.spend?"$".concat((0,f.pw)(e.spend,6)):"N/A"]}),s.includes("max_budget")&&(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Max Budget:"})," ",void 0!==e.max_budget?"$".concat((0,f.pw)(e.max_budget,6)):"N/A"]})]});if(e["No differing fields detected in 'before' state"]||e["No differing fields detected in 'updated' state"]||e["No fields changed"])return(0,t.jsx)(ed.x,{children:e[Object.keys(e)[0]]})}return(0,t.jsx)("pre",{className:"p-2 bg-gray-50 border rounded text-xs overflow-auto max-h-60",children:JSON.stringify(e,null,2)})},o=a,d=l;if(("updated"===n||"rotated"===n)&&a&&l&&("LiteLLM_TeamTable"===r||"LiteLLM_UserTable"===r||"LiteLLM_VerificationToken"===r)){let e={},s={};new Set([...Object.keys(a),...Object.keys(l)]).forEach(t=>{JSON.stringify(a[t])!==JSON.stringify(l[t])&&(a.hasOwnProperty(t)&&(e[t]=a[t]),l.hasOwnProperty(t)&&(s[t]=l[t]))}),Object.keys(a).forEach(t=>{l.hasOwnProperty(t)||e.hasOwnProperty(t)||(e[t]=a[t],s[t]=void 0)}),Object.keys(l).forEach(t=>{a.hasOwnProperty(t)||s.hasOwnProperty(t)||(s[t]=l[t],e[t]=void 0)}),o=Object.keys(e).length>0?e:{"No differing fields detected in 'before' state":"N/A"},d=Object.keys(s).length>0?s:{"No differing fields detected in 'updated' state":"N/A"},0===Object.keys(e).length&&0===Object.keys(s).length&&(o={"No fields changed":"N/A"},d={"No fields changed":"N/A"})}return(0,t.jsxs)("div",{className:"-mx-4 p-4 bg-slate-100 border-y border-slate-300 grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Before Value:"}),i(o,"LiteLLM_VerificationToken"===r)]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Updated Value:"}),i(d,"LiteLLM_VerificationToken"===r)]})]})},{rowData:s.original})},[]);if(!u)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)(ed.x,{style:{display:"block",marginBottom:"10px"},children:"This is a LiteLLM Enterprise feature, and requires a valid key to use."}),(0,t.jsx)(ed.x,{style:{display:"block",marginBottom:"20px",fontStyle:"italic"},children:"Here's a preview of what Audit Logs offer:"}),(0,t.jsx)("img",{src:ec,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=>{console.error("Failed to load audit logs preview image"),e.target.style.display="none"}})]});let W=P>0?(v-1)*N+1:0,z=Math.min(v*N,P);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4"}),(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)("h1",{className:"text-xl font-semibold py-4",children:"Audit Logs"}),(0,t.jsx)(e=>{let{show:s}=e;return s?(0,t.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start mb-6",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:"Audit Logs Not Available"}),(0,t.jsx)("p",{className:"text-sm text-blue-700 mt-1",children:"To enable audit logging, add the following configuration to your LiteLLM proxy configuration file:"}),(0,t.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:"litellm_settings:\n store_audit_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 and proxy restart."})]})]}):null},{show:V}),(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",children:[(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)("input",{type:"text",placeholder:"Search by Object ID...",value:M,onChange:e=>T(e.target.value),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)("button",{onClick:()=>{F.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,t.jsx)("svg",{className:"w-4 h-4 ".concat(F.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,t.jsx)("span",{children:"Refresh"})]})]})}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsxs)("div",{className:"relative",ref:p,children:[(0,t.jsx)("label",{htmlFor:"actionFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Action:"}),(0,t.jsxs)("button",{id:"actionFilterDisplay",onClick:()=>O(!R),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,t.jsxs)("span",{children:["all"===E&&"All Actions","created"===E&&"Created","updated"===E&&"Updated","deleted"===E&&"Deleted","rotated"===E&&"Rotated"]}),(0,t.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),R&&(0,t.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,t.jsx)("div",{className:"space-y-1",children:[{label:"All Actions",value:"all"},{label:"Created",value:"created"},{label:"Updated",value:"updated"},{label:"Deleted",value:"deleted"},{label:"Rotated",value:"rotated"}].map(e=>(0,t.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(E===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{D(e.value),O(!1)},children:e.label},e.value))})})]}),(0,t.jsxs)("div",{className:"relative",ref:j,children:[(0,t.jsx)("label",{htmlFor:"tableFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Table:"}),(0,t.jsxs)("button",{id:"tableFilterDisplay",onClick:()=>q(!H),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,t.jsxs)("span",{children:["all"===A&&"All Tables","keys"===A&&"Keys","teams"===A&&"Teams","users"===A&&"Users"]}),(0,t.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),H&&(0,t.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,t.jsx)("div",{className:"space-y-1",children:[{label:"All Tables",value:"all"},{label:"Keys",value:"keys"},{label:"Teams",value:"teams"},{label:"Users",value:"users"}].map(e=>(0,t.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(A===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{I(e.value),q(!1)},children:e.label},e.value))})})]}),(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing ",F.isLoading?"...":W," -"," ",F.isLoading?"...":z," of"," ",F.isLoading?"...":P," results"]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",F.isLoading?"...":v," of"," ",F.isLoading?"...":Z]}),(0,t.jsx)("button",{onClick:()=>b(e=>Math.max(1,e-1)),disabled:F.isLoading||1===v,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:()=>b(e=>Math.min(Z,e+1)),disabled:F.isLoading||v===Z,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)(c.w,{columns:y,data:U,renderSubComponent:B,getRowCanExpand:()=>!0})]})]})}let eu=(e,s,a)=>{if(e)return"".concat(r()(s).format("MMM D, h:mm A")," - ").concat(r()(a).format("MMM D, h:mm A"));let t=r()(),l=r()(s),n=t.diff(l,"minutes");if(n>=0&&n<2)return"Last 1 Minute";if(n>=2&&n<16)return"Last 15 Minutes";if(n>=16&&n<61)return"Last Hour";let i=t.diff(l,"hours");return i>=1&&i<5?"Last 4 Hours":i>=5&&i<25?"Last 24 Hours":i>=25&&i<169?"Last 7 Days":"".concat(l.format("MMM D")," - ").concat(t.format("MMM D"))};var ex=a(9309);function eh(e){var s,a,l;let{accessToken:m,token:u,userRole:x,userID:h,allTeams:g,premiumUser:p}=e,[f,j]=(0,i.useState)(""),[b,y]=(0,i.useState)(!1),[w,k]=(0,i.useState)(!1),[_,S]=(0,i.useState)(1),[L]=(0,i.useState)(50),T=(0,i.useRef)(null),E=(0,i.useRef)(null),D=(0,i.useRef)(null),[A,I]=(0,i.useState)(r()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),[R,O]=(0,i.useState)(r()().format("YYYY-MM-DDTHH:mm")),[H,F]=(0,i.useState)(!1),[Y,K]=(0,i.useState)(!1),[P,Z]=(0,i.useState)(""),[U,V]=(0,i.useState)(""),[B,W]=(0,i.useState)(""),[z,J]=(0,i.useState)(""),[G,X]=(0,i.useState)(""),[ed,ec]=(0,i.useState)(null),[ex,eh]=(0,i.useState)(null),[ep,ef]=(0,i.useState)(""),[ej,ev]=(0,i.useState)(""),[eb,ey]=(0,i.useState)(x&&C.lo.includes(x)),[eN,ew]=(0,i.useState)("request logs"),[ek,e_]=(0,i.useState)(null),[eS,eC]=(0,i.useState)(null),eL=(0,o.NL)(),[eM,eT]=(0,i.useState)(()=>{let e=sessionStorage.getItem("isLiveTail");return null===e||JSON.parse(e)});(0,i.useEffect)(()=>{sessionStorage.setItem("isLiveTail",JSON.stringify(eM))},[eM]);let[eE,eD]=(0,i.useState)({value:24,unit:"hours"});(0,i.useEffect)(()=>{(async()=>{ex&&m&&ec({...(await (0,d.keyInfoV1Call)(m,ex)).info,token:ex,api_key:ex})})()},[ex,m]),(0,i.useEffect)(()=>{function e(e){T.current&&!T.current.contains(e.target)&&k(!1),E.current&&!E.current.contains(e.target)&&y(!1),D.current&&!D.current.contains(e.target)&&K(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,i.useEffect)(()=>{x&&C.lo.includes(x)&&ey(!0)},[x]);let eA=(0,n.a)({queryKey:["logs","table",_,L,A,R,B,z,eb?h:null,ep,G],queryFn:async()=>{if(!m||!u||!x||!h)return{data:[],total:0,page:1,page_size:L,total_pages:0};let e=r()(A).utc().format("YYYY-MM-DD HH:mm:ss"),s=H?r()(R).utc().format("YYYY-MM-DD HH:mm:ss"):r()().utc().format("YYYY-MM-DD HH:mm:ss"),a=await (0,d.uiSpendLogsCall)(m,z||void 0,B||void 0,void 0,e,s,_,L,eb?h:void 0,ej,ep,G);return await N(a.data,e,m,eL),a.data=a.data.map(s=>{let a=eL.getQueryData(["logDetails",s.request_id,e]);return(null==a?void 0:a.messages)&&(null==a?void 0:a.response)&&(s.messages=a.messages,s.response=a.response),s}),a},enabled:!!m&&!!u&&!!x&&!!h&&"request logs"===eN,refetchInterval:!!eM&&1===_&&15e3,refetchIntervalInBackground:!0}),{filters:eI,filteredLogs:eR,allTeams:eO,allKeyAliases:eH,handleFilterChange:eq,handleFilterReset:eF}=function(e){let{logs:s,accessToken:a,startTime:t,endTime:l,pageSize:o=es.d,isCustomDate:c,setCurrentPage:m,userID:u,userRole:x}=e,h=(0,i.useMemo)(()=>({[ea.TEAM_ID]:"",[ea.KEY_HASH]:"",[ea.REQUEST_ID]:"",[ea.MODEL]:"",[ea.USER_ID]:"",[ea.END_USER]:"",[ea.STATUS]:"",[ea.KEY_ALIAS]:""}),[]),[g,p]=(0,i.useState)(h),[f,j]=(0,i.useState)({data:[],total:0,page:1,page_size:50,total_pages:0}),v=(0,i.useRef)(0),b=(0,i.useCallback)(async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!a)return;console.log("Filters being sent to API:",e);let n=Date.now();v.current=n;let i=r()(t).utc().format("YYYY-MM-DD HH:mm:ss"),m=c?r()(l).utc().format("YYYY-MM-DD HH:mm:ss"):r()().utc().format("YYYY-MM-DD HH:mm:ss");try{let t=await (0,d.uiSpendLogsCall)(a,e[ea.KEY_HASH]||void 0,e[ea.TEAM_ID]||void 0,e[ea.REQUEST_ID]||void 0,i,m,s,o,e[ea.USER_ID]||void 0,e[ea.END_USER]||void 0,e[ea.STATUS]||void 0,e[ea.MODEL]||void 0,e[ea.KEY_ALIAS]||void 0);n===v.current&&t.data&&j(t)}catch(e){console.error("Error searching users:",e)}},[a,t,l,c,o]),y=(0,i.useMemo)(()=>ee()((e,s)=>b(e,s),300),[b]);(0,i.useEffect)(()=>()=>y.cancel(),[y]);let N=(0,n.a)({queryKey:["allKeys"],queryFn:async()=>{if(!a)throw Error("Access token required");return await (0,$.LO)(a)},enabled:!!a}).data||[],w=(0,i.useMemo)(()=>!!(g[ea.KEY_ALIAS]||g[ea.KEY_HASH]||g[ea.REQUEST_ID]||g[ea.USER_ID]||g[ea.END_USER]),[g]),k=(0,i.useMemo)(()=>{if(!s||!s.data)return{data:[],total:0,page:1,page_size:50,total_pages:0};if(w)return s;let e=[...s.data];return g[ea.TEAM_ID]&&(e=e.filter(e=>e.team_id===g[ea.TEAM_ID])),g[ea.STATUS]&&(e=e.filter(e=>"success"===g[ea.STATUS]?!e.status||"success"===e.status:e.status===g[ea.STATUS])),g[ea.MODEL]&&(e=e.filter(e=>e.model===g[ea.MODEL])),g[ea.KEY_HASH]&&(e=e.filter(e=>e.api_key===g[ea.KEY_HASH])),g[ea.END_USER]&&(e=e.filter(e=>e.end_user===g[ea.END_USER])),{data:e,total:s.total,page:s.page,page_size:s.page_size,total_pages:s.total_pages}},[s,g,w]),_=(0,i.useMemo)(()=>w?f&&f.data&&f.data.length>0?f:s||{data:[],total:0,page:1,page_size:50,total_pages:0}:k,[w,f,k,s]),{data:S}=(0,n.a)({queryKey:["allTeamsForLogFilters",a],queryFn:async()=>a&&await (0,$.IE)(a)||[],enabled:!!a});return{filters:g,filteredLogs:_,allKeyAliases:N,allTeams:S,handleFilterChange:e=>{p(s=>{let a={...s,...e};for(let e of Object.keys(h))e in a||(a[e]=h[e]);return JSON.stringify(a)!==JSON.stringify(s)&&(m(1),y(a,1)),a})},handleFilterReset:()=>{p(h),j({data:[],total:0,page:1,page_size:50,total_pages:0}),y(h,1)}}}({logs:eA.data||{data:[],total:0,page:1,page_size:L||10,total_pages:1},accessToken:m,startTime:A,endTime:R,pageSize:L,isCustomDate:H,setCurrentPage:S,userID:h,userRole:x}),eY=(0,i.useCallback)(async e=>{if(m)try{let s=(await (0,d.keyListCall)(m,null,null,e,null,null,_,L)).keys.find(s=>s.key_alias===e);s&&J(s.token)}catch(e){console.error("Error fetching key hash for alias:",e)}},[m,_,L]);(0,i.useEffect)(()=>{m&&(eI["Team ID"]?W(eI["Team ID"]):W(""),ef(eI.Status||""),X(eI.Model||""),ev(eI["End User"]||""),eI["Key Hash"]?J(eI["Key Hash"]):eI["Key Alias"]?eY(eI["Key Alias"]):J(""))},[eI,m,eY]);let eK=(0,n.a)({queryKey:["sessionLogs",eS],queryFn:async()=>{if(!m||!eS)return{data:[],total:0,page:1,page_size:50,total_pages:1};let e=await (0,d.sessionSpendLogsCall)(m,eS);return{data:e.data||e||[],total:(e.data||e||[]).length,page:1,page_size:1e3,total_pages:1}},enabled:!!m&&!!eS});if((0,i.useEffect)(()=>{var e;(null===(e=eA.data)||void 0===e?void 0:e.data)&&ek&&!eA.data.data.some(e=>e.request_id===ek)&&e_(null)},[null===(s=eA.data)||void 0===s?void 0:s.data,ek]),!m||!u||!x||!h)return null;let eP=eR.data.filter(e=>!f||e.request_id.includes(f)||e.model.includes(f)||e.user&&e.user.includes(f)).map(e=>({...e,duration:(Date.parse(e.endTime)-Date.parse(e.startTime))/1e3,onKeyHashClick:e=>eh(e),onSessionClick:e=>{e&&eC(e)}}))||[],eZ=(null===(l=eK.data)||void 0===l?void 0:null===(a=l.data)||void 0===a?void 0:a.map(e=>({...e,onKeyHashClick:e=>eh(e),onSessionClick:e=>{}})))||[],eU=[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>g&&0!==g.length?g.filter(s=>s.team_id.toLowerCase().includes(e.toLowerCase())||s.team_alias&&s.team_alias.toLowerCase().includes(e.toLowerCase())).map(e=>({label:"".concat(e.team_alias||e.team_id," (").concat(e.team_id,")"),value:e.team_id})):[]},{name:"Status",label:"Status",isSearchable:!1,options:[{label:"Success",value:"success"},{label:"Failure",value:"failure"}]},{name:"Model",label:"Model",isSearchable:!1},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>m?(await (0,$.LO)(m)).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e})):[]},{name:"End User",label:"End User",isSearchable:!0,searchFn:async e=>{if(!m)return[];let s=await (0,d.allEndUsersCall)(m);return((null==s?void 0:s.map(e=>e.user_id))||[]).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e}))}},{name:"Key Hash",label:"Key Hash",isSearchable:!1}];if(eS&&eK.data)return(0,t.jsx)("div",{className:"w-full p-6",children:(0,t.jsx)(q,{sessionId:eS,logs:eK.data.data,onBack:()=>eC(null)})});let eV=[{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"}],eB=eV.find(e=>e.value===eE.value&&e.unit===eE.unit),eW=H?eu(H,A,R):null==eB?void 0:eB.label;return(0,t.jsx)("div",{className:"w-full max-w-screen p-6 overflow-x-hidden box-border",children:(0,t.jsxs)(er.Z,{defaultIndex:0,onIndexChange:e=>ew(0===e?"request logs":"audit logs"),children:[(0,t.jsxs)(en.Z,{children:[(0,t.jsx)(el.Z,{children:"Request Logs"}),(0,t.jsx)(el.Z,{children:"Audit Logs"})]}),(0,t.jsxs)(eo.Z,{children:[(0,t.jsxs)(ei.Z,{children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,t.jsx)("h1",{className:"text-xl font-semibold",children:eS?(0,t.jsxs)(t.Fragment,{children:["Session: ",(0,t.jsx)("span",{className:"font-mono",children:eS}),(0,t.jsx)("button",{className:"ml-4 px-3 py-1 text-sm border rounded hover:bg-gray-50",onClick:()=>eC(null),children:"← Back to All Logs"})]}):"Request Logs"})}),ed&&ex&&ed.api_key===ex?(0,t.jsx)(M.Z,{keyId:ex,keyData:ed,accessToken:m,userID:h,userRole:x,teams:g,onClose:()=>eh(null),premiumUser:p,backButtonText:"Back to Logs"}):eS?(0,t.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,t.jsx)(c.w,{columns:v,data:eZ,renderSubComponent:eg,getRowCanExpand:()=>!0})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Q.Z,{options:eU,onApplyFilters:eq,onResetFilters:eF}),(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:f,onChange:e=>j(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:D,children:[(0,t.jsxs)("button",{onClick:()=>K(!Y),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"})}),eW]}),Y&&(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:[eV.map(e=>(0,t.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(eW===e.label?"bg-blue-50 text-blue-600":""),onClick:()=>{O(r()().format("YYYY-MM-DDTHH:mm")),I(r()().subtract(e.value,e.unit).format("YYYY-MM-DDTHH:mm")),eD({value:e.value,unit:e.unit}),F(!1),K(!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 ".concat(H?"bg-blue-50 text-blue-600":""),onClick:()=>F(!H),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)(et.Z,{color:"green",checked:eM,defaultChecked:!0,onChange:eT})]}),{}),(0,t.jsxs)("button",{onClick:()=>{eA.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,t.jsx)("svg",{className:"w-4 h-4 ".concat(eA.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,t.jsx)("span",{children:"Refresh"})]})]}),H&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{children:(0,t.jsx)("input",{type:"datetime-local",value:A,onChange:e=>{I(e.target.value),S(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:R,onChange:e=>{O(e.target.value),S(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 ",eA.isLoading?"...":eR?(_-1)*L+1:0," -"," ",eA.isLoading?"...":eR?Math.min(_*L,eR.total):0," ","of ",eA.isLoading?"...":eR?eR.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 ",eA.isLoading?"...":_," of"," ",eA.isLoading?"...":eR?eR.total_pages:1]}),(0,t.jsx)("button",{onClick:()=>S(e=>Math.max(1,e-1)),disabled:eA.isLoading||1===_,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:()=>S(e=>Math.min(eR.total_pages||1,e+1)),disabled:eA.isLoading||_===(eR.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"})]})]})]})}),eM&&1===_&&(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:()=>eT(!1),className:"text-sm text-green-600 hover:text-green-800",children:"Stop"})]}),(0,t.jsx)(c.w,{columns:v,data:eP,renderSubComponent:eg,getRowCanExpand:()=>!0})]})]})]}),(0,t.jsx)(ei.Z,{children:(0,t.jsx)(em,{userID:h,userRole:x,token:u,accessToken:m,isActive:"audit logs"===eN,premiumUser:p,allTeams:g})})]})]})})}function eg(e){var s,a,l,r,n,i,o,d,c,m;let{row:x}=e,h=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},g=x.original.metadata||{},p="failure"===g.status,j=p?g.error_information:null,v=x.original.messages&&(Array.isArray(x.original.messages)?x.original.messages.length>0:Object.keys(x.original.messages).length>0),b=x.original.response&&Object.keys(h(x.original.response)).length>0,y=g.vector_store_request_metadata&&Array.isArray(g.vector_store_request_metadata)&&g.vector_store_request_metadata.length>0,N=null===(s=x.original.metadata)||void 0===s?void 0:s.guardrail_information,w=Array.isArray(N)?N:N?[N]:[],k=w.length>0,C=w.reduce((e,s)=>{let a=null==s?void 0:s.masked_entity_count;return a?e+Object.values(a).reduce((e,s)=>"number"==typeof s?e+s:e,0):e},0),M=1===w.length?null!==(m=null===(a=w[0])||void 0===a?void 0:a.guardrail_name)&&void 0!==m?m:"-":w.length>1?"".concat(w.length," guardrails"):"-",T=(0,ex.aS)(x.original.request_id,64);return(0,t.jsxs)("div",{className:"p-6 bg-gray-50 space-y-6 w-full max-w-full overflow-hidden box-border",children:[(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden",children:[(0,t.jsx)("div",{className:"p-4 border-b",children:(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Request Details"})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 p-4 w-full max-w-full overflow-hidden",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:"Request ID:"}),x.original.request_id.length>64?(0,t.jsx)(u.Z,{title:x.original.request_id,children:(0,t.jsx)("span",{className:"font-mono text-sm",children:T})}):(0,t.jsx)("span",{className:"font-mono text-sm",children:x.original.request_id})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Model:"}),(0,t.jsx)("span",{children:x.original.model})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Model ID:"}),(0,t.jsx)("span",{children:x.original.model_id})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Call Type:"}),(0,t.jsx)("span",{children:x.original.call_type})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,t.jsx)("span",{children:x.original.custom_llm_provider||"-"})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"API Base:"}),(0,t.jsx)(u.Z,{title:x.original.api_base||"-",children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:x.original.api_base||"-"})})]}),(null==x?void 0:null===(l=x.original)||void 0===l?void 0:l.requester_ip_address)&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"IP Address:"}),(0,t.jsx)("span",{children:null==x?void 0:null===(r=x.original)||void 0===r?void 0:r.requester_ip_address})]}),k&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail:"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-mono",children:M}),C>0&&(0,t.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[C," masked"]})]})]})]}),(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:"Tokens:"}),(0,t.jsxs)("span",{children:[x.original.total_tokens," (",x.original.prompt_tokens," prompt tokens +"," ",x.original.completion_tokens," completion tokens)"]})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Cache Read Tokens:"}),(0,t.jsx)("span",{children:(0,f.pw)((null===(i=x.original.metadata)||void 0===i?void 0:null===(n=i.additional_usage_values)||void 0===n?void 0:n.cache_read_input_tokens)||0)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Cache Creation Tokens:"}),(0,t.jsx)("span",{children:(0,f.pw)(null===(o=x.original.metadata)||void 0===o?void 0:o.additional_usage_values.cache_creation_input_tokens)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Cost:"}),(0,t.jsxs)("span",{children:["$",(0,f.pw)(x.original.spend||0,6)]})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Cache Hit:"}),(0,t.jsx)("span",{children:x.original.cache_hit})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,t.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ".concat("failure"!==((null===(d=x.original.metadata)||void 0===d?void 0:d.status)||"Success").toLowerCase()?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:"failure"!==((null===(c=x.original.metadata)||void 0===c?void 0:c.status)||"Success").toLowerCase()?"Success":"Failure"})]}),(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:x.original.startTime})]}),(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:x.original.endTime})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,t.jsxs)("span",{children:[x.original.duration," s."]})]})]})]})]}),(0,t.jsx)(L,{show:!v&&!b}),(0,t.jsx)("div",{className:"w-full max-w-full overflow-hidden",children:(0,t.jsx)(_,{row:x,hasMessages:v,hasResponse:b,hasError:p,errorInfo:j,getRawRequest:()=>{var e;return(null===(e=x.original)||void 0===e?void 0:e.proxy_server_request)?h(x.original.proxy_server_request):h(x.original.messages)},formattedResponse:()=>p&&j?{error:{message:j.error_message||"An error occurred",type:j.error_class||"error",code:j.error_code||"unknown",param:null}}:h(x.original.response)})}),k&&(0,t.jsx)(G,{data:N}),y&&(0,t.jsx)(F,{data:g.vector_store_request_metadata}),p&&j&&(0,t.jsx)(S,{errorInfo:j}),x.original.request_tags&&Object.keys(x.original.request_tags).length>0&&(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsx)("div",{className:"flex justify-between items-center p-4 border-b",children:(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Request Tags"})}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(x.original.request_tags).map(e=>{let[s,a]=e;return(0,t.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[s,": ",String(a)]},s)})})})]}),x.original.metadata&&Object.keys(x.original.metadata).length>0&&(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Metadata"}),(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(JSON.stringify(x.original.metadata,null,2))},className:"p-1 hover:bg-gray-200 rounded",title:"Copy metadata",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,t.jsx)("div",{className:"p-4 overflow-auto max-h-64",children:(0,t.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(x.original.metadata,null,2)})})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3801-f335ffe9a3ef7ac2.js b/litellm/proxy/_experimental/out/_next/static/chunks/3801-f335ffe9a3ef7ac2.js new file mode 100644 index 00000000000..9656da7d32a --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/3801-f335ffe9a3ef7ac2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3801],{12363:function(e,s,a){a.d(s,{d:function(){return r},n:function(){return l}});var t=a(2265);let l=()=>{let[e,s]=(0,t.useState)("http://localhost:4000");return(0,t.useEffect)(()=>{{let{protocol:e,host:a}=window.location;s("".concat(e,"//").concat(a))}},[]),e},r=25},30841:function(e,s,a){a.d(s,{IE:function(){return r},LO:function(){return l},cT:function(){return n}});var t=a(19250);let l=async e=>{if(!e)return[];try{let{aliases:s}=await (0,t.keyAliasesCall)(e);return Array.from(new Set((s||[]).filter(Boolean)))}catch(e){return console.error("Error fetching all key aliases:",e),[]}},r=async(e,s)=>{if(!e)return[];try{let a=[],l=1,r=!0;for(;r;){let n=await (0,t.teamListCall)(e,s||null,null);a=[...a,...n],l{if(!e)return[];try{let s=[],a=1,l=!0;for(;l;){let r=await (0,t.organizationListCall)(e);s=[...s,...r],a{let{options:s,onApplyFilters:a,onResetFilters:d,initialValues:m={},buttonLabel:u="Filters"}=e,[x,h]=(0,l.useState)(!1),[g,p]=(0,l.useState)(m),[f,j]=(0,l.useState)({}),[v,b]=(0,l.useState)({}),[y,N]=(0,l.useState)({}),[w,k]=(0,l.useState)({}),_=(0,l.useCallback)(c()(async(e,s)=>{if(s.isSearchable&&s.searchFn){b(e=>({...e,[s.name]:!0}));try{let a=await s.searchFn(e);j(e=>({...e,[s.name]:a}))}catch(e){console.error("Error searching:",e),j(e=>({...e,[s.name]:[]}))}finally{b(e=>({...e,[s.name]:!1}))}}},300),[]),S=(0,l.useCallback)(async e=>{if(e.isSearchable&&e.searchFn&&!w[e.name]){b(s=>({...s,[e.name]:!0})),k(s=>({...s,[e.name]:!0}));try{let s=await e.searchFn("");j(a=>({...a,[e.name]:s}))}catch(s){console.error("Error loading initial options:",s),j(s=>({...s,[e.name]:[]}))}finally{b(s=>({...s,[e.name]:!1}))}}},[w]);(0,l.useEffect)(()=>{x&&s.forEach(e=>{e.isSearchable&&!w[e.name]&&S(e)})},[x,s,S,w]);let C=(e,s)=>{let t={...g,[e]:s};p(t),a(t)},L=(e,s)=>{e&&s.isSearchable&&!w[s.name]&&S(s)};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)(r.ZP,{icon:(0,t.jsx)(o.Z,{className:"h-4 w-4"}),onClick:()=>h(!x),className:"flex items-center gap-2",children:u}),(0,t.jsx)(r.ZP,{onClick:()=>{let e={};s.forEach(s=>{e[s.name]=""}),p(e),d()},children:"Reset Filters"})]}),x&&(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","Key Hash","Model"].map(e=>{let a=s.find(s=>s.label===e||s.name===e);return a?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("label",{className:"text-sm text-gray-600",children:a.label||a.name}),a.isSearchable?(0,t.jsx)(n.default,{showSearch:!0,className:"w-full",placeholder:"Search ".concat(a.label||a.name,"..."),value:g[a.name]||void 0,onChange:e=>C(a.name,e),onDropdownVisibleChange:e=>L(e,a),onSearch:e=>{N(s=>({...s,[a.name]:e})),a.searchFn&&_(e,a)},filterOption:!1,loading:v[a.name],options:f[a.name]||[],allowClear:!0,notFoundContent:v[a.name]?"Loading...":"No results found"}):a.options?(0,t.jsx)(n.default,{className:"w-full",placeholder:"Select ".concat(a.label||a.name,"..."),value:g[a.name]||void 0,onChange:e=>C(a.name,e),allowClear:!0,children:a.options.map(e=>(0,t.jsx)(n.default.Option,{value:e.value,children:e.label},e.value))}):(0,t.jsx)(i.default,{className:"w-full",placeholder:"Enter ".concat(a.label||a.name,"..."),value:g[a.name]||"",onChange:e=>C(a.name,e.target.value),allowClear:!0})]},a.name):null})})]})}},33801:function(e,s,a){a.d(s,{I:function(){return eg},Z:function(){return eh}});var t=a(57437),l=a(77398),r=a.n(l),n=a(11713),i=a(2265),o=a(29827),d=a(19250),c=a(12322),m=a(59872),u=a(41649),x=a(78489),h=a(99981),g=a(42673);let p=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"}},f=e=>{let{utcTime:s}=e;return(0,t.jsx)("span",{style:{fontFamily:"monospace",width:"180px",display:"inline-block"},children:p(s)})},j=(e,s)=>{var a,t;return(null===(t=e.metadata)||void 0===t?void 0:null===(a=t.mcp_tool_call_metadata)||void 0===a?void 0:a.mcp_server_logo_url)?e.metadata.mcp_tool_call_metadata.mcp_server_logo_url:s?(0,g.dr)(s).logo:""},v=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,t.jsx)(()=>{let[e,a]=i.useState(s.getIsExpanded()),l=i.useCallback(()=>{a(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,t.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,t.jsx)("svg",{className:"w-4 h-4 transform transition-transform duration-75 ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,t.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Time",accessorKey:"startTime",cell:e=>(0,t.jsx)(f,{utcTime:e.getValue()})},{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 ".concat(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()||""),a=e.row.original.onSessionClick;return(0,t.jsx)(h.Z,{title:String(e.getValue()||""),children:(0,t.jsx)(x.Z,{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:()=>null==a?void 0:a(s),children:String(e.getValue()||"")})})}},{header:"Request ID",accessorKey:"request_id",cell:e=>(0,t.jsx)(h.Z,{title:String(e.getValue()||""),children:(0,t.jsx)("span",{className:"font-mono text-xs max-w-[15ch] truncate block",children:String(e.getValue()||"")})})},{header:"Cost",accessorKey:"spend",cell:e=>(0,t.jsx)(h.Z,{title:"$".concat(String(e.getValue()||0)," "),children:(0,t.jsx)("span",{children:(0,m.GS)(e.getValue()||0)})})},{header:"Duration (s)",accessorKey:"duration",cell:e=>(0,t.jsx)(h.Z,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Team Name",accessorKey:"metadata.user_api_key_team_alias",cell:e=>(0,t.jsx)(h.Z,{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)(h.Z,{title:s,children:(0,t.jsx)("span",{className:"font-mono max-w-[15ch] truncate block cursor-pointer hover:text-blue-600",onClick:()=>null==a?void 0:a(s),children:s})})}},{header:"Key Name",accessorKey:"metadata.user_api_key_alias",cell:e=>(0,t.jsx)(h.Z,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Model",accessorKey:"model",cell:e=>{let s=e.row.original,a=s.custom_llm_provider,l=String(e.getValue()||"");return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,t.jsx)("img",{src:j(s,a),alt:"",className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)(h.Z,{title:l,children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:l})})]})}},{header:"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)(h.Z,{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)(h.Z,{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),l=a[0],r=a.slice(1);return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:(0,t.jsx)(h.Z,{title:(0,t.jsx)("div",{className:"flex flex-col gap-1",children:a.map(e=>{let[s,a]=e;return(0,t.jsxs)("span",{children:[s,": ",String(a)]},s)})}),children:(0,t.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[l[0],": ",String(l[1]),r.length>0&&" +".concat(r.length)]})})})}}],b=e=>(0,t.jsx)(u.Z,{color:"gray",className:"flex items-center gap-1",children:(0,t.jsx)("span",{className:"whitespace-nowrap text-xs",children:e})}),y=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,t.jsx)(()=>{let[e,a]=i.useState(s.getIsExpanded()),l=i.useCallback(()=>{a(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,t.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,t.jsx)("svg",{className:"w-4 h-4 transform transition-transform ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,t.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Timestamp",accessorKey:"updated_at",cell:e=>(0,t.jsx)(f,{utcTime:e.getValue()})},{header:"Table Name",accessorKey:"table_name",cell:e=>{let s=e.getValue(),a=s;switch(s){case"LiteLLM_VerificationToken":a="Keys";break;case"LiteLLM_TeamTable":a="Teams";break;case"LiteLLM_OrganizationTable":a="Organizations";break;case"LiteLLM_UserTable":a="Users";break;case"LiteLLM_ProxyModelTable":a="Models";break;default:a=s}return(0,t.jsx)("span",{children:a})}},{header:"Action",accessorKey:"action",cell:e=>(0,t.jsx)("span",{children:b(e.getValue())})},{header:"Changed By",accessorKey:"changed_by",cell:e=>{let s=e.row.original.changed_by,a=e.row.original.changed_by_api_key;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"font-medium",children:s}),a&&(0,t.jsx)(h.Z,{title:a,children:(0,t.jsxs)("div",{className:"text-xs text-muted-foreground max-w-[15ch] truncate",children:[" ",a]})})]})}},{header:"Affected Item ID",accessorKey:"object_id",cell:e=>(0,t.jsx)(()=>{let s=e.getValue(),[a,l]=(0,i.useState)(!1);if(!s)return(0,t.jsx)(t.Fragment,{children:"-"});let r=async()=>{try{await navigator.clipboard.writeText(String(s)),l(!0),setTimeout(()=>l(!1),1500)}catch(e){console.error("Failed to copy object ID: ",e)}};return(0,t.jsx)(h.Z,{title:a?"Copied!":String(s),children:(0,t.jsx)("span",{className:"max-w-[20ch] truncate block cursor-pointer hover:text-blue-600",onClick:r,children:String(s)})})},{})}],N=async(e,s,a,t)=>{console.log("prefetchLogDetails called with",e.length,"logs");let l=e.map(e=>{if(e.request_id)return console.log("Prefetching details for request_id:",e.request_id),t.prefetchQuery({queryKey:["logDetails",e.request_id,s],queryFn:async()=>{console.log("Fetching details for",e.request_id);let t=await (0,d.uiSpendLogDetailsCall)(a,e.request_id,s);return console.log("Received details for",e.request_id,":",t?"success":"failed"),t},staleTime:6e5,gcTime:6e5})});try{let e=await Promise.all(l);return console.log("All prefetch promises completed:",e.length),e}catch(e){throw console.error("Error in prefetchLogDetails:",e),e}};var w=a(9114),k=a(86669);function _(e){let{row:s,hasMessages:a,hasResponse:l,hasError:r,errorInfo:n,getRawRequest:i,formattedResponse:o}=e,d=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let a=document.execCommand("copy");if(document.body.removeChild(s),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},c=async()=>{await d(JSON.stringify(i(),null,2))?w.Z.success("Request copied to clipboard"):w.Z.fromBackend("Failed to copy request")},m=async()=>{await d(JSON.stringify(o(),null,2))?w.Z.success("Response copied to clipboard"):w.Z.fromBackend("Failed to copy response")};return(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 w-full max-w-full overflow-hidden box-border",children:[(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Request"}),(0,t.jsx)("button",{onClick:c,className:"p-1 hover:bg-gray-200 rounded",title:"Copy request",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,t.jsx)("div",{className:"p-4 overflow-auto max-h-96 w-full max-w-full box-border",children:(0,t.jsx)("div",{className:"[&_[role='tree']]:bg-white [&_[role='tree']]:text-slate-900",children:(0,t.jsx)(k.gc,{data:i(),style:k.jF,clickToExpandNode:!0})})})]}),(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,t.jsxs)("h3",{className:"text-lg font-medium",children:["Response",r&&(0,t.jsxs)("span",{className:"ml-2 text-sm text-red-600",children:["• HTTP code ",(null==n?void 0:n.error_code)||400]})]}),(0,t.jsx)("button",{onClick:m,className:"p-1 hover:bg-gray-200 rounded",title:"Copy response",disabled:!l,children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,t.jsx)("div",{className:"p-4 overflow-auto max-h-96 w-full max-w-full box-border",children:l?(0,t.jsx)("div",{className:"[&_[role='tree']]:bg-white [&_[role='tree']]:text-slate-900",children:(0,t.jsx)(k.gc,{data:i(),style:k.jF,clickToExpandNode:!0})}):(0,t.jsx)("div",{className:"text-gray-500 text-sm italic text-center py-4",children:"Response data not available"})})]})]})}a(52621);let S=e=>{var s;let{errorInfo:a}=e,[l,r]=i.useState({}),[n,o]=i.useState(!1),d=e=>{r(s=>({...s,[e]:!s[e]}))},c=a.traceback&&(s=a.traceback)?Array.from(s.matchAll(/File "([^"]+)", line (\d+)/g)).map(e=>{let a=e[1],t=e[2],l=a.split("/").pop()||a,r=e.index||0,n=s.indexOf('File "',r+1),i=n>-1?s.substring(r,n).trim():s.substring(r).trim(),o=i.split("\n"),d="";return o.length>1&&(d=o[o.length-1].trim()),{filePath:a,fileName:l,lineNumber:t,code:d,inFunction:i.includes(" in ")?i.split(" in ")[1].split("\n")[0]:""}}):[];return(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsx)("div",{className:"p-4 border-b",children:(0,t.jsxs)("h3",{className:"text-lg font-medium flex items-center text-red-600",children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,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"})}),"Error Details"]})}),(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"bg-red-50 rounded-md p-4 mb-4",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"text-red-800 font-medium w-20",children:"Type:"}),(0,t.jsx)("span",{className:"text-red-700",children:a.error_class||"Unknown Error"})]}),(0,t.jsxs)("div",{className:"flex mt-2",children:[(0,t.jsx)("span",{className:"text-red-800 font-medium w-20 flex-shrink-0",children:"Message:"}),(0,t.jsx)("span",{className:"text-red-700 break-words whitespace-pre-wrap",children:a.error_message||"Unknown error occurred"})]})]}),a.traceback&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsx)("h4",{className:"font-medium",children:"Traceback"}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsx)("button",{onClick:()=>{let e=!n;if(o(e),c.length>0){let s={};c.forEach((a,t)=>{s[t]=e}),r(s)}},className:"text-gray-500 hover:text-gray-700 flex items-center text-sm",children:n?"Collapse All":"Expand All"}),(0,t.jsxs)("button",{onClick:()=>navigator.clipboard.writeText(a.traceback||""),className:"text-gray-500 hover:text-gray-700 flex items-center",title:"Copy traceback",children:[(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),(0,t.jsx)("span",{className:"ml-1",children:"Copy"})]})]})]}),(0,t.jsx)("div",{className:"bg-white rounded-md border border-gray-200 overflow-hidden shadow-sm",children:c.map((e,s)=>(0,t.jsxs)("div",{className:"border-b border-gray-200 last:border-b-0",children:[(0,t.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between cursor-pointer hover:bg-gray-50",onClick:()=>d(s),children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"text-gray-400 mr-2 w-12 text-right",children:e.lineNumber}),(0,t.jsx)("span",{className:"text-gray-600 font-medium",children:e.fileName}),(0,t.jsx)("span",{className:"text-gray-500 mx-1",children:"in"}),(0,t.jsx)("span",{className:"text-indigo-600 font-medium",children:e.inFunction||e.fileName})]}),(0,t.jsx)("svg",{className:"w-5 h-5 text-gray-500 transition-transform ".concat(l[s]?"transform rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(l[s]||!1)&&e.code&&(0,t.jsx)("div",{className:"px-12 py-2 font-mono text-sm text-gray-800 bg-gray-50 overflow-x-auto border-t border-gray-100",children:e.code})]},s))})]})]})]})};var C=a(20347);let L=e=>{let{show:s}=e;return s?(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:"]}),(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:\n store_model_in_db: true\n 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};var M=a(94292),T=a(12514),E=a(35829),D=a(84264),A=a(96761),I=a(10900),R=a(5545),O=a(30401),H=a(78867);let q=e=>{let{sessionId:s,logs:a,onBack:l}=e,[r,n]=(0,i.useState)(null),[o,d]=(0,i.useState)({}),u=a.reduce((e,s)=>e+(s.spend||0),0),g=a.reduce((e,s)=>e+(s.total_tokens||0),0),p=a.reduce((e,s)=>{var a,t;return e+((null===(t=s.metadata)||void 0===t?void 0:null===(a=t.additional_usage_values)||void 0===a?void 0:a.cache_read_input_tokens)||0)},0),f=a.reduce((e,s)=>{var a,t;return e+((null===(t=s.metadata)||void 0===t?void 0:null===(a=t.additional_usage_values)||void 0===a?void 0:a.cache_creation_input_tokens)||0)},0),j=g+p+f,b=a.length>0?new Date(a[0].startTime):new Date;(((a.length>0?new Date(a[a.length-1].endTime):new Date).getTime()-b.getTime())/1e3).toFixed(2),a.map(e=>({time:new Date(e.startTime).toISOString(),tokens:e.total_tokens||0,cost:e.spend||0}));let y=async(e,s)=>{await (0,m.vQ)(e)&&(d(e=>({...e,[s]:!0})),setTimeout(()=>{d(e=>({...e,[s]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)(x.Z,{icon:I.Z,variant:"light",onClick:l,className:"mb-4",children:"Back to All Logs"}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold text-gray-900",children:"Session Details"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)("p",{className:"text-sm text-gray-500 font-mono",children:s}),(0,t.jsx)(R.ZP,{type:"text",size:"small",icon:o["session-id"]?(0,t.jsx)(O.Z,{size:12}):(0,t.jsx)(H.Z,{size:12}),onClick:()=>y(s,"session-id"),className:"left-2 z-10 transition-all duration-200 ".concat(o["session-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,t.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/ui_logs_sessions",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:text-blue-800 flex items-center gap-1",children:["Get started with session management here",(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:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,t.jsxs)(T.Z,{children:[(0,t.jsx)(D.Z,{children:"Total Requests"}),(0,t.jsx)(E.Z,{children:a.length})]}),(0,t.jsxs)(T.Z,{children:[(0,t.jsx)(D.Z,{children:"Total Cost"}),(0,t.jsxs)(E.Z,{children:["$",(0,m.pw)(u,6)]})]}),(0,t.jsx)(h.Z,{title:(0,t.jsxs)("div",{className:"text-white min-w-[200px]",children:[(0,t.jsx)("div",{className:"text-lg font-medium mb-3",children:"Usage breakdown"}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-base font-medium mb-2",children:"Input usage:"}),(0,t.jsxs)("div",{className:"space-y-2 text-sm text-gray-300",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"input:"}),(0,t.jsx)("span",{className:"ml-8",children:(0,m.pw)(a.reduce((e,s)=>e+(s.prompt_tokens||0),0))})]}),p>0&&(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"input_cached_tokens:"}),(0,t.jsx)("span",{className:"ml-8",children:(0,m.pw)(p)})]}),f>0&&(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"input_cache_creation_tokens:"}),(0,t.jsx)("span",{className:"ml-8",children:(0,m.pw)(f)})]})]})]}),(0,t.jsxs)("div",{className:"border-t border-gray-600 pt-3",children:[(0,t.jsx)("div",{className:"text-base font-medium mb-2",children:"Output usage:"}),(0,t.jsx)("div",{className:"space-y-2 text-sm text-gray-300",children:(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"output:"}),(0,t.jsx)("span",{className:"ml-8",children:(0,m.pw)(a.reduce((e,s)=>e+(s.completion_tokens||0),0))})]})})]}),(0,t.jsx)("div",{className:"border-t border-gray-600 pt-3",children:(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-base font-medium",children:"Total usage:"}),(0,t.jsx)("span",{className:"text-sm text-gray-300",children:(0,m.pw)(j)})]})})]})]}),placement:"top",overlayStyle:{minWidth:"300px"},children:(0,t.jsxs)(T.Z,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(D.Z,{children:"Total Tokens"}),(0,t.jsx)("span",{className:"text-gray-400 text-sm",children:"ⓘ"})]}),(0,t.jsx)(E.Z,{children:(0,m.pw)(j)})]})})]}),(0,t.jsx)(A.Z,{children:"Session Logs"}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(c.w,{columns:v,data:a,renderSubComponent:eg,getRowCanExpand:()=>!0,loadingMessage:"Loading logs...",noDataMessage:"No logs found"})})]})};function F(e){let{data:s}=e,[a,l]=(0,i.useState)(!0),[r,n]=(0,i.useState)({});if(!s||0===s.length)return null;let o=e=>new Date(1e3*e).toLocaleString(),d=(e,s)=>"".concat(((s-e)*1e3).toFixed(2),"ms"),c=(e,s)=>{let a="".concat(e,"-").concat(s);n(e=>({...e,[a]:!e[a]}))};return(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>l(!a),children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 text-gray-600 transition-transform ".concat(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)("h3",{className:"text-lg font-medium",children:"Vector Store Requests"})]}),(0,t.jsx)("span",{className:"text-sm text-gray-500",children:a?"Click to collapse":"Click to expand"})]}),a&&(0,t.jsx)("div",{className:"p-4",children:s.map((e,s)=>(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,g.dr)(e.custom_llm_provider);return(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)("img",{src:s,alt:"".concat(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:o(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:o(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:d(e.start_time,e.end_time)})]})]})]})}),(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,a)=>{let l=r["".concat(s,"-").concat(a)]||!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:()=>c(s,a),children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(l?"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 ",a+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)})]})]})]}),l&&(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))})]},a)})})]},s))})]})}let Y=e=>e>=.8?"text-green-600":"text-yellow-600";var K=e=>{let{entities:s}=e,[a,l]=(0,i.useState)(!0),[r,n]=(0,i.useState)({}),o=e=>{n(s=>({...s,[e]:!s[e]}))};return s&&0!==s.length?(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"flex items-center mb-2 cursor-pointer",onClick:()=>l(!a),children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(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 (",s.length,")"]})]}),a&&(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>{let a=r[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:()=>o(s),children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(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 ".concat(Y(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:Y(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};let P=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"slate";return(0,t.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block ".concat({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})},Z=e=>e?P("detected","red"):P("not detected","slate"),U=e=>{let{title:s,count:a,defaultOpen:l=!0,right:r,children:n}=e,[o,d]=(0,i.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:()=>d(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 ".concat(o?"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:[s," ","number"==typeof a&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal",children:["(",a,")"]})]})]}),(0,t.jsx)("div",{children:r})]}),o&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:n})]})},V=e=>{let{label:s,children:a,mono:l}=e;return(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:s}),(0,t.jsx)("span",{className:l?"font-mono text-sm break-all":"",children:a})]})},B=()=>(0,t.jsx)("div",{className:"my-3 border-t"});var W=e=>{var s,a,l,r,n,i,o,d,c,m;let{response:u}=e;if(!u)return null;let x=null!==(n=null!==(r=u.outputs)&&void 0!==r?r:u.output)&&void 0!==n?n:[],h="GUARDRAIL_INTERVENED"===u.action?"red":"green",g=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(null===(s=u.guardrailCoverage)||void 0===s?void 0:s.textCharacters)&&P("text guarded ".concat(null!==(i=u.guardrailCoverage.textCharacters.guarded)&&void 0!==i?i:0,"/").concat(null!==(o=u.guardrailCoverage.textCharacters.total)&&void 0!==o?o:0),"blue"),(null===(a=u.guardrailCoverage)||void 0===a?void 0:a.images)&&P("images guarded ".concat(null!==(d=u.guardrailCoverage.images.guarded)&&void 0!==d?d:0,"/").concat(null!==(c=u.guardrailCoverage.images.total)&&void 0!==c?c:0),"blue")]}),p=u.usage&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(u.usage).map(e=>{let[s,a]=e;return"number"==typeof a?(0,t.jsxs)("span",{className:"px-2 py-1 bg-slate-100 text-slate-800 rounded-md text-xs font-medium",children:[s,": ",a]},s):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)(V,{label:"Action:",children:P(null!==(m=u.action)&&void 0!==m?m:"N/A",h)}),u.actionReason&&(0,t.jsx)(V,{label:"Action Reason:",children:u.actionReason}),u.blockedResponse&&(0,t.jsx)(V,{label:"Blocked Response:",children:(0,t.jsx)("span",{className:"italic",children:u.blockedResponse})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{label:"Coverage:",children:g}),(0,t.jsx)(V,{label:"Usage:",children:p})]})]}),x.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B,{}),(0,t.jsx)("h4",{className:"font-medium mb-2",children:"Outputs"}),(0,t.jsx)("div",{className:"space-y-2",children:x.map((e,s)=>{var a;return(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsx)("div",{className:"text-sm whitespace-pre-wrap",children:null!==(a=e.text)&&void 0!==a?a:(0,t.jsx)("em",{children:"(non-text output)"})})},s)})})]})]}),(null===(l=u.assessments)||void 0===l?void 0:l.length)?(0,t.jsx)("div",{className:"space-y-3",children:u.assessments.map((e,s)=>{var a,l,r,n,i,o,d,c,m,u,x,h,g,p,f,j,v,b,y,N,w,k,_,S;let C=(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.wordPolicy&&P("word","slate"),e.contentPolicy&&P("content","slate"),e.topicPolicy&&P("topic","slate"),e.sensitiveInformationPolicy&&P("sensitive-info","slate"),e.contextualGroundingPolicy&&P("contextual-grounding","slate"),e.automatedReasoningPolicy&&P("automated-reasoning","slate")]});return(0,t.jsxs)(U,{title:"Assessment #".concat(s+1),defaultOpen:!0,right:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(null===(a=e.invocationMetrics)||void 0===a?void 0:a.guardrailProcessingLatency)!=null&&P("".concat(e.invocationMetrics.guardrailProcessingLatency," ms"),"amber"),C]}),children:[e.wordPolicy&&(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Word Policy"}),(null!==(j=null===(l=e.wordPolicy.customWords)||void 0===l?void 0:l.length)&&void 0!==j?j:0)>0&&(0,t.jsx)(U,{title:"Custom Words",defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:e.wordPolicy.customWords.map((e,s)=>{var a;return(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:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-mono text-sm break-all",children:e.match})]}),Z(e.detected)]},s)})})}),(null!==(v=null===(r=e.wordPolicy.managedWordLists)||void 0===r?void 0:r.length)&&void 0!==v?v:0)>0&&(0,t.jsx)(U,{title:"Managed Word Lists",defaultOpen:!1,children:(0,t.jsx)("div",{className:"space-y-2",children:e.wordPolicy.managedWordLists.map((e,s)=>{var a;return(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:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-mono text-sm break-all",children:e.match}),e.type&&P(e.type,"slate")]}),Z(e.detected)]},s)})})})]}),(null===(i=e.contentPolicy)||void 0===i?void 0:null===(n=i.filters)||void 0===n?void 0:n.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)=>{var a,l,r,n;return(0,t.jsxs)("tr",{className:"border-t",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(a=e.type)&&void 0!==a?a:"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:P(null!==(l=e.action)&&void 0!==l?l:"—",e.detected?"red":"slate")}),(0,t.jsx)("td",{className:"py-1 pr-4",children:Z(e.detected)}),(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(r=e.filterStrength)&&void 0!==r?r:"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(n=e.confidence)&&void 0!==n?n:"—"})]},s)})})]})})]}):null,(null===(d=e.contextualGroundingPolicy)||void 0===d?void 0:null===(o=d.filters)||void 0===o?void 0:o.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)=>{var a,l,r,n;return(0,t.jsxs)("tr",{className:"border-t",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(a=e.type)&&void 0!==a?a:"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:P(null!==(l=e.action)&&void 0!==l?l:"—",e.detected?"red":"slate")}),(0,t.jsx)("td",{className:"py-1 pr-4",children:Z(e.detected)}),(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(r=e.score)&&void 0!==r?r:"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(n=e.threshold)&&void 0!==n?n:"—"})]},s)})})]})})]}):null,e.sensitiveInformationPolicy&&(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Sensitive Information"}),(null!==(b=null===(c=e.sensitiveInformationPolicy.piiEntities)||void 0===c?void 0:c.length)&&void 0!==b?b:0)>0&&(0,t.jsx)(U,{title:"PII Entities",defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:e.sensitiveInformationPolicy.piiEntities.map((e,s)=>{var a;return(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:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),e.type&&P(e.type,"slate"),(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e.match})]}),Z(e.detected)]},s)})})}),(null!==(y=null===(m=e.sensitiveInformationPolicy.regexes)||void 0===m?void 0:m.length)&&void 0!==y?y:0)>0&&(0,t.jsx)(U,{title:"Custom Regexes",defaultOpen:!1,children:(0,t.jsx)("div",{className:"space-y-2",children:e.sensitiveInformationPolicy.regexes.map((e,s)=>{var a,l;return(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:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-medium",children:null!==(l=e.name)&&void 0!==l?l:"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:[Z(e.detected),e.match&&(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e.match})]})]},s)})})})]}),(null===(x=e.topicPolicy)||void 0===x?void 0:null===(u=x.topics)||void 0===u?void 0:u.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)=>{var a,l;return(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:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-medium",children:null!==(l=e.name)&&void 0!==l?l:"topic"}),e.type&&P(e.type,"slate"),Z(e.detected)]})},s)})})]}):null,e.invocationMetrics&&(0,t.jsx)(U,{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)(V,{label:"Latency (ms)",children:null!==(N=e.invocationMetrics.guardrailProcessingLatency)&&void 0!==N?N:"—"}),(0,t.jsx)(V,{label:"Coverage:",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(null===(h=e.invocationMetrics.guardrailCoverage)||void 0===h?void 0:h.textCharacters)&&P("text ".concat(null!==(w=e.invocationMetrics.guardrailCoverage.textCharacters.guarded)&&void 0!==w?w:0,"/").concat(null!==(k=e.invocationMetrics.guardrailCoverage.textCharacters.total)&&void 0!==k?k:0),"blue"),(null===(g=e.invocationMetrics.guardrailCoverage)||void 0===g?void 0:g.images)&&P("images ".concat(null!==(_=e.invocationMetrics.guardrailCoverage.images.guarded)&&void 0!==_?_:0,"/").concat(null!==(S=e.invocationMetrics.guardrailCoverage.images.total)&&void 0!==S?S:0),"blue")]})})]}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsx)(V,{label:"Usage:",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.invocationMetrics.usage&&Object.entries(e.invocationMetrics.usage).map(e=>{let[s,a]=e;return"number"==typeof a?(0,t.jsxs)("span",{className:"px-2 py-1 bg-slate-100 text-slate-800 rounded-md text-xs font-medium",children:[s,": ",a]},s):null})})})})]})}),(null===(f=e.automatedReasoningPolicy)||void 0===f?void 0:null===(p=f.findings)||void 0===p?void 0:p.length)?(0,t.jsx)(U,{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)(U,{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(u,null,2)})})]})};let z=e=>new Date(1e3*e).toLocaleString(),J=e=>{var s,a;let{entry:l,index:r,total:n}=e,i=null!==(s=l.guardrail_provider)&&void 0!==s?s:"presidio",o=null!==(a=l.guardrail_status)&&void 0!==a?a:"unknown",d="success"===o.toLowerCase(),c=l.masked_entity_count||{},m=Object.values(c).reduce((e,s)=>e+("number"==typeof s?s:0),0),u=l.guardrail_response,x=Array.isArray(u)?u:[],g="bedrock"!==i||null===u||"object"!=typeof u||Array.isArray(u)?void 0:u;return(0,t.jsxs)("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[n>1&&(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("h4",{className:"text-base font-semibold",children:["Guardrail #",r+1,(0,t.jsx)("span",{className:"ml-2 font-mono text-sm text-gray-600",children:l.guardrail_name})]}),(0,t.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-600 rounded-md text-xs capitalize",children:i})]}),(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)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail Name:"}),(0,t.jsx)("span",{className:"font-mono break-words",children:l.guardrail_name})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Mode:"}),(0,t.jsx)("span",{className:"font-mono break-words",children:l.guardrail_mode})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,t.jsx)(h.Z,{title:d?null:"Guardrail failed to run.",placement:"top",arrow:!0,destroyTooltipOnHide:!0,children:(0,t.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block ".concat(d?"bg-green-100 text-green-800":"bg-red-100 text-red-800 cursor-help"),children:o})})]})]}),(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:z(l.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:z(l.end_time)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,t.jsxs)("span",{children:[l.duration.toFixed(4),"s"]})]})]})]}),m>0&&(0,t.jsxs)("div",{className:"mt-4 pt-4 border-t",children:[(0,t.jsx)("h5",{className:"font-medium mb-2",children:"Masked Entity Summary"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(c).map(e=>{let[s,a]=e;return(0,t.jsxs)("span",{className:"px-3 py-1.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[s,": ",a]},s)})})]}),"presidio"===i&&x.length>0&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(K,{entities:x})}),"bedrock"===i&&g&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(W,{response:g})})]})};var G=e=>{let{data:s}=e,a=Array.isArray(s)?s.filter(e=>!!e):s?[s]:[],[l,r]=(0,i.useState)(!0),n=1===a.length?a[0].guardrail_name:"".concat(a.length," guardrails"),o=Array.from(new Set(a.map(e=>e.guardrail_status))).every(e=>"success"===(null!=e?e:"").toLowerCase()),d=a.reduce((e,s)=>e+Object.values(s.masked_entity_count||{}).reduce((e,s)=>e+("number"==typeof s?s:0),0),0);return 0===a.length?null:(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>r(!l),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-5 h-5 text-gray-600 transition-transform ".concat(l?"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)("h3",{className:"text-lg font-medium",children:"Guardrail Information"}),(0,t.jsx)(h.Z,{title:o?null:"Guardrail failed to run.",placement:"top",arrow:!0,destroyTooltipOnHide:!0,children:(0,t.jsx)("span",{className:"ml-2 px-2 py-1 rounded-md text-xs font-medium inline-block ".concat(o?"bg-green-100 text-green-800":"bg-red-100 text-red-800 cursor-help"),children:o?"success":"failure"})}),(0,t.jsx)("span",{className:"ml-2 font-mono text-sm text-gray-600",children:n}),d>0&&(0,t.jsxs)("span",{className:"ml-2 px-2 py-1 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[d," masked ",1===d?"entity":"entities"]})]}),(0,t.jsx)("span",{className:"text-sm text-gray-500",children:l?"Click to collapse":"Click to expand"})]}),l&&(0,t.jsx)("div",{className:"p-4 space-y-6",children:a.map((e,s)=>{var l;return(0,t.jsx)(J,{entry:e,index:s,total:a.length},"".concat(null!==(l=e.guardrail_name)&&void 0!==l?l:"guardrail","-").concat(s))})})]})},Q=a(23048),$=a(30841),X=a(7310),ee=a.n(X),es=a(12363);let ea={TEAM_ID:"Team ID",KEY_HASH:"Key Hash",REQUEST_ID:"Request ID",MODEL:"Model",USER_ID:"User ID",END_USER:"End User",STATUS:"Status",KEY_ALIAS:"Key Alias"};var et=a(59341),el=a(12485),er=a(18135),en=a(35242),ei=a(29706),eo=a(77991),ed=a(92280);let ec="".concat("../ui/assets/","audit-logs-preview.png");function em(e){let{userID:s,userRole:a,token:l,accessToken:o,isActive:u,premiumUser:x,allTeams:h}=e,[g,p]=(0,i.useState)(r()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),f=(0,i.useRef)(null),j=(0,i.useRef)(null),[v,b]=(0,i.useState)(1),[N]=(0,i.useState)(50),[w,k]=(0,i.useState)({}),[_,S]=(0,i.useState)(""),[C,L]=(0,i.useState)(""),[M,T]=(0,i.useState)(""),[E,D]=(0,i.useState)("all"),[A,I]=(0,i.useState)("all"),[R,O]=(0,i.useState)(!1),[H,q]=(0,i.useState)(!1),F=(0,n.a)({queryKey:["all_audit_logs",o,l,a,s,g],queryFn:async()=>{if(!o||!l||!a||!s)return[];let e=r()(g).utc().format("YYYY-MM-DD HH:mm:ss"),t=r()().utc().format("YYYY-MM-DD HH:mm:ss"),n=[],i=1,c=1;do{let s=await (0,d.uiAuditLogsCall)(o,e,t,i,50);n=n.concat(s.audit_logs),c=s.total_pages,i++}while(i<=c);return n},enabled:!!o&&!!l&&!!a&&!!s&&u,refetchInterval:5e3,refetchIntervalInBackground:!0}),Y=(0,i.useCallback)(async e=>{if(o)try{let s=(await (0,d.keyListCall)(o,null,null,e,null,null,1,10)).keys.find(s=>s.key_alias===e);s?L(s.token):L("")}catch(e){console.error("Error fetching key hash for alias:",e),L("")}},[o]);(0,i.useEffect)(()=>{if(!o)return;let e=!1,s=!1;w["Team ID"]?_!==w["Team ID"]&&(S(w["Team ID"]),e=!0):""!==_&&(S(""),e=!0),w["Key Hash"]?C!==w["Key Hash"]&&(L(w["Key Hash"]),s=!0):w["Key Alias"]?Y(w["Key Alias"]):""!==C&&(L(""),s=!0),(e||s)&&b(1)},[w,o,Y,_,C]),(0,i.useEffect)(()=>{b(1)},[_,C,g,M,E,A]),(0,i.useEffect)(()=>{function e(e){f.current&&!f.current.contains(e.target)&&O(!1),j.current&&!j.current.contains(e.target)&&q(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let K=(0,i.useMemo)(()=>F.data?F.data.filter(e=>{var s,a,t,l,r,n,i;let o=!0,d=!0,c=!0,m=!0,u=!0;if(_){let r="string"==typeof e.before_value?null===(s=JSON.parse(e.before_value))||void 0===s?void 0:s.team_id:null===(a=e.before_value)||void 0===a?void 0:a.team_id,n="string"==typeof e.updated_values?null===(t=JSON.parse(e.updated_values))||void 0===t?void 0:t.team_id:null===(l=e.updated_values)||void 0===l?void 0:l.team_id;o=r===_||n===_}if(C)try{let s="string"==typeof e.before_value?JSON.parse(e.before_value):e.before_value,a="string"==typeof e.updated_values?JSON.parse(e.updated_values):e.updated_values,t=null==s?void 0:s.token,l=null==a?void 0:a.token;d="string"==typeof t&&t.includes(C)||"string"==typeof l&&l.includes(C)}catch(e){d=!1}if(M&&(c=null===(r=e.object_id)||void 0===r?void 0:r.toLowerCase().includes(M.toLowerCase())),"all"!==E&&(m=(null===(n=e.action)||void 0===n?void 0:n.toLowerCase())===E.toLowerCase()),"all"!==A){let s="";switch(A){case"keys":s="litellm_verificationtoken";break;case"teams":s="litellm_teamtable";break;case"users":s="litellm_usertable";break;default:s=A}u=(null===(i=e.table_name)||void 0===i?void 0:i.toLowerCase())===s}return o&&d&&c&&m&&u}):[],[F.data,_,C,M,E,A]),P=K.length,Z=Math.ceil(P/N)||1,U=(0,i.useMemo)(()=>{let e=(v-1)*N,s=e+N;return K.slice(e,s)},[K,v,N]),V=!F.data||0===F.data.length,B=(0,i.useCallback)(e=>{let{row:s}=e;return(0,t.jsx)(e=>{let{rowData:s}=e,{before_value:a,updated_values:l,table_name:r,action:n}=s,i=(e,s)=>{if(!e||0===Object.keys(e).length)return(0,t.jsx)(ed.x,{children:"N/A"});if(s){let s=Object.keys(e),a=["token","spend","max_budget"];if(s.every(e=>a.includes(e))&&s.length>0)return(0,t.jsxs)("div",{children:[s.includes("token")&&(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Token:"})," ",e.token||"N/A"]}),s.includes("spend")&&(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Spend:"})," ",void 0!==e.spend?"$".concat((0,m.pw)(e.spend,6)):"N/A"]}),s.includes("max_budget")&&(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Max Budget:"})," ",void 0!==e.max_budget?"$".concat((0,m.pw)(e.max_budget,6)):"N/A"]})]});if(e["No differing fields detected in 'before' state"]||e["No differing fields detected in 'updated' state"]||e["No fields changed"])return(0,t.jsx)(ed.x,{children:e[Object.keys(e)[0]]})}return(0,t.jsx)("pre",{className:"p-2 bg-gray-50 border rounded text-xs overflow-auto max-h-60",children:JSON.stringify(e,null,2)})},o=a,d=l;if(("updated"===n||"rotated"===n)&&a&&l&&("LiteLLM_TeamTable"===r||"LiteLLM_UserTable"===r||"LiteLLM_VerificationToken"===r)){let e={},s={};new Set([...Object.keys(a),...Object.keys(l)]).forEach(t=>{JSON.stringify(a[t])!==JSON.stringify(l[t])&&(a.hasOwnProperty(t)&&(e[t]=a[t]),l.hasOwnProperty(t)&&(s[t]=l[t]))}),Object.keys(a).forEach(t=>{l.hasOwnProperty(t)||e.hasOwnProperty(t)||(e[t]=a[t],s[t]=void 0)}),Object.keys(l).forEach(t=>{a.hasOwnProperty(t)||s.hasOwnProperty(t)||(s[t]=l[t],e[t]=void 0)}),o=Object.keys(e).length>0?e:{"No differing fields detected in 'before' state":"N/A"},d=Object.keys(s).length>0?s:{"No differing fields detected in 'updated' state":"N/A"},0===Object.keys(e).length&&0===Object.keys(s).length&&(o={"No fields changed":"N/A"},d={"No fields changed":"N/A"})}return(0,t.jsxs)("div",{className:"-mx-4 p-4 bg-slate-100 border-y border-slate-300 grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Before Value:"}),i(o,"LiteLLM_VerificationToken"===r)]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Updated Value:"}),i(d,"LiteLLM_VerificationToken"===r)]})]})},{rowData:s.original})},[]);if(!x)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)(ed.x,{style:{display:"block",marginBottom:"10px"},children:"This is a LiteLLM Enterprise feature, and requires a valid key to use."}),(0,t.jsx)(ed.x,{style:{display:"block",marginBottom:"20px",fontStyle:"italic"},children:"Here's a preview of what Audit Logs offer:"}),(0,t.jsx)("img",{src:ec,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=>{console.error("Failed to load audit logs preview image"),e.target.style.display="none"}})]});let W=P>0?(v-1)*N+1:0,z=Math.min(v*N,P);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4"}),(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)("h1",{className:"text-xl font-semibold py-4",children:"Audit Logs"}),(0,t.jsx)(e=>{let{show:s}=e;return s?(0,t.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start mb-6",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:"Audit Logs Not Available"}),(0,t.jsx)("p",{className:"text-sm text-blue-700 mt-1",children:"To enable audit logging, add the following configuration to your LiteLLM proxy configuration file:"}),(0,t.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:"litellm_settings:\n store_audit_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 and proxy restart."})]})]}):null},{show:V}),(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",children:[(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)("input",{type:"text",placeholder:"Search by Object ID...",value:M,onChange:e=>T(e.target.value),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)("button",{onClick:()=>{F.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,t.jsx)("svg",{className:"w-4 h-4 ".concat(F.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,t.jsx)("span",{children:"Refresh"})]})]})}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsxs)("div",{className:"relative",ref:f,children:[(0,t.jsx)("label",{htmlFor:"actionFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Action:"}),(0,t.jsxs)("button",{id:"actionFilterDisplay",onClick:()=>O(!R),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,t.jsxs)("span",{children:["all"===E&&"All Actions","created"===E&&"Created","updated"===E&&"Updated","deleted"===E&&"Deleted","rotated"===E&&"Rotated"]}),(0,t.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),R&&(0,t.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,t.jsx)("div",{className:"space-y-1",children:[{label:"All Actions",value:"all"},{label:"Created",value:"created"},{label:"Updated",value:"updated"},{label:"Deleted",value:"deleted"},{label:"Rotated",value:"rotated"}].map(e=>(0,t.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(E===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{D(e.value),O(!1)},children:e.label},e.value))})})]}),(0,t.jsxs)("div",{className:"relative",ref:j,children:[(0,t.jsx)("label",{htmlFor:"tableFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Table:"}),(0,t.jsxs)("button",{id:"tableFilterDisplay",onClick:()=>q(!H),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,t.jsxs)("span",{children:["all"===A&&"All Tables","keys"===A&&"Keys","teams"===A&&"Teams","users"===A&&"Users"]}),(0,t.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),H&&(0,t.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,t.jsx)("div",{className:"space-y-1",children:[{label:"All Tables",value:"all"},{label:"Keys",value:"keys"},{label:"Teams",value:"teams"},{label:"Users",value:"users"}].map(e=>(0,t.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(A===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{I(e.value),q(!1)},children:e.label},e.value))})})]}),(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing ",F.isLoading?"...":W," -"," ",F.isLoading?"...":z," of"," ",F.isLoading?"...":P," results"]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",F.isLoading?"...":v," of"," ",F.isLoading?"...":Z]}),(0,t.jsx)("button",{onClick:()=>b(e=>Math.max(1,e-1)),disabled:F.isLoading||1===v,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:()=>b(e=>Math.min(Z,e+1)),disabled:F.isLoading||v===Z,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)(c.w,{columns:y,data:U,renderSubComponent:B,getRowCanExpand:()=>!0})]})]})}let eu=(e,s,a)=>{if(e)return"".concat(r()(s).format("MMM D, h:mm A")," - ").concat(r()(a).format("MMM D, h:mm A"));let t=r()(),l=r()(s),n=t.diff(l,"minutes");if(n>=0&&n<2)return"Last 1 Minute";if(n>=2&&n<16)return"Last 15 Minutes";if(n>=16&&n<61)return"Last Hour";let i=t.diff(l,"hours");return i>=1&&i<5?"Last 4 Hours":i>=5&&i<25?"Last 24 Hours":i>=25&&i<169?"Last 7 Days":"".concat(l.format("MMM D")," - ").concat(t.format("MMM D"))};var ex=a(9309);function eh(e){var s,a,l;let{accessToken:m,token:u,userRole:x,userID:h,allTeams:g,premiumUser:p}=e,[f,j]=(0,i.useState)(""),[b,y]=(0,i.useState)(!1),[w,k]=(0,i.useState)(!1),[_,S]=(0,i.useState)(1),[L]=(0,i.useState)(50),T=(0,i.useRef)(null),E=(0,i.useRef)(null),D=(0,i.useRef)(null),[A,I]=(0,i.useState)(r()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),[R,O]=(0,i.useState)(r()().format("YYYY-MM-DDTHH:mm")),[H,F]=(0,i.useState)(!1),[Y,K]=(0,i.useState)(!1),[P,Z]=(0,i.useState)(""),[U,V]=(0,i.useState)(""),[B,W]=(0,i.useState)(""),[z,J]=(0,i.useState)(""),[G,X]=(0,i.useState)(""),[ed,ec]=(0,i.useState)(null),[ex,eh]=(0,i.useState)(null),[ep,ef]=(0,i.useState)(""),[ej,ev]=(0,i.useState)(""),[eb,ey]=(0,i.useState)(x&&C.lo.includes(x)),[eN,ew]=(0,i.useState)("request logs"),[ek,e_]=(0,i.useState)(null),[eS,eC]=(0,i.useState)(null),eL=(0,o.NL)(),[eM,eT]=(0,i.useState)(()=>{let e=sessionStorage.getItem("isLiveTail");return null===e||JSON.parse(e)});(0,i.useEffect)(()=>{sessionStorage.setItem("isLiveTail",JSON.stringify(eM))},[eM]);let[eE,eD]=(0,i.useState)({value:24,unit:"hours"});(0,i.useEffect)(()=>{(async()=>{ex&&m&&ec({...(await (0,d.keyInfoV1Call)(m,ex)).info,token:ex,api_key:ex})})()},[ex,m]),(0,i.useEffect)(()=>{function e(e){T.current&&!T.current.contains(e.target)&&k(!1),E.current&&!E.current.contains(e.target)&&y(!1),D.current&&!D.current.contains(e.target)&&K(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,i.useEffect)(()=>{x&&C.lo.includes(x)&&ey(!0)},[x]);let eA=(0,n.a)({queryKey:["logs","table",_,L,A,R,B,z,eb?h:null,ep,G],queryFn:async()=>{if(!m||!u||!x||!h)return{data:[],total:0,page:1,page_size:L,total_pages:0};let e=r()(A).utc().format("YYYY-MM-DD HH:mm:ss"),s=H?r()(R).utc().format("YYYY-MM-DD HH:mm:ss"):r()().utc().format("YYYY-MM-DD HH:mm:ss"),a=await (0,d.uiSpendLogsCall)(m,z||void 0,B||void 0,void 0,e,s,_,L,eb?h:void 0,ej,ep,G);return await N(a.data,e,m,eL),a.data=a.data.map(s=>{let a=eL.getQueryData(["logDetails",s.request_id,e]);return(null==a?void 0:a.messages)&&(null==a?void 0:a.response)&&(s.messages=a.messages,s.response=a.response),s}),a},enabled:!!m&&!!u&&!!x&&!!h&&"request logs"===eN,refetchInterval:!!eM&&1===_&&15e3,refetchIntervalInBackground:!0}),{filters:eI,filteredLogs:eR,allTeams:eO,allKeyAliases:eH,handleFilterChange:eq,handleFilterReset:eF}=function(e){let{logs:s,accessToken:a,startTime:t,endTime:l,pageSize:o=es.d,isCustomDate:c,setCurrentPage:m,userID:u,userRole:x}=e,h=(0,i.useMemo)(()=>({[ea.TEAM_ID]:"",[ea.KEY_HASH]:"",[ea.REQUEST_ID]:"",[ea.MODEL]:"",[ea.USER_ID]:"",[ea.END_USER]:"",[ea.STATUS]:"",[ea.KEY_ALIAS]:""}),[]),[g,p]=(0,i.useState)(h),[f,j]=(0,i.useState)({data:[],total:0,page:1,page_size:50,total_pages:0}),v=(0,i.useRef)(0),b=(0,i.useCallback)(async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!a)return;console.log("Filters being sent to API:",e);let n=Date.now();v.current=n;let i=r()(t).utc().format("YYYY-MM-DD HH:mm:ss"),m=c?r()(l).utc().format("YYYY-MM-DD HH:mm:ss"):r()().utc().format("YYYY-MM-DD HH:mm:ss");try{let t=await (0,d.uiSpendLogsCall)(a,e[ea.KEY_HASH]||void 0,e[ea.TEAM_ID]||void 0,e[ea.REQUEST_ID]||void 0,i,m,s,o,e[ea.USER_ID]||void 0,e[ea.END_USER]||void 0,e[ea.STATUS]||void 0,e[ea.MODEL]||void 0,e[ea.KEY_ALIAS]||void 0);n===v.current&&t.data&&j(t)}catch(e){console.error("Error searching users:",e)}},[a,t,l,c,o]),y=(0,i.useMemo)(()=>ee()((e,s)=>b(e,s),300),[b]);(0,i.useEffect)(()=>()=>y.cancel(),[y]);let N=(0,n.a)({queryKey:["allKeys"],queryFn:async()=>{if(!a)throw Error("Access token required");return await (0,$.LO)(a)},enabled:!!a}).data||[],w=(0,i.useMemo)(()=>!!(g[ea.KEY_ALIAS]||g[ea.KEY_HASH]||g[ea.REQUEST_ID]||g[ea.USER_ID]||g[ea.END_USER]),[g]),k=(0,i.useMemo)(()=>{if(!s||!s.data)return{data:[],total:0,page:1,page_size:50,total_pages:0};if(w)return s;let e=[...s.data];return g[ea.TEAM_ID]&&(e=e.filter(e=>e.team_id===g[ea.TEAM_ID])),g[ea.STATUS]&&(e=e.filter(e=>"success"===g[ea.STATUS]?!e.status||"success"===e.status:e.status===g[ea.STATUS])),g[ea.MODEL]&&(e=e.filter(e=>e.model===g[ea.MODEL])),g[ea.KEY_HASH]&&(e=e.filter(e=>e.api_key===g[ea.KEY_HASH])),g[ea.END_USER]&&(e=e.filter(e=>e.end_user===g[ea.END_USER])),{data:e,total:s.total,page:s.page,page_size:s.page_size,total_pages:s.total_pages}},[s,g,w]),_=(0,i.useMemo)(()=>w?f&&f.data&&f.data.length>0?f:s||{data:[],total:0,page:1,page_size:50,total_pages:0}:k,[w,f,k,s]),{data:S}=(0,n.a)({queryKey:["allTeamsForLogFilters",a],queryFn:async()=>a&&await (0,$.IE)(a)||[],enabled:!!a});return{filters:g,filteredLogs:_,allKeyAliases:N,allTeams:S,handleFilterChange:e=>{p(s=>{let a={...s,...e};for(let e of Object.keys(h))e in a||(a[e]=h[e]);return JSON.stringify(a)!==JSON.stringify(s)&&(m(1),y(a,1)),a})},handleFilterReset:()=>{p(h),j({data:[],total:0,page:1,page_size:50,total_pages:0}),y(h,1)}}}({logs:eA.data||{data:[],total:0,page:1,page_size:L||10,total_pages:1},accessToken:m,startTime:A,endTime:R,pageSize:L,isCustomDate:H,setCurrentPage:S,userID:h,userRole:x}),eY=(0,i.useCallback)(async e=>{if(m)try{let s=(await (0,d.keyListCall)(m,null,null,e,null,null,_,L)).keys.find(s=>s.key_alias===e);s&&J(s.token)}catch(e){console.error("Error fetching key hash for alias:",e)}},[m,_,L]);(0,i.useEffect)(()=>{m&&(eI["Team ID"]?W(eI["Team ID"]):W(""),ef(eI.Status||""),X(eI.Model||""),ev(eI["End User"]||""),eI["Key Hash"]?J(eI["Key Hash"]):eI["Key Alias"]?eY(eI["Key Alias"]):J(""))},[eI,m,eY]);let eK=(0,n.a)({queryKey:["sessionLogs",eS],queryFn:async()=>{if(!m||!eS)return{data:[],total:0,page:1,page_size:50,total_pages:1};let e=await (0,d.sessionSpendLogsCall)(m,eS);return{data:e.data||e||[],total:(e.data||e||[]).length,page:1,page_size:1e3,total_pages:1}},enabled:!!m&&!!eS});if((0,i.useEffect)(()=>{var e;(null===(e=eA.data)||void 0===e?void 0:e.data)&&ek&&!eA.data.data.some(e=>e.request_id===ek)&&e_(null)},[null===(s=eA.data)||void 0===s?void 0:s.data,ek]),!m||!u||!x||!h)return null;let eP=eR.data.filter(e=>!f||e.request_id.includes(f)||e.model.includes(f)||e.user&&e.user.includes(f)).map(e=>({...e,duration:(Date.parse(e.endTime)-Date.parse(e.startTime))/1e3,onKeyHashClick:e=>eh(e),onSessionClick:e=>{e&&eC(e)}}))||[],eZ=(null===(l=eK.data)||void 0===l?void 0:null===(a=l.data)||void 0===a?void 0:a.map(e=>({...e,onKeyHashClick:e=>eh(e),onSessionClick:e=>{}})))||[],eU=[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>g&&0!==g.length?g.filter(s=>s.team_id.toLowerCase().includes(e.toLowerCase())||s.team_alias&&s.team_alias.toLowerCase().includes(e.toLowerCase())).map(e=>({label:"".concat(e.team_alias||e.team_id," (").concat(e.team_id,")"),value:e.team_id})):[]},{name:"Status",label:"Status",isSearchable:!1,options:[{label:"Success",value:"success"},{label:"Failure",value:"failure"}]},{name:"Model",label:"Model",isSearchable:!1},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>m?(await (0,$.LO)(m)).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e})):[]},{name:"End User",label:"End User",isSearchable:!0,searchFn:async e=>{if(!m)return[];let s=await (0,d.allEndUsersCall)(m);return((null==s?void 0:s.map(e=>e.user_id))||[]).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e}))}},{name:"Key Hash",label:"Key Hash",isSearchable:!1}];if(eS&&eK.data)return(0,t.jsx)("div",{className:"w-full p-6",children:(0,t.jsx)(q,{sessionId:eS,logs:eK.data.data,onBack:()=>eC(null)})});let eV=[{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"}],eB=eV.find(e=>e.value===eE.value&&e.unit===eE.unit),eW=H?eu(H,A,R):null==eB?void 0:eB.label;return(0,t.jsx)("div",{className:"w-full max-w-screen p-6 overflow-x-hidden box-border",children:(0,t.jsxs)(er.Z,{defaultIndex:0,onIndexChange:e=>ew(0===e?"request logs":"audit logs"),children:[(0,t.jsxs)(en.Z,{children:[(0,t.jsx)(el.Z,{children:"Request Logs"}),(0,t.jsx)(el.Z,{children:"Audit Logs"})]}),(0,t.jsxs)(eo.Z,{children:[(0,t.jsxs)(ei.Z,{children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,t.jsx)("h1",{className:"text-xl font-semibold",children:eS?(0,t.jsxs)(t.Fragment,{children:["Session: ",(0,t.jsx)("span",{className:"font-mono",children:eS}),(0,t.jsx)("button",{className:"ml-4 px-3 py-1 text-sm border rounded hover:bg-gray-50",onClick:()=>eC(null),children:"← Back to All Logs"})]}):"Request Logs"})}),ed&&ex&&ed.api_key===ex?(0,t.jsx)(M.Z,{keyId:ex,keyData:ed,accessToken:m,userID:h,userRole:x,teams:g,onClose:()=>eh(null),premiumUser:p,backButtonText:"Back to Logs"}):eS?(0,t.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,t.jsx)(c.w,{columns:v,data:eZ,renderSubComponent:eg,getRowCanExpand:()=>!0})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Q.Z,{options:eU,onApplyFilters:eq,onResetFilters:eF}),(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:f,onChange:e=>j(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:D,children:[(0,t.jsxs)("button",{onClick:()=>K(!Y),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"})}),eW]}),Y&&(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:[eV.map(e=>(0,t.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(eW===e.label?"bg-blue-50 text-blue-600":""),onClick:()=>{O(r()().format("YYYY-MM-DDTHH:mm")),I(r()().subtract(e.value,e.unit).format("YYYY-MM-DDTHH:mm")),eD({value:e.value,unit:e.unit}),F(!1),K(!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 ".concat(H?"bg-blue-50 text-blue-600":""),onClick:()=>F(!H),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)(et.Z,{color:"green",checked:eM,defaultChecked:!0,onChange:eT})]}),{}),(0,t.jsxs)("button",{onClick:()=>{eA.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,t.jsx)("svg",{className:"w-4 h-4 ".concat(eA.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,t.jsx)("span",{children:"Refresh"})]})]}),H&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{children:(0,t.jsx)("input",{type:"datetime-local",value:A,onChange:e=>{I(e.target.value),S(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:R,onChange:e=>{O(e.target.value),S(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 ",eA.isLoading?"...":eR?(_-1)*L+1:0," -"," ",eA.isLoading?"...":eR?Math.min(_*L,eR.total):0," ","of ",eA.isLoading?"...":eR?eR.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 ",eA.isLoading?"...":_," of"," ",eA.isLoading?"...":eR?eR.total_pages:1]}),(0,t.jsx)("button",{onClick:()=>S(e=>Math.max(1,e-1)),disabled:eA.isLoading||1===_,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:()=>S(e=>Math.min(eR.total_pages||1,e+1)),disabled:eA.isLoading||_===(eR.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"})]})]})]})}),eM&&1===_&&(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:()=>eT(!1),className:"text-sm text-green-600 hover:text-green-800",children:"Stop"})]}),(0,t.jsx)(c.w,{columns:v,data:eP,renderSubComponent:eg,getRowCanExpand:()=>!0})]})]})]}),(0,t.jsx)(ei.Z,{children:(0,t.jsx)(em,{userID:h,userRole:x,token:u,accessToken:m,isActive:"audit logs"===eN,premiumUser:p,allTeams:g})})]})]})})}function eg(e){var s,a,l,r,n,i,o,d,c,u;let{row:x}=e,g=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},p=x.original.metadata||{},f="failure"===p.status,j=f?p.error_information:null,v=x.original.messages&&(Array.isArray(x.original.messages)?x.original.messages.length>0:Object.keys(x.original.messages).length>0),b=x.original.response&&Object.keys(g(x.original.response)).length>0,y=p.vector_store_request_metadata&&Array.isArray(p.vector_store_request_metadata)&&p.vector_store_request_metadata.length>0,N=null===(s=x.original.metadata)||void 0===s?void 0:s.guardrail_information,w=Array.isArray(N)?N:N?[N]:[],k=w.length>0,C=w.reduce((e,s)=>{let a=null==s?void 0:s.masked_entity_count;return a?e+Object.values(a).reduce((e,s)=>"number"==typeof s?e+s:e,0):e},0),M=1===w.length?null!==(u=null===(a=w[0])||void 0===a?void 0:a.guardrail_name)&&void 0!==u?u:"-":w.length>1?"".concat(w.length," guardrails"):"-",T=(0,ex.aS)(x.original.request_id,64);return(0,t.jsxs)("div",{className:"p-6 bg-gray-50 space-y-6 w-full max-w-full overflow-hidden box-border",children:[(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden",children:[(0,t.jsx)("div",{className:"p-4 border-b",children:(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Request Details"})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 p-4 w-full max-w-full overflow-hidden",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:"Request ID:"}),x.original.request_id.length>64?(0,t.jsx)(h.Z,{title:x.original.request_id,children:(0,t.jsx)("span",{className:"font-mono text-sm",children:T})}):(0,t.jsx)("span",{className:"font-mono text-sm",children:x.original.request_id})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Model:"}),(0,t.jsx)("span",{children:x.original.model})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Model ID:"}),(0,t.jsx)("span",{children:x.original.model_id})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Call Type:"}),(0,t.jsx)("span",{children:x.original.call_type})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,t.jsx)("span",{children:x.original.custom_llm_provider||"-"})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"API Base:"}),(0,t.jsx)(h.Z,{title:x.original.api_base||"-",children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:x.original.api_base||"-"})})]}),(null==x?void 0:null===(l=x.original)||void 0===l?void 0:l.requester_ip_address)&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"IP Address:"}),(0,t.jsx)("span",{children:null==x?void 0:null===(r=x.original)||void 0===r?void 0:r.requester_ip_address})]}),k&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail:"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-mono",children:M}),C>0&&(0,t.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[C," masked"]})]})]})]}),(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:"Tokens:"}),(0,t.jsxs)("span",{children:[x.original.total_tokens," (",x.original.prompt_tokens," prompt tokens +"," ",x.original.completion_tokens," completion tokens)"]})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Cache Read Tokens:"}),(0,t.jsx)("span",{children:(0,m.pw)((null===(i=x.original.metadata)||void 0===i?void 0:null===(n=i.additional_usage_values)||void 0===n?void 0:n.cache_read_input_tokens)||0)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Cache Creation Tokens:"}),(0,t.jsx)("span",{children:(0,m.pw)(null===(o=x.original.metadata)||void 0===o?void 0:o.additional_usage_values.cache_creation_input_tokens)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Cost:"}),(0,t.jsxs)("span",{children:["$",(0,m.pw)(x.original.spend||0,6)]})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Cache Hit:"}),(0,t.jsx)("span",{children:x.original.cache_hit})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,t.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ".concat("failure"!==((null===(d=x.original.metadata)||void 0===d?void 0:d.status)||"Success").toLowerCase()?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:"failure"!==((null===(c=x.original.metadata)||void 0===c?void 0:c.status)||"Success").toLowerCase()?"Success":"Failure"})]}),(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:x.original.startTime})]}),(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:x.original.endTime})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,t.jsxs)("span",{children:[x.original.duration," s."]})]})]})]})]}),(0,t.jsx)(L,{show:!v&&!b}),(0,t.jsx)("div",{className:"w-full max-w-full overflow-hidden",children:(0,t.jsx)(_,{row:x,hasMessages:v,hasResponse:b,hasError:f,errorInfo:j,getRawRequest:()=>{var e;return(null===(e=x.original)||void 0===e?void 0:e.proxy_server_request)?g(x.original.proxy_server_request):g(x.original.messages)},formattedResponse:()=>f&&j?{error:{message:j.error_message||"An error occurred",type:j.error_class||"error",code:j.error_code||"unknown",param:null}}:g(x.original.response)})}),k&&(0,t.jsx)(G,{data:N}),y&&(0,t.jsx)(F,{data:p.vector_store_request_metadata}),f&&j&&(0,t.jsx)(S,{errorInfo:j}),x.original.request_tags&&Object.keys(x.original.request_tags).length>0&&(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsx)("div",{className:"flex justify-between items-center p-4 border-b",children:(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Request Tags"})}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(x.original.request_tags).map(e=>{let[s,a]=e;return(0,t.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[s,": ",String(a)]},s)})})})]}),x.original.metadata&&Object.keys(x.original.metadata).length>0&&(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Metadata"}),(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(JSON.stringify(x.original.metadata,null,2))},className:"p-1 hover:bg-gray-200 rounded",title:"Copy metadata",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,t.jsx)("div",{className:"p-4 overflow-auto max-h-64",children:(0,t.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(x.original.metadata,null,2)})})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3881-fb9362275df4cfb8.js b/litellm/proxy/_experimental/out/_next/static/chunks/3881-fb9362275df4cfb8.js deleted file mode 100644 index dc34278e2aa..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3881-fb9362275df4cfb8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3881],{2894:function(t,e,s){s.d(e,{R:function(){return u},m:function(){return n}});var i=s(18238),r=s(7989),a=s(11255),n=class extends r.F{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||u(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#r({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,a.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#r({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});let i="pending"===this.state.status,r=!this.#i.canStart();try{if(i)e();else{this.#r({type:"pending",variables:t,isPaused:r}),await this.#s.config.onMutate?.(t,this,s);let e=await this.options.onMutate?.(t,s);e!==this.state.context&&this.#r({type:"pending",context:e,variables:t,isPaused:r})}let a=await this.#i.start();return await this.#s.config.onSuccess?.(a,t,this.state.context,this,s),await this.options.onSuccess?.(a,t,this.state.context,s),await this.#s.config.onSettled?.(a,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(a,null,t,this.state.context,s),this.#r({type:"success",data:a}),a}catch(e){try{throw await this.#s.config.onError?.(e,t,this.state.context,this,s),await this.options.onError?.(e,t,this.state.context,s),await this.#s.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(void 0,e,t,this.state.context,s),e}finally{this.#r({type:"error",error:e})}}finally{this.#s.runNext(this)}}#r(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),i.Vr.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function u(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21623:function(t,e,s){s.d(e,{S:function(){return y}});var i=s(45345),r=s(21733),a=s(18238),n=s(24112),u=class extends n.l{constructor(t={}){super(),this.config=t,this.#a=new Map}#a;build(t,e,s){let a=e.queryKey,n=e.queryHash??(0,i.Rm)(a,e),u=this.get(n);return u||(u=new r.A({client:t,queryKey:a,queryHash:n,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(a)}),this.add(u)),u}add(t){this.#a.has(t.queryHash)||(this.#a.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#a.get(t.queryHash);e&&(t.destroy(),e===t&&this.#a.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){a.Vr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#a.get(t)}getAll(){return[...this.#a.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,i._x)(e,t))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(e=>(0,i._x)(t,e)):e}notify(t){a.Vr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){a.Vr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){a.Vr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},o=s(2894),h=class extends n.l{constructor(t={}){super(),this.config=t,this.#n=new Set,this.#u=new Map,this.#o=0}#n;#u;#o;build(t,e,s){let i=new o.m({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#n.add(t);let e=c(t);if("string"==typeof e){let s=this.#u.get(e);s?s.push(t):this.#u.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#n.delete(t)){let e=c(t);if("string"==typeof e){let s=this.#u.get(e);if(s){if(s.length>1){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#u.delete(e)}}}this.notify({type:"removed",mutation:t})}canRun(t){let e=c(t);if("string"!=typeof e)return!0;{let s=this.#u.get(e),i=s?.find(t=>"pending"===t.state.status);return!i||i===t}}runNext(t){let e=c(t);if("string"!=typeof e)return Promise.resolve();{let s=this.#u.get(e)?.find(e=>e!==t&&e.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){a.Vr.batch(()=>{this.#n.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#n.clear(),this.#u.clear()})}getAll(){return Array.from(this.#n)}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,i.X7)(e,t))}findAll(t={}){return this.getAll().filter(e=>(0,i.X7)(t,e))}notify(t){a.Vr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return a.Vr.batch(()=>Promise.all(t.map(t=>t.continue().catch(i.ZT))))}};function c(t){return t.options.scope?.id}var l=s(87045),d=s(57853);function f(t){return{onFetch:(e,s)=>{let r=e.options,a=e.fetchOptions?.meta?.fetchMore?.direction,n=e.state.data?.pages||[],u=e.state.data?.pageParams||[],o={pages:[],pageParams:[]},h=0,c=async()=>{let s=!1,c=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(e.signal.aborted?s=!0:e.signal.addEventListener("abort",()=>{s=!0}),e.signal)})},l=(0,i.cG)(e.options,e.fetchOptions),d=async(t,r,a)=>{if(s)return Promise.reject();if(null==r&&t.pages.length)return Promise.resolve(t);let n=(()=>{let t={client:e.client,queryKey:e.queryKey,pageParam:r,direction:a?"backward":"forward",meta:e.options.meta};return c(t),t})(),u=await l(n),{maxPages:o}=e.options,h=a?i.Ht:i.VX;return{pages:h(t.pages,u,o),pageParams:h(t.pageParams,r,o)}};if(a&&n.length){let t="backward"===a,e={pages:n,pageParams:u},s=(t?function(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}:p)(r,e);o=await d(e,s,t)}else{let e=t??n.length;do{let t=0===h?u[0]??r.initialPageParam:p(r,o);if(h>0&&null==t)break;o=await d(o,t),h++}while(he.options.persister?.(c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=c}}}function p(t,{pages:e,pageParams:s}){let i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}var y=class{#h;#s;#c;#l;#d;#f;#p;#y;constructor(t={}){this.#h=t.queryCache||new u,this.#s=t.mutationCache||new h,this.#c=t.defaultOptions||{},this.#l=new Map,this.#d=new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#p=l.j.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onFocus())}),this.#y=d.N.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#p?.(),this.#p=void 0,this.#y?.(),this.#y=void 0)}isFetching(t){return this.#h.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#s.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),s=this.#h.build(this,e),r=s.state.data;return void 0===r?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime((0,i.KC)(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#h.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){let r=this.defaultQueryOptions({queryKey:t}),a=this.#h.get(r.queryHash),n=a?.state.data,u=(0,i.SE)(e,n);if(void 0!==u)return this.#h.build(this,r).setData(u,{...s,manual:!0})}setQueriesData(t,e,s){return a.Vr.batch(()=>this.#h.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state}removeQueries(t){let e=this.#h;a.Vr.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let s=this.#h;return a.Vr.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let s={revert:!0,...e};return Promise.all(a.Vr.batch(()=>this.#h.findAll(t).map(t=>t.cancel(s)))).then(i.ZT).catch(i.ZT)}invalidateQueries(t,e={}){return a.Vr.batch(()=>(this.#h.findAll(t).forEach(t=>{t.invalidate()}),t?.refetchType==="none")?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e))}refetchQueries(t,e={}){let s={...e,cancelRefetch:e.cancelRefetch??!0};return Promise.all(a.Vr.batch(()=>this.#h.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(i.ZT)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(i.ZT)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let s=this.#h.build(this,e);return s.isStaleByTime((0,i.KC)(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(i.ZT).catch(i.ZT)}fetchInfiniteQuery(t){return t.behavior=f(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(i.ZT).catch(i.ZT)}ensureInfiniteQueryData(t){return t.behavior=f(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return d.N.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#h}getMutationCache(){return this.#s}getDefaultOptions(){return this.#c}setDefaultOptions(t){this.#c=t}setQueryDefaults(t,e){this.#l.set((0,i.Ym)(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#l.values()],s={};return e.forEach(e=>{(0,i.to)(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#d.set((0,i.Ym)(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#d.values()],s={};return e.forEach(e=>{(0,i.to)(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#c.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=(0,i.Rm)(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===i.CN&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#c.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#h.clear(),this.#s.clear()}}},21770:function(t,e,s){s.d(e,{D:function(){return c}});var i=s(2265),r=s(2894),a=s(18238),n=s(24112),u=s(45345),o=class extends n.l{#t;#m=void 0;#g;#b;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#v()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#t.defaultMutationOptions(t),(0,u.VS)(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#g,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,u.Ym)(e.mutationKey)!==(0,u.Ym)(this.options.mutationKey)?this.reset():this.#g?.state.status==="pending"&&this.#g.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#g?.removeObserver(this)}onMutationUpdate(t){this.#v(),this.#C(t)}getCurrentResult(){return this.#m}reset(){this.#g?.removeObserver(this),this.#g=void 0,this.#v(),this.#C()}mutate(t,e){return this.#b=e,this.#g?.removeObserver(this),this.#g=this.#t.getMutationCache().build(this.#t,this.options),this.#g.addObserver(this),this.#g.execute(t)}#v(){let t=this.#g?.state??(0,r.R)();this.#m={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#C(t){a.Vr.batch(()=>{if(this.#b&&this.hasListeners()){let e=this.#m.variables,s=this.#m.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#b.onSuccess?.(t.data,e,s,i),this.#b.onSettled?.(t.data,null,e,s,i)):t?.type==="error"&&(this.#b.onError?.(t.error,e,s,i),this.#b.onSettled?.(void 0,t.error,e,s,i))}this.listeners.forEach(t=>{t(this.#m)})})}},h=s(29827);function c(t,e){let s=(0,h.NL)(e),[r]=i.useState(()=>new o(s,t));i.useEffect(()=>{r.setOptions(t)},[r,t]);let n=i.useSyncExternalStore(i.useCallback(t=>r.subscribe(a.Vr.batchCalls(t)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),c=i.useCallback((t,e)=>{r.mutate(t,e).catch(u.ZT)},[r]);if(n.error&&(0,u.L3)(r.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:c,mutateAsync:n.mutate}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3897-4235c90dedbe107a.js b/litellm/proxy/_experimental/out/_next/static/chunks/3897-4235c90dedbe107a.js new file mode 100644 index 00000000000..3eb139c30d6 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/3897-4235c90dedbe107a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3897],{51653:function(t,e,n){n.d(e,{Z:function(){return L}});var o=n(2265),a=n(8900),r=n(39725),i=n(49638),s=n(54537),c=n(55726),l=n(36760),u=n.n(l),d=n(66632),p=n(18242),m=n(28791),h=n(19722),f=n(71744),g=n(93463),b=n(12918),y=n(99320);let v=(t,e,n,o,a)=>({background:t,border:"".concat((0,g.bf)(o.lineWidth)," ").concat(o.lineType," ").concat(e),["".concat(a,"-icon")]:{color:n}}),O=t=>{let{componentCls:e,motionDurationSlow:n,marginXS:o,marginSM:a,fontSize:r,fontSizeLG:i,lineHeight:s,borderRadiusLG:c,motionEaseInOutCirc:l,withDescriptionIconSize:u,colorText:d,colorTextHeading:p,withDescriptionPadding:m,defaultPadding:h}=t;return{[e]:Object.assign(Object.assign({},(0,b.Wf)(t)),{position:"relative",display:"flex",alignItems:"center",padding:h,wordWrap:"break-word",borderRadius:c,["&".concat(e,"-rtl")]:{direction:"rtl"},["".concat(e,"-content")]:{flex:1,minWidth:0},["".concat(e,"-icon")]:{marginInlineEnd:o,lineHeight:0},"&-description":{display:"none",fontSize:r,lineHeight:s},"&-message":{color:p},["&".concat(e,"-motion-leave")]:{overflow:"hidden",opacity:1,transition:"max-height ".concat(n," ").concat(l,", opacity ").concat(n," ").concat(l,",\n padding-top ").concat(n," ").concat(l,", padding-bottom ").concat(n," ").concat(l,",\n margin-bottom ").concat(n," ").concat(l)},["&".concat(e,"-motion-leave-active")]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),["".concat(e,"-with-description")]:{alignItems:"flex-start",padding:m,["".concat(e,"-icon")]:{marginInlineEnd:a,fontSize:u,lineHeight:0},["".concat(e,"-message")]:{display:"block",marginBottom:o,color:p,fontSize:i},["".concat(e,"-description")]:{display:"block",color:d}},["".concat(e,"-banner")]:{marginBottom:0,border:"0 !important",borderRadius:0}}},S=t=>{let{componentCls:e,colorSuccess:n,colorSuccessBorder:o,colorSuccessBg:a,colorWarning:r,colorWarningBorder:i,colorWarningBg:s,colorError:c,colorErrorBorder:l,colorErrorBg:u,colorInfo:d,colorInfoBorder:p,colorInfoBg:m}=t;return{[e]:{"&-success":v(a,o,n,t,e),"&-info":v(m,p,d,t,e),"&-warning":v(s,i,r,t,e),"&-error":Object.assign(Object.assign({},v(u,l,c,t,e)),{["".concat(e,"-description > pre")]:{margin:0,padding:0}})}}},E=t=>{let{componentCls:e,iconCls:n,motionDurationMid:o,marginXS:a,fontSizeIcon:r,colorIcon:i,colorIconHover:s}=t;return{[e]:{"&-action":{marginInlineStart:a},["".concat(e,"-close-icon")]:{marginInlineStart:a,padding:0,overflow:"hidden",fontSize:r,lineHeight:(0,g.bf)(r),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",["".concat(n,"-close")]:{color:i,transition:"color ".concat(o),"&:hover":{color:s}}},"&-close-text":{color:i,transition:"color ".concat(o),"&:hover":{color:s}}}}};var w=(0,y.I$)("Alert",t=>[O(t),S(t),E(t)],t=>({withDescriptionIconSize:t.fontSizeHeading3,defaultPadding:"".concat(t.paddingContentVerticalSM,"px ").concat(12,"px"),withDescriptionPadding:"".concat(t.paddingMD,"px ").concat(t.paddingContentHorizontalLG,"px")})),x=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(t);ae.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]]);return n};let I={success:a.Z,info:c.Z,error:r.Z,warning:s.Z},C=t=>{let{icon:e,prefixCls:n,type:a}=t,r=I[a]||null;return e?(0,h.wm)(e,o.createElement("span",{className:"".concat(n,"-icon")},e),()=>({className:u()("".concat(n,"-icon"),e.props.className)})):o.createElement(r,{className:"".concat(n,"-icon")})},j=t=>{let{isClosable:e,prefixCls:n,closeIcon:a,handleClose:r,ariaProps:s}=t,c=!0===a||void 0===a?o.createElement(i.Z,null):a;return e?o.createElement("button",Object.assign({type:"button",onClick:r,className:"".concat(n,"-close-icon"),tabIndex:0},s),c):null},N=o.forwardRef((t,e)=>{let{description:n,prefixCls:a,message:r,banner:i,className:s,rootClassName:c,style:l,onMouseEnter:h,onMouseLeave:g,onClick:b,afterClose:y,showIcon:v,closable:O,closeText:S,closeIcon:E,action:I,id:N}=t,M=x(t,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[R,k]=o.useState(!1),z=o.useRef(null);o.useImperativeHandle(e,()=>({nativeElement:z.current}));let{getPrefixCls:G,direction:Z,closable:P,closeIcon:L,className:A,style:H}=(0,f.dj)("alert"),D=G("alert",a),[W,K,B]=w(D),_=e=>{var n;k(!0),null===(n=t.onClose)||void 0===n||n.call(t,e)},T=o.useMemo(()=>void 0!==t.type?t.type:i?"warning":"info",[t.type,i]),V=o.useMemo(()=>"object"==typeof O&&!!O.closeIcon||!!S||("boolean"==typeof O?O:!1!==E&&null!=E||!!P),[S,E,O,P]),U=!!i&&void 0===v||v,X=u()(D,"".concat(D,"-").concat(T),{["".concat(D,"-with-description")]:!!n,["".concat(D,"-no-icon")]:!U,["".concat(D,"-banner")]:!!i,["".concat(D,"-rtl")]:"rtl"===Z},A,s,c,B,K),$=(0,p.Z)(M,{aria:!0,data:!0}),Y=o.useMemo(()=>"object"==typeof O&&O.closeIcon?O.closeIcon:S||(void 0!==E?E:"object"==typeof P&&P.closeIcon?P.closeIcon:L),[E,O,P,S,L]),F=o.useMemo(()=>{let t=null!=O?O:P;if("object"==typeof t){let{closeIcon:e}=t;return x(t,["closeIcon"])}return{}},[O,P]);return W(o.createElement(d.ZP,{visible:!R,motionName:"".concat(D,"-motion"),motionAppear:!1,motionEnter:!1,onLeaveStart:t=>({maxHeight:t.offsetHeight}),onLeaveEnd:y},(e,a)=>{let{className:i,style:s}=e;return o.createElement("div",Object.assign({id:N,ref:(0,m.sQ)(z,a),"data-show":!R,className:u()(X,i),style:Object.assign(Object.assign(Object.assign({},H),l),s),onMouseEnter:h,onMouseLeave:g,onClick:b,role:"alert"},$),U?o.createElement(C,{description:n,icon:t.icon,prefixCls:D,type:T}):null,o.createElement("div",{className:"".concat(D,"-content")},r?o.createElement("div",{className:"".concat(D,"-message")},r):null,n?o.createElement("div",{className:"".concat(D,"-description")},n):null),I?o.createElement("div",{className:"".concat(D,"-action")},I):null,o.createElement(j,{isClosable:V,prefixCls:D,closeIcon:Y,handleClose:_,ariaProps:F}))}))});var M=n(76405),R=n(25049),k=n(24995),z=n(63929),G=n(37977),Z=n(41690);let P=function(t){function e(){var t,n,o;return(0,M.Z)(this,e),n=e,o=arguments,n=(0,k.Z)(n),(t=(0,G.Z)(this,(0,z.Z)()?Reflect.construct(n,o||[],(0,k.Z)(this).constructor):n.apply(this,o))).state={error:void 0,info:{componentStack:""}},t}return(0,Z.Z)(e,t),(0,R.Z)(e,[{key:"componentDidCatch",value:function(t,e){this.setState({error:t,info:e})}},{key:"render",value:function(){let{message:t,description:e,id:n,children:a}=this.props,{error:r,info:i}=this.state,s=(null==i?void 0:i.componentStack)||null,c=void 0===t?(r||"").toString():t;return r?o.createElement(N,{id:n,type:"error",message:c,description:o.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},void 0===e?s:e)}):a}}])}(o.Component);N.ErrorBoundary=P;var L=N},58760:function(t,e,n){n.d(e,{Z:function(){return C}});var o=n(2265),a=n(36760),r=n.n(a),i=n(45287);function s(t){return["small","middle","large"].includes(t)}function c(t){return!!t&&"number"==typeof t&&!Number.isNaN(t)}var l=n(71744),u=n(77685),d=n(17691),p=n(99320);let m=t=>{let{componentCls:e,borderRadius:n,paddingSM:o,colorBorder:a,paddingXS:r,fontSizeLG:i,fontSizeSM:s,borderRadiusLG:c,borderRadiusSM:l,colorBgContainerDisabled:u,lineWidth:p}=t;return{[e]:[{display:"inline-flex",alignItems:"center",gap:0,paddingInline:o,margin:0,background:u,borderWidth:p,borderStyle:"solid",borderColor:a,borderRadius:n,"&-large":{fontSize:i,borderRadius:c},"&-small":{paddingInline:r,borderRadius:l,fontSize:s},"&-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,d.c)(t,{focus:!1})]}};var h=(0,p.I$)(["Space","Addon"],t=>[m(t)]),f=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(t);ae.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]]);return n};let g=o.forwardRef((t,e)=>{let{className:n,children:a,style:i,prefixCls:s}=t,c=f(t,["className","children","style","prefixCls"]),{getPrefixCls:d,direction:p}=o.useContext(l.E_),m=d("space-addon",s),[g,b,y]=h(m),{compactItemClassnames:v,compactSize:O}=(0,u.ri)(m,p),S=r()(m,b,v,y,{["".concat(m,"-").concat(O)]:O},n);return g(o.createElement("div",Object.assign({ref:e,className:S,style:i},c),a))}),b=o.createContext({latestIndex:0}),y=b.Provider;var v=t=>{let{className:e,index:n,children:a,split:r,style:i}=t,{latestIndex:s}=o.useContext(b);return null==a?null:o.createElement(o.Fragment,null,o.createElement("div",{className:e,style:i},a),n{let{componentCls:e,antCls:n}=t;return{[e]:{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"}},["".concat(e,"-item:empty")]:{display:"none"},["".concat(e,"-item > ").concat(n,"-badge-not-a-wrapper:only-child")]:{display:"block"}}}},E=t=>{let{componentCls:e}=t;return{[e]:{"&-gap-row-small":{rowGap:t.spaceGapSmallSize},"&-gap-row-middle":{rowGap:t.spaceGapMiddleSize},"&-gap-row-large":{rowGap:t.spaceGapLargeSize},"&-gap-col-small":{columnGap:t.spaceGapSmallSize},"&-gap-col-middle":{columnGap:t.spaceGapMiddleSize},"&-gap-col-large":{columnGap:t.spaceGapLargeSize}}}};var w=(0,p.I$)("Space",t=>{let e=(0,O.IX)(t,{spaceGapSmallSize:t.paddingXS,spaceGapMiddleSize:t.padding,spaceGapLargeSize:t.paddingLG});return[S(e),E(e)]},()=>({}),{resetStyle:!1}),x=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&0>e.indexOf(o)&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(t);ae.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]]);return n};let I=o.forwardRef((t,e)=>{var n;let{getPrefixCls:a,direction:u,size:d,className:p,style:m,classNames:h,styles:f}=(0,l.dj)("space"),{size:g=null!=d?d:"small",align:b,className:O,rootClassName:S,children:E,direction:I="horizontal",prefixCls:C,split:j,style:N,wrap:M=!1,classNames:R,styles:k}=t,z=x(t,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[G,Z]=Array.isArray(g)?g:[g,g],P=s(Z),L=s(G),A=c(Z),H=c(G),D=(0,i.Z)(E,{keepEmpty:!0}),W=void 0===b&&"horizontal"===I?"center":b,K=a("space",C),[B,_,T]=w(K),V=r()(K,p,_,"".concat(K,"-").concat(I),{["".concat(K,"-rtl")]:"rtl"===u,["".concat(K,"-align-").concat(W)]:W,["".concat(K,"-gap-row-").concat(Z)]:P,["".concat(K,"-gap-col-").concat(G)]:L},O,S,T),U=r()("".concat(K,"-item"),null!==(n=null==R?void 0:R.item)&&void 0!==n?n:h.item),X=Object.assign(Object.assign({},f.item),null==k?void 0:k.item),$=D.map((t,e)=>{let n=(null==t?void 0:t.key)||"".concat(U,"-").concat(e);return o.createElement(v,{className:U,key:n,index:e,split:j,style:X},t)}),Y=o.useMemo(()=>({latestIndex:D.reduce((t,e,n)=>null!=e?n:t,0)}),[D]);if(0===D.length)return null;let F={};return M&&(F.flexWrap="wrap"),!L&&H&&(F.columnGap=G),!P&&A&&(F.rowGap=Z),B(o.createElement("div",Object.assign({ref:e,className:V,style:Object.assign(Object.assign(Object.assign({},F),m),N)},z),o.createElement(y,{value:Y},$)))});I.Compact=u.ZP,I.Addon=g;var C=I},21770:function(t,e,n){n.d(e,{D:function(){return u}});var o=n(2265),a=n(2894),r=n(18238),i=n(24112),s=n(45345),c=class extends i.l{#t;#e=void 0;#n;#o;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#t.defaultMutationOptions(t),(0,s.VS)(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,s.Ym)(e.mutationKey)!==(0,s.Ym)(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#r(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#r()}mutate(t,e){return this.#o=e,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#a(){let t=this.#n?.state??(0,a.R)();this.#e={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#r(t){r.Vr.batch(()=>{if(this.#o&&this.hasListeners()){let e=this.#e.variables,n=this.#e.context,o={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#o.onSuccess?.(t.data,e,n,o),this.#o.onSettled?.(t.data,null,e,n,o)):t?.type==="error"&&(this.#o.onError?.(t.error,e,n,o),this.#o.onSettled?.(void 0,t.error,e,n,o))}this.listeners.forEach(t=>{t(this.#e)})})}},l=n(29827);function u(t,e){let n=(0,l.NL)(e),[a]=o.useState(()=>new c(n,t));o.useEffect(()=>{a.setOptions(t)},[a,t]);let i=o.useSyncExternalStore(o.useCallback(t=>a.subscribe(r.Vr.batchCalls(t)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),u=o.useCallback((t,e)=>{a.mutate(t,e).catch(s.ZT)},[a]);if(i.error&&(0,s.L3)(a.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}},61994:function(t,e,n){function o(){for(var t,e,n=0,o="",a=arguments.length;n{let{data:n=[],categories:i=[],index:d,colors:S=w.s,valueFormatter:C=E.Cj,startEndOnly:j=!1,showXAxis:N=!0,showYAxis:z=!0,yAxisWidth:L=56,intervalType:T="equidistantPreserveStart",animationDuration:Z=900,showAnimation:P=!1,showTooltip:M=!0,showLegend:R=!0,showGridLines:I=!0,autoMinValue:B=!1,curveType:W="linear",minValue:D,maxValue:H,connectNulls:A=!1,allowDecimals:F=!0,noDataText:q,className:G,onValueChange:K,enableLegendSlider:V=!1,customTooltip:_,rotateLabelX:X,padding:Y=N||z?{left:20,right:20}:{left:0,right:0},tickGap:$=5,xAxisLabel:U,yAxisLabel:Q}=e,J=(0,o._T)(e,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","padding","tickGap","xAxisLabel","yAxisLabel"]),[ee,et]=(0,a.useState)(60),[en,eo]=(0,a.useState)(void 0),[ea,er]=(0,a.useState)(void 0),ei=(0,x.me)(i,S),ec=(0,x.i4)(B,D,H),el=!!K;function es(e){el&&(e===ea&&!en||(0,x.FB)(n,e)&&en&&en.dataKey===e?(er(void 0),null==K||K(null)):(er(e),null==K||K({eventType:"category",categoryClicked:e})),eo(void 0))}return a.createElement("div",Object.assign({ref:t,className:(0,O.q)("w-full h-80",G)},J),a.createElement(r.h,{className:"h-full w-full"},(null==n?void 0:n.length)?a.createElement(u,{data:n,onClick:el&&(ea||en)?()=>{eo(void 0),er(void 0),null==K||K(null)}:void 0,margin:{bottom:U?30:void 0,left:Q?20:void 0,right:Q?5:void 0,top:5}},I?a.createElement(m.q,{className:(0,O.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,a.createElement(l.K,{padding:Y,hide:!N,dataKey:d,interval:j?"preserveStartEnd":T,tick:{transform:"translate(0, 6)"},ticks:j?[n[0][d],n[n.length-1][d]]:void 0,fill:"",stroke:"",className:(0,O.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:$,angle:null==X?void 0:X.angle,dy:null==X?void 0:X.verticalShift,height:null==X?void 0:X.xAxisHeight},U&&a.createElement(b._,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},U)),a.createElement(s.B,{width:L,hide:!z,axisLine:!1,tickLine:!1,type:"number",domain:ec,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,O.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:C,allowDecimals:F},Q&&a.createElement(b._,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},Q)),a.createElement(p.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:M?e=>{let{active:t,payload:n,label:o}=e;return _?a.createElement(_,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=ei.get(e.dataKey))&&void 0!==t?t:k.fr.Gray})}),active:t,label:o}):a.createElement(v.ZP,{active:t,payload:n,label:o,valueFormatter:C,categoryColors:ei})}:a.createElement(a.Fragment,null),position:{y:0}}),R?a.createElement(f.D,{verticalAlign:"top",height:ee,content:e=>{let{payload:t}=e;return(0,h.Z)({payload:t},ei,et,ea,el?e=>es(e):void 0,V)}}):null,i.map(e=>{var t;return a.createElement(c.x,{className:(0,O.q)((0,E.bM)(null!==(t=ei.get(e))&&void 0!==t?t:k.fr.Gray,w.K.text).strokeColor),strokeOpacity:en||ea&&ea!==e?.3:1,activeDot:e=>{var t;let{cx:o,cy:r,stroke:i,strokeLinecap:c,strokeLinejoin:l,strokeWidth:s,dataKey:d}=e;return a.createElement(g.o,{className:(0,O.q)("stroke-tremor-background dark:stroke-dark-tremor-background",K?"cursor-pointer":"",(0,E.bM)(null!==(t=ei.get(d))&&void 0!==t?t:k.fr.Gray,w.K.text).fillColor),cx:o,cy:r,r:5,fill:"",stroke:i,strokeLinecap:c,strokeLinejoin:l,strokeWidth:s,onClick:(t,o)=>{o.stopPropagation(),el&&(e.index===(null==en?void 0:en.index)&&e.dataKey===(null==en?void 0:en.dataKey)||(0,x.FB)(n,e.dataKey)&&ea&&ea===e.dataKey?(er(void 0),eo(void 0),null==K||K(null)):(er(e.dataKey),eo({index:e.index,dataKey:e.dataKey}),null==K||K(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var o;let{stroke:r,strokeLinecap:i,strokeLinejoin:c,strokeWidth:l,cx:s,cy:d,dataKey:u,index:m}=t;return(0,x.FB)(n,e)&&!(en||ea&&ea!==e)||(null==en?void 0:en.index)===m&&(null==en?void 0:en.dataKey)===e?a.createElement(g.o,{key:m,cx:s,cy:d,r:5,stroke:r,fill:"",strokeLinecap:i,strokeLinejoin:c,strokeWidth:l,className:(0,O.q)("stroke-tremor-background dark:stroke-dark-tremor-background",K?"cursor-pointer":"",(0,E.bM)(null!==(o=ei.get(u))&&void 0!==o?o:k.fr.Gray,w.K.text).fillColor)}):a.createElement(a.Fragment,{key:m})},key:e,name:e,type:W,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:P,animationDuration:Z,connectNulls:A})}),K?i.map(e=>a.createElement(c.x,{className:(0,O.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:W,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:A,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;es(n)}})):null):a.createElement(y.Z,{noDataText:q})))});S.displayName="LineChart"},59341:function(e,t,n){n.d(t,{Z:function(){return Z}});var o=n(5853),a=n(71049),r=n(11323),i=n(2265),c=n(66797),l=n(40099),s=n(74275),d=n(59456),u=n(93980),m=n(65573),b=n(67561),p=n(87550),f=n(628),g=n(80281),h=n(31370),v=n(20131),y=n(38929),x=n(52307),k=n(52724),w=n(7935);let O=(0,i.createContext)(null);O.displayName="GroupContext";let E=i.Fragment,S=Object.assign((0,y.yV)(function(e,t){var n;let o=(0,i.useId)(),E=(0,g.Q)(),S=(0,p.B)(),{id:C=E||"headlessui-switch-".concat(o),disabled:j=S||!1,checked:N,defaultChecked:z,onChange:L,name:T,value:Z,form:P,autoFocus:M=!1,...R}=e,I=(0,i.useContext)(O),[B,W]=(0,i.useState)(null),D=(0,i.useRef)(null),H=(0,b.T)(D,t,null===I?null:I.setSwitch,W),A=(0,s.L)(z),[F,q]=(0,l.q)(N,L,null!=A&&A),G=(0,d.G)(),[K,V]=(0,i.useState)(!1),_=(0,u.z)(()=>{V(!0),null==q||q(!F),G.nextFrame(()=>{V(!1)})}),X=(0,u.z)(e=>{if((0,h.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),_()}),Y=(0,u.z)(e=>{e.key===k.R.Space?(e.preventDefault(),_()):e.key===k.R.Enter&&(0,v.g)(e.currentTarget)}),$=(0,u.z)(e=>e.preventDefault()),U=(0,w.wp)(),Q=(0,x.zH)(),{isFocusVisible:J,focusProps:ee}=(0,a.F)({autoFocus:M}),{isHovered:et,hoverProps:en}=(0,r.X)({isDisabled:j}),{pressed:eo,pressProps:ea}=(0,c.x)({disabled:j}),er=(0,i.useMemo)(()=>({checked:F,disabled:j,hover:et,focus:J,active:eo,autofocus:M,changing:K}),[F,et,J,eo,j,K,M]),ei=(0,y.dG)({id:C,ref:H,role:"switch",type:(0,m.f)(e,B),tabIndex:-1===e.tabIndex?0:null!=(n=e.tabIndex)?n:0,"aria-checked":F,"aria-labelledby":U,"aria-describedby":Q,disabled:j||void 0,autoFocus:M,onClick:X,onKeyUp:Y,onKeyPress:$},ee,en,ea),ec=(0,i.useCallback)(()=>{if(void 0!==A)return null==q?void 0:q(A)},[q,A]),el=(0,y.L6)();return i.createElement(i.Fragment,null,null!=T&&i.createElement(f.Mt,{disabled:j,data:{[T]:Z||"on"},overrides:{type:"checkbox",checked:F},form:P,onReset:ec}),el({ourProps:ei,theirProps:R,slot:er,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var t;let[n,o]=(0,i.useState)(null),[a,r]=(0,w.bE)(),[c,l]=(0,x.fw)(),s=(0,i.useMemo)(()=>({switch:n,setSwitch:o}),[n,o]),d=(0,y.L6)();return i.createElement(l,{name:"Switch.Description",value:c},i.createElement(r,{name:"Switch.Label",value:a,props:{htmlFor:null==(t=s.switch)?void 0:t.id,onClick(e){n&&(e.currentTarget instanceof HTMLLabelElement&&e.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},i.createElement(O.Provider,{value:s},d({ourProps:{},theirProps:e,slot:{},defaultTag:E,name:"Switch.Group"}))))},Label:w.__,Description:x.dk});var C=n(44140),j=n(26898),N=n(13241),z=n(1153),L=n(47187);let T=(0,z.fn)("Switch"),Z=i.forwardRef((e,t)=>{let{checked:n,defaultChecked:a=!1,onChange:r,color:c,name:l,error:s,errorMessage:d,disabled:u,required:m,tooltip:b,id:p}=e,f=(0,o._T)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),g={bgColor:c?(0,z.bM)(c,j.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:c?(0,z.bM)(c,j.K.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[h,v]=(0,C.Z)(a,n),[y,x]=(0,i.useState)(!1),{tooltipProps:k,getReferenceProps:w}=(0,L.l)(300);return i.createElement("div",{className:"flex flex-row items-center justify-start"},i.createElement(L.Z,Object.assign({text:b},k)),i.createElement("div",Object.assign({ref:(0,z.lq)([t,k.refs.setReference]),className:(0,N.q)(T("root"),"flex flex-row relative h-5")},f,w),i.createElement("input",{type:"checkbox",className:(0,N.q)(T("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:l,required:m,checked:h,onChange:e=>{e.preventDefault()}}),i.createElement(S,{checked:h,onChange:e=>{v(e),null==r||r(e)},disabled:u,className:(0,N.q)(T("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",u?"cursor-not-allowed":""),onFocus:()=>x(!0),onBlur:()=>x(!1),id:p},i.createElement("span",{className:(0,N.q)(T("sr-only"),"sr-only")},"Switch ",h?"on":"off"),i.createElement("span",{"aria-hidden":"true",className:(0,N.q)(T("background"),h?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")}),i.createElement("span",{"aria-hidden":"true",className:(0,N.q)(T("round"),h?(0,N.q)(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,N.q)("ring-2",g.ringColor):"")}))),s&&d?i.createElement("p",{className:(0,N.q)(T("errorMessage"),"text-sm text-red-500 mt-1 ")},d):null)});Z.displayName="Switch"},33866:function(e,t,n){n.d(t,{Z:function(){return P}});var o=n(2265),a=n(36760),r=n.n(a),i=n(66632),c=n(93350),l=n(19722),s=n(71744),d=n(93463),u=n(12918),m=n(18536),b=n(71140),p=n(99320);let f=new d.E4("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),g=new d.E4("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),h=new d.E4("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),v=new d.E4("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),y=new d.E4("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),x=new d.E4("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),k=e=>{let{componentCls:t,iconCls:n,antCls:o,badgeShadowSize:a,textFontSize:r,textFontSizeSM:i,statusSize:c,dotSize:l,textFontWeight:s,indicatorHeight:b,indicatorHeightSM:p,marginXS:k,calc:w}=e,O="".concat(o,"-scroll-number"),E=(0,m.Z)(e,(e,n)=>{let{darkColor:o}=n;return{["&".concat(t," ").concat(t,"-color-").concat(e)]:{background:o,["&:not(".concat(t,"-count)")]:{color:o},"a:hover &":{background:o}}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,["".concat(t,"-count")]:{display:"inline-flex",justifyContent:"center",zIndex:e.indicatorZIndex,minWidth:b,height:b,color:e.badgeTextColor,fontWeight:s,fontSize:r,lineHeight:(0,d.bf)(b),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:w(b).div(2).equal(),boxShadow:"0 0 0 ".concat((0,d.bf)(a)," ").concat(e.badgeShadowColor),transition:"background ".concat(e.motionDurationMid),a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},["".concat(t,"-count-sm")]:{minWidth:p,height:p,fontSize:i,lineHeight:(0,d.bf)(p),borderRadius:w(p).div(2).equal()},["".concat(t,"-multiple-words")]:{padding:"0 ".concat((0,d.bf)(e.paddingXS)),bdi:{unicodeBidi:"plaintext"}},["".concat(t,"-dot")]:{zIndex:e.indicatorZIndex,width:l,minWidth:l,height:l,background:e.badgeColor,borderRadius:"100%",boxShadow:"0 0 0 ".concat((0,d.bf)(a)," ").concat(e.badgeShadowColor)},["".concat(t,"-count, ").concat(t,"-dot, ").concat(O,"-custom-component")]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",["&".concat(n,"-spin")]:{animationName:x,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},["&".concat(t,"-status")]:{lineHeight:"inherit",verticalAlign:"baseline",["".concat(t,"-status-dot")]:{position:"relative",top:-1,display:"inline-block",width:c,height:c,verticalAlign:"middle",borderRadius:"50%"},["".concat(t,"-status-success")]:{backgroundColor:e.colorSuccess},["".concat(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:a,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:f,animationDuration:e.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},["".concat(t,"-status-default")]:{backgroundColor:e.colorTextPlaceholder},["".concat(t,"-status-error")]:{backgroundColor:e.colorError},["".concat(t,"-status-warning")]:{backgroundColor:e.colorWarning},["".concat(t,"-status-text")]:{marginInlineStart:k,color:e.colorText,fontSize:e.fontSize}}}),E),{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:g,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["".concat(t,"-zoom-leave")]:{animationName:h,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["&".concat(t,"-not-a-wrapper")]:{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:v,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["".concat(t,"-zoom-leave")]:{animationName:y,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["&:not(".concat(t,"-status)")]:{verticalAlign:"middle"},["".concat(O,"-custom-component, ").concat(t,"-count")]:{transform:"none"},["".concat(O,"-custom-component, ").concat(O)]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[O]:{overflow:"hidden",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseOutBack),["".concat(O,"-only")]:{position:"relative",display:"inline-block",height:b,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseOutBack),WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",["> p".concat(O,"-only-unit")]:{height:b,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},["".concat(O,"-symbol")]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",["".concat(t,"-count, ").concat(t,"-dot, ").concat(O,"-custom-component")]:{transform:"translate(-50%, -50%)"}}})}},w=e=>{let{fontHeight:t,lineWidth:n,marginXS:o,colorBorderBg:a}=e,r=e.colorTextLightSolid,i=e.colorError,c=e.colorErrorHover;return(0,b.IX)(e,{badgeFontHeight:t,badgeShadowSize:n,badgeTextColor:r,badgeColor:i,badgeColorHover:c,badgeShadowColor:a,badgeProcessingDuration:"1.2s",badgeRibbonOffset:o,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},O=e=>{let{fontSize:t,lineHeight:n,fontSizeSM:o,lineWidth:a}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*n)-2*a,indicatorHeightSM:t,dotSize:o/2,textFontSize:o,textFontSizeSM:o,textFontWeight:"normal",statusSize:o/2}};var E=(0,p.I$)("Badge",e=>k(w(e)),O);let S=e=>{let{antCls:t,badgeFontHeight:n,marginXS:o,badgeRibbonOffset:a,calc:r}=e,i="".concat(t,"-ribbon"),c=(0,m.Z)(e,(e,t)=>{let{darkColor:n}=t;return{["&".concat(i,"-color-").concat(e)]:{background:n,color:n}}});return{["".concat(t,"-ribbon-wrapper")]:{position:"relative"},[i]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"absolute",top:o,padding:"0 ".concat((0,d.bf)(e.paddingXS)),color:e.colorPrimary,lineHeight:(0,d.bf)(n),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,["".concat(i,"-text")]:{color:e.badgeTextColor},["".concat(i,"-corner")]:{position:"absolute",top:"100%",width:a,height:a,color:"currentcolor",border:"".concat((0,d.bf)(r(a).div(2).equal())," solid"),transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),c),{["&".concat(i,"-placement-end")]:{insetInlineEnd:r(a).mul(-1).equal(),borderEndEndRadius:0,["".concat(i,"-corner")]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},["&".concat(i,"-placement-start")]:{insetInlineStart:r(a).mul(-1).equal(),borderEndStartRadius:0,["".concat(i,"-corner")]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}};var C=(0,p.I$)(["Badge","Ribbon"],e=>S(w(e)),O);let j=e=>{let t;let{prefixCls:n,value:a,current:i,offset:c=0}=e;return c&&(t={position:"absolute",top:"".concat(c,"00%"),left:0}),o.createElement("span",{style:t,className:r()("".concat(n,"-only-unit"),{current:i})},a)};var N=e=>{let t,n;let{prefixCls:a,count:r,value:i}=e,c=Number(i),l=Math.abs(r),[s,d]=o.useState(c),[u,m]=o.useState(l),b=()=>{d(c),m(l)};if(o.useEffect(()=>{let e=setTimeout(b,1e3);return()=>clearTimeout(e)},[c]),s===c||Number.isNaN(c)||Number.isNaN(s))t=[o.createElement(j,Object.assign({},e,{key:c,current:!0}))],n={transition:"none"};else{t=[];let a=c+10,r=[];for(let e=c;e<=a;e+=1)r.push(e);let i=ue%10===s);t=(i<0?r.slice(0,d+1):r.slice(d)).map((t,n)=>o.createElement(j,Object.assign({},e,{key:t,value:t%10,offset:i<0?n-d:n,current:n===d}))),n={transform:"translateY(".concat(-function(e,t,n){let o=e,a=0;for(;(o+10)%10!==t;)o+=n,a+=n;return a}(s,c,i),"00%)")}}return o.createElement("span",{className:"".concat(a,"-only"),style:n,onTransitionEnd:b},t)},z=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let L=o.forwardRef((e,t)=>{let{prefixCls:n,count:a,className:i,motionClassName:c,style:d,title:u,show:m,component:b="sup",children:p}=e,f=z(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:g}=o.useContext(s.E_),h=g("scroll-number",n),v=Object.assign(Object.assign({},f),{"data-show":m,style:d,className:r()(h,i,c),title:u}),y=a;if(a&&Number(a)%1==0){let e=String(a).split("");y=o.createElement("bdi",null,e.map((t,n)=>o.createElement(N,{prefixCls:h,count:Number(a),value:t,key:e.length-n})))}return((null==d?void 0:d.borderColor)&&(v.style=Object.assign(Object.assign({},d),{boxShadow:"0 0 0 1px ".concat(d.borderColor," inset")})),p)?(0,l.Tm)(p,e=>({className:r()("".concat(h,"-custom-component"),null==e?void 0:e.className,c)})):o.createElement(b,Object.assign({},v,{ref:t}),y)});var T=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let Z=o.forwardRef((e,t)=>{var n,a,d,u,m;let{prefixCls:b,scrollNumberPrefixCls:p,children:f,status:g,text:h,color:v,count:y=null,overflowCount:x=99,dot:k=!1,size:w="default",title:O,offset:S,style:C,className:j,rootClassName:N,classNames:z,styles:Z,showZero:P=!1}=e,M=T(e,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:R,direction:I,badge:B}=o.useContext(s.E_),W=R("badge",b),[D,H,A]=E(W),F=y>x?"".concat(x,"+"):y,q="0"===F||0===F||"0"===h||0===h,G=null===y||q&&!P,K=(null!=g||null!=v)&&G,V=null!=g||!q,_=k&&!q,X=_?"":F,Y=(0,o.useMemo)(()=>((null==X||""===X)&&(null==h||""===h)||q&&!P)&&!_,[X,q,P,_,h]),$=(0,o.useRef)(y);Y||($.current=y);let U=$.current,Q=(0,o.useRef)(X);Y||(Q.current=X);let J=Q.current,ee=(0,o.useRef)(_);Y||(ee.current=_);let et=(0,o.useMemo)(()=>{if(!S)return Object.assign(Object.assign({},null==B?void 0:B.style),C);let e={marginTop:S[1]};return"rtl"===I?e.left=Number.parseInt(S[0],10):e.right=-Number.parseInt(S[0],10),Object.assign(Object.assign(Object.assign({},e),null==B?void 0:B.style),C)},[I,S,C,null==B?void 0:B.style]),en=null!=O?O:"string"==typeof U||"number"==typeof U?U:void 0,eo=!Y&&(0===h?P:!!h&&!0!==h),ea=eo?o.createElement("span",{className:"".concat(W,"-status-text")},h):null,er=U&&"object"==typeof U?(0,l.Tm)(U,e=>({style:Object.assign(Object.assign({},et),e.style)})):void 0,ei=(0,c.o2)(v,!1),ec=r()(null==z?void 0:z.indicator,null===(n=null==B?void 0:B.classNames)||void 0===n?void 0:n.indicator,{["".concat(W,"-status-dot")]:K,["".concat(W,"-status-").concat(g)]:!!g,["".concat(W,"-color-").concat(v)]:ei}),el={};v&&!ei&&(el.color=v,el.background=v);let es=r()(W,{["".concat(W,"-status")]:K,["".concat(W,"-not-a-wrapper")]:!f,["".concat(W,"-rtl")]:"rtl"===I},j,N,null==B?void 0:B.className,null===(a=null==B?void 0:B.classNames)||void 0===a?void 0:a.root,null==z?void 0:z.root,H,A);if(!f&&K&&(h||V||!G)){let e=et.color;return D(o.createElement("span",Object.assign({},M,{className:es,style:Object.assign(Object.assign(Object.assign({},null==Z?void 0:Z.root),null===(d=null==B?void 0:B.styles)||void 0===d?void 0:d.root),et)}),o.createElement("span",{className:ec,style:Object.assign(Object.assign(Object.assign({},null==Z?void 0:Z.indicator),null===(u=null==B?void 0:B.styles)||void 0===u?void 0:u.indicator),el)}),eo&&o.createElement("span",{style:{color:e},className:"".concat(W,"-status-text")},h)))}return D(o.createElement("span",Object.assign({ref:t},M,{className:es,style:Object.assign(Object.assign({},null===(m=null==B?void 0:B.styles)||void 0===m?void 0:m.root),null==Z?void 0:Z.root)}),f,o.createElement(i.ZP,{visible:!Y,motionName:"".concat(W,"-zoom"),motionAppear:!1,motionDeadline:1e3},e=>{var t,n;let{className:a}=e,i=R("scroll-number",p),c=ee.current,l=r()(null==z?void 0:z.indicator,null===(t=null==B?void 0:B.classNames)||void 0===t?void 0:t.indicator,{["".concat(W,"-dot")]:c,["".concat(W,"-count")]:!c,["".concat(W,"-count-sm")]:"small"===w,["".concat(W,"-multiple-words")]:!c&&J&&J.toString().length>1,["".concat(W,"-status-").concat(g)]:!!g,["".concat(W,"-color-").concat(v)]:ei}),s=Object.assign(Object.assign(Object.assign({},null==Z?void 0:Z.indicator),null===(n=null==B?void 0:B.styles)||void 0===n?void 0:n.indicator),et);return v&&!ei&&((s=s||{}).background=v),o.createElement(L,{prefixCls:i,show:!Y,motionClassName:a,className:l,count:J,title:en,style:s,key:"scrollNumber"},er)}),ea))});Z.Ribbon=e=>{let{className:t,prefixCls:n,style:a,color:i,children:l,text:d,placement:u="end",rootClassName:m}=e,{getPrefixCls:b,direction:p}=o.useContext(s.E_),f=b("ribbon",n),g="".concat(f,"-wrapper"),[h,v,y]=C(f,g),x=(0,c.o2)(i,!1),k=r()(f,"".concat(f,"-placement-").concat(u),{["".concat(f,"-rtl")]:"rtl"===p,["".concat(f,"-color-").concat(i)]:x},t),w={},O={};return i&&!x&&(w.background=i,O.color=i),h(o.createElement("div",{className:r()(g,m,v,y)},l,o.createElement("div",{className:r()(k,v),style:Object.assign(Object.assign({},w),a)},o.createElement("span",{className:"".concat(f,"-text")},d),o.createElement("div",{className:"".concat(f,"-corner"),style:O}))))};var P=Z},5945:function(e,t,n){n.d(t,{Z:function(){return T}});var o=n(2265),a=n(36760),r=n.n(a),i=n(18694),c=n(71744),l=n(33759),s=n(50337),d=n(65869),u=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n},m=e=>{var{prefixCls:t,className:n,hoverable:a=!0}=e,i=u(e,["prefixCls","className","hoverable"]);let{getPrefixCls:l}=o.useContext(c.E_),s=l("card",t),d=r()("".concat(s,"-grid"),n,{["".concat(s,"-grid-hoverable")]:a});return o.createElement("div",Object.assign({},i,{className:d}))},b=n(93463),p=n(12918),f=n(99320),g=n(71140);let h=e=>{let{antCls:t,componentCls:n,headerHeight:o,headerPadding:a,tabsMarginBottom:r}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:o,marginBottom:-1,padding:"0 ".concat((0,b.bf)(a)),color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary),borderRadius:"".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG)," 0 0")},(0,p.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},p.vS),{["\n > ".concat(n,"-typography,\n > ").concat(n,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(t,"-tabs-top")]:{clear:"both",marginBottom:r,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary)}}})},v=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:o,lineWidth:a}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:"\n ".concat((0,b.bf)(a)," 0 0 0 ").concat(n,",\n 0 ").concat((0,b.bf)(a)," 0 0 ").concat(n,",\n ").concat((0,b.bf)(a)," ").concat((0,b.bf)(a)," 0 0 ").concat(n,",\n ").concat((0,b.bf)(a)," 0 0 0 ").concat(n," inset,\n 0 ").concat((0,b.bf)(a)," 0 0 ").concat(n," inset;\n "),transition:"all ".concat(e.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:o}}},y=e=>{let{componentCls:t,iconCls:n,actionsLiMargin:o,cardActionsIconSize:a,colorBorderSecondary:r,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(r),display:"flex",borderRadius:"0 0 ".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG))},(0,p.dF)()),{"& > li":{margin:o,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 ".concat(e.motionDurationMid)},["a:not(".concat(t,"-btn), > ").concat(n)]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:(0,b.bf)(e.fontHeight),transition:"color ".concat(e.motionDurationMid),"&:hover":{color:e.colorPrimary}},["> ".concat(n)]:{fontSize:a,lineHeight:(0,b.bf)(e.calc(a).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(r)}}})},x=e=>Object.assign(Object.assign({margin:"".concat((0,b.bf)(e.calc(e.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,p.dF)()),{"&-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},p.vS),"&-description":{color:e.colorTextDescription}}),k=e=>{let{componentCls:t,colorFillAlter:n,headerPadding:o,bodyPadding:a}=e;return{["".concat(t,"-head")]:{padding:"0 ".concat((0,b.bf)(o)),background:n,"&-title":{fontSize:e.fontSize}},["".concat(t,"-body")]:{padding:"".concat((0,b.bf)(e.padding)," ").concat((0,b.bf)(a))}}},w=e=>{let{componentCls:t}=e;return{overflow:"hidden",["".concat(t,"-body")]:{userSelect:"none"}}},O=e=>{let{componentCls:t,cardShadow:n,cardHeadPadding:o,colorBorderSecondary:a,boxShadowTertiary:r,bodyPadding:i,extraColor:c}=e;return{[t]:Object.assign(Object.assign({},(0,p.Wf)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,["&:not(".concat(t,"-bordered)")]:{boxShadow:r},["".concat(t,"-head")]:h(e),["".concat(t,"-extra")]:{marginInlineStart:"auto",color:c,fontWeight:"normal",fontSize:e.fontSize},["".concat(t,"-body")]:{padding:i,borderRadius:"0 0 ".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG))},["".concat(t,"-grid")]:v(e),["".concat(t,"-cover")]:{"> *":{display:"block",width:"100%",borderRadius:"".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG)," 0 0")}},["".concat(t,"-actions")]:y(e),["".concat(t,"-meta")]:x(e)}),["".concat(t,"-bordered")]:{border:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),["".concat(t,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(t,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(e.motionDurationMid,", border-color ").concat(e.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:n}},["".concat(t,"-contain-grid")]:{borderRadius:"".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG)," 0 0 "),["".concat(t,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(t,"-loading) ").concat(t,"-body")]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},["".concat(t,"-contain-tabs")]:{["> div".concat(t,"-head")]:{minHeight:0,["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:o}}},["".concat(t,"-type-inner")]:k(e),["".concat(t,"-loading")]:w(e),["".concat(t,"-rtl")]:{direction:"rtl"}}},E=e=>{let{componentCls:t,bodyPaddingSM:n,headerPaddingSM:o,headerHeightSM:a,headerFontSizeSM:r}=e;return{["".concat(t,"-small")]:{["> ".concat(t,"-head")]:{minHeight:a,padding:"0 ".concat((0,b.bf)(o)),fontSize:r,["> ".concat(t,"-head-wrapper")]:{["> ".concat(t,"-extra")]:{fontSize:e.fontSize}}},["> ".concat(t,"-body")]:{padding:n}},["".concat(t,"-small").concat(t,"-contain-tabs")]:{["> ".concat(t,"-head")]:{["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var S=(0,f.I$)("Card",e=>{let t=(0,g.IX)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[O(t),E(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:"".concat(e.paddingSM,"px 0"),tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:null!==(t=e.bodyPadding)&&void 0!==t?t:e.paddingLG,headerPadding:null!==(n=e.headerPadding)&&void 0!==n?n:e.paddingLG}}),C=n(56250),j=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let N=e=>{let{actionClasses:t,actions:n=[],actionStyle:a}=e;return o.createElement("ul",{className:t,style:a},n.map((e,t)=>o.createElement("li",{style:{width:"".concat(100/n.length,"%")},key:"action-".concat(t)},o.createElement("span",null,e))))},z=o.forwardRef((e,t)=>{let n;let{prefixCls:a,className:u,rootClassName:b,style:p,extra:f,headStyle:g={},bodyStyle:h={},title:v,loading:y,bordered:x,variant:k,size:w,type:O,cover:E,actions:z,tabList:L,children:T,activeTabKey:Z,defaultActiveTabKey:P,tabBarExtraContent:M,hoverable:R,tabProps:I={},classNames:B,styles:W}=e,D=j(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:H,direction:A,card:F}=o.useContext(c.E_),[q]=(0,C.Z)("card",k,x),G=e=>{var t;return r()(null===(t=null==F?void 0:F.classNames)||void 0===t?void 0:t[e],null==B?void 0:B[e])},K=e=>{var t;return Object.assign(Object.assign({},null===(t=null==F?void 0:F.styles)||void 0===t?void 0:t[e]),null==W?void 0:W[e])},V=o.useMemo(()=>{let e=!1;return o.Children.forEach(T,t=>{(null==t?void 0:t.type)===m&&(e=!0)}),e},[T]),_=H("card",a),[X,Y,$]=S(_),U=o.createElement(s.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},T),Q=void 0!==Z,J=Object.assign(Object.assign({},I),{[Q?"activeKey":"defaultActiveKey"]:Q?Z:P,tabBarExtraContent:M}),ee=(0,l.Z)(w),et=ee&&"default"!==ee?ee:"large",en=L?o.createElement(d.default,Object.assign({size:et},J,{className:"".concat(_,"-head-tabs"),onChange:t=>{var n;null===(n=e.onTabChange)||void 0===n||n.call(e,t)},items:L.map(e=>{var{tab:t}=e;return Object.assign({label:t},j(e,["tab"]))})})):null;if(v||f||en){let e=r()("".concat(_,"-head"),G("header")),t=r()("".concat(_,"-head-title"),G("title")),a=r()("".concat(_,"-extra"),G("extra")),i=Object.assign(Object.assign({},g),K("header"));n=o.createElement("div",{className:e,style:i},o.createElement("div",{className:"".concat(_,"-head-wrapper")},v&&o.createElement("div",{className:t,style:K("title")},v),f&&o.createElement("div",{className:a,style:K("extra")},f)),en)}let eo=r()("".concat(_,"-cover"),G("cover")),ea=E?o.createElement("div",{className:eo,style:K("cover")},E):null,er=r()("".concat(_,"-body"),G("body")),ei=Object.assign(Object.assign({},h),K("body")),ec=o.createElement("div",{className:er,style:ei},y?U:T),el=r()("".concat(_,"-actions"),G("actions")),es=(null==z?void 0:z.length)?o.createElement(N,{actionClasses:el,actionStyle:K("actions"),actions:z}):null,ed=(0,i.Z)(D,["onTabChange"]),eu=r()(_,null==F?void 0:F.className,{["".concat(_,"-loading")]:y,["".concat(_,"-bordered")]:"borderless"!==q,["".concat(_,"-hoverable")]:R,["".concat(_,"-contain-grid")]:V,["".concat(_,"-contain-tabs")]:null==L?void 0:L.length,["".concat(_,"-").concat(ee)]:ee,["".concat(_,"-type-").concat(O)]:!!O,["".concat(_,"-rtl")]:"rtl"===A},u,b,Y,$),em=Object.assign(Object.assign({},null==F?void 0:F.style),p);return X(o.createElement("div",Object.assign({ref:t},ed,{className:eu,style:em}),n,ea,ec,es))});var L=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};z.Grid=m,z.Meta=e=>{let{prefixCls:t,className:n,avatar:a,title:i,description:l}=e,s=L(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:d}=o.useContext(c.E_),u=d("card",t),m=r()("".concat(u,"-meta"),n),b=a?o.createElement("div",{className:"".concat(u,"-meta-avatar")},a):null,p=i?o.createElement("div",{className:"".concat(u,"-meta-title")},i):null,f=l?o.createElement("div",{className:"".concat(u,"-meta-description")},l):null,g=p||f?o.createElement("div",{className:"".concat(u,"-meta-detail")},p,f):null;return o.createElement("div",Object.assign({},s,{className:m}),b,g)};var T=z},69410:function(e,t,n){var o=n(54998);t.Z=o.Z},867:function(e,t,n){n.d(t,{Z:function(){return S}});var o=n(2265),a=n(54537),r=n(36760),i=n.n(r),c=n(50506),l=n(18694),s=n(71744),d=n(79326),u=n(59367),m=n(92570),b=n(5545),p=n(51248),f=n(55274),g=n(37381),h=n(20435),v=n(99320);let y=e=>{let{componentCls:t,iconCls:n,antCls:o,zIndexPopup:a,colorText:r,colorWarning:i,marginXXS:c,marginXS:l,fontSize:s,fontWeightStrong:d,colorTextHeading:u}=e;return{[t]:{zIndex:a,["&".concat(o,"-popover")]:{fontSize:s},["".concat(t,"-message")]:{marginBottom:l,display:"flex",flexWrap:"nowrap",alignItems:"start",["> ".concat(t,"-message-icon ").concat(n)]:{color:i,fontSize:s,lineHeight:1,marginInlineEnd:l},["".concat(t,"-title")]:{fontWeight:d,color:u,"&:only-child":{fontWeight:"normal"}},["".concat(t,"-description")]:{marginTop:c,color:r}},["".concat(t,"-buttons")]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:l}}}}};var x=(0,v.I$)("Popconfirm",e=>y(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1}),k=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let w=e=>{let{prefixCls:t,okButtonProps:n,cancelButtonProps:r,title:i,description:c,cancelText:l,okText:d,okType:h="primary",icon:v=o.createElement(a.Z,null),showCancel:y=!0,close:x,onConfirm:k,onCancel:w,onPopupClick:O}=e,{getPrefixCls:E}=o.useContext(s.E_),[S]=(0,f.Z)("Popconfirm",g.Z.Popconfirm),C=(0,m.Z)(i),j=(0,m.Z)(c);return o.createElement("div",{className:"".concat(t,"-inner-content"),onClick:O},o.createElement("div",{className:"".concat(t,"-message")},v&&o.createElement("span",{className:"".concat(t,"-message-icon")},v),o.createElement("div",{className:"".concat(t,"-message-text")},C&&o.createElement("div",{className:"".concat(t,"-title")},C),j&&o.createElement("div",{className:"".concat(t,"-description")},j))),o.createElement("div",{className:"".concat(t,"-buttons")},y&&o.createElement(b.ZP,Object.assign({onClick:w,size:"small"},r),l||(null==S?void 0:S.cancelText)),o.createElement(u.Z,{buttonProps:Object.assign(Object.assign({size:"small"},(0,p.nx)(h)),n),actionFn:k,close:x,prefixCls:E("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},d||(null==S?void 0:S.okText))))};var O=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let E=o.forwardRef((e,t)=>{var n,r;let{prefixCls:u,placement:m="top",trigger:b="click",okType:p="primary",icon:f=o.createElement(a.Z,null),children:g,overlayClassName:h,onOpenChange:v,onVisibleChange:y,overlayStyle:k,styles:E,classNames:S}=e,C=O(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:j,className:N,style:z,classNames:L,styles:T}=(0,s.dj)("popconfirm"),[Z,P]=(0,c.Z)(!1,{value:null!==(n=e.open)&&void 0!==n?n:e.visible,defaultValue:null!==(r=e.defaultOpen)&&void 0!==r?r:e.defaultVisible}),M=(e,t)=>{P(e,!0),null==y||y(e),null==v||v(e,t)},R=j("popconfirm",u),I=i()(R,N,h,L.root,null==S?void 0:S.root),B=i()(L.body,null==S?void 0:S.body),[W]=x(R);return W(o.createElement(d.Z,Object.assign({},(0,l.Z)(C,["title"]),{trigger:b,placement:m,onOpenChange:(t,n)=>{let{disabled:o=!1}=e;o||M(t,n)},open:Z,ref:t,classNames:{root:I,body:B},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},T.root),z),k),null==E?void 0:E.root),body:Object.assign(Object.assign({},T.body),null==E?void 0:E.body)},content:o.createElement(w,Object.assign({okType:p,icon:f},e,{prefixCls:R,close:e=>{M(!1,e)},onConfirm:t=>{var n;return null===(n=e.onConfirm)||void 0===n?void 0:n.call(void 0,t)},onCancel:t=>{var n;M(!1,t),null===(n=e.onCancel)||void 0===n||n.call(void 0,t)}})),"data-popover-inject":!0}),g))});E._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,placement:n,className:a,style:r}=e,c=k(e,["prefixCls","placement","className","style"]),{getPrefixCls:l}=o.useContext(s.E_),d=l("popconfirm",t),[u]=x(d);return u(o.createElement(h.ZP,{placement:n,className:i()(d,a),style:r,content:o.createElement(w,Object.assign({prefixCls:d},c))}))};var S=E},47451:function(e,t,n){var o=n(77774);t.Z=o.Z},30401:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},87769:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("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"}]])},42208:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("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"}]])},2356:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"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"}))});t.Z=a},15731:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=a},45589:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"}))});t.Z=a},53410:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"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"}))});t.Z=a},91126:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"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"}),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=a}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/4292-a3e9c22c4ffc7d9a.js b/litellm/proxy/_experimental/out/_next/static/chunks/4292-8e0695b825b78276.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/4292-a3e9c22c4ffc7d9a.js rename to litellm/proxy/_experimental/out/_next/static/chunks/4292-8e0695b825b78276.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/4679-9b9402b1da10881c.js b/litellm/proxy/_experimental/out/_next/static/chunks/4679-9b9402b1da10881c.js new file mode 100644 index 00000000000..8929e9e83d6 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/4679-9b9402b1da10881c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4679],{95704:function(e,t,a){a.d(t,{Dx:function(){return u.Z},RM:function(){return l.Z},SC:function(){return c.Z},Zb:function(){return s.Z},iA:function(){return r.Z},pj:function(){return n.Z},ss:function(){return i.Z},xs:function(){return o.Z},xv:function(){return d.Z}});var s=a(12514),r=a(21626),l=a(97214),n=a(28241),i=a(58834),o=a(69552),c=a(71876),d=a(84264),u=a(96761)},92280:function(e,t,a){a.d(t,{x:function(){return s.Z}});var s=a(84264)},56522:function(e,t,a){a.d(t,{o:function(){return r.Z},x:function(){return s.Z}});var s=a(84264),r=a(49566)},39760:function(e,t,a){var s=a(2265),r=a(99376),l=a(14474),n=a(3914),i=a(19250);t.Z=()=>{var e,t,a,o,c,d;let u=(0,r.useRouter)(),m="undefined"!=typeof document?(0,n.e)("token"):null;(0,s.useEffect)(()=>{m||u.replace("".concat((0,i.getProxyBaseUrl)(),"/ui/login"))},[m,u]);let g=(0,s.useMemo)(()=>{if(!m)return null;try{return(0,l.o)(m)}catch(e){return(0,n.b)(),u.replace("".concat((0,i.getProxyBaseUrl)(),"/ui/login")),null}},[m,u]);return{token:m,accessToken:null!==(e=null==g?void 0:g.key)&&void 0!==e?e:null,userId:null!==(t=null==g?void 0:g.user_id)&&void 0!==t?t:null,userEmail:null!==(a=null==g?void 0:g.user_email)&&void 0!==a?a:null,userRole:function(e){if(!e)return"Undefined Role";switch(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"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(o=null==g?void 0:g.user_role)&&void 0!==o?o:null),premiumUser:null!==(c=null==g?void 0:g.premium_user)&&void 0!==c?c:null,disabledPersonalKeyCreation:null!==(d=null==g?void 0:g.disabled_non_admin_personal_key_creation)&&void 0!==d?d:null,showSSOBanner:(null==g?void 0:g.login_method)==="username_password"}}},82586:function(e,t,a){var s=a(57437),r=a(2265),l=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:o,placeholder:c="Select agents",disabled:d=!1}=e,[u,m]=(0,r.useState)([]),[g,p]=(0,r.useState)([]),[x,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{if(o){h(!0);try{let e=await (0,n.getAgentsList)(o),t=(null==e?void 0:e.agents)||[];m(t);let a=new Set;t.forEach(e=>{let t=e.agent_access_groups;t&&Array.isArray(t)&&t.forEach(e=>a.add(e))}),p(Array.from(a))}catch(e){console.error("Error fetching agents:",e)}finally{h(!1)}}})()},[o]);let f=[...g.map(e=>({label:e,value:"group:".concat(e),isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...u.map(e=>({label:"".concat(e.agent_name||e.agent_id),value:e.agent_id,isAccessGroup:!1,searchText:"".concat(e.agent_name||e.agent_id," ").concat(e.agent_id," Agent")}))],v=[...(null==a?void 0:a.agents)||[],...((null==a?void 0:a.accessGroups)||[]).map(e=>"group:".concat(e))];return(0,s.jsx)("div",{children:(0,s.jsx)(l.default,{mode:"multiple",placeholder:c,onChange:e=>{t({agents:e.filter(e=>!e.startsWith("group:")),accessGroups:e.filter(e=>e.startsWith("group:")).map(e=>e.replace("group:",""))})},value:v,loading:x,className:i,showSearch:!0,style:{width:"100%"},disabled:d,filterOption:(e,t)=>{var a;return((null===(a=f.find(e=>e.value===(null==t?void 0:t.value)))||void 0===a?void 0:a.searchText)||"").toLowerCase().includes(e.toLowerCase())},children:f.map(e=>(0,s.jsx)(l.default.Option,{value:e.value,label:e.label,children:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,s.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#722ed1",flexShrink:0}}),(0,s.jsx)("span",{style:{flex:1},children:e.label}),(0,s.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#722ed1",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"Agent"})]})},e.value))})})}},97434:function(e,t,a){a.d(t,{Dg:function(){return l},Lo:function(){return n},PA:function(){return c},RD:function(){return i},Z3:function(){return o}});let s="../ui/assets/logos/",r=[{id:"arize",displayName:"Arize",logo:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"otel.png"),supports_key_team_logging:!1,dynamic_params:{otel_endpoint:"text",otel_headers:"text"},description:"OpenTelemetry Logging Integration"},{id:"s3",displayName:"S3",logo:"".concat(s,"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:"".concat(s,"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=r.reduce((e,t)=>(e[t.displayName]=t,e),{}),n=r.reduce((e,t)=>(e[t.displayName]=t.id,e),{}),i=r.reduce((e,t)=>(e[t.id]=t.displayName,e),{}),o=e=>e.map(e=>n[e]||e),c=e=>e.map(e=>i[e]||e)},95096:function(e,t,a){var s=a(57437),r=a(2265),l=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:o,placeholder:c="Select pass through routes",disabled:d=!1,teamId:u}=e,[m,g]=(0,r.useState)([]),[p,x]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(o){x(!0);try{let e=await (0,n.getPassThroughEndpointsCall)(o,u);if(e.endpoints){let t=e.endpoints.map(e=>e.path);g(t)}}catch(e){console.error("Error fetching pass through routes:",e)}finally{x(!1)}}})()},[o,u]),(0,s.jsx)(l.default,{mode:"tags",placeholder:c,onChange:t,value:a,loading:p,className:i,options:m.map(e=>({label:e,value:e})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})}},46468:function(e,t,a){a.d(t,{K2:function(){return r},Ob:function(){return n},W0:function(){return l}});var s=a(19250);let r=async(e,t,a)=>{try{if(null===e||null===t)return;if(null!==a){let r=(await (0,s.modelAvailableCall)(a,e,t,!0,null,!0)).data.map(e=>e.id),l=[],n=[];return r.forEach(e=>{e.endsWith("/*")?l.push(e):n.push(e)}),[...l,...n]}}catch(e){console.error("Error fetching user models:",e)}},l=e=>{if("all-proxy-models"===e)return"All Proxy Models";if(e.endsWith("/*")){let t=e.replace("/*","");return"All ".concat(t," models")}return e},n=(e,t)=>{let a=[],s=[];return console.log("teamModels",e),console.log("allModels",t),e.forEach(e=>{if(e.endsWith("/*")){let r=e.replace("/*",""),l=t.filter(e=>e.startsWith(r+"/"));s.push(...l),a.push(e)}else s.push(e)}),[...a,...s].filter((e,t,a)=>a.indexOf(e)===t)}},95920:function(e,t,a){var s=a(57437),r=a(2265),l=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:o,placeholder:c="Select MCP servers",disabled:d=!1}=e,[u,m]=(0,r.useState)([]),[g,p]=(0,r.useState)([]),[x,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{if(o){h(!0);try{let[e,t]=await Promise.all([(0,n.fetchMCPServers)(o),(0,n.fetchMCPAccessGroups)(o)]),a=Array.isArray(e)?e:e.data||[],s=Array.isArray(t)?t:t.data||[];m(a),p(s)}catch(e){console.error("Error fetching MCP servers or access groups:",e)}finally{h(!1)}}})()},[o]);let f=[...g.map(e=>({label:e,value:e,isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...u.map(e=>({label:"".concat(e.server_name||e.server_id," (").concat(e.server_id,")"),value:e.server_id,isAccessGroup:!1,searchText:"".concat(e.server_name||e.server_id," ").concat(e.server_id," MCP Server")}))],v=[...(null==a?void 0:a.servers)||[],...(null==a?void 0:a.accessGroups)||[]];return(0,s.jsx)("div",{children:(0,s.jsx)(l.default,{mode:"multiple",placeholder:c,onChange:e=>{t({servers:e.filter(e=>!g.includes(e)),accessGroups:e.filter(e=>g.includes(e))})},value:v,loading:x,className:i,showSearch:!0,style:{width:"100%"},disabled:d,filterOption:(e,t)=>{var a;return((null===(a=f.find(e=>e.value===(null==t?void 0:t.value)))||void 0===a?void 0:a.searchText)||"").toLowerCase().includes(e.toLowerCase())},children:f.map(e=>(0,s.jsx)(l.default.Option,{value:e.value,label:e.label,children:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,s.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#1890ff",flexShrink:0}}),(0,s.jsx)("span",{style:{flex:1},children:e.label}),(0,s.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#1890ff",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"MCP Server"})]})},e.value))})})}},68473:function(e,t,a){var s=a(57437),r=a(2265),l=a(19250),n=a(92280),i=a(10353),o=a(4156),c=a(32489);t.Z=e=>{let{accessToken:t,selectedServers:a,toolPermissions:d,onChange:u,disabled:m=!1}=e,[g,p]=(0,r.useState)([]),[x,h]=(0,r.useState)({}),[f,v]=(0,r.useState)({}),[_,y]=(0,r.useState)({});(0,r.useEffect)(()=>{(async()=>{if(0===a.length){p([]);return}try{let e=await (0,l.fetchMCPServers)(t),s=(Array.isArray(e)?e:e.data||[]).filter(e=>a.includes(e.server_id));p(s)}catch(e){console.error("Error fetching MCP servers:",e),p([])}})()},[a,t]);let b=async e=>{v(t=>({...t,[e]:!0})),y(t=>({...t,[e]:""}));try{let a=await (0,l.listMCPTools)(t,e);a.error?(y(t=>({...t,[e]:a.message||"Failed to fetch tools"})),h(t=>({...t,[e]:[]}))):h(t=>({...t,[e]:a.tools||[]}))}catch(t){console.error("Error fetching tools for server ".concat(e,":"),t),y(t=>({...t,[e]:"Failed to fetch tools"})),h(t=>({...t,[e]:[]}))}finally{v(t=>({...t,[e]:!1}))}};(0,r.useEffect)(()=>{g.forEach(e=>{x[e.server_id]||f[e.server_id]||b(e.server_id)})},[g]);let j=(e,t)=>{let a=d[e]||[],s=a.includes(t)?a.filter(e=>e!==t):[...a,t];u({...d,[e]:s})},N=e=>{let t=x[e]||[];u({...d,[e]:t.map(e=>e.name)})},w=e=>{u({...d,[e]:[]})};return 0===a.length?null:(0,s.jsx)("div",{className:"space-y-4",children:g.map(e=>{let t=e.server_name||e.alias||e.server_id,a=x[e.server_id]||[],r=d[e.server_id]||[],l=f[e.server_id],u=_[e.server_id];return(0,s.jsxs)("div",{className:"border rounded-lg bg-gray-50",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 border-b bg-white rounded-t-lg",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.x,{className:"font-semibold text-gray-900",children:t}),e.description&&(0,s.jsx)(n.x,{className:"text-sm text-gray-500",children:e.description})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>N(e.server_id),disabled:m||l,children:"Select All"}),(0,s.jsx)("button",{className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>w(e.server_id),disabled:m||l,children:"Deselect All"}),(0,s.jsx)("button",{className:"text-gray-400 hover:text-gray-600",onClick:()=>{},children:(0,s.jsx)(c.Z,{className:"w-4 h-4"})})]})]}),(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)(n.x,{className:"text-sm font-medium text-gray-700 mb-3",children:"Available Tools"}),l&&(0,s.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,s.jsx)(i.Z,{size:"large"}),(0,s.jsx)(n.x,{className:"ml-3 text-gray-500",children:"Loading tools..."})]}),u&&!l&&(0,s.jsxs)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg text-center",children:[(0,s.jsx)(n.x,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,s.jsx)(n.x,{className:"text-sm text-red-500 mt-1",children:u})]}),!l&&!u&&a.length>0&&(0,s.jsx)("div",{className:"space-y-2",children:a.map(t=>{let a=r.includes(t.name);return(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(o.Z,{checked:a,onChange:()=>j(e.server_id,t.name),disabled:m}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(n.x,{className:"font-medium text-gray-900",children:t.name}),(0,s.jsxs)(n.x,{className:"text-sm text-gray-500",children:["- ",t.description||"No description"]})]})})]},t.name)})}),!l&&!u&&0===a.length&&(0,s.jsx)("div",{className:"text-center py-6",children:(0,s.jsx)(n.x,{className:"text-gray-500",children:"No tools available"})})]})]},e.server_id)})})}},10703:function(e,t,a){a.d(t,{p:function(){return r}});var s=a(19250);let r=async e=>{try{let t=await (0,s.modelHubCall)(e);if(console.log("model_info:",t),(null==t?void 0:t.data.length)>0){let e=t.data.map(e=>({model_group:e.model_group,mode:null==e?void 0: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}}},24199:function(e,t,a){a.d(t,{Z:function(){return l}});var s=a(57437);a(2265);var r=a(30150),l=e=>{let{step:t=.01,style:a={width:"100%"},placeholder:l="Enter a numerical value",min:n,max:i,onChange:o,...c}=e;return(0,s.jsx)(r.Z,{onWheel:e=>e.currentTarget.blur(),step:t,style:a,placeholder:l,min:n,max:i,onChange:o,...c})}},54507:function(e,t,a){a.d(t,{Z:function(){return v}});var s=a(57437);a(2265);var r=a(37592),l=a(99981),n=a(23496),i=a(15424),o=a(78489),c=a(12514),d=a(49566),u=a(91777),m=a(82182),g=a(22452),p=a(74998),x=a(97434),h=a(24199);let{Option:f}=r.default;var v=e=>{let{value:t=[],onChange:a,disabledCallbacks:v=[],onDisabledCallbacksChange:_}=e,y=Object.entries(x.Dg).filter(e=>{let[t,a]=e;return a.supports_key_team_logging}).map(e=>{let[t,a]=e;return t}),b=Object.keys(x.Dg),j=e=>{null==a||a(e)},N=e=>{j(t.filter((t,a)=>a!==e))},w=(e,a,s)=>{let r=[...t];if("callback_name"===a){let t=x.Lo[s]||s;r[e]={...r[e],[a]:t,callback_vars:{}}}else r[e]={...r[e],[a]:s};j(r)},k=(e,a,s)=>{let r=[...t];r[e]={...r[e],callback_vars:{...r[e].callback_vars,[a]:s}},j(r)},C=(e,t)=>{var a,r;if(!e.callback_name)return null;let n=null===(a=Object.entries(x.Lo).find(t=>{let[a,s]=t;return s===e.callback_name}))||void 0===a?void 0:a[0];if(!n)return null;let o=(null===(r=x.Dg[n])||void 0===r?void 0:r.dynamic_params)||{};return 0===Object.keys(o).length?null:(0,s.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,s.jsx)("div",{className:"w-3 h-3 bg-blue-100 rounded-full flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full"})}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Integration Parameters"})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4",children:Object.entries(o).map(a=>{let[r,n]=a;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("label",{className:"text-sm font-medium text-gray-700 capitalize flex items-center space-x-1",children:[(0,s.jsx)("span",{children:r.replace(/_/g," ")}),(0,s.jsx)(l.Z,{title:"Environment variable reference recommended: os.environ/".concat(r.toUpperCase()),children:(0,s.jsx)(i.Z,{className:"text-gray-400 cursor-help text-xs"})}),"password"===n&&(0,s.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"===n&&(0,s.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"===n&&(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"Value must be between 0 and 1"}),"number"===n?(0,s.jsx)(h.Z,{step:.01,width:400,placeholder:"os.environ/".concat(r.toUpperCase()),value:e.callback_vars[r]||"",onChange:e=>k(t,r,e.target.value)}):(0,s.jsx)(d.Z,{type:"password"===n?"password":"text",placeholder:"os.environ/".concat(r.toUpperCase()),value:e.callback_vars[r]||"",onChange:e=>k(t,r,e.target.value)})]},r)})})]})};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(u.Z,{className:"w-5 h-5 text-red-500"}),(0,s.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Disabled Callbacks"}),(0,s.jsx)(l.Z,{title:"Select callbacks to disable for this key. Disabled callbacks will not receive any logging data.",children:(0,s.jsx)(i.Z,{className:"text-gray-400 cursor-help"})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Disabled Callbacks"}),(0,s.jsx)(r.default,{mode:"multiple",placeholder:"Select callbacks to disable",value:v,onChange:e=>{let t=(0,x.Z3)(e);null==_||_(t)},style:{width:"100%"},optionLabelProp:"label",children:b.map(e=>{var t,a;let r=null===(t=x.Dg[e])||void 0===t?void 0:t.logo,n=null===(a=x.Dg[e])||void 0===a?void 0:a.description;return(0,s.jsx)(f,{value:e,label:e,children:(0,s.jsx)(l.Z,{title:n,placement:"right",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,s.jsx)("img",{src:r,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let a=t.target,s=a.parentElement;if(s){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),s.replaceChild(t,a)}}}),(0,s.jsx)("span",{children:e})]})})},e)})}),(0,s.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,s.jsx)(n.Z,{}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(m.Z,{className:"w-5 h-5 text-blue-500"}),(0,s.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Logging Integrations"}),(0,s.jsx)(l.Z,{title:"Configure callback logging integrations for this team.",children:(0,s.jsx)(i.Z,{className:"text-gray-400 cursor-help"})})]}),(0,s.jsx)(o.Z,{variant:"secondary",onClick:()=>{j([...t,{callback_name:"",callback_type:"success",callback_vars:{}}])},icon:g.Z,size:"sm",className:"hover:border-blue-400 hover:text-blue-500",type:"button",children:"Add Integration"})]}),(0,s.jsx)("div",{className:"space-y-4",children:t.map((e,t)=>{var a,n;let i=e.callback_name?null===(a=Object.entries(x.Lo).find(t=>{let[a,s]=t;return s===e.callback_name}))||void 0===a?void 0:a[0]:void 0,d=i?null===(n=x.Dg[i])||void 0===n?void 0:n.logo:null;return(0,s.jsxs)(c.Z,{className:"border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200",decoration:"top",decorationColor:"blue",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[d&&(0,s.jsx)("img",{src:d,alt:i,className:"w-5 h-5 object-contain"}),(0,s.jsxs)("span",{className:"text-sm font-medium",children:[i||"New Integration"," Configuration"]})]}),(0,s.jsx)(o.Z,{variant:"light",onClick:()=>N(t),icon:p.Z,size:"xs",color:"red",className:"hover:bg-red-50",type:"button",children:"Remove"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Integration Type"}),(0,s.jsx)(r.default,{value:i,placeholder:"Select integration",onChange:e=>w(t,"callback_name",e),className:"w-full",optionLabelProp:"label",children:y.map(e=>{var t,a;let r=null===(t=x.Dg[e])||void 0===t?void 0:t.logo,n=null===(a=x.Dg[e])||void 0===a?void 0:a.description;return(0,s.jsx)(f,{value:e,label:e,children:(0,s.jsx)(l.Z,{title:n,placement:"right",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,s.jsx)("img",{src:r,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let a=t.target,s=a.parentElement;if(s){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),s.replaceChild(t,a)}}}),(0,s.jsx)("span",{children:e})]})})},e)})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Event Type"}),(0,s.jsxs)(r.default,{value:e.callback_type,onChange:e=>w(t,"callback_type",e),className:"w-full",children:[(0,s.jsx)(f,{value:"success",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,s.jsx)("span",{children:"Success Only"})]})}),(0,s.jsx)(f,{value:"failure",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),(0,s.jsx)("span",{children:"Failure Only"})]})}),(0,s.jsx)(f,{value:"success_and_failure",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,s.jsx)("span",{children:"Success & Failure"})]})})]})]})]}),C(e,t)]})]},t)})}),0===t.length&&(0,s.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,s.jsx)(m.Z,{className:"w-12 h-12 text-gray-300 mb-3 mx-auto"}),(0,s.jsx)("div",{className:"text-base font-medium mb-1",children:"No logging integrations configured"}),(0,s.jsx)("div",{className:"text-sm text-gray-400",children:'Click "Add Integration" to configure logging for this team'})]})]})}},97415:function(e,t,a){var s=a(57437),r=a(2265),l=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:o,placeholder:c="Select vector stores",disabled:d=!1}=e,[u,m]=(0,r.useState)([]),[g,p]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(o){p(!0);try{let e=await (0,n.vectorStoreListCall)(o);e.data&&m(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{p(!1)}}})()},[o]),(0,s.jsx)("div",{children:(0,s.jsx)(l.default,{mode:"multiple",placeholder:c,onChange:t,value:a,loading:g,className:i,options:u.map(e=>({label:"".concat(e.vector_store_name||e.vector_store_id," (").concat(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})})}},59872:function(e,t,a){a.d(t,{GS:function(){return n},nl:function(){return r},pw:function(){return l},vQ:function(){return i}});var s=a(9114);function r(e,t){let a=structuredClone(e);for(let[e,s]of Object.entries(t))e in a&&(a[e]=s);return a}let l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=!(arguments.length>3)||void 0===arguments[3]||arguments[3];if(null==e||!Number.isFinite(e)||0===e&&!s)return"-";let r={minimumFractionDigits:t,maximumFractionDigits:t};if(!a)return e.toLocaleString("en-US",r);let l=Math.abs(e),n=l,i="";return l>=1e6?(n=l/1e6,i="M"):l>=1e3&&(n=l/1e3,i="K"),"".concat(e<0?"-":"").concat(n.toLocaleString("en-US",r)).concat(i)},n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6;if(null==e||!Number.isFinite(e)||0===e)return"-";let a=l(e,t,!1,!1);if(0===Number(a.replace(/,/g,""))){let e=(1/10**t).toFixed(t);return"< $".concat(e)}return"$".concat(a)},i=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return o(e,t);try{return await navigator.clipboard.writeText(e),s.Z.success(t),!0}catch(a){return console.error("Clipboard API failed: ",a),o(e,t)}},o=(e,t)=>{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 s.Z.success(t),!0;throw Error("execCommand failed")}catch(e){return s.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,t,a){a.d(t,{LQ:function(){return l},P4:function(){return i},ZL:function(){return s},lo:function(){return r},tY:function(){return n}});let s=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],r=["Internal User","Internal Viewer"],l=["Internal User","Admin","proxy_admin"],n=e=>s.includes(e),i=e=>"proxy_admin"===e||"Admin"===e}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/4679-bdd70e8457d0a482.js b/litellm/proxy/_experimental/out/_next/static/chunks/4679-bdd70e8457d0a482.js deleted file mode 100644 index 2a001d732ca..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/4679-bdd70e8457d0a482.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4679],{95704:function(e,t,a){a.d(t,{Dx:function(){return u.Z},RM:function(){return l.Z},SC:function(){return o.Z},Zb:function(){return s.Z},iA:function(){return r.Z},pj:function(){return n.Z},ss:function(){return i.Z},xs:function(){return c.Z},xv:function(){return d.Z}});var s=a(12514),r=a(21626),l=a(97214),n=a(28241),i=a(58834),c=a(69552),o=a(71876),d=a(84264),u=a(96761)},92280:function(e,t,a){a.d(t,{x:function(){return s.Z}});var s=a(84264)},56522:function(e,t,a){a.d(t,{o:function(){return r.Z},x:function(){return s.Z}});var s=a(84264),r=a(49566)},80443:function(e,t,a){var s=a(2265),r=a(99376),l=a(14474),n=a(3914),i=a(19250);t.Z=()=>{var e,t,a,c,o,d;let u=(0,r.useRouter)(),m="undefined"!=typeof document?(0,n.e)("token"):null;(0,s.useEffect)(()=>{m||u.replace("".concat((0,i.getProxyBaseUrl)(),"/ui/login"))},[m,u]);let g=(0,s.useMemo)(()=>{if(!m)return null;try{return(0,l.o)(m)}catch(e){return(0,n.b)(),u.replace("".concat((0,i.getProxyBaseUrl)(),"/ui/login")),null}},[m,u]);return{token:m,accessToken:null!==(e=null==g?void 0:g.key)&&void 0!==e?e:null,userId:null!==(t=null==g?void 0:g.user_id)&&void 0!==t?t:null,userEmail:null!==(a=null==g?void 0:g.user_email)&&void 0!==a?a:null,userRole:function(e){if(!e)return"Undefined Role";switch(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"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(c=null==g?void 0:g.user_role)&&void 0!==c?c:null),premiumUser:null!==(o=null==g?void 0:g.premium_user)&&void 0!==o?o:null,disabledPersonalKeyCreation:null!==(d=null==g?void 0:g.disabled_non_admin_personal_key_creation)&&void 0!==d?d:null,showSSOBanner:(null==g?void 0:g.login_method)==="username_password"}}},82586:function(e,t,a){var s=a(57437),r=a(2265),l=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:c,placeholder:o="Select agents",disabled:d=!1}=e,[u,m]=(0,r.useState)([]),[g,p]=(0,r.useState)([]),[x,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{if(c){h(!0);try{let e=await (0,n.getAgentsList)(c),t=(null==e?void 0:e.agents)||[];m(t);let a=new Set;t.forEach(e=>{let t=e.agent_access_groups;t&&Array.isArray(t)&&t.forEach(e=>a.add(e))}),p(Array.from(a))}catch(e){console.error("Error fetching agents:",e)}finally{h(!1)}}})()},[c]);let f=[...g.map(e=>({label:e,value:"group:".concat(e),isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...u.map(e=>({label:"".concat(e.agent_name||e.agent_id),value:e.agent_id,isAccessGroup:!1,searchText:"".concat(e.agent_name||e.agent_id," ").concat(e.agent_id," Agent")}))],v=[...(null==a?void 0:a.agents)||[],...((null==a?void 0:a.accessGroups)||[]).map(e=>"group:".concat(e))];return(0,s.jsx)("div",{children:(0,s.jsx)(l.default,{mode:"multiple",placeholder:o,onChange:e=>{t({agents:e.filter(e=>!e.startsWith("group:")),accessGroups:e.filter(e=>e.startsWith("group:")).map(e=>e.replace("group:",""))})},value:v,loading:x,className:i,showSearch:!0,style:{width:"100%"},disabled:d,filterOption:(e,t)=>{var a;return((null===(a=f.find(e=>e.value===(null==t?void 0:t.value)))||void 0===a?void 0:a.searchText)||"").toLowerCase().includes(e.toLowerCase())},children:f.map(e=>(0,s.jsx)(l.default.Option,{value:e.value,label:e.label,children:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,s.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#722ed1",flexShrink:0}}),(0,s.jsx)("span",{style:{flex:1},children:e.label}),(0,s.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#722ed1",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"Agent"})]})},e.value))})})}},97434:function(e,t,a){a.d(t,{Dg:function(){return l},Lo:function(){return n},PA:function(){return o},RD:function(){return i},Z3:function(){return c}});let s="../ui/assets/logos/",r=[{id:"arize",displayName:"Arize",logo:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"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:"".concat(s,"otel.png"),supports_key_team_logging:!1,dynamic_params:{otel_endpoint:"text",otel_headers:"text"},description:"OpenTelemetry Logging Integration"},{id:"s3",displayName:"S3",logo:"".concat(s,"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:"".concat(s,"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=r.reduce((e,t)=>(e[t.displayName]=t,e),{}),n=r.reduce((e,t)=>(e[t.displayName]=t.id,e),{}),i=r.reduce((e,t)=>(e[t.id]=t.displayName,e),{}),c=e=>e.map(e=>n[e]||e),o=e=>e.map(e=>i[e]||e)},95096:function(e,t,a){var s=a(57437),r=a(2265),l=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:c,placeholder:o="Select pass through routes",disabled:d=!1,teamId:u}=e,[m,g]=(0,r.useState)([]),[p,x]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(c){x(!0);try{let e=await (0,n.getPassThroughEndpointsCall)(c,u);if(e.endpoints){let t=e.endpoints.map(e=>e.path);g(t)}}catch(e){console.error("Error fetching pass through routes:",e)}finally{x(!1)}}})()},[c,u]),(0,s.jsx)(l.default,{mode:"tags",placeholder:o,onChange:t,value:a,loading:p,className:i,options:m.map(e=>({label:e,value:e})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})}},46468:function(e,t,a){a.d(t,{K2:function(){return r},Ob:function(){return n},W0:function(){return l}});var s=a(19250);let r=async(e,t,a)=>{try{if(null===e||null===t)return;if(null!==a){let r=(await (0,s.modelAvailableCall)(a,e,t,!0,null,!0)).data.map(e=>e.id),l=[],n=[];return r.forEach(e=>{e.endsWith("/*")?l.push(e):n.push(e)}),[...l,...n]}}catch(e){console.error("Error fetching user models:",e)}},l=e=>{if(e.endsWith("/*")){let t=e.replace("/*","");return"All ".concat(t," models")}return e},n=(e,t)=>{let a=[],s=[];return console.log("teamModels",e),console.log("allModels",t),e.forEach(e=>{if(e.endsWith("/*")){let r=e.replace("/*",""),l=t.filter(e=>e.startsWith(r+"/"));s.push(...l),a.push(e)}else s.push(e)}),[...a,...s].filter((e,t,a)=>a.indexOf(e)===t)}},95920:function(e,t,a){var s=a(57437),r=a(2265),l=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:c,placeholder:o="Select MCP servers",disabled:d=!1}=e,[u,m]=(0,r.useState)([]),[g,p]=(0,r.useState)([]),[x,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{if(c){h(!0);try{let[e,t]=await Promise.all([(0,n.fetchMCPServers)(c),(0,n.fetchMCPAccessGroups)(c)]),a=Array.isArray(e)?e:e.data||[],s=Array.isArray(t)?t:t.data||[];m(a),p(s)}catch(e){console.error("Error fetching MCP servers or access groups:",e)}finally{h(!1)}}})()},[c]);let f=[...g.map(e=>({label:e,value:e,isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...u.map(e=>({label:"".concat(e.server_name||e.server_id," (").concat(e.server_id,")"),value:e.server_id,isAccessGroup:!1,searchText:"".concat(e.server_name||e.server_id," ").concat(e.server_id," MCP Server")}))],v=[...(null==a?void 0:a.servers)||[],...(null==a?void 0:a.accessGroups)||[]];return(0,s.jsx)("div",{children:(0,s.jsx)(l.default,{mode:"multiple",placeholder:o,onChange:e=>{t({servers:e.filter(e=>!g.includes(e)),accessGroups:e.filter(e=>g.includes(e))})},value:v,loading:x,className:i,showSearch:!0,style:{width:"100%"},disabled:d,filterOption:(e,t)=>{var a;return((null===(a=f.find(e=>e.value===(null==t?void 0:t.value)))||void 0===a?void 0:a.searchText)||"").toLowerCase().includes(e.toLowerCase())},children:f.map(e=>(0,s.jsx)(l.default.Option,{value:e.value,label:e.label,children:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,s.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#1890ff",flexShrink:0}}),(0,s.jsx)("span",{style:{flex:1},children:e.label}),(0,s.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#1890ff",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"MCP Server"})]})},e.value))})})}},68473:function(e,t,a){var s=a(57437),r=a(2265),l=a(19250),n=a(92280),i=a(10353),c=a(61994),o=a(32489);t.Z=e=>{let{accessToken:t,selectedServers:a,toolPermissions:d,onChange:u,disabled:m=!1}=e,[g,p]=(0,r.useState)([]),[x,h]=(0,r.useState)({}),[f,v]=(0,r.useState)({}),[_,y]=(0,r.useState)({});(0,r.useEffect)(()=>{(async()=>{if(0===a.length){p([]);return}try{let e=await (0,l.fetchMCPServers)(t),s=(Array.isArray(e)?e:e.data||[]).filter(e=>a.includes(e.server_id));p(s)}catch(e){console.error("Error fetching MCP servers:",e),p([])}})()},[a,t]);let b=async e=>{v(t=>({...t,[e]:!0})),y(t=>({...t,[e]:""}));try{let a=await (0,l.listMCPTools)(t,e);a.error?(y(t=>({...t,[e]:a.message||"Failed to fetch tools"})),h(t=>({...t,[e]:[]}))):h(t=>({...t,[e]:a.tools||[]}))}catch(t){console.error("Error fetching tools for server ".concat(e,":"),t),y(t=>({...t,[e]:"Failed to fetch tools"})),h(t=>({...t,[e]:[]}))}finally{v(t=>({...t,[e]:!1}))}};(0,r.useEffect)(()=>{g.forEach(e=>{x[e.server_id]||f[e.server_id]||b(e.server_id)})},[g]);let j=(e,t)=>{let a=d[e]||[],s=a.includes(t)?a.filter(e=>e!==t):[...a,t];u({...d,[e]:s})},N=e=>{let t=x[e]||[];u({...d,[e]:t.map(e=>e.name)})},w=e=>{u({...d,[e]:[]})};return 0===a.length?null:(0,s.jsx)("div",{className:"space-y-4",children:g.map(e=>{let t=e.server_name||e.alias||e.server_id,a=x[e.server_id]||[],r=d[e.server_id]||[],l=f[e.server_id],u=_[e.server_id];return(0,s.jsxs)("div",{className:"border rounded-lg bg-gray-50",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 border-b bg-white rounded-t-lg",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.x,{className:"font-semibold text-gray-900",children:t}),e.description&&(0,s.jsx)(n.x,{className:"text-sm text-gray-500",children:e.description})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>N(e.server_id),disabled:m||l,children:"Select All"}),(0,s.jsx)("button",{className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>w(e.server_id),disabled:m||l,children:"Deselect All"}),(0,s.jsx)("button",{className:"text-gray-400 hover:text-gray-600",onClick:()=>{},children:(0,s.jsx)(o.Z,{className:"w-4 h-4"})})]})]}),(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)(n.x,{className:"text-sm font-medium text-gray-700 mb-3",children:"Available Tools"}),l&&(0,s.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,s.jsx)(i.Z,{size:"large"}),(0,s.jsx)(n.x,{className:"ml-3 text-gray-500",children:"Loading tools..."})]}),u&&!l&&(0,s.jsxs)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg text-center",children:[(0,s.jsx)(n.x,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,s.jsx)(n.x,{className:"text-sm text-red-500 mt-1",children:u})]}),!l&&!u&&a.length>0&&(0,s.jsx)("div",{className:"space-y-2",children:a.map(t=>{let a=r.includes(t.name);return(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(c.Z,{checked:a,onChange:()=>j(e.server_id,t.name),disabled:m}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(n.x,{className:"font-medium text-gray-900",children:t.name}),(0,s.jsxs)(n.x,{className:"text-sm text-gray-500",children:["- ",t.description||"No description"]})]})})]},t.name)})}),!l&&!u&&0===a.length&&(0,s.jsx)("div",{className:"text-center py-6",children:(0,s.jsx)(n.x,{className:"text-gray-500",children:"No tools available"})})]})]},e.server_id)})})}},10703:function(e,t,a){a.d(t,{p:function(){return r}});var s=a(19250);let r=async e=>{try{let t=await (0,s.modelHubCall)(e);if(console.log("model_info:",t),(null==t?void 0:t.data.length)>0){let e=t.data.map(e=>({model_group:e.model_group,mode:null==e?void 0: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}}},24199:function(e,t,a){a.d(t,{Z:function(){return l}});var s=a(57437);a(2265);var r=a(30150),l=e=>{let{step:t=.01,style:a={width:"100%"},placeholder:l="Enter a numerical value",min:n,max:i,onChange:c,...o}=e;return(0,s.jsx)(r.Z,{onWheel:e=>e.currentTarget.blur(),step:t,style:a,placeholder:l,min:n,max:i,onChange:c,...o})}},54507:function(e,t,a){a.d(t,{Z:function(){return v}});var s=a(57437);a(2265);var r=a(37592),l=a(99981),n=a(23496),i=a(15424),c=a(78489),o=a(12514),d=a(49566),u=a(91777),m=a(82182),g=a(22452),p=a(74998),x=a(97434),h=a(24199);let{Option:f}=r.default;var v=e=>{let{value:t=[],onChange:a,disabledCallbacks:v=[],onDisabledCallbacksChange:_}=e,y=Object.entries(x.Dg).filter(e=>{let[t,a]=e;return a.supports_key_team_logging}).map(e=>{let[t,a]=e;return t}),b=Object.keys(x.Dg),j=e=>{null==a||a(e)},N=e=>{j(t.filter((t,a)=>a!==e))},w=(e,a,s)=>{let r=[...t];if("callback_name"===a){let t=x.Lo[s]||s;r[e]={...r[e],[a]:t,callback_vars:{}}}else r[e]={...r[e],[a]:s};j(r)},k=(e,a,s)=>{let r=[...t];r[e]={...r[e],callback_vars:{...r[e].callback_vars,[a]:s}},j(r)},C=(e,t)=>{var a,r;if(!e.callback_name)return null;let n=null===(a=Object.entries(x.Lo).find(t=>{let[a,s]=t;return s===e.callback_name}))||void 0===a?void 0:a[0];if(!n)return null;let c=(null===(r=x.Dg[n])||void 0===r?void 0:r.dynamic_params)||{};return 0===Object.keys(c).length?null:(0,s.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,s.jsx)("div",{className:"w-3 h-3 bg-blue-100 rounded-full flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full"})}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Integration Parameters"})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4",children:Object.entries(c).map(a=>{let[r,n]=a;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("label",{className:"text-sm font-medium text-gray-700 capitalize flex items-center space-x-1",children:[(0,s.jsx)("span",{children:r.replace(/_/g," ")}),(0,s.jsx)(l.Z,{title:"Environment variable reference recommended: os.environ/".concat(r.toUpperCase()),children:(0,s.jsx)(i.Z,{className:"text-gray-400 cursor-help text-xs"})}),"password"===n&&(0,s.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"===n&&(0,s.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"===n&&(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"Value must be between 0 and 1"}),"number"===n?(0,s.jsx)(h.Z,{step:.01,width:400,placeholder:"os.environ/".concat(r.toUpperCase()),value:e.callback_vars[r]||"",onChange:e=>k(t,r,e.target.value)}):(0,s.jsx)(d.Z,{type:"password"===n?"password":"text",placeholder:"os.environ/".concat(r.toUpperCase()),value:e.callback_vars[r]||"",onChange:e=>k(t,r,e.target.value)})]},r)})})]})};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(u.Z,{className:"w-5 h-5 text-red-500"}),(0,s.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Disabled Callbacks"}),(0,s.jsx)(l.Z,{title:"Select callbacks to disable for this key. Disabled callbacks will not receive any logging data.",children:(0,s.jsx)(i.Z,{className:"text-gray-400 cursor-help"})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Disabled Callbacks"}),(0,s.jsx)(r.default,{mode:"multiple",placeholder:"Select callbacks to disable",value:v,onChange:e=>{let t=(0,x.Z3)(e);null==_||_(t)},style:{width:"100%"},optionLabelProp:"label",children:b.map(e=>{var t,a;let r=null===(t=x.Dg[e])||void 0===t?void 0:t.logo,n=null===(a=x.Dg[e])||void 0===a?void 0:a.description;return(0,s.jsx)(f,{value:e,label:e,children:(0,s.jsx)(l.Z,{title:n,placement:"right",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,s.jsx)("img",{src:r,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let a=t.target,s=a.parentElement;if(s){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),s.replaceChild(t,a)}}}),(0,s.jsx)("span",{children:e})]})})},e)})}),(0,s.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,s.jsx)(n.Z,{}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(m.Z,{className:"w-5 h-5 text-blue-500"}),(0,s.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Logging Integrations"}),(0,s.jsx)(l.Z,{title:"Configure callback logging integrations for this team.",children:(0,s.jsx)(i.Z,{className:"text-gray-400 cursor-help"})})]}),(0,s.jsx)(c.Z,{variant:"secondary",onClick:()=>{j([...t,{callback_name:"",callback_type:"success",callback_vars:{}}])},icon:g.Z,size:"sm",className:"hover:border-blue-400 hover:text-blue-500",type:"button",children:"Add Integration"})]}),(0,s.jsx)("div",{className:"space-y-4",children:t.map((e,t)=>{var a,n;let i=e.callback_name?null===(a=Object.entries(x.Lo).find(t=>{let[a,s]=t;return s===e.callback_name}))||void 0===a?void 0:a[0]:void 0,d=i?null===(n=x.Dg[i])||void 0===n?void 0:n.logo:null;return(0,s.jsxs)(o.Z,{className:"border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200",decoration:"top",decorationColor:"blue",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[d&&(0,s.jsx)("img",{src:d,alt:i,className:"w-5 h-5 object-contain"}),(0,s.jsxs)("span",{className:"text-sm font-medium",children:[i||"New Integration"," Configuration"]})]}),(0,s.jsx)(c.Z,{variant:"light",onClick:()=>N(t),icon:p.Z,size:"xs",color:"red",className:"hover:bg-red-50",type:"button",children:"Remove"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Integration Type"}),(0,s.jsx)(r.default,{value:i,placeholder:"Select integration",onChange:e=>w(t,"callback_name",e),className:"w-full",optionLabelProp:"label",children:y.map(e=>{var t,a;let r=null===(t=x.Dg[e])||void 0===t?void 0:t.logo,n=null===(a=x.Dg[e])||void 0===a?void 0:a.description;return(0,s.jsx)(f,{value:e,label:e,children:(0,s.jsx)(l.Z,{title:n,placement:"right",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,s.jsx)("img",{src:r,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let a=t.target,s=a.parentElement;if(s){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),s.replaceChild(t,a)}}}),(0,s.jsx)("span",{children:e})]})})},e)})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Event Type"}),(0,s.jsxs)(r.default,{value:e.callback_type,onChange:e=>w(t,"callback_type",e),className:"w-full",children:[(0,s.jsx)(f,{value:"success",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,s.jsx)("span",{children:"Success Only"})]})}),(0,s.jsx)(f,{value:"failure",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),(0,s.jsx)("span",{children:"Failure Only"})]})}),(0,s.jsx)(f,{value:"success_and_failure",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,s.jsx)("span",{children:"Success & Failure"})]})})]})]})]}),C(e,t)]})]},t)})}),0===t.length&&(0,s.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,s.jsx)(m.Z,{className:"w-12 h-12 text-gray-300 mb-3 mx-auto"}),(0,s.jsx)("div",{className:"text-base font-medium mb-1",children:"No logging integrations configured"}),(0,s.jsx)("div",{className:"text-sm text-gray-400",children:'Click "Add Integration" to configure logging for this team'})]})]})}},97415:function(e,t,a){var s=a(57437),r=a(2265),l=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:c,placeholder:o="Select vector stores",disabled:d=!1}=e,[u,m]=(0,r.useState)([]),[g,p]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(c){p(!0);try{let e=await (0,n.vectorStoreListCall)(c);e.data&&m(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{p(!1)}}})()},[c]),(0,s.jsx)("div",{children:(0,s.jsx)(l.default,{mode:"multiple",placeholder:o,onChange:t,value:a,loading:g,className:i,options:u.map(e=>({label:"".concat(e.vector_store_name||e.vector_store_id," (").concat(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})})}},59872:function(e,t,a){a.d(t,{nl:function(){return r},pw:function(){return l},vQ:function(){return n}});var s=a(9114);function r(e,t){let a=structuredClone(e);for(let[e,s]of Object.entries(t))e in a&&(a[e]=s);return a}let l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let s={minimumFractionDigits:t,maximumFractionDigits:t};if(!a)return e.toLocaleString("en-US",s);let r=Math.abs(e),l=r,n="";return r>=1e6?(l=r/1e6,n="M"):r>=1e3&&(l=r/1e3,n="K"),"".concat(e<0?"-":"").concat(l.toLocaleString("en-US",s)).concat(n)},n=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return i(e,t);try{return await navigator.clipboard.writeText(e),s.Z.success(t),!0}catch(a){return console.error("Clipboard API failed: ",a),i(e,t)}},i=(e,t)=>{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 s.Z.success(t),!0;throw Error("execCommand failed")}catch(e){return s.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,t,a){a.d(t,{LQ:function(){return l},P4:function(){return i},ZL:function(){return s},lo:function(){return r},tY:function(){return n}});let s=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],r=["Internal User","Internal Viewer"],l=["Internal User","Admin","proxy_admin"],n=e=>s.includes(e),i=e=>"proxy_admin"===e||"Admin"===e}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/5301-92cec930d7b4b830.js b/litellm/proxy/_experimental/out/_next/static/chunks/5301-92cec930d7b4b830.js deleted file mode 100644 index 4ddd9818c18..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/5301-92cec930d7b4b830.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5301],{19046:function(e,t,s){s.d(t,{Dx:function(){return l.Z},Zb:function(){return o.Z},oi:function(){return n.Z},xv:function(){return r.Z},zx:function(){return a.Z}});var a=s(78489),o=s(12514),r=s(84264),n=s(49566),l=s(96761)},88712:function(e,t,s){var a=s(57437);s(2265);var o=s(33145),r=s(66830),n=s(50010);t.Z=e=>{let{message:t}=e;if(!(0,r.br)(t))return null;let s="string"==typeof t.content&&t.content.includes("[PDF attached]");return(0,a.jsx)("div",{className:"mb-2",children:s?(0,a.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,a.jsx)(n.Z,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,a.jsx)(o.default,{src:t.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"}})})}},27930:function(e,t,s){var a=s(57437);s(2265);var o=s(65319),r=s(99981),n=s(53508);let{Dragger:l}=o.default;t.Z=e=>{let{chatUploadedImage:t,chatImagePreviewUrl:s,onImageUpload:o,onRemoveImage:i}=e;return(0,a.jsx)(a.Fragment,{children:!t&&(0,a.jsx)(l,{beforeUpload:o,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,a.jsx)(r.Z,{title:"Attach image or PDF",children:(0,a.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,a.jsx)(n.Z,{style:{fontSize:"16px"}})})})})})}},66830:function(e,t,s){s.d(t,{Hk:function(){return r},Sn:function(){return o},br:function(){return n}});let a=e=>new Promise((t,s)=>{let a=new FileReader;a.onload=()=>{t(a.result)},a.onerror=s,a.readAsDataURL(e)}),o=async(e,t)=>({role:"user",content:[{type:"text",text:e},{type:"image_url",image_url:{url:await a(t)}}]}),r=(e,t,s,a)=>{let o="";t&&a&&(o=a.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let r={role:"user",content:t?"".concat(e," ").concat(o):e};return t&&s&&(r.imagePreviewUrl=s),r},n=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl},75301:function(e,t,s){s.d(t,{Z:function(){return e0}});var a=s(57437),o=s(61935),r=s(92403),n=s(12660),l=s(25980),i=s(69993),c=s(55322),d=s(71891),m=s(58630),u=s(15424),x=s(44625),g=s(57400),p=s(26430),h=s(11894),f=s(15883),v=s(99890),b=s(26349),y=s(50010),j=s(79276),N=s(19046),w=s(4260),S=s(65319),k=s(57840),P=s(37592),A=s(79326),C=s(5545),Z=s(99981),T=s(10353),_=s(22116),E=s(2265),I=s(62831),R=s(17906),M=s(94263),L=s(93837),O=s(9309),K=s(67479),U=s(9114),D=s(99020),z=s(97415),F=s(92280),B=s(61994),H=s(19015),G=s(85847),q=e=>{let{temperature:t=1,maxTokens:s=2048,useAdvancedParams:o,onTemperatureChange:r,onMaxTokensChange:n,onUseAdvancedParamsChange:l}=e,[i,c]=(0,E.useState)(!1),d=void 0!==o?o:i,[m,x]=(0,E.useState)(t),[g,p]=(0,E.useState)(s);(0,E.useEffect)(()=>{x(t)},[t]),(0,E.useEffect)(()=>{p(s)},[s]);let h=e=>{let t=null!=e?e:1;x(t),null==r||r(t)},f=e=>{let t=null!=e?e:1e3;p(t),null==n||n(t)},v=d?"text-gray-700":"text-gray-400",b=e=>{l?l(e):c(e)};return(0,a.jsxs)("div",{className:"space-y-4 p-4 w-80",children:[(0,a.jsx)(B.Z,{checked:d,onChange:e=>b(e.target.checked),children:(0,a.jsx)("span",{className:"font-medium",children:"Use Advanced Parameters"})}),(0,a.jsxs)("div",{className:"space-y-4 transition-opacity duration-200",style:{opacity:d?1:.4},children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(F.x,{className:"text-sm ".concat(v),children:"Temperature"}),(0,a.jsx)(Z.Z,{title:"Controls randomness. Lower values make output more deterministic, higher values more creative.",children:(0,a.jsx)(u.Z,{className:"text-xs ".concat(v," cursor-help")})})]}),(0,a.jsx)(H.Z,{min:0,max:2,step:.1,value:m,onChange:h,disabled:!d,precision:1,className:"w-20"})]}),(0,a.jsx)(G.Z,{min:0,max:2,step:.1,value:m,onChange:h,disabled:!d,marks:{0:"0",1:"1.0",2:"2.0"}})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(F.x,{className:"text-sm ".concat(v),children:"Max Tokens"}),(0,a.jsx)(Z.Z,{title:"Maximum number of tokens to generate in the response.",children:(0,a.jsx)(u.Z,{className:"text-xs ".concat(v," cursor-help")})})]}),(0,a.jsx)(H.Z,{min:1,max:32768,step:1,value:g,onChange:f,disabled:!d})]}),(0,a.jsx)(G.Z,{min:1,max:32768,step:1,value:g,onChange:f,disabled:!d,marks:{1:"1",32768:"32768"}})]})]})]})},J=e=>{let{message:t}=e;return t.isAudio&&"string"==typeof t.content?(0,a.jsx)("div",{className:"mb-2",children:(0,a.jsx)("audio",{controls:!0,src:t.content,className:"max-w-full",style:{maxWidth:"500px"},children:"Your browser does not support the audio element."})}):null},V=s(8443);let W={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"},Y=Object.entries({ALLOY:"alloy",ASH:"ash",BALAD:"ballad",CORAL:"coral",ECHO:"echo",FABLE:"fable",NOVA:"nova",ONYX:"onyx",SAGE:"sage",SHIMMER:"shimmer"}).map(e=>{let[t,s]=e;return{value:s,label:W[t]}}),X=[{value:V.KP.CHAT,label:"/v1/chat/completions"},{value:V.KP.RESPONSES,label:"/v1/responses"},{value:V.KP.ANTHROPIC_MESSAGES,label:"/v1/messages"},{value:V.KP.IMAGE,label:"/v1/images/generations"},{value:V.KP.IMAGE_EDITS,label:"/v1/images/edits"},{value:V.KP.EMBEDDINGS,label:"/v1/embeddings"},{value:V.KP.SPEECH,label:"/v1/audio/speech"},{value:V.KP.TRANSCRIPTION,label:"/v1/audio/transcriptions"},{value:V.KP.A2A_AGENTS,label:"/v1/a2a/message/send"}];var $=s(88712),Q=s(27930),ee=s(66830),et=s(82971),es=e=>{let{endpointType:t,onEndpointChange:s,className:o}=e;return(0,a.jsx)("div",{className:o,children:(0,a.jsx)(P.default,{showSearch:!0,value:t,style:{width:"100%"},onChange:s,options:X,className:"rounded-md"})})},ea=s(85498),eo=s(19250);async function er(e,t,s,a){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5?arguments[5]:void 0,n=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,i=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0;if(!a)throw Error("Virtual Key is required");console.log=function(){};let x=(0,eo.getProxyBaseUrl)(),g={};o&&o.length>0&&(g["x-litellm-tags"]=o.join(","));let p=new ea.ZP({apiKey:a,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:g});try{let o=Date.now(),g=!1,h=u&&u.length>0?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",allowed_tools:u,headers:{"x-litellm-api-key":"Bearer ".concat(a)}}]:void 0,f={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&&(f.vector_store_ids=d),m&&(f.guardrails=m),h&&(f.tools=h,f.tool_choice="auto"),p.messages.stream(f,{signal:r}))){if(console.log("Stream event:",e),"content_block_delta"===e.type){let a=e.delta;if(!g){g=!0;let e=Date.now()-o;console.log("First token received! Time:",e,"ms"),l&&l(e)}"text_delta"===a.type?t("assistant",a.text,s):"reasoning_delta"===a.type&&n&&n(a.text)}if("message_delta"===e.type&&e.usage&&i){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};i(s)}}}catch(e){throw(null==r?void 0:r.aborted)?console.log("Anthropic messages request was cancelled"):U.Z.fromBackend("Error occurred while generating model response. Please try again. Error: ".concat(e)),e}}var en=s(7271);async function el(e,t,s,a,o,r,n,l,i){console.log=function(){},console.log("isLocal:",!1);let c=(0,eo.getProxyBaseUrl)(),d=new en.ZP.OpenAI({apiKey:o,baseURL:c,dangerouslyAllowBrowser:!0,defaultHeaders:r&&r.length>0?{"x-litellm-tags":r.join(",")}:void 0});try{let o=await d.audio.speech.create({model:a,input:e,voice:t,...l?{response_format:l}:{},...i?{speed:i}:{}},{signal:n}),r=await o.blob(),c=URL.createObjectURL(r);s(c,a)}catch(e){throw(null==n?void 0:n.aborted)?console.log("Audio speech request was cancelled"):U.Z.fromBackend("Error occurred while generating speech. Please try again. Error: ".concat(e)),e}}async function ei(e,t,s,a,o,r,n,l,i,c){console.log=function(){},console.log("isLocal:",!1);let d=(0,eo.getProxyBaseUrl)(),m=new en.ZP.OpenAI({apiKey:a,baseURL:d,dangerouslyAllowBrowser:!0,defaultHeaders:o&&o.length>0?{"x-litellm-tags":o.join(",")}:void 0});try{console.log("Processing audio file for transcription:",e.name);let a=await m.audio.transcriptions.create({model:s,file:e,...n?{language:n}:{},...l?{prompt:l}:{},...i?{response_format:i}:{},...void 0!==c?{temperature:c}:{}},{signal:r});if(console.log("Transcription response:",a),a&&a.text)t(a.text,s),U.Z.success("Audio transcribed successfully");else throw Error("No transcription text in response")}catch(e){if(console.error("Error making audio transcription request:",e),null==r?void 0:r.aborted)console.log("Audio transcription request was cancelled");else{var u;let t="Failed to transcribe audio";(null==e?void 0:null===(u=e.error)||void 0===u?void 0:u.message)?t=e.error.message:(null==e?void 0:e.message)&&(t=e.message),U.Z.fromBackend("Audio transcription failed: ".concat(t))}throw e}}var ec=s(95459);async function ed(e,t,s,a,o){if(!a)throw Error("Virtual Key is required");console.log=function(){};let r=(0,eo.getProxyBaseUrl)(),n={};o&&o.length>0&&(n["x-litellm-tags"]=o.join(","));try{var l,i,c;let o=r.endsWith("/")?r.slice(0,-1):r,d=await fetch("".concat(o,"/embeddings"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a),...n},body:JSON.stringify({model:s,input:e})});if(!d.ok){let e=await d.text();throw Error(e||"Request failed with status ".concat(d.status))}let m=await d.json(),u=null==m?void 0:null===(i=m.data)||void 0===i?void 0:null===(l=i[0])||void 0===l?void 0:l.embedding;if(!u)throw Error("No embedding returned from server");t(JSON.stringify(u),null!==(c=null==m?void 0:m.model)&&void 0!==c?c:s)}catch(e){throw U.Z.fromBackend("Error occurred while making embeddings request. Please try again. Error: ".concat(e)),e}}async function em(e){try{return(await (0,eo.mcpToolsCall)(e)).tools||[]}catch(e){return console.error("Error fetching MCP tools:",e),[]}}var eu=s(10703);async function ex(e,t,s,a,o,r,n){console.log=function(){},console.log("isLocal:",!1);let l=(0,eo.getProxyBaseUrl)(),i=new en.ZP.OpenAI({apiKey:o,baseURL:l,dangerouslyAllowBrowser:!0,defaultHeaders:r&&r.length>0?{"x-litellm-tags":r.join(",")}:void 0});try{let o=Array.isArray(e)?e:[e],r=[];for(let e=0;e1&&U.Z.success("Successfully processed ".concat(r.length," images"))}catch(e){if(console.error("Error making image edit request:",e),null==n?void 0:n.aborted)console.log("Image edits request was cancelled");else{var c;let t="Failed to edit image(s)";(null==e?void 0:null===(c=e.error)||void 0===c?void 0:c.message)?t=e.error.message:(null==e?void 0:e.message)&&(t=e.message),U.Z.fromBackend("Image edit failed: ".concat(t))}throw e}}async function eg(e,t,s,a,o,r){console.log=function(){},console.log("isLocal:",!1);let n=(0,eo.getProxyBaseUrl)(),l=new en.ZP.OpenAI({apiKey:a,baseURL:n,dangerouslyAllowBrowser:!0,defaultHeaders:o&&o.length>0?{"x-litellm-tags":o.join(",")}:void 0});try{let a=await l.images.generate({model:s,prompt:e},{signal:r});if(console.log(a.data),a.data&&a.data[0]){if(a.data[0].url)t(a.data[0].url,s);else if(a.data[0].b64_json){let e=a.data[0].b64_json;t("data:image/png;base64,".concat(e),s)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==r?void 0:r.aborted)?console.log("Image generation request was cancelled"):U.Z.fromBackend("Error occurred while generating image. Please try again. Error: ".concat(e)),e}}async function ep(e,t,s,a){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5?arguments[5]:void 0,n=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,i=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0,x=arguments.length>13?arguments[13]:void 0,g=arguments.length>14?arguments[14]:void 0,p=arguments.length>15?arguments[15]:void 0;if(!a)throw Error("Virtual Key is required");console.log=function(){};let h=(0,eo.getProxyBaseUrl)(),f={};o&&o.length>0&&(f["x-litellm-tags"]=o.join(","));let v=new en.ZP.OpenAI({apiKey:a,baseURL:h,dangerouslyAllowBrowser:!0,defaultHeaders:f});try{let a=Date.now(),o=!1,h=e.map(e=>(Array.isArray(e.content),{role:e.role,content:e.content,type:"message"})),f=u&&u.length>0?[{type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never",allowed_tools:u}]:void 0,P=await v.responses.create({model:s,input:h,stream:!0,litellm_trace_id:c,...x?{previous_response_id:x}:{},...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},...f?{tools:f,tool_choice:"required"}:{}},{signal:r}),A="";for await(let e of P)if(console.log("Response event:",e),"object"==typeof e&&null!==e){var b,y,j,N,w,S,k;if(((null===(b=e.type)||void 0===b?void 0:b.startsWith("response.mcp_"))||"response.output_item.done"===e.type&&((null===(y=e.item)||void 0===y?void 0:y.type)==="mcp_list_tools"||(null===(j=e.item)||void 0===j?void 0:j.type)==="mcp_call"))&&(console.log("MCP event received:",e),p)){let t={type:e.type,sequence_number:e.sequence_number,output_index:e.output_index,item_id:e.item_id||(null===(S=e.item)||void 0===S?void 0:S.id),item:e.item,delta:e.delta,arguments:e.arguments,timestamp:Date.now()};p(t)}if("response.output_item.done"===e.type&&(null===(N=e.item)||void 0===N?void 0:N.type)==="mcp_call"&&(null===(w=e.item)||void 0===w?void 0:w.name)&&(A=e.item.name,console.log("MCP tool used:",A)),"response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let r=e.delta;if(console.log("Text delta",r),r.trim().length>0&&(t("assistant",r,s),!o)){o=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),l&&l(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let t=e.delta;"string"==typeof t&&n&&n(t)}if("response.completed"===e.type&&"response"in e){let t=e.response,s=t.usage;if(console.log("Usage data:",s),console.log("Response completed event:",t),t.id&&g&&(console.log("Response ID for session management:",t.id),g(t.id)),s&&i){console.log("Usage data:",s);let e={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.total_tokens};(null===(k=s.completion_tokens_details)||void 0===k?void 0:k.reasoning_tokens)&&(e.reasoningTokens=s.completion_tokens_details.reasoning_tokens),i(e,A)}}}return P}catch(e){throw(null==r?void 0:r.aborted)?console.log("Responses API request was cancelled"):U.Z.fromBackend("Error occurred while generating model response. Please try again. Error: ".concat(e)),e}}let eh=async e=>{try{let t=(0,eo.getProxyBaseUrl)(),s=await fetch(t?"".concat(t,"/v1/agents"):"/v1/agents",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.json();throw Error(e.detail||"Failed to fetch agents")}let a=await s.json();return console.log("Fetched agents:",a),a.sort((e,t)=>{let s=e.agent_name||e.agent_id,a=t.agent_name||t.agent_id;return s.localeCompare(a)}),a}catch(e){throw console.error("Error fetching agents:",e),e}},ef=e=>{if(!e)return;let t={};if(e.id&&(t.taskId=e.id),e.contextId&&(t.contextId=e.contextId),e.status){var s;if(t.status={state:e.status.state,timestamp:e.status.timestamp},null===(s=e.status.message)||void 0===s?void 0:s.parts){let s=e.status.message.parts.filter(e=>"text"===e.kind&&e.text).map(e=>e.text).join(" ");s&&(t.status.message=s)}}return e.metadata&&"object"==typeof e.metadata&&(t.metadata=e.metadata),Object.keys(t).length>0?t:void 0},ev=async(e,t,s,a,o,r,n,l)=>{let i;let c=(0,eo.getProxyBaseUrl)(),d=c?"".concat(c,"/a2a/").concat(e):"/a2a/".concat(e),m=(0,L.Z)(),u=(0,L.Z)().replace(/-/g,""),x=performance.now(),g=!1,p="";try{var h,f,v,b;let c=await fetch(d,{method:"POST",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:m,method:"message/stream",params:{message:{kind:"message",messageId:u,role:"user",parts:[{kind:"text",text:t}]}}}),signal:o});if(!c.ok){let e=await c.json();throw Error((null===(f=e.error)||void 0===f?void 0:f.message)||e.detail||"HTTP ".concat(c.status))}let y=null===(h=c.body)||void 0===h?void 0:h.getReader();if(!y)throw Error("No response body");let j=new TextDecoder,N="",w=!1;for(;!w;){let t=await y.read();w=t.done;let a=t.value;if(w)break;let o=(N+=j.decode(a,{stream:!0})).split("\n");for(let t of(N=o.pop()||"",o))if(t.trim())try{let a=JSON.parse(t);if(!g){g=!0;let e=performance.now()-x;r&&r(e)}let o=a.result;if(o){let t=ef(o);t&&(i={...i,...t});let a=o.kind;if("artifact-update"===a&&o.artifact){let t=o.artifact;if(t.parts&&Array.isArray(t.parts))for(let a of t.parts)"text"===a.kind&&a.text&&(p+=a.text,s(p,"a2a_agent/".concat(e)))}else if(o.artifacts&&Array.isArray(o.artifacts)){for(let t of o.artifacts)if(t.parts&&Array.isArray(t.parts))for(let a of t.parts)"text"===a.kind&&a.text&&(p+=a.text,s(p,"a2a_agent/".concat(e)))}else if("status-update"===a&&(null===(b=o.status)||void 0===b?void 0:null===(v=b.message)||void 0===v?void 0:v.parts)){if(!p)for(let t of o.status.message.parts)"text"===t.kind&&t.text&&s(t.text,"a2a_agent/".concat(e))}else if(o.parts&&Array.isArray(o.parts))for(let t of o.parts)"text"===t.kind&&t.text&&(p+=t.text,s(p,"a2a_agent/".concat(e)))}if(a.error)throw Error(a.error.message)}catch(e){t.trim().length>0&&console.warn("Failed to parse A2A streaming chunk:",t,e)}}let S=performance.now()-x;n&&n(S),i&&l&&l(i)}catch(e){if(null==o?void 0:o.aborted){console.log("A2A streaming request was cancelled");return}throw console.error("A2A stream message error:",e),e}};var eb=s(83669),ey=s(29271),ej=s(5540),eN=s(38434),ew=s(23639),eS=s(62272),ek=s(70464),eP=s(77565);let eA=e=>{switch(e){case"completed":return(0,a.jsx)(eb.Z,{className:"text-green-500"});case"working":case"submitted":return(0,a.jsx)(o.Z,{className:"text-blue-500"});case"failed":case"canceled":return(0,a.jsx)(ey.Z,{className:"text-red-500"});default:return(0,a.jsx)(ej.Z,{className:"text-gray-500"})}},eC=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"}},eZ=e=>{if(!e)return null;try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return e}},eT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.length>t?"".concat(e.substring(0,t),"…"):e:null},e_=e=>{navigator.clipboard.writeText(e)};var eE=e=>{let{a2aMetadata:t,timeToFirstToken:s,totalLatency:o}=e,[r,n]=(0,E.useState)(!1);if(!t&&!s&&!o)return null;let{taskId:l,contextId:c,status:d,metadata:m}=t||{},u=eZ(null==d?void 0:d.timestamp);return(0,a.jsxs)("div",{className:"a2a-metrics mt-3 pt-2 border-t border-gray-200 text-xs",children:[(0,a.jsxs)("div",{className:"flex items-center mb-2 text-gray-600",children:[(0,a.jsx)(i.Z,{className:"mr-1.5 text-blue-500"}),(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"A2A Metadata"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-gray-500 ml-4",children:[(null==d?void 0:d.state)&&(0,a.jsxs)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ".concat(eC(d.state)),children:[eA(d.state),(0,a.jsx)("span",{className:"ml-1 capitalize",children:d.state})]}),u&&(0,a.jsx)(Z.Z,{title:null==d?void 0:d.timestamp,children:(0,a.jsxs)("span",{className:"flex items-center",children:[(0,a.jsx)(ej.Z,{className:"mr-1"}),u]})}),void 0!==o&&(0,a.jsx)(Z.Z,{title:"Total latency",children:(0,a.jsxs)("span",{className:"flex items-center text-blue-600",children:[(0,a.jsx)(ej.Z,{className:"mr-1"}),(o/1e3).toFixed(2),"s"]})}),void 0!==s&&(0,a.jsx)(Z.Z,{title:"Time to first token",children:(0,a.jsxs)("span",{className:"flex items-center text-green-600",children:["TTFT: ",(s/1e3).toFixed(2),"s"]})})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-gray-500 ml-4 mt-1.5",children:[l&&(0,a.jsx)(Z.Z,{title:"Click to copy: ".concat(l),children:(0,a.jsxs)("span",{className:"flex items-center cursor-pointer hover:text-gray-700",onClick:()=>e_(l),children:[(0,a.jsx)(eN.Z,{className:"mr-1"}),"Task: ",eT(l),(0,a.jsx)(ew.Z,{className:"ml-1 text-gray-400 hover:text-gray-600"})]})}),c&&(0,a.jsx)(Z.Z,{title:"Click to copy: ".concat(c),children:(0,a.jsxs)("span",{className:"flex items-center cursor-pointer hover:text-gray-700",onClick:()=>e_(c),children:[(0,a.jsx)(eS.Z,{className:"mr-1"}),"Session: ",eT(c),(0,a.jsx)(ew.Z,{className:"ml-1 text-gray-400 hover:text-gray-600"})]})}),(m||(null==d?void 0:d.message))&&(0,a.jsxs)(C.ZP,{type:"text",size:"small",className:"text-xs text-blue-500 hover:text-blue-700 p-0 h-auto",onClick:()=>n(!r),children:[r?(0,a.jsx)(ek.Z,{}):(0,a.jsx)(eP.Z,{}),(0,a.jsx)("span",{className:"ml-1",children:"Details"})]})]}),r&&(0,a.jsxs)("div",{className:"mt-2 ml-4 p-3 bg-gray-50 rounded-md text-gray-600 border border-gray-200",children:[(null==d?void 0:d.message)&&(0,a.jsxs)("div",{className:"mb-2",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"Status Message:"}),(0,a.jsx)("span",{className:"ml-2",children:d.message})]}),l&&(0,a.jsxs)("div",{className:"mb-1.5 flex items-center",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700 w-24",children:"Task ID:"}),(0,a.jsx)("code",{className:"ml-2 px-2 py-1 bg-white border border-gray-200 rounded text-xs font-mono",children:l}),(0,a.jsx)(ew.Z,{className:"ml-2 cursor-pointer text-gray-400 hover:text-blue-500",onClick:()=>e_(l)})]}),c&&(0,a.jsxs)("div",{className:"mb-1.5 flex items-center",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700 w-24",children:"Session ID:"}),(0,a.jsx)("code",{className:"ml-2 px-2 py-1 bg-white border border-gray-200 rounded text-xs font-mono",children:c}),(0,a.jsx)(ew.Z,{className:"ml-2 cursor-pointer text-gray-400 hover:text-blue-500",onClick:()=>e_(c)})]}),m&&Object.keys(m).length>0&&(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"Custom Metadata:"}),(0,a.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(m,null,2)})]})]})]})},eI=s(29),eR=s.n(eI),eM=s(44851);let{Text:eL}=k.default,{Panel:eO}=eM.default;var eK=e=>{var t,s;let{events:o,className:r}=e;if(console.log("MCPEventsDisplay: Received events:",o),!o||0===o.length)return console.log("MCPEventsDisplay: No events, returning null"),null;let n=o.find(e=>{var t;return"response.output_item.done"===e.type&&(null===(t=e.item)||void 0===t?void 0:t.type)==="mcp_list_tools"&&e.item.tools&&e.item.tools.length>0}),l=o.filter(e=>{var t;return"response.output_item.done"===e.type&&(null===(t=e.item)||void 0===t?void 0:t.type)==="mcp_call"});return(console.log("MCPEventsDisplay: toolsEvent:",n),console.log("MCPEventsDisplay: mcpCallEvents:",l),n||0!==l.length)?(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac "+"mcp-events-display ".concat(r||""),children:[(0,a.jsx)(eR(),{id:"32b14b04f420f3ac",children:'.openai-mcp-tools.jsx-32b14b04f420f3ac{position:relative;margin:0;padding:0}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse.jsx-32b14b04f420f3ac{background:transparent!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-item.jsx-32b14b04f420f3ac{border:none!important;background:transparent!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac{padding:0 0 0 20px!important;background:transparent!important;border:none!important;font-size:14px!important;color:#9ca3af!important;font-weight:400!important;line-height:20px!important;min-height:20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac:hover{background:transparent!important;color:#6b7280!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content.jsx-32b14b04f420f3ac{border:none!important;background:transparent!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{position:absolute!important;left:2px!important;top:2px!important;color:#9ca3af!important;font-size:10px!important;width:16px!important;height:16px!important;display:-webkit-box!important;display:-webkit-flex!important;display:-moz-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center!important;-webkit-align-items:center!important;-moz-box-align:center!important;-ms-flex-align:center!important;align-items:center!important;-webkit-box-pack:center!important;-webkit-justify-content:center!important;-moz-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac:hover{color:#6b7280!important}.openai-vertical-line.jsx-32b14b04f420f3ac{position:absolute;left:9px;top:18px;bottom:0;width:.5px;background-color:#f3f4f6;opacity:.8}.tool-item.jsx-32b14b04f420f3ac{font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:13px;color:#4b5563;line-height:18px;padding:0;margin:0;background:white;position:relative;z-index:1}.mcp-section.jsx-32b14b04f420f3ac{margin-bottom:12px;background:white;position:relative;z-index:1}.mcp-section.jsx-32b14b04f420f3ac:last-child{margin-bottom:0}.mcp-section-header.jsx-32b14b04f420f3ac{font-size:13px;color:#6b7280;font-weight:500;margin-bottom:4px}.mcp-code-block.jsx-32b14b04f420f3ac{background:#f9fafb;border:1px solid#f3f4f6;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;padding:8px;font-size:12px}.mcp-json.jsx-32b14b04f420f3ac{font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace;color:#374151;margin:0;white-space:pre-wrap;word-wrap:break-word}.mcp-approved.jsx-32b14b04f420f3ac{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;color:#6b7280}.mcp-checkmark.jsx-32b14b04f420f3ac{color:#10b981;margin-right:6px;font-weight:bold}.mcp-response-content.jsx-32b14b04f420f3ac{font-size:13px;color:#374151;line-height:1.5;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace}'}),(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac openai-mcp-tools",children:[(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac openai-vertical-line"}),(0,a.jsxs)(eM.default,{ghost:!0,size:"small",expandIconPosition:"start",defaultActiveKey:n?["list-tools"]:l.map((e,t)=>"mcp-call-".concat(t)),children:[n&&(0,a.jsx)(eO,{header:"List tools",children:(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac",children:null===(s=n.item)||void 0===s?void 0:null===(t=s.tools)||void 0===t?void 0:t.map((e,t)=>(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac tool-item",children:e.name},t))})},"list-tools"),l.map((e,t)=>{var s,o,r;return(0,a.jsx)(eO,{header:(null===(s=e.item)||void 0===s?void 0:s.name)||"Tool call",children:(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac",children:[(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Request"}),(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-code-block",children:(null===(o=e.item)||void 0===o?void 0:o.arguments)&&(0,a.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,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-approved",children:[(0,a.jsx)("span",{className:"jsx-32b14b04f420f3ac mcp-checkmark",children:"✓"})," Approved"]})}),(null===(r=e.item)||void 0===r?void 0:r.output)&&(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Response"}),(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-response-content",children:e.item.output})]})]})},"mcp-call-".concat(t))})]})]})]}):(console.log("MCPEventsDisplay: No valid events found, returning null"),null)},eU=s(94331),eD=s(38398);let ez=e=>new Promise((t,s)=>{let a=new FileReader;a.onload=()=>{t(a.result.split(",")[1])},a.onerror=s,a.readAsDataURL(e)}),eF=async(e,t)=>{let s=await ez(t),a=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:".concat(a,";base64,").concat(s)}]}},eB=(e,t,s,a)=>{let o="";t&&a&&(o=a.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let r={role:"user",content:t?"".concat(e," ").concat(o):e};return t&&s&&(r.imagePreviewUrl=s),r},eH=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl;var eG=e=>{let{message:t}=e;if(!eH(t))return null;let s="string"==typeof t.content&&t.content.includes("[PDF attached]");return(0,a.jsx)("div",{className:"mb-2",children:s?(0,a.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,a.jsx)(y.Z,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,a.jsx)("img",{src:t.imagePreviewUrl,alt:"User uploaded image",className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px"}})})},eq=s(53508);let{Dragger:eJ}=S.default;var eV=e=>{let{responsesUploadedImage:t,responsesImagePreviewUrl:s,onImageUpload:o,onRemoveImage:r}=e;return(0,a.jsx)(a.Fragment,{children:!t&&(0,a.jsx)(eJ,{beforeUpload:o,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,a.jsx)(Z.Z,{title:"Attach image or PDF",children:(0,a.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,a.jsx)(eq.Z,{style:{fontSize:"16px"}})})})})})},eW=s(33152),eY=s(63709),eX=e=>{let{endpointType:t,responsesSessionId:s,useApiSessionManagement:o,onToggleSessionManagement:r}=e;return t!==V.KP.RESPONSES?null:(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Session Management"}),(0,a.jsx)(Z.Z,{title:"Choose between LiteLLM API session management (using previous_response_id) or UI-based session management (using chat history)",children:(0,a.jsx)(u.Z,{className:"text-gray-400",style:{fontSize:"12px"}})})]}),(0,a.jsx)(eY.Z,{checked:o,onChange:r,checkedChildren:"API",unCheckedChildren:"UI",size:"small"})]}),(0,a.jsxs)("div",{className:"text-xs p-2 rounded-md ".concat(s?"bg-green-50 text-green-700 border border-green-200":"bg-blue-50 text-blue-700 border border-blue-200"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(u.Z,{style:{fontSize:"12px"}}),(()=>{if(!s)return o?"API Session: Ready":"UI Session: Ready";let e=o?"Response ID":"UI Session",t=s.slice(0,10);return"".concat(e,": ").concat(t,"...")})()]}),s&&(0,a.jsx)(Z.Z,{title:(0,a.jsxs)("div",{className:"text-xs",children:[(0,a.jsx)("div",{className:"mb-1",children:"Copy response ID to continue session:"}),(0,a.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" \\\n -H "Authorization: Bearer your-api-key" \\\n -H "Content-Type: application/json" \\\n -d \'{\n "model": "your-model",\n "input": [{"role": "user", "content": "your message", "type": "message"}],\n "previous_response_id": "'.concat(s,'",\n "stream": true\n }\'')})]}),overlayStyle:{maxWidth:"500px"},children:(0,a.jsx)("button",{onClick:()=>{s&&(navigator.clipboard.writeText(s),U.Z.success("Response ID copied to clipboard!"))},className:"ml-2 p-1 hover:bg-green-100 rounded transition-colors",children:(0,a.jsx)(ew.Z,{style:{fontSize:"12px"}})})})]}),(0,a.jsx)("div",{className:"text-xs opacity-75 mt-1",children:s?o?"LiteLLM API session active - context maintained server-side":"UI session active - context maintained client-side":o?"LiteLLM will manage session using previous_response_id":"UI will manage session using chat history"})]})]})};let{TextArea:e$}=w.default,{Dragger:eQ}=S.default;var e0=e=>{let{accessToken:t,token:s,userRole:w,userID:S,disabledPersonalKeyCreation:F,proxySettings:B}=e,[H,G]=(0,E.useState)(!1),[W,X]=(0,E.useState)([]),[ea,eo]=(0,E.useState)(()=>{let e=sessionStorage.getItem("selectedMCPTools");try{let t=e?JSON.parse(e):[];return Array.isArray(t)?t:t?[t]:[]}catch(e){return console.error("Error parsing selectedMCPTools from sessionStorage",e),[]}}),[en,ef]=(0,E.useState)(!1),[eb,ey]=(0,E.useState)(()=>{let e=sessionStorage.getItem("apiKeySource");if(e)try{return JSON.parse(e)}catch(e){console.error("Error parsing apiKeySource from sessionStorage",e)}return F?"custom":"session"}),[ej,eN]=(0,E.useState)(()=>sessionStorage.getItem("apiKey")||""),[ew,eS]=(0,E.useState)(""),[ek,eP]=(0,E.useState)(()=>{try{let e=sessionStorage.getItem("chatHistory");return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing chatHistory from sessionStorage",e),[]}}),[eA,eC]=(0,E.useState)(void 0),[eZ,eT]=(0,E.useState)(!1),[e_,eI]=(0,E.useState)([]),[eR,eM]=(0,E.useState)([]),[eL,eO]=(0,E.useState)(void 0),ez=(0,E.useRef)(null),[eH,eq]=(0,E.useState)(()=>sessionStorage.getItem("endpointType")||V.KP.CHAT),[eJ,eY]=(0,E.useState)(!1),e0=(0,E.useRef)(null),[e1,e2]=(0,E.useState)(()=>{let e=sessionStorage.getItem("selectedTags");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedTags from sessionStorage",e),[]}}),[e4,e3]=(0,E.useState)(()=>{let e=sessionStorage.getItem("selectedVoice");if(!e)return"alloy";try{return JSON.parse(e)}catch(t){return e}}),[e5,e6]=(0,E.useState)(()=>{let e=sessionStorage.getItem("selectedVectorStores");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedVectorStores from sessionStorage",e),[]}}),[e7,e8]=(0,E.useState)(()=>{let e=sessionStorage.getItem("selectedGuardrails");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedGuardrails from sessionStorage",e),[]}}),[e9,te]=(0,E.useState)(()=>sessionStorage.getItem("messageTraceId")||null),[tt,ts]=(0,E.useState)(()=>sessionStorage.getItem("responsesSessionId")||null),[ta,to]=(0,E.useState)(()=>{let e=sessionStorage.getItem("useApiSessionManagement");return!e||JSON.parse(e)}),[tr,tn]=(0,E.useState)([]),[tl,ti]=(0,E.useState)([]),[tc,td]=(0,E.useState)(null),[tm,tu]=(0,E.useState)(null),[tx,tg]=(0,E.useState)(null),[tp,th]=(0,E.useState)(null),[tf,tv]=(0,E.useState)(null),[tb,ty]=(0,E.useState)(!1),[tj,tN]=(0,E.useState)(""),[tw,tS]=(0,E.useState)("openai"),[tk,tP]=(0,E.useState)([]),[tA,tC]=(0,E.useState)(1),[tZ,tT]=(0,E.useState)(2048),[t_,tE]=(0,E.useState)(!1),tI=(0,E.useRef)(null),tR=async()=>{let e="session"===eb?t:ej;if(e){ef(!0);try{let t=await em(e);X(t)}catch(e){console.error("Error fetching MCP tools:",e)}finally{ef(!1)}}};(0,E.useEffect)(()=>{H&&tR()},[H,t,ej,eb]),(0,E.useEffect)(()=>{tb&&tN((0,et.L)({apiKeySource:eb,accessToken:t,apiKey:ej,inputMessage:ew,chatHistory:ek,selectedTags:e1,selectedVectorStores:e5,selectedGuardrails:e7,selectedMCPTools:ea,endpointType:eH,selectedModel:eA,selectedSdk:tw,selectedVoice:e4,proxySettings:B}))},[tb,tw,eb,t,ej,ew,ek,e1,e5,e7,ea,eH,eA,B]),(0,E.useEffect)(()=>{let e=setTimeout(()=>{sessionStorage.setItem("chatHistory",JSON.stringify(ek))},500);return()=>{clearTimeout(e)}},[ek]),(0,E.useEffect)(()=>{sessionStorage.setItem("apiKeySource",JSON.stringify(eb)),sessionStorage.setItem("apiKey",ej),sessionStorage.setItem("endpointType",eH),sessionStorage.setItem("selectedTags",JSON.stringify(e1)),sessionStorage.setItem("selectedVectorStores",JSON.stringify(e5)),sessionStorage.setItem("selectedGuardrails",JSON.stringify(e7)),sessionStorage.setItem("selectedMCPTools",JSON.stringify(ea)),sessionStorage.setItem("selectedVoice",e4),eA?sessionStorage.setItem("selectedModel",eA):sessionStorage.removeItem("selectedModel"),e9?sessionStorage.setItem("messageTraceId",e9):sessionStorage.removeItem("messageTraceId"),tt?sessionStorage.setItem("responsesSessionId",tt):sessionStorage.removeItem("responsesSessionId"),sessionStorage.setItem("useApiSessionManagement",JSON.stringify(ta))},[eb,ej,eA,eH,e1,e5,e7,e9,tt,ta,ea,e4]),(0,E.useEffect)(()=>{let e="session"===eb?t:ej;if(!e||!s||!w||!S){console.log("userApiKey or token or userRole or userID is missing = ",e,s,w,S);return}(async()=>{try{if(!e){console.log("userApiKey is missing");return}let t=await (0,eu.p)(e);console.log("Fetched models:",t),eI(t);let s=t.some(e=>e.model_group===eA);t.length&&s||eC(void 0)}catch(e){console.error("Error fetching model info:",e)}})(),tR()},[t,S,w,eb,ej,s]),(0,E.useEffect)(()=>{let e="session"===eb?t:ej;e&&eH===V.KP.A2A_AGENTS&&(async()=>{try{let t=await eh(e);eM(t),eL&&!t.some(e=>e.agent_name===eL)&&eO(void 0)}catch(e){console.error("Error fetching agents:",e)}})()},[t,eb,ej,eH]),(0,E.useEffect)(()=>{tI.current&&setTimeout(()=>{var e;null===(e=tI.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},100)},[ek]);let tM=(e,t,s)=>{console.log("updateTextUI called with:",e,t,s),eP(a=>{let o=a[a.length-1];if(!o||o.role!==e||o.isImage||o.isAudio)return[...a,{role:e,content:t,model:s}];{var r;let e={...o,content:o.content+t,model:null!==(r=o.model)&&void 0!==r?r:s};return[...a.slice(0,-1),e]}})},tL=e=>{eP(t=>{let s=t[t.length-1];return!s||"assistant"!==s.role||s.isImage||s.isAudio?t.length>0&&"user"===t[t.length-1].role?[...t,{role:"assistant",content:"",reasoningContent:e}]:t:[...t.slice(0,t.length-1),{...s,reasoningContent:(s.reasoningContent||"")+e}]})},tO=e=>{console.log("updateTimingData called with:",e),eP(t=>{let s=t[t.length-1];if(console.log("Current last message:",s),s&&"assistant"===s.role){console.log("Updating assistant message with timeToFirstToken:",e);let a=[...t.slice(0,t.length-1),{...s,timeToFirstToken:e}];return console.log("Updated chat history:",a),a}return s&&"user"===s.role?(console.log("Creating new assistant message with timeToFirstToken:",e),[...t,{role:"assistant",content:"",timeToFirstToken:e}]):(console.log("No appropriate message found to update timing"),t)})},tK=(e,t)=>{console.log("Received usage data:",e),eP(s=>{let a=s[s.length-1];if(a&&"assistant"===a.role){console.log("Updating message with usage data:",e);let o={...a,usage:e,toolName:t};return console.log("Updated message:",o),[...s.slice(0,s.length-1),o]}return s})},tU=e=>{console.log("Received A2A metadata:",e),eP(t=>{let s=t[t.length-1];if(s&&"assistant"===s.role){let a={...s,a2aMetadata:e};return[...t.slice(0,t.length-1),a]}return t})},tD=e=>{eP(t=>{let s=t[t.length-1];return s&&"assistant"===s.role?[...t.slice(0,t.length-1),{...s,totalLatency:e}]:t})},tz=e=>{console.log("Received search results:",e),eP(t=>{let s=t[t.length-1];if(s&&"assistant"===s.role){console.log("Updating message with search results");let a={...s,searchResults:e};return[...t.slice(0,t.length-1),a]}return t})},tF=e=>{console.log("Received response ID for session management:",e),ta&&ts(e)},tB=e=>{console.log("ChatUI: Received MCP event:",e),tP(t=>{if(t.some(t=>t.item_id===e.item_id&&t.type===e.type&&t.sequence_number===e.sequence_number))return console.log("ChatUI: Duplicate MCP event, skipping"),t;let s=[...t,e];return console.log("ChatUI: Updated MCP events:",s),s})},tH=(e,t)=>{eP(s=>[...s,{role:"assistant",content:e,model:t,isImage:!0}])},tG=(e,t)=>{eP(s=>[...s,{role:"assistant",content:(0,O.aS)(e,100),model:t,isEmbeddings:!0}])},tq=(e,t)=>{eP(s=>[...s,{role:"assistant",content:e,model:t,isAudio:!0}])},tJ=(e,t)=>{eP(s=>{let a=s[s.length-1];if(!a||"assistant"!==a.role||a.isImage||a.isAudio)return[...s,{role:"assistant",content:"",model:t,image:{url:e,detail:"auto"}}];{var o;let r={...a,image:{url:e,detail:"auto"},model:null!==(o=a.model)&&void 0!==o?o:t};return[...s.slice(0,-1),r]}})},tV=e=>{tn(t=>[...t,e]);let t=URL.createObjectURL(e);return ti(e=>[...e,t]),!1},tW=e=>{tl[e]&&URL.revokeObjectURL(tl[e]),tn(t=>t.filter((t,s)=>s!==e)),ti(t=>t.filter((t,s)=>s!==e))},tY=()=>{tl.forEach(e=>{URL.revokeObjectURL(e)}),tn([]),ti([])},tX=()=>{tm&&URL.revokeObjectURL(tm),td(null),tu(null)},t$=()=>{tp&&URL.revokeObjectURL(tp),tg(null),th(null)},tQ=()=>{tv(null)},t0=async()=>{let e;if(""===ew.trim()&&eH!==V.KP.TRANSCRIPTION)return;if(eH===V.KP.IMAGE_EDITS&&0===tr.length){U.Z.fromBackend("Please upload at least one image for editing");return}if(eH===V.KP.TRANSCRIPTION&&!tf){U.Z.fromBackend("Please upload an audio file for transcription");return}if(eH===V.KP.A2A_AGENTS&&!eL){U.Z.fromBackend("Please select an agent to send a message");return}if(!s||!w||!S)return;let a="session"===eb?t:ej;if(!a){U.Z.fromBackend("Please provide a Virtual Key or select Current UI Session");return}e0.current=new AbortController;let o=e0.current.signal;if(eH===V.KP.RESPONSES&&tc)try{e=await eF(ew,tc)}catch(e){U.Z.fromBackend("Failed to process image. Please try again.");return}else if(eH===V.KP.CHAT&&tx)try{e=await (0,ee.Sn)(ew,tx)}catch(e){U.Z.fromBackend("Failed to process image. Please try again.");return}else e={role:"user",content:ew};let r=e9||(0,L.Z)();e9||te(r),eP([...ek,eH===V.KP.RESPONSES&&tc?eB(ew,!0,tm||void 0,tc.name):eH===V.KP.CHAT&&tx?(0,ee.Hk)(ew,!0,tp||void 0,tx.name):eH===V.KP.TRANSCRIPTION&&tf?eB(ew?"\uD83C\uDFB5 Audio file: ".concat(tf.name,"\nPrompt: ").concat(ew):"\uD83C\uDFB5 Audio file: ".concat(tf.name),!1):eB(ew,!1)]),tP([]),eY(!0);try{if(eA){if(eH===V.KP.CHAT){let t=[...ek.filter(e=>!e.isImage&&!e.isAudio).map(e=>{let{role:t,content:s}=e;return{role:t,content:"string"==typeof s?s:""}}),e];await (0,ec.n)(t,(e,t)=>tM("assistant",e,t),eA,a,e1,o,tL,tO,tK,r,e5.length>0?e5:void 0,e7.length>0?e7:void 0,ea,tJ,tz,t_?tA:void 0,t_?tZ:void 0,tD)}else if(eH===V.KP.IMAGE)await eg(ew,(e,t)=>tH(e,t),eA,a,e1,o);else if(eH===V.KP.SPEECH)await el(ew,e4,(e,t)=>tq(e,t),eA||"",a,e1,o);else if(eH===V.KP.IMAGE_EDITS)tr.length>0&&await ex(1===tr.length?tr[0]:tr,ew,(e,t)=>tH(e,t),eA,a,e1,o);else if(eH===V.KP.RESPONSES){let t;t=ta&&tt?[e]:[...ek.filter(e=>!e.isImage&&!e.isAudio).map(e=>{let{role:t,content:s}=e;return{role:t,content:s}}),e],await ep(t,(e,t,s)=>tM(e,t,s),eA,a,e1,o,tL,tO,tK,r,e5.length>0?e5:void 0,e7.length>0?e7:void 0,ea,ta?tt:null,tF,tB)}else if(eH===V.KP.ANTHROPIC_MESSAGES){let t=[...ek.filter(e=>!e.isImage&&!e.isAudio).map(e=>{let{role:t,content:s}=e;return{role:t,content:s}}),e];await er(t,(e,t,s)=>tM(e,t,s),eA,a,e1,o,tL,tO,tK,r,e5.length>0?e5:void 0,e7.length>0?e7:void 0,ea)}else eH===V.KP.EMBEDDINGS?await ed(ew,(e,t)=>tG(e,t),eA,a,e1):eH===V.KP.TRANSCRIPTION&&tf&&await ei(tf,(e,t)=>tM("assistant",e,t),eA,a,e1,o)}eH===V.KP.A2A_AGENTS&&eL&&await ev(eL,ew,(e,t)=>tM("assistant",e,t),a,o,tO,tD,tU)}catch(e){o.aborted?console.log("Request was cancelled"):(console.error("Error fetching response",e),tM("assistant","Error fetching response:"+e))}finally{eY(!1),e0.current=null,eH===V.KP.IMAGE_EDITS&&tY(),eH===V.KP.RESPONSES&&tc&&tX(),eH===V.KP.CHAT&&tx&&t$(),eH===V.KP.TRANSCRIPTION&&tf&&tQ()}eS("")};if(w&&"Admin Viewer"===w){let{Title:e,Paragraph:t}=k.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(t,{children:"Ask your proxy admin for access to test models"})]})}let t1=(0,a.jsx)(o.Z,{style:{fontSize:24},spin:!0});return(0,a.jsxs)("div",{className:"w-full p-4 pb-0 bg-white",children:[(0,a.jsx)(N.Zb,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,a.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,a.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 overflow-y-auto",children:[(0,a.jsx)(N.Dx,{className:"text-xl font-semibold mb-6 mt-2",children:"Configurations"}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(r.Z,{className:"mr-2"})," Virtual Key Source"]}),(0,a.jsx)(P.default,{disabled:F,value:eb,style:{width:"100%"},onChange:e=>{ey(e)},options:[{value:"session",label:"Current UI Session"},{value:"custom",label:"Virtual Key"}],className:"rounded-md"}),"custom"===eb&&(0,a.jsx)(N.oi,{className:"mt-2",placeholder:"Enter custom Virtual Key",type:"password",onValueChange:eN,value:ej,icon:r.Z})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(n.Z,{className:"mr-2"})," Endpoint Type"]}),(0,a.jsx)(es,{endpointType:eH,onEndpointChange:e=>{eq(e),eC(void 0),eO(void 0),eT(!1);try{sessionStorage.removeItem("selectedModel"),sessionStorage.removeItem("selectedAgent")}catch(e){}},className:"mb-4"}),eH===V.KP.SPEECH&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(l.Z,{className:"mr-2"}),"Voice"]}),(0,a.jsx)(P.default,{value:e4,onChange:e=>{e3(e),sessionStorage.setItem("selectedVoice",e)},style:{width:"100%"},className:"rounded-md",options:Y})]}),(0,a.jsx)(eX,{endpointType:eH,responsesSessionId:tt,useApiSessionManagement:ta,onToggleSessionManagement:e=>{to(e),e||ts(null)}})]}),eH!==V.KP.A2A_AGENTS&&(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center justify-between",children:[(0,a.jsxs)("span",{className:"flex items-center",children:[(0,a.jsx)(i.Z,{className:"mr-2"})," Select Model"]}),(()=>{if(!eA||"custom"===eA)return!1;let e=e_.find(e=>e.model_group===eA);return!!e&&(!e.mode||"chat"===e.mode)})()?(0,a.jsx)(A.Z,{content:(0,a.jsx)(q,{temperature:tA,maxTokens:tZ,useAdvancedParams:t_,onTemperatureChange:tC,onMaxTokensChange:tT,onUseAdvancedParamsChange:tE}),title:"Model Settings",trigger:"click",placement:"right",children:(0,a.jsx)(C.ZP,{type:"text",size:"small",icon:(0,a.jsx)(c.Z,{}),className:"text-gray-500 hover:text-gray-700"})}):(0,a.jsx)(Z.Z,{title:"Advanced parameters are only supported for chat models currently",children:(0,a.jsx)(C.ZP,{type:"text",size:"small",icon:(0,a.jsx)(c.Z,{}),className:"text-gray-300 cursor-not-allowed",disabled:!0})})]}),(0,a.jsx)(P.default,{value:eA,placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),eC(e),eT("custom"===e)},options:[...Array.from(new Set(e_.filter(e=>{if(!e.mode)return!0;let t=(0,V.vf)(e.mode);return eH===V.KP.RESPONSES||eH===V.KP.ANTHROPIC_MESSAGES?t===eH||t===V.KP.CHAT:eH===V.KP.IMAGE_EDITS?t===eH||t===V.KP.IMAGE:t===eH}).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%"},showSearch:!0,className:"rounded-md"}),eZ&&(0,a.jsx)(N.oi,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{ez.current&&clearTimeout(ez.current),ez.current=setTimeout(()=>{eC(e)},500)}})]}),eH===V.KP.A2A_AGENTS&&(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(i.Z,{className:"mr-2"})," Select Agent"]}),(0,a.jsx)(P.default,{value:eL,placeholder:"Select an Agent",onChange:e=>eO(e),options:eR.map(e=>({value:e.agent_name,label:e.agent_name||e.agent_id,key:e.agent_id})),style:{width:"100%"},showSearch:!0,className:"rounded-md",optionLabelProp:"label",children:eR.map(e=>{var t;return(0,a.jsx)(P.default.Option,{value:e.agent_name,label:e.agent_name||e.agent_id,children:(0,a.jsxs)("div",{className:"flex flex-col py-1",children:[(0,a.jsx)("span",{className:"font-medium",children:e.agent_name||e.agent_id}),(null===(t=e.agent_card_params)||void 0===t?void 0:t.description)&&(0,a.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.agent_card_params.description})]})},e.agent_id)})}),0===eR.length&&(0,a.jsx)(N.xv,{className:"text-xs text-gray-500 mt-2 block",children:"No agents found. Create agents via /v1/agents endpoint."})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(d.Z,{className:"mr-2"})," Tags"]}),(0,a.jsx)(D.Z,{value:e1,onChange:e2,className:"mb-4",accessToken:t||""})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(m.Z,{className:"mr-2"})," MCP Tool",(0,a.jsx)(Z.Z,{className:"ml-1",title:"Select MCP tools to use in your conversation, only available for /v1/responses endpoint",children:(0,a.jsx)(u.Z,{})})]}),(0,a.jsx)(P.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select MCP tools",value:ea,onChange:e=>eo(e),loading:en,className:"mb-4",allowClear:!0,optionLabelProp:"label",disabled:eH!==V.KP.RESPONSES,maxTagCount:"responsive",children:Array.isArray(W)&&W.map(e=>(0,a.jsx)(P.default.Option,{value:e.name,label:(0,a.jsx)("div",{className:"font-medium",children:e.name}),children:(0,a.jsxs)("div",{className:"flex flex-col py-1",children:[(0,a.jsx)("span",{className:"font-medium",children:e.name}),(0,a.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(x.Z,{className:"mr-2"})," Vector Store",(0,a.jsx)(Z.Z,{className:"ml-1",title:(0,a.jsxs)("span",{children:["Select vector store(s) to use for this LLM API call. You can set up your vector store"," ",(0,a.jsx)("a",{href:"?page=vector-stores",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,a.jsx)(u.Z,{})})]}),(0,a.jsx)(z.Z,{value:e5,onChange:e6,className:"mb-4",accessToken:t||""})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(g.Z,{className:"mr-2"})," Guardrails",(0,a.jsx)(Z.Z,{className:"ml-1",title:(0,a.jsxs)("span",{children:["Select guardrail(s) to use for this LLM API call. You can set up your guardrails"," ",(0,a.jsx)("a",{href:"?page=guardrails",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,a.jsx)(u.Z,{})})]}),(0,a.jsx)(K.Z,{value:e7,onChange:e8,className:"mb-4",accessToken:t||""})]})]})]}),(0,a.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,a.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,a.jsx)(N.Dx,{className:"text-xl font-semibold mb-0",children:"Test Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(N.zx,{onClick:()=>{ek.forEach(e=>{e.isAudio&&"string"==typeof e.content&&URL.revokeObjectURL(e.content)}),eP([]),te(null),ts(null),tP([]),tY(),tX(),t$(),tQ(),sessionStorage.removeItem("chatHistory"),sessionStorage.removeItem("messageTraceId"),sessionStorage.removeItem("responsesSessionId"),U.Z.success("Chat history cleared.")},className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:p.Z,children:"Clear Chat"}),(0,a.jsx)(N.zx,{onClick:()=>ty(!0),className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:h.Z,children:"Get Code"})]})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===ek.length&&(0,a.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,a.jsx)(i.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,a.jsx)(N.xv,{children:"Start a conversation, generate an image, or handle audio"})]}),ek.map((e,t)=>(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"mb-4 ".concat("user"===e.role?"text-right":"text-left"),children:(0,a.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===e.role?"#f0f8ff":"#ffffff",border:"user"===e.role?"1px solid #e6f0fa":"1px solid #f0f0f0",textAlign:"left"},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===e.role?"#e6f0fa":"#f5f5f5"},children:"user"===e.role?(0,a.jsx)(f.Z,{style:{fontSize:"12px",color:"#2563eb"}}):(0,a.jsx)(i.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,a.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,a.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,a.jsx)(eU.Z,{reasoningContent:e.reasoningContent}),"assistant"===e.role&&t===ek.length-1&&tk.length>0&&eH===V.KP.RESPONSES&&(0,a.jsx)("div",{className:"mb-3",children:(0,a.jsx)(eK,{events:tk})}),"assistant"===e.role&&e.searchResults&&(0,a.jsx)(eW.J,{searchResults:e.searchResults}),(0,a.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,a.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,a.jsx)(J,{message:e}):(0,a.jsxs)(a.Fragment,{children:[eH===V.KP.RESPONSES&&(0,a.jsx)(eG,{message:e}),eH===V.KP.CHAT&&(0,a.jsx)($.Z,{message:e}),(0,a.jsx)(I.UG,{components:{code(e){let{node:t,inline:s,className:o,children:r,...n}=e,l=/language-(\w+)/.exec(o||"");return!s&&l?(0,a.jsx)(R.Z,{style:M.Z,language:l[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...n,children:String(r).replace(/\n$/,"")}):(0,a.jsx)("code",{className:"".concat(o," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),style:{wordBreak:"break-word"},...n,children:r})},pre:e=>{let{node:t,...s}=e;return(0,a.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...s})}},children:"string"==typeof e.content?e.content:""}),e.image&&(0,a.jsx)("div",{className:"mt-3",children:(0,a.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,a.jsx)(eD.Z,{timeToFirstToken:e.timeToFirstToken,totalLatency:e.totalLatency,usage:e.usage,toolName:e.toolName}),"assistant"===e.role&&e.a2aMetadata&&(0,a.jsx)(eE,{a2aMetadata:e.a2aMetadata,timeToFirstToken:e.timeToFirstToken,totalLatency:e.totalLatency})]})]})})},t)),eJ&&tk.length>0&&eH===V.KP.RESPONSES&&ek.length>0&&"user"===ek[ek.length-1].role&&(0,a.jsx)("div",{className:"text-left mb-4",children:(0,a.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"#ffffff",border:"1px solid #f0f0f0",textAlign:"left"},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"#f5f5f5"},children:(0,a.jsx)(i.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,a.jsx)("strong",{className:"text-sm capitalize",children:"Assistant"})]}),(0,a.jsx)(eK,{events:tk})]})}),eJ&&(0,a.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,a.jsx)(T.Z,{indicator:t1})}),(0,a.jsx)("div",{ref:tI,style:{height:"1px"}})]}),(0,a.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[eH===V.KP.IMAGE_EDITS&&(0,a.jsx)("div",{className:"mb-4",children:0===tr.length?(0,a.jsxs)(eQ,{beforeUpload:tV,accept:"image/*",showUploadList:!1,children:[(0,a.jsx)("p",{className:"ant-upload-drag-icon",children:(0,a.jsx)(v.Z,{style:{fontSize:"24px",color:"#666"}})}),(0,a.jsx)("p",{className:"ant-upload-text text-sm",children:"Click or drag images to upload"}),(0,a.jsx)("p",{className:"ant-upload-hint text-xs text-gray-500",children:"Support for PNG, JPG, JPEG formats. Multiple images supported."})]}):(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[tr.map((e,t)=>(0,a.jsxs)("div",{className:"relative inline-block",children:[(0,a.jsx)("img",{src:tl[t]||"",alt:"Upload preview ".concat(t+1),className:"max-w-32 max-h-32 rounded-md border border-gray-200 object-cover"}),(0,a.jsx)("button",{className:"absolute top-1 right-1 bg-white shadow-sm border border-gray-200 rounded px-1 py-1 text-red-500 hover:bg-red-50 text-xs",onClick:()=>tW(t),children:(0,a.jsx)(b.Z,{})})]},t)),(0,a.jsxs)("div",{className:"flex items-center justify-center w-32 h-32 border-2 border-dashed border-gray-300 rounded-md hover:border-gray-400 cursor-pointer",onClick:()=>{var e;return null===(e=document.getElementById("additional-image-upload"))||void 0===e?void 0:e.click()},children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(v.Z,{style:{fontSize:"24px",color:"#666"}}),(0,a.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Add more"})]}),(0,a.jsx)("input",{id:"additional-image-upload",type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:e=>{Array.from(e.target.files||[]).forEach(e=>tV(e))}})]})]})}),eH===V.KP.TRANSCRIPTION&&(0,a.jsx)("div",{className:"mb-4",children:tf?(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-1",children:[(0,a.jsx)(l.Z,{style:{fontSize:"20px",color:"#666"}}),(0,a.jsx)("span",{className:"text-sm font-medium",children:tf.name}),(0,a.jsxs)("span",{className:"text-xs text-gray-500",children:["(",(tf.size/1024/1024).toFixed(2)," MB)"]})]}),(0,a.jsxs)("button",{className:"bg-white shadow-sm border border-gray-200 rounded px-2 py-1 text-red-500 hover:bg-red-50 text-xs",onClick:tQ,children:[(0,a.jsx)(b.Z,{})," Remove"]})]}):(0,a.jsxs)(eQ,{beforeUpload:e=>(tv(e),!1),accept:"audio/*,.mp3,.mp4,.mpeg,.mpga,.m4a,.wav,.webm",showUploadList:!1,children:[(0,a.jsx)("p",{className:"ant-upload-drag-icon",children:(0,a.jsx)(l.Z,{style:{fontSize:"24px",color:"#666"}})}),(0,a.jsx)("p",{className:"ant-upload-text text-sm",children:"Click or drag audio file to upload"}),(0,a.jsx)("p",{className:"ant-upload-hint text-xs text-gray-500",children:"Support for MP3, MP4, MPEG, MPGA, M4A, WAV, WEBM formats. Max file size: 25 MB."})]})}),eH===V.KP.RESPONSES&&tc&&(0,a.jsx)("div",{className:"mb-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,a.jsx)("div",{className:"relative inline-block",children:tc.name.toLowerCase().endsWith(".pdf")?(0,a.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,a.jsx)(y.Z,{style:{fontSize:"16px",color:"white"}})}):(0,a.jsx)("img",{src:tm||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:tc.name}),(0,a.jsx)("div",{className:"text-xs text-gray-500",children:tc.name.toLowerCase().endsWith(".pdf")?"PDF":"Image"})]}),(0,a.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:tX,children:(0,a.jsx)(b.Z,{style:{fontSize:"12px"}})})]})}),eH===V.KP.CHAT&&tx&&(0,a.jsx)("div",{className:"mb-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,a.jsx)("div",{className:"relative inline-block",children:tx.name.toLowerCase().endsWith(".pdf")?(0,a.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,a.jsx)(y.Z,{style:{fontSize:"16px",color:"white"}})}):(0,a.jsx)("img",{src:tp||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:tx.name}),(0,a.jsx)("div",{className:"text-xs text-gray-500",children:tx.name.toLowerCase().endsWith(".pdf")?"PDF":"Image"})]}),(0,a.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:t$,children:(0,a.jsx)(b.Z,{style:{fontSize:"12px"}})})]})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[(0,a.jsxs)("div",{className:"flex-shrink-0 mr-2",children:[eH===V.KP.RESPONSES&&!tc&&(0,a.jsx)(eV,{responsesUploadedImage:tc,responsesImagePreviewUrl:tm,onImageUpload:e=>(td(e),tu(URL.createObjectURL(e)),!1),onRemoveImage:tX}),eH===V.KP.CHAT&&!tx&&(0,a.jsx)(Q.Z,{chatUploadedImage:tx,chatImagePreviewUrl:tp,onImageUpload:e=>(tg(e),th(URL.createObjectURL(e)),!1),onRemoveImage:t$})]}),(0,a.jsx)(e$,{value:ew,onChange:e=>eS(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),t0())},placeholder:eH===V.KP.CHAT||eH===V.KP.EMBEDDINGS||eH===V.KP.RESPONSES||eH===V.KP.ANTHROPIC_MESSAGES?"Type your message... (Shift+Enter for new line)":eH===V.KP.A2A_AGENTS?"Send a message to the A2A agent...":eH===V.KP.IMAGE_EDITS?"Describe how you want to edit the image...":eH===V.KP.SPEECH?"Enter text to convert to speech...":eH===V.KP.TRANSCRIPTION?"Optional: Add context or prompt for transcription...":"Describe the image you want to generate...",disabled:eJ,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,a.jsx)(N.zx,{onClick:t0,disabled:eJ||(eH===V.KP.TRANSCRIPTION?!tf:!ew.trim()),className:"flex-shrink-0 ml-2 !w-8 !h-8 !min-w-8 !p-0 !rounded-full !bg-blue-600 hover:!bg-blue-700 disabled:!bg-gray-300 !border-none !text-white disabled:!text-gray-500 !flex !items-center !justify-center",children:(0,a.jsx)(j.Z,{style:{fontSize:"14px"}})})]}),eJ&&(0,a.jsx)(N.zx,{onClick:()=>{e0.current&&(e0.current.abort(),e0.current=null,eY(!1),U.Z.info("Request cancelled"))},className:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200",icon:b.Z,children:"Cancel"})]})]})]})]})}),(0,a.jsxs)(_.Z,{title:"Generated Code",visible:tb,onCancel:()=>ty(!1),footer:null,width:800,children:[(0,a.jsxs)("div",{className:"flex justify-between items-end my-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(N.xv,{className:"font-medium block mb-1 text-gray-700",children:"SDK Type"}),(0,a.jsx)(P.default,{value:tw,onChange:e=>tS(e),style:{width:150},options:[{value:"openai",label:"OpenAI SDK"},{value:"azure",label:"Azure SDK"}]})]}),(0,a.jsx)(C.ZP,{onClick:()=>{navigator.clipboard.writeText(tj),U.Z.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,a.jsx)(R.Z,{language:"python",style:M.Z,wrapLines:!0,wrapLongLines:!0,className:"rounded-md",customStyle:{maxHeight:"60vh",overflowY:"auto"},children:tj})]}),"custom"===eb&&(0,a.jsx)(_.Z,{title:"Select MCP Tool",visible:H,onCancel:()=>G(!1),onOk:()=>{G(!1),U.Z.success("MCP tool selection updated")},width:800,children:en?(0,a.jsx)("div",{className:"flex justify-center items-center py-8",children:(0,a.jsx)(T.Z,{indicator:(0,a.jsx)(o.Z,{style:{fontSize:24},spin:!0})})}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(N.xv,{className:"text-gray-600 block mb-4",children:"Select the MCP tools you want to use in your conversation."}),(0,a.jsx)(P.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select MCP tools",value:ea,onChange:e=>eo(e),optionLabelProp:"label",allowClear:!0,maxTagCount:"responsive",children:W.map(e=>(0,a.jsx)(P.default.Option,{value:e.name,label:(0,a.jsx)("div",{className:"font-medium",children:e.name}),children:(0,a.jsxs)("div",{className:"flex flex-col py-1",children:[(0,a.jsx)("span",{className:"font-medium",children:e.name}),(0,a.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]})})]})}},94331:function(e,t,s){var a=s(57437),o=s(2265),r=s(5545),n=s(62831),l=s(17906),i=s(94263),c=s(83322),d=s(70464),m=s(77565);t.Z=e=>{let{reasoningContent:t}=e,[s,u]=(0,o.useState)(!0);return t?(0,a.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,a.jsxs)(r.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>u(!s),icon:(0,a.jsx)(c.Z,{}),children:[s?"Hide reasoning":"Show reasoning",s?(0,a.jsx)(d.Z,{className:"ml-1"}):(0,a.jsx)(m.Z,{className:"ml-1"})]}),s&&(0,a.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,a.jsx)(n.UG,{components:{code(e){let{node:t,inline:s,className:o,children:r,...n}=e,c=/language-(\w+)/.exec(o||"");return!s&&c?(0,a.jsx)(l.Z,{style:i.Z,language:c[1],PreTag:"div",className:"rounded-md my-2",...n,children:String(r).replace(/\n$/,"")}):(0,a.jsx)("code",{className:"".concat(o," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),...n,children:r})}},children:t})})]}):null}},38398:function(e,t,s){var a=s(57437);s(2265);var o=s(99981),r=s(5540),n=s(71282),l=s(11741),i=s(83322),c=s(16601),d=s(62670),m=s(58630);t.Z=e=>{let{timeToFirstToken:t,totalLatency:s,usage:u,toolName:x}=e;return t||s||u?(0,a.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!==t&&(0,a.jsx)(o.Z,{title:"Time to first token",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(r.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["TTFT: ",(t/1e3).toFixed(2),"s"]})]})}),void 0!==s&&(0,a.jsx)(o.Z,{title:"Total latency",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(r.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Total Latency: ",(s/1e3).toFixed(2),"s"]})]})}),(null==u?void 0:u.promptTokens)!==void 0&&(0,a.jsx)(o.Z,{title:"Prompt tokens",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(n.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["In: ",u.promptTokens]})]})}),(null==u?void 0:u.completionTokens)!==void 0&&(0,a.jsx)(o.Z,{title:"Completion tokens",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(l.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Out: ",u.completionTokens]})]})}),(null==u?void 0:u.reasoningTokens)!==void 0&&(0,a.jsx)(o.Z,{title:"Reasoning tokens",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(i.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Reasoning: ",u.reasoningTokens]})]})}),(null==u?void 0:u.totalTokens)!==void 0&&(0,a.jsx)(o.Z,{title:"Total tokens",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(c.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Total: ",u.totalTokens]})]})}),(null==u?void 0:u.cost)!==void 0&&(0,a.jsx)(o.Z,{title:"Cost",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(d.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["$",u.cost.toFixed(6)]})]})}),x&&(0,a.jsx)(o.Z,{title:"Tool used",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(m.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Tool: ",x]})]})})]}):null}},33152:function(e,t,s){s.d(t,{J:function(){return d}});var a=s(57437),o=s(2265),r=s(5545),n=s(44625),l=s(70464),i=s(77565),c=s(38434);function d(e){let{searchResults:t}=e,[s,d]=(0,o.useState)(!0),[m,u]=(0,o.useState)({});if(!t||0===t.length)return null;let x=(e,t)=>{let s="".concat(e,"-").concat(t);u(e=>({...e,[s]:!e[s]}))},g=t.reduce((e,t)=>e+t.data.length,0);return(0,a.jsxs)("div",{className:"search-results-content mt-1 mb-2",children:[(0,a.jsxs)(r.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>d(!s),icon:(0,a.jsx)(n.Z,{}),children:[s?"Hide sources":"Show sources (".concat(g,")"),s?(0,a.jsx)(l.Z,{className:"ml-1"}):(0,a.jsx)(i.Z,{className:"ml-1"})]}),s&&(0,a.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm",children:(0,a.jsx)("div",{className:"space-y-3",children:t.map((e,t)=>(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"text-xs text-gray-600 mb-2 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium",children:"Query:"}),(0,a.jsxs)("span",{className:"italic",children:['"',e.search_query,'"']}),(0,a.jsx)("span",{className:"text-gray-400",children:"•"}),(0,a.jsxs)("span",{className:"text-gray-500",children:[e.data.length," result",1!==e.data.length?"s":""]})]}),(0,a.jsx)("div",{className:"space-y-2",children:e.data.map((e,s)=>{let o=m["".concat(t,"-").concat(s)]||!1;return(0,a.jsxs)("div",{className:"border border-gray-200 rounded-md overflow-hidden bg-white",children:[(0,a.jsx)("div",{className:"flex items-center justify-between p-2 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>x(t,s),children:(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,a.jsx)("svg",{className:"w-4 h-4 text-gray-400 transition-transform flex-shrink-0 ".concat(o?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,a.jsx)(c.Z,{className:"text-gray-400 flex-shrink-0",style:{fontSize:"12px"}}),(0,a.jsx)("span",{className:"text-xs font-medium text-gray-700 truncate",children:e.filename||e.file_id||"Result ".concat(s+1)}),(0,a.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)})]})}),o&&(0,a.jsx)("div",{className:"border-t border-gray-200 bg-white",children:(0,a.jsxs)("div",{className:"p-3 space-y-2",children:[e.content.map((e,t)=>(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"text-xs font-mono bg-gray-50 p-2 rounded text-gray-800 whitespace-pre-wrap break-words",children:e.text})},t)),e.attributes&&Object.keys(e.attributes).length>0&&(0,a.jsxs)("div",{className:"mt-2 pt-2 border-t border-gray-100",children:[(0,a.jsx)("div",{className:"text-xs text-gray-500 mb-1 font-medium",children:"Metadata:"}),(0,a.jsx)("div",{className:"space-y-1",children:Object.entries(e.attributes).map(e=>{let[t,s]=e;return(0,a.jsxs)("div",{className:"text-xs flex gap-2",children:[(0,a.jsxs)("span",{className:"text-gray-500 font-medium",children:[t,":"]}),(0,a.jsx)("span",{className:"text-gray-700 font-mono break-all",children:String(s)})]},t)})})]})]})})]},s)})})]},t))})})]})}},95459:function(e,t,s){s.d(t,{n:function(){return r}});var a=s(7271),o=s(19250);async function r(e,t,s,r,n,l,i,c,d,m,u,x,g,p,h,f,v,b){console.log=function(){},console.log("isLocal:",!1);let y=(0,o.getProxyBaseUrl)(),j={};n&&n.length>0&&(j["x-litellm-tags"]=n.join(","));let N=new a.ZP.OpenAI({apiKey:r,baseURL:y,dangerouslyAllowBrowser:!0,defaultHeaders:j});try{let a;let o=Date.now(),n=!1,j=g&&g.length>0?[{type:"mcp",server_label:"litellm",server_url:"".concat(y,"/mcp"),require_approval:"never",allowed_tools:g,headers:{"x-litellm-api-key":"Bearer ".concat(r)}}]:void 0;for await(let r of(await N.chat.completions.create({model:s,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:m,messages:e,...u?{vector_store_ids:u}:{},...x?{guardrails:x}:{},...j?{tools:j,tool_choice:"auto"}:{},...void 0!==f?{temperature:f}:{},...void 0!==v?{max_tokens:v}:{}},{signal:l}))){var w,S,k,P,A,C,Z,T,_;console.log("Stream chunk:",r);let e=null===(w=r.choices[0])||void 0===w?void 0:w.delta;if(console.log("Delta content:",null===(k=r.choices[0])||void 0===k?void 0:null===(S=k.delta)||void 0===S?void 0:S.content),console.log("Delta reasoning content:",null==e?void 0:e.reasoning_content),!n&&((null===(A=r.choices[0])||void 0===A?void 0:null===(P=A.delta)||void 0===P?void 0:P.content)||e&&e.reasoning_content)&&(n=!0,a=Date.now()-o,console.log("First token received! Time:",a,"ms"),c?(console.log("Calling onTimingData with:",a),c(a)):console.log("onTimingData callback is not defined!")),null===(Z=r.choices[0])||void 0===Z?void 0:null===(C=Z.delta)||void 0===C?void 0:C.content){let e=r.choices[0].delta.content;t(e,r.model)}if(e&&e.image&&p&&(console.log("Image generated:",e.image),p(e.image.url,r.model)),e&&e.reasoning_content){let t=e.reasoning_content;i&&i(t)}if(e&&(null===(T=e.provider_specific_fields)||void 0===T?void 0:T.search_results)&&h&&(console.log("Search results found:",e.provider_specific_fields.search_results),h(e.provider_specific_fields.search_results)),r.usage&&d){console.log("Usage data found:",r.usage);let e={completionTokens:r.usage.completion_tokens,promptTokens:r.usage.prompt_tokens,totalTokens:r.usage.total_tokens};(null===(_=r.usage.completion_tokens_details)||void 0===_?void 0:_.reasoning_tokens)&&(e.reasoningTokens=r.usage.completion_tokens_details.reasoning_tokens),void 0!==r.usage.cost&&null!==r.usage.cost&&(e.cost=parseFloat(r.usage.cost)),d(e)}}let E=Date.now();b&&b(E-o)}catch(e){throw(null==l?void 0:l.aborted)&&console.log("Chat completion request was cancelled"),e}}},99020:function(e,t,s){var a=s(57437),o=s(2265),r=s(37592),n=s(19250);t.Z=e=>{let{onChange:t,value:s,className:l,accessToken:i}=e,[c,d]=(0,o.useState)([]),[m,u]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{(async()=>{if(i)try{let e=await (0,n.tagListCall)(i);console.log("List tags response:",e),d(Object.values(e))}catch(e){console.error("Error fetching tags:",e)}finally{u(!1)}})()},[i]),(0,a.jsx)(r.default,{mode:"tags",showSearch:!0,placeholder:"Select or create tags",onChange:t,value:s,loading:m,className:l,options:c.map(e=>({label:e.name,value:e.name,title:e.description||e.name})),optionFilterProp:"label",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"}})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/5869-426268ba6ad0ce0c.js b/litellm/proxy/_experimental/out/_next/static/chunks/5869-99bf8c2997f4811f.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/5869-426268ba6ad0ce0c.js rename to litellm/proxy/_experimental/out/_next/static/chunks/5869-99bf8c2997f4811f.js index 63b2a7aa742..7224a73aee3 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/5869-426268ba6ad0ce0c.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/5869-99bf8c2997f4811f.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5869],{96473:function(t,e,n){n.d(e,{Z:function(){return i}});var a=n(1119),o=n(2265),c={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"},r=n(55015),i=o.forwardRef(function(t,e){return o.createElement(r.Z,(0,a.Z)({},t,{ref:e,icon:c}))})},65869:function(t,e,n){n.d(e,{default:function(){return t_}});var a=n(2265),o=n(49638),c=n(39760),r=n(96473),i=n(36760),l=n.n(i),d=n(1119),s=n(11993),u=n(31686),f=n(26365),v=n(41154),b=n(6989),p=n(50506),m=n(79267),h=(0,a.createContext)(null),g=n(83145),k=n(31474),y=n(58525),w=n(28791),x=n(53346),_=function(t){var e=t.activeTabOffset,n=t.horizontal,o=t.rtl,c=t.indicator,r=void 0===c?{}:c,i=r.size,l=r.align,d=void 0===l?"center":l,s=(0,a.useState)(),u=(0,f.Z)(s,2),v=u[0],b=u[1],p=(0,a.useRef)(),m=a.useCallback(function(t){return"function"==typeof i?i(t):"number"==typeof i?i:t},[i]);function h(){x.Z.cancel(p.current)}return(0,a.useEffect)(function(){var t={};if(e){if(n){t.width=m(e.width);var a=o?"right":"left";"start"===d&&(t[a]=e[a]),"center"===d&&(t[a]=e[a]+e.width/2,t.transform=o?"translateX(50%)":"translateX(-50%)"),"end"===d&&(t[a]=e[a]+e.width,t.transform="translateX(-100%)")}else t.height=m(e.height),"start"===d&&(t.top=e.top),"center"===d&&(t.top=e.top+e.height/2,t.transform="translateY(-50%)"),"end"===d&&(t.top=e.top+e.height,t.transform="translateY(-100%)")}return h(),p.current=(0,x.Z)(function(){v&&t&&Object.keys(t).every(function(e){var n=t[e],a=v[e];return"number"==typeof n&&"number"==typeof a?Math.round(n)===Math.round(a):n===a})||b(t)}),h},[JSON.stringify(e),n,o,d,m]),{style:v}},S={width:0,height:0,left:0,top:0};function E(t,e){var n=a.useRef(t),o=a.useState({}),c=(0,f.Z)(o,2)[1];return[n.current,function(t){var a="function"==typeof t?t(n.current):t;a!==n.current&&e(a,n.current),n.current=a,c({})}]}var Z=n(27380);function C(t){var e=(0,a.useState)(0),n=(0,f.Z)(e,2),o=n[0],c=n[1],r=(0,a.useRef)(0),i=(0,a.useRef)();return i.current=t,(0,Z.o)(function(){var t;null===(t=i.current)||void 0===t||t.call(i)},[o]),function(){r.current===o&&(r.current+=1,c(r.current))}}var R={width:0,height:0,left:0,top:0,right:0};function P(t){var e;return t instanceof Map?(e={},t.forEach(function(t,n){e[n]=t})):e=t,JSON.stringify(e)}function T(t){return String(t).replace(/"/g,"TABS_DQ")}function I(t,e,n,a){return!!n&&!a&&!1!==t&&(void 0!==t||!1!==e&&null!==e)}var M=a.forwardRef(function(t,e){var n=t.prefixCls,o=t.editable,c=t.locale,r=t.style;return o&&!1!==o.showAdd?a.createElement("button",{ref:e,type:"button",className:"".concat(n,"-nav-add"),style:r,"aria-label":(null==c?void 0:c.addAriaLabel)||"Add tab",onClick:function(t){o.onEdit("add",{event:t})}},o.addIcon||"+"):null}),L=a.forwardRef(function(t,e){var n,o=t.position,c=t.prefixCls,r=t.extra;if(!r)return null;var i={};return"object"!==(0,v.Z)(r)||a.isValidElement(r)?i.right=r:i=r,"right"===o&&(n=i.right),"left"===o&&(n=i.left),n?a.createElement("div",{className:"".concat(c,"-extra-content"),ref:e},n):null}),O=n(71030),N=n(33082),B=n(95814),D=a.forwardRef(function(t,e){var n=t.prefixCls,o=t.id,c=t.tabs,r=t.locale,i=t.mobile,u=t.more,v=void 0===u?{}:u,b=t.style,p=t.className,m=t.editable,h=t.tabBarGutter,g=t.rtl,k=t.removeAriaLabel,y=t.onTabClick,w=t.getPopupContainer,x=t.popupClassName,_=(0,a.useState)(!1),S=(0,f.Z)(_,2),E=S[0],Z=S[1],C=(0,a.useState)(null),R=(0,f.Z)(C,2),P=R[0],T=R[1],L=v.icon,D="".concat(o,"-more-popup"),z="".concat(n,"-dropdown"),j=null!==P?"".concat(D,"-").concat(P):null,H=null==r?void 0:r.dropdownAriaLabel,W=a.createElement(N.ZP,{onClick:function(t){y(t.key,t.domEvent),Z(!1)},prefixCls:"".concat(z,"-menu"),id:D,tabIndex:-1,role:"listbox","aria-activedescendant":j,selectedKeys:[P],"aria-label":void 0!==H?H:"expanded dropdown"},c.map(function(t){var e=t.closable,n=t.disabled,c=t.closeIcon,r=t.key,i=t.label,l=I(e,c,m,n);return a.createElement(N.sN,{key:r,id:"".concat(D,"-").concat(r),role:"option","aria-controls":o&&"".concat(o,"-panel-").concat(r),disabled:n},a.createElement("span",null,i),l&&a.createElement("button",{type:"button","aria-label":k||"remove",tabIndex:0,className:"".concat(z,"-menu-item-remove"),onClick:function(t){t.stopPropagation(),t.preventDefault(),t.stopPropagation(),m.onEdit("remove",{key:r,event:t})}},c||m.removeIcon||"\xd7"))}));function G(t){for(var e=c.filter(function(t){return!t.disabled}),n=e.findIndex(function(t){return t.key===P})||0,a=e.length,o=0;oMath.abs(i-n)?[i,l,d-e.left,s-e.top]:[n,a,c,o]},W=function(t){var e=t.current||{},n=e.offsetWidth,a=void 0===n?0:n,o=e.offsetHeight;if(t.current){var c=t.current.getBoundingClientRect(),r=c.width,i=c.height;if(1>Math.abs(r-a))return[r,i]}return[a,void 0===o?0:o]},G=function(t,e){return t[e?0:1]},A=a.forwardRef(function(t,e){var n,o,c,r,i,v,b,p,m,x,Z,O,N,B,D,A,X,K,q,F,V,Y,U,Q,J,$,tt,te,tn,ta,to,tc,tr,ti,tl,td,ts,tu,tf,tv=t.className,tb=t.style,tp=t.id,tm=t.animated,th=t.activeKey,tg=t.rtl,tk=t.extra,ty=t.editable,tw=t.locale,tx=t.tabPosition,t_=t.tabBarGutter,tS=t.children,tE=t.onTabClick,tZ=t.onTabScroll,tC=t.indicator,tR=a.useContext(h),tP=tR.prefixCls,tT=tR.tabs,tI=(0,a.useRef)(null),tM=(0,a.useRef)(null),tL=(0,a.useRef)(null),tO=(0,a.useRef)(null),tN=(0,a.useRef)(null),tB=(0,a.useRef)(null),tD=(0,a.useRef)(null),tz="top"===tx||"bottom"===tx,tj=E(0,function(t,e){tz&&tZ&&tZ({direction:t>e?"left":"right"})}),tH=(0,f.Z)(tj,2),tW=tH[0],tG=tH[1],tA=E(0,function(t,e){!tz&&tZ&&tZ({direction:t>e?"top":"bottom"})}),tX=(0,f.Z)(tA,2),tK=tX[0],tq=tX[1],tF=(0,a.useState)([0,0]),tV=(0,f.Z)(tF,2),tY=tV[0],tU=tV[1],tQ=(0,a.useState)([0,0]),tJ=(0,f.Z)(tQ,2),t$=tJ[0],t0=tJ[1],t1=(0,a.useState)([0,0]),t2=(0,f.Z)(t1,2),t8=t2[0],t6=t2[1],t9=(0,a.useState)([0,0]),t4=(0,f.Z)(t9,2),t5=t4[0],t3=t4[1],t7=(n=new Map,o=(0,a.useRef)([]),c=(0,a.useState)({}),r=(0,f.Z)(c,2)[1],i=(0,a.useRef)("function"==typeof n?n():n),v=C(function(){var t=i.current;o.current.forEach(function(e){t=e(t)}),o.current=[],i.current=t,r({})}),[i.current,function(t){o.current.push(t),v()}]),et=(0,f.Z)(t7,2),ee=et[0],en=et[1],ea=(b=t$[0],(0,a.useMemo)(function(){for(var t=new Map,e=ee.get(null===(o=tT[0])||void 0===o?void 0:o.key)||S,n=e.left+e.width,a=0;aef?ef:t}tz&&tg?(eu=0,ef=Math.max(0,ec-ed)):(eu=Math.min(0,ed-ec),ef=0);var eb=(0,a.useRef)(null),ep=(0,a.useState)(),em=(0,f.Z)(ep,2),eh=em[0],eg=em[1];function ek(){eg(Date.now())}function ey(){eb.current&&clearTimeout(eb.current)}p=function(t,e){function n(t,e){t(function(t){return ev(t+e)})}return!!el&&(tz?n(tG,t):n(tq,e),ey(),ek(),!0)},m=(0,a.useState)(),Z=(x=(0,f.Z)(m,2))[0],O=x[1],N=(0,a.useState)(0),D=(B=(0,f.Z)(N,2))[0],A=B[1],X=(0,a.useState)(0),q=(K=(0,f.Z)(X,2))[0],F=K[1],V=(0,a.useState)(),U=(Y=(0,f.Z)(V,2))[0],Q=Y[1],J=(0,a.useRef)(),$=(0,a.useRef)(),(tt=(0,a.useRef)(null)).current={onTouchStart:function(t){var e=t.touches[0];O({x:e.screenX,y:e.screenY}),window.clearInterval(J.current)},onTouchMove:function(t){if(Z){var e=t.touches[0],n=e.screenX,a=e.screenY;O({x:n,y:a});var o=n-Z.x,c=a-Z.y;p(o,c);var r=Date.now();A(r),F(r-D),Q({x:o,y:c})}},onTouchEnd:function(){if(Z&&(O(null),Q(null),U)){var t=U.x/q,e=U.y/q;if(!(.1>Math.max(Math.abs(t),Math.abs(e)))){var n=t,a=e;J.current=window.setInterval(function(){if(.01>Math.abs(n)&&.01>Math.abs(a)){window.clearInterval(J.current);return}n*=.9046104802746175,a*=.9046104802746175,p(20*n,20*a)},20)}}},onWheel:function(t){var e=t.deltaX,n=t.deltaY,a=0,o=Math.abs(e),c=Math.abs(n);o===c?a="x"===$.current?e:n:o>c?(a=e,$.current="x"):(a=n,$.current="y"),p(-a,-a)&&t.preventDefault()}},a.useEffect(function(){function t(t){tt.current.onTouchMove(t)}function e(t){tt.current.onTouchEnd(t)}return document.addEventListener("touchmove",t,{passive:!1}),document.addEventListener("touchend",e,{passive:!0}),tO.current.addEventListener("touchstart",function(t){tt.current.onTouchStart(t)},{passive:!0}),tO.current.addEventListener("wheel",function(t){tt.current.onWheel(t)},{passive:!1}),function(){document.removeEventListener("touchmove",t),document.removeEventListener("touchend",e)}},[]),(0,a.useEffect)(function(){return ey(),eh&&(eb.current=setTimeout(function(){eg(0)},100)),ey},[eh]);var ew=(te=tz?tW:tK,tr=(tn=(0,u.Z)((0,u.Z)({},t),{},{tabs:tT})).tabs,ti=tn.tabPosition,tl=tn.rtl,["top","bottom"].includes(ti)?(ta="width",to=tl?"right":"left",tc=Math.abs(te)):(ta="height",to="top",tc=-te),(0,a.useMemo)(function(){if(!tr.length)return[0,0];for(var t=tr.length,e=t,n=0;nMath.floor(tc+ed)){e=n-1;break}}for(var o=0,c=t-1;c>=0;c-=1)if((ea.get(tr[c].key)||R)[to]e?[0,-1]:[o,e]},[ea,ed,ec,er,ei,tc,ti,tr.map(function(t){return t.key}).join("_"),tl])),ex=(0,f.Z)(ew,2),e_=ex[0],eS=ex[1],eE=(0,y.Z)(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:th,e=ea.get(t)||{width:0,height:0,left:0,right:0,top:0};if(tz){var n=tW;tg?e.righttW+ed&&(n=e.right+e.width-ed):e.left<-tW?n=-e.left:e.left+e.width>-tW+ed&&(n=-(e.left+e.width-ed)),tq(0),tG(ev(n))}else{var a=tK;e.top<-tK?a=-e.top:e.top+e.height>-tK+ed&&(a=-(e.top+e.height-ed)),tG(0),tq(ev(a))}}),eZ=(0,a.useState)(),eC=(0,f.Z)(eZ,2),eR=eC[0],eP=eC[1],eT=(0,a.useState)(!1),eI=(0,f.Z)(eT,2),eM=eI[0],eL=eI[1],eO=tT.filter(function(t){return!t.disabled}).map(function(t){return t.key}),eN=function(t){var e=eO.indexOf(eR||th),n=eO.length;eP(eO[(e+t+n)%n])},eB=function(t,e){var n=eO.indexOf(t),a=tT.find(function(e){return e.key===t});I(null==a?void 0:a.closable,null==a?void 0:a.closeIcon,ty,null==a?void 0:a.disabled)&&(e.preventDefault(),e.stopPropagation(),ty.onEdit("remove",{key:t,event:e}),n===eO.length-1?eN(-1):eN(1))},eD=function(t,e){eL(!0),1===e.button&&eB(t,e)},ez=function(t){var e=t.code,n=tg&&tz,a=eO[0],o=eO[eO.length-1];switch(e){case"ArrowLeft":tz&&eN(n?1:-1);break;case"ArrowRight":tz&&eN(n?-1:1);break;case"ArrowUp":t.preventDefault(),tz||eN(-1);break;case"ArrowDown":t.preventDefault(),tz||eN(1);break;case"Home":t.preventDefault(),eP(a);break;case"End":t.preventDefault(),eP(o);break;case"Enter":case"Space":t.preventDefault(),tE(null!=eR?eR:th,t);break;case"Backspace":case"Delete":eB(eR,t)}},ej={};tz?ej[tg?"marginRight":"marginLeft"]=t_:ej.marginTop=t_;var eH=tT.map(function(t,e){var n=t.key;return a.createElement(j,{id:tp,prefixCls:tP,key:n,tab:t,style:0===e?void 0:ej,closable:t.closable,editable:ty,active:n===th,focus:n===eR,renderWrapper:tS,removeAriaLabel:null==tw?void 0:tw.removeAriaLabel,tabCount:eO.length,currentPosition:e+1,onClick:function(t){tE(n,t)},onKeyDown:ez,onFocus:function(){eM||eP(n),eE(n),ek(),tO.current&&(tg||(tO.current.scrollLeft=0),tO.current.scrollTop=0)},onBlur:function(){eP(void 0)},onMouseDown:function(t){return eD(n,t)},onMouseUp:function(){eL(!1)}})}),eW=function(){return en(function(){var t,e=new Map,n=null===(t=tN.current)||void 0===t?void 0:t.getBoundingClientRect();return tT.forEach(function(t){var a,o=t.key,c=null===(a=tN.current)||void 0===a?void 0:a.querySelector('[data-node-key="'.concat(T(o),'"]'));if(c){var r=H(c,n),i=(0,f.Z)(r,4),l=i[0],d=i[1],s=i[2],u=i[3];e.set(o,{width:l,height:d,left:s,top:u})}}),e})};(0,a.useEffect)(function(){eW()},[tT.map(function(t){return t.key}).join("_")]);var eG=C(function(){var t=W(tI),e=W(tM),n=W(tL);tU([t[0]-e[0]-n[0],t[1]-e[1]-n[1]]);var a=W(tD);t6(a),t3(W(tB));var o=W(tN);t0([o[0]-a[0],o[1]-a[1]]),eW()}),eA=tT.slice(0,e_),eX=tT.slice(eS+1),eK=[].concat((0,g.Z)(eA),(0,g.Z)(eX)),eq=ea.get(th),eF=_({activeTabOffset:eq,horizontal:tz,indicator:tC,rtl:tg}).style;(0,a.useEffect)(function(){eE()},[th,eu,ef,P(eq),P(ea),tz]),(0,a.useEffect)(function(){eG()},[tg]);var eV=!!eK.length,eY="".concat(tP,"-nav-wrap");return tz?tg?(ts=tW>0,td=tW!==ef):(td=tW<0,ts=tW!==eu):(tu=tK<0,tf=tK!==eu),a.createElement(k.Z,{onResize:eG},a.createElement("div",{ref:(0,w.x1)(e,tI),role:"tablist","aria-orientation":tz?"horizontal":"vertical",className:l()("".concat(tP,"-nav"),tv),style:tb,onKeyDown:function(){ek()}},a.createElement(L,{ref:tM,position:"left",extra:tk,prefixCls:tP}),a.createElement(k.Z,{onResize:eG},a.createElement("div",{className:l()(eY,(0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)({},"".concat(eY,"-ping-left"),td),"".concat(eY,"-ping-right"),ts),"".concat(eY,"-ping-top"),tu),"".concat(eY,"-ping-bottom"),tf)),ref:tO},a.createElement(k.Z,{onResize:eG},a.createElement("div",{ref:tN,className:"".concat(tP,"-nav-list"),style:{transform:"translate(".concat(tW,"px, ").concat(tK,"px)"),transition:eh?"none":void 0}},eH,a.createElement(M,{ref:tD,prefixCls:tP,locale:tw,editable:ty,style:(0,u.Z)((0,u.Z)({},0===eH.length?void 0:ej),{},{visibility:eV?"hidden":null})}),a.createElement("div",{className:l()("".concat(tP,"-ink-bar"),(0,s.Z)({},"".concat(tP,"-ink-bar-animated"),tm.inkBar)),style:eF}))))),a.createElement(z,(0,d.Z)({},t,{removeAriaLabel:null==tw?void 0:tw.removeAriaLabel,ref:tB,prefixCls:tP,tabs:eK,className:!eV&&es,tabMoving:!!eh})),a.createElement(L,{ref:tL,position:"right",extra:tk,prefixCls:tP})))}),X=a.forwardRef(function(t,e){var n=t.prefixCls,o=t.className,c=t.style,r=t.id,i=t.active,d=t.tabKey,s=t.children;return a.createElement("div",{id:r&&"".concat(r,"-panel-").concat(d),role:"tabpanel",tabIndex:i?0:-1,"aria-labelledby":r&&"".concat(r,"-tab-").concat(d),"aria-hidden":!i,style:c,className:l()(n,i&&"".concat(n,"-active"),o),ref:e},s)}),K=["renderTabBar"],q=["label","key"],F=function(t){var e=t.renderTabBar,n=(0,b.Z)(t,K),o=a.useContext(h).tabs;return e?e((0,u.Z)((0,u.Z)({},n),{},{panes:o.map(function(t){var e=t.label,n=t.key,o=(0,b.Z)(t,q);return a.createElement(X,(0,d.Z)({tab:e,key:n,tabKey:n},o))})}),A):a.createElement(A,n)},V=n(66632),Y=["key","forceRender","style","className","destroyInactiveTabPane"],U=function(t){var e=t.id,n=t.activeKey,o=t.animated,c=t.tabPosition,r=t.destroyInactiveTabPane,i=a.useContext(h),f=i.prefixCls,v=i.tabs,p=o.tabPane,m="".concat(f,"-tabpane");return a.createElement("div",{className:l()("".concat(f,"-content-holder"))},a.createElement("div",{className:l()("".concat(f,"-content"),"".concat(f,"-content-").concat(c),(0,s.Z)({},"".concat(f,"-content-animated"),p))},v.map(function(t){var c=t.key,i=t.forceRender,s=t.style,f=t.className,v=t.destroyInactiveTabPane,h=(0,b.Z)(t,Y),g=c===n;return a.createElement(V.ZP,(0,d.Z)({key:c,visible:g,forceRender:i,removeOnLeave:!!(r||v),leavedClassName:"".concat(m,"-hidden")},o.tabPaneMotion),function(t,n){var o=t.style,r=t.className;return a.createElement(X,(0,d.Z)({},h,{prefixCls:m,id:e,tabKey:c,animated:p,active:g,style:(0,u.Z)((0,u.Z)({},s),o),className:l()(f,r),ref:n}))})})))};n(32559);var Q=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","more","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],J=0,$=a.forwardRef(function(t,e){var n=t.id,o=t.prefixCls,c=void 0===o?"rc-tabs":o,r=t.className,i=t.items,g=t.direction,k=t.activeKey,y=t.defaultActiveKey,w=t.editable,x=t.animated,_=t.tabPosition,S=void 0===_?"top":_,E=t.tabBarGutter,Z=t.tabBarStyle,C=t.tabBarExtraContent,R=t.locale,P=t.more,T=t.destroyInactiveTabPane,I=t.renderTabBar,M=t.onChange,L=t.onTabClick,O=t.onTabScroll,N=t.getPopupContainer,B=t.popupClassName,D=t.indicator,z=(0,b.Z)(t,Q),j=a.useMemo(function(){return(i||[]).filter(function(t){return t&&"object"===(0,v.Z)(t)&&"key"in t})},[i]),H="rtl"===g,W=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{inkBar:!0,tabPane:!1};return(t=!1===e?{inkBar:!1,tabPane:!1}:!0===e?{inkBar:!0,tabPane:!1}:(0,u.Z)({inkBar:!0},"object"===(0,v.Z)(e)?e:{})).tabPaneMotion&&void 0===t.tabPane&&(t.tabPane=!0),!t.tabPaneMotion&&t.tabPane&&(t.tabPane=!1),t}(x),G=(0,a.useState)(!1),A=(0,f.Z)(G,2),X=A[0],K=A[1];(0,a.useEffect)(function(){K((0,m.Z)())},[]);var q=(0,p.Z)(function(){var t;return null===(t=j[0])||void 0===t?void 0:t.key},{value:k,defaultValue:y}),V=(0,f.Z)(q,2),Y=V[0],$=V[1],tt=(0,a.useState)(function(){return j.findIndex(function(t){return t.key===Y})}),te=(0,f.Z)(tt,2),tn=te[0],ta=te[1];(0,a.useEffect)(function(){var t,e=j.findIndex(function(t){return t.key===Y});-1===e&&(e=Math.max(0,Math.min(tn,j.length-1)),$(null===(t=j[e])||void 0===t?void 0:t.key)),ta(e)},[j.map(function(t){return t.key}).join("_"),Y,tn]);var to=(0,p.Z)(null,{value:n}),tc=(0,f.Z)(to,2),tr=tc[0],ti=tc[1];(0,a.useEffect)(function(){n||(ti("rc-tabs-".concat(J)),J+=1)},[]);var tl={id:tr,activeKey:Y,animated:W,tabPosition:S,rtl:H,mobile:X},td=(0,u.Z)((0,u.Z)({},tl),{},{editable:w,locale:R,more:P,tabBarGutter:E,onTabClick:function(t,e){null==L||L(t,e);var n=t!==Y;$(t),n&&(null==M||M(t))},onTabScroll:O,extra:C,style:Z,panes:null,getPopupContainer:N,popupClassName:B,indicator:D});return a.createElement(h.Provider,{value:{tabs:j,prefixCls:c}},a.createElement("div",(0,d.Z)({ref:e,id:n,className:l()(c,"".concat(c,"-").concat(S),(0,s.Z)((0,s.Z)((0,s.Z)({},"".concat(c,"-mobile"),X),"".concat(c,"-editable"),w),"".concat(c,"-rtl"),H),r)},z),a.createElement(F,(0,d.Z)({},td,{renderTabBar:I})),a.createElement(U,(0,d.Z)({destroyInactiveTabPane:T},tl,{animated:W}))))}),tt=n(71744),te=n(64024),tn=n(33759),ta=n(68710);let to={motionAppear:!1,motionEnter:!0,motionLeave:!0};var tc=n(45287),tr=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n},ti=n(93463),tl=n(12918),td=n(99320),ts=n(71140),tu=n(18544),tf=t=>{let{componentCls:e,motionDurationSlow:n}=t;return[{[e]:{["".concat(e,"-switch")]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:"opacity ".concat(n)}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:"opacity ".concat(n)}}}}},[(0,tu.oN)(t,"slide-up"),(0,tu.oN)(t,"slide-down")]]};let tv=t=>{let{componentCls:e,tabsCardPadding:n,cardBg:a,cardGutter:o,colorBorderSecondary:c,itemSelectedColor:r}=t;return{["".concat(e,"-card")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{margin:0,padding:n,background:a,border:"".concat((0,ti.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(c),transition:"all ".concat(t.motionDurationSlow," ").concat(t.motionEaseInOut)},["".concat(e,"-tab-active")]:{color:r,background:t.colorBgContainer},["".concat(e,"-tab-focus:has(").concat(e,"-tab-btn:focus-visible)")]:(0,tl.oN)(t,-3),["& ".concat(e,"-tab").concat(e,"-tab-focus ").concat(e,"-tab-btn:focus-visible")]:{outline:"none"},["".concat(e,"-ink-bar")]:{visibility:"hidden"}},["&".concat(e,"-top, &").concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab + ").concat(e,"-tab")]:{marginLeft:{_skip_check_:!0,value:(0,ti.bf)(o)}}}},["&".concat(e,"-top")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:"".concat((0,ti.bf)(t.borderRadiusLG)," ").concat((0,ti.bf)(t.borderRadiusLG)," 0 0")},["".concat(e,"-tab-active")]:{borderBottomColor:t.colorBgContainer}}},["&".concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:"0 0 ".concat((0,ti.bf)(t.borderRadiusLG)," ").concat((0,ti.bf)(t.borderRadiusLG))},["".concat(e,"-tab-active")]:{borderTopColor:t.colorBgContainer}}},["&".concat(e,"-left, &").concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab + ").concat(e,"-tab")]:{marginTop:(0,ti.bf)(o)}}},["&".concat(e,"-left")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,ti.bf)(t.borderRadiusLG)," 0 0 ").concat((0,ti.bf)(t.borderRadiusLG))}},["".concat(e,"-tab-active")]:{borderRightColor:{_skip_check_:!0,value:t.colorBgContainer}}}},["&".concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,ti.bf)(t.borderRadiusLG)," ").concat((0,ti.bf)(t.borderRadiusLG)," 0")}},["".concat(e,"-tab-active")]:{borderLeftColor:{_skip_check_:!0,value:t.colorBgContainer}}}}}}},tb=t=>{let{componentCls:e,itemHoverColor:n,dropdownEdgeChildVerticalPadding:a}=t;return{["".concat(e,"-dropdown")]:Object.assign(Object.assign({},(0,tl.Wf)(t)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:t.zIndexPopup,display:"block","&-hidden":{display:"none"},["".concat(e,"-dropdown-menu")]:{maxHeight:t.tabsDropdownHeight,margin:0,padding:"".concat((0,ti.bf)(a)," 0"),overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:t.colorBgContainer,backgroundClip:"padding-box",borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,"&-item":Object.assign(Object.assign({},tl.vS),{display:"flex",alignItems:"center",minWidth:t.tabsDropdownWidth,margin:0,padding:"".concat((0,ti.bf)(t.paddingXXS)," ").concat((0,ti.bf)(t.paddingSM)),color:t.colorText,fontWeight:"normal",fontSize:t.fontSize,lineHeight:t.lineHeight,cursor:"pointer",transition:"all ".concat(t.motionDurationSlow),"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:t.marginSM},color:t.colorIcon,fontSize:t.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:t.controlItemBgHover},"&-disabled":{"&, &:hover":{color:t.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},tp=t=>{let{componentCls:e,margin:n,colorBorderSecondary:a,horizontalMargin:o,verticalItemPadding:c,verticalItemMargin:r,calc:i}=t;return{["".concat(e,"-top, ").concat(e,"-bottom")]:{flexDirection:"column",["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:"".concat((0,ti.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(a),content:"''"},["".concat(e,"-ink-bar")]:{height:t.lineWidthBold,"&-animated":{transition:"width ".concat(t.motionDurationSlow,", left ").concat(t.motionDurationSlow,",\n right ").concat(t.motionDurationSlow)}},["".concat(e,"-nav-wrap")]:{"&::before, &::after":{top:0,bottom:0,width:t.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:t.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:t.boxShadowTabsOverflowRight},["&".concat(e,"-nav-wrap-ping-left::before")]:{opacity:1},["&".concat(e,"-nav-wrap-ping-right::after")]:{opacity:1}}}},["".concat(e,"-top")]:{["> ".concat(e,"-nav,\n > div > ").concat(e,"-nav")]:{"&::before":{bottom:0},["".concat(e,"-ink-bar")]:{bottom:0}}},["".concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},["".concat(e,"-ink-bar")]:{top:0}},["> ".concat(e,"-content-holder, > div > ").concat(e,"-content-holder")]:{order:0}},["".concat(e,"-left, ").concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{flexDirection:"column",minWidth:i(t.controlHeight).mul(1.25).equal(),["".concat(e,"-tab")]:{padding:c,textAlign:"center"},["".concat(e,"-tab + ").concat(e,"-tab")]:{margin:r},["".concat(e,"-nav-wrap")]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:t.controlHeight},"&::before":{top:0,boxShadow:t.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:t.boxShadowTabsOverflowBottom},["&".concat(e,"-nav-wrap-ping-top::before")]:{opacity:1},["&".concat(e,"-nav-wrap-ping-bottom::after")]:{opacity:1}},["".concat(e,"-ink-bar")]:{width:t.lineWidthBold,"&-animated":{transition:"height ".concat(t.motionDurationSlow,", top ").concat(t.motionDurationSlow)}},["".concat(e,"-nav-list, ").concat(e,"-nav-operations")]:{flex:"1 0 auto",flexDirection:"column"}}},["".concat(e,"-left")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-ink-bar")]:{right:{_skip_check_:!0,value:0}}},["> ".concat(e,"-content-holder, > div > ").concat(e,"-content-holder")]:{marginLeft:{_skip_check_:!0,value:(0,ti.bf)(i(t.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:"".concat((0,ti.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorder)},["> ".concat(e,"-content > ").concat(e,"-tabpane")]:{paddingLeft:{_skip_check_:!0,value:t.paddingLG}}}},["".concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{order:1,["".concat(e,"-ink-bar")]:{left:{_skip_check_:!0,value:0}}},["> ".concat(e,"-content-holder, > div > ").concat(e,"-content-holder")]:{order:0,marginRight:{_skip_check_:!0,value:i(t.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:"".concat((0,ti.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorder)},["> ".concat(e,"-content > ").concat(e,"-tabpane")]:{paddingRight:{_skip_check_:!0,value:t.paddingLG}}}}}},tm=t=>{let{componentCls:e,cardPaddingSM:n,cardPaddingLG:a,cardHeightSM:o,cardHeightLG:c,horizontalItemPaddingSM:r,horizontalItemPaddingLG:i}=t;return{[e]:{"&-small":{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:r,fontSize:t.titleFontSizeSM}}},"&-large":{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:i,fontSize:t.titleFontSizeLG,lineHeight:t.lineHeightLG}}}},["".concat(e,"-card")]:{["&".concat(e,"-small")]:{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:n},["".concat(e,"-nav-add")]:{minWidth:o,minHeight:o}},["&".concat(e,"-bottom")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:"0 0 ".concat((0,ti.bf)(t.borderRadius)," ").concat((0,ti.bf)(t.borderRadius))}},["&".concat(e,"-top")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:"".concat((0,ti.bf)(t.borderRadius)," ").concat((0,ti.bf)(t.borderRadius)," 0 0")}},["&".concat(e,"-right")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,ti.bf)(t.borderRadius)," ").concat((0,ti.bf)(t.borderRadius)," 0")}}},["&".concat(e,"-left")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,ti.bf)(t.borderRadius)," 0 0 ").concat((0,ti.bf)(t.borderRadius))}}}},["&".concat(e,"-large")]:{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:a},["".concat(e,"-nav-add")]:{minWidth:c,minHeight:c}}}}}},th=t=>{let{componentCls:e,itemActiveColor:n,itemHoverColor:a,iconCls:o,tabsHorizontalItemMargin:c,horizontalItemPadding:r,itemSelectedColor:i,itemColor:l}=t,d="".concat(e,"-tab");return{[d]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:r,fontSize:t.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:l,"&-btn, &-remove":{"&:focus:not(:focus-visible), &:active":{color:n}},"&-btn":{outline:"none",transition:"all ".concat(t.motionDurationSlow),["".concat(d,"-icon:not(:last-child)")]:{marginInlineEnd:t.marginSM}},"&-remove":Object.assign({flex:"none",lineHeight:1,marginRight:{_skip_check_:!0,value:t.calc(t.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:t.marginXS},color:t.colorIcon,fontSize:t.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:"all ".concat(t.motionDurationSlow),"&:hover":{color:t.colorTextHeading}},(0,tl.Qy)(t)),"&:hover":{color:a},["&".concat(d,"-active ").concat(d,"-btn")]:{color:i,textShadow:t.tabsActiveTextShadow},["&".concat(d,"-focus ").concat(d,"-btn:focus-visible")]:(0,tl.oN)(t),["&".concat(d,"-disabled")]:{color:t.colorTextDisabled,cursor:"not-allowed"},["&".concat(d,"-disabled ").concat(d,"-btn, &").concat(d,"-disabled ").concat(e,"-remove")]:{"&:focus, &:active":{color:t.colorTextDisabled}},["& ".concat(d,"-remove ").concat(o)]:{margin:0,verticalAlign:"middle"},["".concat(o,":not(:last-child)")]:{marginRight:{_skip_check_:!0,value:t.marginSM}}},["".concat(d," + ").concat(d)]:{margin:{_skip_check_:!0,value:c}}}},tg=t=>{let{componentCls:e,tabsHorizontalItemMarginRTL:n,iconCls:a,cardGutter:o,calc:c}=t;return{["".concat(e,"-rtl")]:{direction:"rtl",["".concat(e,"-nav")]:{["".concat(e,"-tab")]:{margin:{_skip_check_:!0,value:n},["".concat(e,"-tab:last-of-type")]:{marginLeft:{_skip_check_:!0,value:0}},[a]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:(0,ti.bf)(t.marginSM)}},["".concat(e,"-tab-remove")]:{marginRight:{_skip_check_:!0,value:(0,ti.bf)(t.marginXS)},marginLeft:{_skip_check_:!0,value:(0,ti.bf)(c(t.marginXXS).mul(-1).equal())},[a]:{margin:0}}}},["&".concat(e,"-left")]:{["> ".concat(e,"-nav")]:{order:1},["> ".concat(e,"-content-holder")]:{order:0}},["&".concat(e,"-right")]:{["> ".concat(e,"-nav")]:{order:0},["> ".concat(e,"-content-holder")]:{order:1}},["&".concat(e,"-card").concat(e,"-top, &").concat(e,"-card").concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab + ").concat(e,"-tab")]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},["".concat(e,"-dropdown-rtl")]:{direction:"rtl"},["".concat(e,"-menu-item")]:{["".concat(e,"-dropdown-rtl")]:{textAlign:{_skip_check_:!0,value:"right"}}}}},tk=t=>{let{componentCls:e,tabsCardPadding:n,cardHeight:a,cardGutter:o,itemHoverColor:c,itemActiveColor:r,colorBorderSecondary:i}=t;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,tl.Wf)(t)),{display:"flex",["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{position:"relative",display:"flex",flex:"none",alignItems:"center",["".concat(e,"-nav-wrap")]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:"opacity ".concat(t.motionDurationSlow),content:"''",pointerEvents:"none"}},["".concat(e,"-nav-list")]:{position:"relative",display:"flex",transition:"opacity ".concat(t.motionDurationSlow)},["".concat(e,"-nav-operations")]:{display:"flex",alignSelf:"stretch"},["".concat(e,"-nav-operations-hidden")]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},["".concat(e,"-nav-more")]:{position:"relative",padding:n,background:"transparent",border:0,color:t.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:t.calc(t.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},["".concat(e,"-nav-add")]:Object.assign({minWidth:a,minHeight:a,marginLeft:{_skip_check_:!0,value:o},background:"transparent",border:"".concat((0,ti.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(i),borderRadius:"".concat((0,ti.bf)(t.borderRadiusLG)," ").concat((0,ti.bf)(t.borderRadiusLG)," 0 0"),outline:"none",cursor:"pointer",color:t.colorText,transition:"all ".concat(t.motionDurationSlow," ").concat(t.motionEaseInOut),"&:hover":{color:c},"&:active, &:focus:not(:focus-visible)":{color:r}},(0,tl.Qy)(t,-3))},["".concat(e,"-extra-content")]:{flex:"none"},["".concat(e,"-ink-bar")]:{position:"absolute",background:t.inkBarColor,pointerEvents:"none"}}),th(t)),{["".concat(e,"-content")]:{position:"relative",width:"100%"},["".concat(e,"-content-holder")]:{flex:"auto",minWidth:0,minHeight:0},["".concat(e,"-tabpane")]:Object.assign(Object.assign({},(0,tl.Qy)(t)),{"&-hidden":{display:"none"}})}),["".concat(e,"-centered")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-nav-wrap")]:{["&:not([class*='".concat(e,"-nav-wrap-ping']) > ").concat(e,"-nav-list")]:{margin:"auto"}}}}}};var ty=(0,td.I$)("Tabs",t=>{let e=(0,ts.IX)(t,{tabsCardPadding:t.cardPadding,dropdownEdgeChildVerticalPadding:t.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:"0 0 0 ".concat((0,ti.bf)(t.horizontalItemGutter)),tabsHorizontalItemMarginRTL:"0 0 0 ".concat((0,ti.bf)(t.horizontalItemGutter))});return[tm(e),tg(e),tp(e),tb(e),tv(e),tk(e),tf(e)]},t=>{let{cardHeight:e,cardHeightSM:n,cardHeightLG:a,controlHeight:o,controlHeightLG:c}=t,r=e||c,i=n||o,l=a||c+8;return{zIndexPopup:t.zIndexPopupBase+50,cardBg:t.colorFillAlter,cardHeight:r,cardHeightSM:i,cardHeightLG:l,cardPadding:"".concat((r-t.fontHeight)/2-t.lineWidth,"px ").concat(t.padding,"px"),cardPaddingSM:"".concat((i-t.fontHeight)/2-t.lineWidth,"px ").concat(t.paddingXS,"px"),cardPaddingLG:"".concat((l-t.fontHeightLG)/2-t.lineWidth,"px ").concat(t.padding,"px"),titleFontSize:t.fontSize,titleFontSizeLG:t.fontSizeLG,titleFontSizeSM:t.fontSize,inkBarColor:t.colorPrimary,horizontalMargin:"0 0 ".concat(t.margin,"px 0"),horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:"".concat(t.paddingSM,"px 0"),horizontalItemPaddingSM:"".concat(t.paddingXS,"px 0"),horizontalItemPaddingLG:"".concat(t.padding,"px 0"),verticalItemPadding:"".concat(t.paddingXS,"px ").concat(t.paddingLG,"px"),verticalItemMargin:"".concat(t.margin,"px 0 0 0"),itemColor:t.colorText,itemSelectedColor:t.colorPrimary,itemHoverColor:t.colorPrimaryHover,itemActiveColor:t.colorPrimaryActive,cardGutter:t.marginXXS/2}}),tw=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n};let tx=a.forwardRef((t,e)=>{var n,i,d,s,u,f,v,b,p,m,h;let g;let{type:k,className:y,rootClassName:w,size:x,onEdit:_,hideAdd:S,centered:E,addIcon:Z,removeIcon:C,moreIcon:R,more:P,popupClassName:T,children:I,items:M,animated:L,style:O,indicatorSize:N,indicator:B,destroyInactiveTabPane:D,destroyOnHidden:z}=t,j=tw(t,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","removeIcon","moreIcon","more","popupClassName","children","items","animated","style","indicatorSize","indicator","destroyInactiveTabPane","destroyOnHidden"]),{prefixCls:H}=j,{direction:W,tabs:G,getPrefixCls:A,getPopupContainer:X}=a.useContext(tt.E_),K=A("tabs",H),q=(0,te.Z)(K),[F,V,Y]=ty(K,q),U=a.useRef(null);a.useImperativeHandle(e,()=>({nativeElement:U.current})),"editable-card"===k&&(g={onEdit:(t,e)=>{let{key:n,event:a}=e;null==_||_("add"===t?a:n,t)},removeIcon:null!==(n=null!=C?C:null==G?void 0:G.removeIcon)&&void 0!==n?n:a.createElement(o.Z,null),addIcon:(null!=Z?Z:null==G?void 0:G.addIcon)||a.createElement(r.Z,null),showAdd:!0!==S});let Q=A(),J=(0,tn.Z)(x),ti=M?M.map(t=>{var e;let n=null!==(e=t.destroyOnHidden)&&void 0!==e?e:t.destroyInactiveTabPane;return Object.assign(Object.assign({},t),{destroyInactiveTabPane:n})}):(0,tc.Z)(I).map(t=>{if(a.isValidElement(t)){let{key:e,props:n}=t,a=n||{},{tab:o}=a,c=tr(a,["tab"]);return Object.assign(Object.assign({key:String(e)},c),{label:o})}return null}).filter(t=>t),tl=function(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{inkBar:!0,tabPane:!1};return(e=!1===n?{inkBar:!1,tabPane:!1}:!0===n?{inkBar:!0,tabPane:!0}:Object.assign({inkBar:!0},"object"==typeof n?n:{})).tabPane&&(e.tabPaneMotion=Object.assign(Object.assign({},to),{motionName:(0,ta.m)(t,"switch")})),e}(K,L),td=Object.assign(Object.assign({},null==G?void 0:G.style),O),ts={align:null!==(i=null==B?void 0:B.align)&&void 0!==i?i:null===(d=null==G?void 0:G.indicator)||void 0===d?void 0:d.align,size:null!==(v=null!==(u=null!==(s=null==B?void 0:B.size)&&void 0!==s?s:N)&&void 0!==u?u:null===(f=null==G?void 0:G.indicator)||void 0===f?void 0:f.size)&&void 0!==v?v:null==G?void 0:G.indicatorSize};return F(a.createElement($,Object.assign({ref:U,direction:W,getPopupContainer:X},j,{items:ti,className:l()({["".concat(K,"-").concat(J)]:J,["".concat(K,"-card")]:["card","editable-card"].includes(k),["".concat(K,"-editable-card")]:"editable-card"===k,["".concat(K,"-centered")]:E},null==G?void 0:G.className,y,w,V,Y,q),popupClassName:l()(T,V,Y,q),style:td,editable:g,more:Object.assign({icon:null!==(h=null!==(m=null!==(p=null===(b=null==G?void 0:G.more)||void 0===b?void 0:b.icon)&&void 0!==p?p:null==G?void 0:G.moreIcon)&&void 0!==m?m:R)&&void 0!==h?h:a.createElement(c.Z,null),transitionName:"".concat(Q,"-slide-up")},P),prefixCls:K,animated:tl,indicator:ts,destroyInactiveTabPane:null!=z?z:D})))});tx.TabPane=()=>null;var t_=tx}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5869],{96473:function(t,e,n){n.d(e,{Z:function(){return i}});var a=n(1119),o=n(2265),c={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"},r=n(55015),i=o.forwardRef(function(t,e){return o.createElement(r.Z,(0,a.Z)({},t,{ref:e,icon:c}))})},65869:function(t,e,n){n.d(e,{default:function(){return t_}});var a=n(2265),o=n(49638),c=n(60440),r=n(96473),i=n(36760),l=n.n(i),d=n(1119),s=n(11993),u=n(31686),f=n(26365),v=n(41154),b=n(6989),p=n(50506),m=n(79267),h=(0,a.createContext)(null),g=n(83145),k=n(31474),y=n(58525),w=n(28791),x=n(53346),_=function(t){var e=t.activeTabOffset,n=t.horizontal,o=t.rtl,c=t.indicator,r=void 0===c?{}:c,i=r.size,l=r.align,d=void 0===l?"center":l,s=(0,a.useState)(),u=(0,f.Z)(s,2),v=u[0],b=u[1],p=(0,a.useRef)(),m=a.useCallback(function(t){return"function"==typeof i?i(t):"number"==typeof i?i:t},[i]);function h(){x.Z.cancel(p.current)}return(0,a.useEffect)(function(){var t={};if(e){if(n){t.width=m(e.width);var a=o?"right":"left";"start"===d&&(t[a]=e[a]),"center"===d&&(t[a]=e[a]+e.width/2,t.transform=o?"translateX(50%)":"translateX(-50%)"),"end"===d&&(t[a]=e[a]+e.width,t.transform="translateX(-100%)")}else t.height=m(e.height),"start"===d&&(t.top=e.top),"center"===d&&(t.top=e.top+e.height/2,t.transform="translateY(-50%)"),"end"===d&&(t.top=e.top+e.height,t.transform="translateY(-100%)")}return h(),p.current=(0,x.Z)(function(){v&&t&&Object.keys(t).every(function(e){var n=t[e],a=v[e];return"number"==typeof n&&"number"==typeof a?Math.round(n)===Math.round(a):n===a})||b(t)}),h},[JSON.stringify(e),n,o,d,m]),{style:v}},S={width:0,height:0,left:0,top:0};function E(t,e){var n=a.useRef(t),o=a.useState({}),c=(0,f.Z)(o,2)[1];return[n.current,function(t){var a="function"==typeof t?t(n.current):t;a!==n.current&&e(a,n.current),n.current=a,c({})}]}var Z=n(27380);function C(t){var e=(0,a.useState)(0),n=(0,f.Z)(e,2),o=n[0],c=n[1],r=(0,a.useRef)(0),i=(0,a.useRef)();return i.current=t,(0,Z.o)(function(){var t;null===(t=i.current)||void 0===t||t.call(i)},[o]),function(){r.current===o&&(r.current+=1,c(r.current))}}var R={width:0,height:0,left:0,top:0,right:0};function P(t){var e;return t instanceof Map?(e={},t.forEach(function(t,n){e[n]=t})):e=t,JSON.stringify(e)}function T(t){return String(t).replace(/"/g,"TABS_DQ")}function I(t,e,n,a){return!!n&&!a&&!1!==t&&(void 0!==t||!1!==e&&null!==e)}var M=a.forwardRef(function(t,e){var n=t.prefixCls,o=t.editable,c=t.locale,r=t.style;return o&&!1!==o.showAdd?a.createElement("button",{ref:e,type:"button",className:"".concat(n,"-nav-add"),style:r,"aria-label":(null==c?void 0:c.addAriaLabel)||"Add tab",onClick:function(t){o.onEdit("add",{event:t})}},o.addIcon||"+"):null}),L=a.forwardRef(function(t,e){var n,o=t.position,c=t.prefixCls,r=t.extra;if(!r)return null;var i={};return"object"!==(0,v.Z)(r)||a.isValidElement(r)?i.right=r:i=r,"right"===o&&(n=i.right),"left"===o&&(n=i.left),n?a.createElement("div",{className:"".concat(c,"-extra-content"),ref:e},n):null}),O=n(71030),N=n(33082),B=n(95814),D=a.forwardRef(function(t,e){var n=t.prefixCls,o=t.id,c=t.tabs,r=t.locale,i=t.mobile,u=t.more,v=void 0===u?{}:u,b=t.style,p=t.className,m=t.editable,h=t.tabBarGutter,g=t.rtl,k=t.removeAriaLabel,y=t.onTabClick,w=t.getPopupContainer,x=t.popupClassName,_=(0,a.useState)(!1),S=(0,f.Z)(_,2),E=S[0],Z=S[1],C=(0,a.useState)(null),R=(0,f.Z)(C,2),P=R[0],T=R[1],L=v.icon,D="".concat(o,"-more-popup"),z="".concat(n,"-dropdown"),j=null!==P?"".concat(D,"-").concat(P):null,H=null==r?void 0:r.dropdownAriaLabel,W=a.createElement(N.ZP,{onClick:function(t){y(t.key,t.domEvent),Z(!1)},prefixCls:"".concat(z,"-menu"),id:D,tabIndex:-1,role:"listbox","aria-activedescendant":j,selectedKeys:[P],"aria-label":void 0!==H?H:"expanded dropdown"},c.map(function(t){var e=t.closable,n=t.disabled,c=t.closeIcon,r=t.key,i=t.label,l=I(e,c,m,n);return a.createElement(N.sN,{key:r,id:"".concat(D,"-").concat(r),role:"option","aria-controls":o&&"".concat(o,"-panel-").concat(r),disabled:n},a.createElement("span",null,i),l&&a.createElement("button",{type:"button","aria-label":k||"remove",tabIndex:0,className:"".concat(z,"-menu-item-remove"),onClick:function(t){t.stopPropagation(),t.preventDefault(),t.stopPropagation(),m.onEdit("remove",{key:r,event:t})}},c||m.removeIcon||"\xd7"))}));function G(t){for(var e=c.filter(function(t){return!t.disabled}),n=e.findIndex(function(t){return t.key===P})||0,a=e.length,o=0;oMath.abs(i-n)?[i,l,d-e.left,s-e.top]:[n,a,c,o]},W=function(t){var e=t.current||{},n=e.offsetWidth,a=void 0===n?0:n,o=e.offsetHeight;if(t.current){var c=t.current.getBoundingClientRect(),r=c.width,i=c.height;if(1>Math.abs(r-a))return[r,i]}return[a,void 0===o?0:o]},G=function(t,e){return t[e?0:1]},A=a.forwardRef(function(t,e){var n,o,c,r,i,v,b,p,m,x,Z,O,N,B,D,A,X,K,q,F,V,Y,U,Q,J,$,tt,te,tn,ta,to,tc,tr,ti,tl,td,ts,tu,tf,tv=t.className,tb=t.style,tp=t.id,tm=t.animated,th=t.activeKey,tg=t.rtl,tk=t.extra,ty=t.editable,tw=t.locale,tx=t.tabPosition,t_=t.tabBarGutter,tS=t.children,tE=t.onTabClick,tZ=t.onTabScroll,tC=t.indicator,tR=a.useContext(h),tP=tR.prefixCls,tT=tR.tabs,tI=(0,a.useRef)(null),tM=(0,a.useRef)(null),tL=(0,a.useRef)(null),tO=(0,a.useRef)(null),tN=(0,a.useRef)(null),tB=(0,a.useRef)(null),tD=(0,a.useRef)(null),tz="top"===tx||"bottom"===tx,tj=E(0,function(t,e){tz&&tZ&&tZ({direction:t>e?"left":"right"})}),tH=(0,f.Z)(tj,2),tW=tH[0],tG=tH[1],tA=E(0,function(t,e){!tz&&tZ&&tZ({direction:t>e?"top":"bottom"})}),tX=(0,f.Z)(tA,2),tK=tX[0],tq=tX[1],tF=(0,a.useState)([0,0]),tV=(0,f.Z)(tF,2),tY=tV[0],tU=tV[1],tQ=(0,a.useState)([0,0]),tJ=(0,f.Z)(tQ,2),t$=tJ[0],t0=tJ[1],t1=(0,a.useState)([0,0]),t2=(0,f.Z)(t1,2),t8=t2[0],t6=t2[1],t4=(0,a.useState)([0,0]),t9=(0,f.Z)(t4,2),t5=t9[0],t3=t9[1],t7=(n=new Map,o=(0,a.useRef)([]),c=(0,a.useState)({}),r=(0,f.Z)(c,2)[1],i=(0,a.useRef)("function"==typeof n?n():n),v=C(function(){var t=i.current;o.current.forEach(function(e){t=e(t)}),o.current=[],i.current=t,r({})}),[i.current,function(t){o.current.push(t),v()}]),et=(0,f.Z)(t7,2),ee=et[0],en=et[1],ea=(b=t$[0],(0,a.useMemo)(function(){for(var t=new Map,e=ee.get(null===(o=tT[0])||void 0===o?void 0:o.key)||S,n=e.left+e.width,a=0;aef?ef:t}tz&&tg?(eu=0,ef=Math.max(0,ec-ed)):(eu=Math.min(0,ed-ec),ef=0);var eb=(0,a.useRef)(null),ep=(0,a.useState)(),em=(0,f.Z)(ep,2),eh=em[0],eg=em[1];function ek(){eg(Date.now())}function ey(){eb.current&&clearTimeout(eb.current)}p=function(t,e){function n(t,e){t(function(t){return ev(t+e)})}return!!el&&(tz?n(tG,t):n(tq,e),ey(),ek(),!0)},m=(0,a.useState)(),Z=(x=(0,f.Z)(m,2))[0],O=x[1],N=(0,a.useState)(0),D=(B=(0,f.Z)(N,2))[0],A=B[1],X=(0,a.useState)(0),q=(K=(0,f.Z)(X,2))[0],F=K[1],V=(0,a.useState)(),U=(Y=(0,f.Z)(V,2))[0],Q=Y[1],J=(0,a.useRef)(),$=(0,a.useRef)(),(tt=(0,a.useRef)(null)).current={onTouchStart:function(t){var e=t.touches[0];O({x:e.screenX,y:e.screenY}),window.clearInterval(J.current)},onTouchMove:function(t){if(Z){var e=t.touches[0],n=e.screenX,a=e.screenY;O({x:n,y:a});var o=n-Z.x,c=a-Z.y;p(o,c);var r=Date.now();A(r),F(r-D),Q({x:o,y:c})}},onTouchEnd:function(){if(Z&&(O(null),Q(null),U)){var t=U.x/q,e=U.y/q;if(!(.1>Math.max(Math.abs(t),Math.abs(e)))){var n=t,a=e;J.current=window.setInterval(function(){if(.01>Math.abs(n)&&.01>Math.abs(a)){window.clearInterval(J.current);return}n*=.9046104802746175,a*=.9046104802746175,p(20*n,20*a)},20)}}},onWheel:function(t){var e=t.deltaX,n=t.deltaY,a=0,o=Math.abs(e),c=Math.abs(n);o===c?a="x"===$.current?e:n:o>c?(a=e,$.current="x"):(a=n,$.current="y"),p(-a,-a)&&t.preventDefault()}},a.useEffect(function(){function t(t){tt.current.onTouchMove(t)}function e(t){tt.current.onTouchEnd(t)}return document.addEventListener("touchmove",t,{passive:!1}),document.addEventListener("touchend",e,{passive:!0}),tO.current.addEventListener("touchstart",function(t){tt.current.onTouchStart(t)},{passive:!0}),tO.current.addEventListener("wheel",function(t){tt.current.onWheel(t)},{passive:!1}),function(){document.removeEventListener("touchmove",t),document.removeEventListener("touchend",e)}},[]),(0,a.useEffect)(function(){return ey(),eh&&(eb.current=setTimeout(function(){eg(0)},100)),ey},[eh]);var ew=(te=tz?tW:tK,tr=(tn=(0,u.Z)((0,u.Z)({},t),{},{tabs:tT})).tabs,ti=tn.tabPosition,tl=tn.rtl,["top","bottom"].includes(ti)?(ta="width",to=tl?"right":"left",tc=Math.abs(te)):(ta="height",to="top",tc=-te),(0,a.useMemo)(function(){if(!tr.length)return[0,0];for(var t=tr.length,e=t,n=0;nMath.floor(tc+ed)){e=n-1;break}}for(var o=0,c=t-1;c>=0;c-=1)if((ea.get(tr[c].key)||R)[to]e?[0,-1]:[o,e]},[ea,ed,ec,er,ei,tc,ti,tr.map(function(t){return t.key}).join("_"),tl])),ex=(0,f.Z)(ew,2),e_=ex[0],eS=ex[1],eE=(0,y.Z)(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:th,e=ea.get(t)||{width:0,height:0,left:0,right:0,top:0};if(tz){var n=tW;tg?e.righttW+ed&&(n=e.right+e.width-ed):e.left<-tW?n=-e.left:e.left+e.width>-tW+ed&&(n=-(e.left+e.width-ed)),tq(0),tG(ev(n))}else{var a=tK;e.top<-tK?a=-e.top:e.top+e.height>-tK+ed&&(a=-(e.top+e.height-ed)),tG(0),tq(ev(a))}}),eZ=(0,a.useState)(),eC=(0,f.Z)(eZ,2),eR=eC[0],eP=eC[1],eT=(0,a.useState)(!1),eI=(0,f.Z)(eT,2),eM=eI[0],eL=eI[1],eO=tT.filter(function(t){return!t.disabled}).map(function(t){return t.key}),eN=function(t){var e=eO.indexOf(eR||th),n=eO.length;eP(eO[(e+t+n)%n])},eB=function(t,e){var n=eO.indexOf(t),a=tT.find(function(e){return e.key===t});I(null==a?void 0:a.closable,null==a?void 0:a.closeIcon,ty,null==a?void 0:a.disabled)&&(e.preventDefault(),e.stopPropagation(),ty.onEdit("remove",{key:t,event:e}),n===eO.length-1?eN(-1):eN(1))},eD=function(t,e){eL(!0),1===e.button&&eB(t,e)},ez=function(t){var e=t.code,n=tg&&tz,a=eO[0],o=eO[eO.length-1];switch(e){case"ArrowLeft":tz&&eN(n?1:-1);break;case"ArrowRight":tz&&eN(n?-1:1);break;case"ArrowUp":t.preventDefault(),tz||eN(-1);break;case"ArrowDown":t.preventDefault(),tz||eN(1);break;case"Home":t.preventDefault(),eP(a);break;case"End":t.preventDefault(),eP(o);break;case"Enter":case"Space":t.preventDefault(),tE(null!=eR?eR:th,t);break;case"Backspace":case"Delete":eB(eR,t)}},ej={};tz?ej[tg?"marginRight":"marginLeft"]=t_:ej.marginTop=t_;var eH=tT.map(function(t,e){var n=t.key;return a.createElement(j,{id:tp,prefixCls:tP,key:n,tab:t,style:0===e?void 0:ej,closable:t.closable,editable:ty,active:n===th,focus:n===eR,renderWrapper:tS,removeAriaLabel:null==tw?void 0:tw.removeAriaLabel,tabCount:eO.length,currentPosition:e+1,onClick:function(t){tE(n,t)},onKeyDown:ez,onFocus:function(){eM||eP(n),eE(n),ek(),tO.current&&(tg||(tO.current.scrollLeft=0),tO.current.scrollTop=0)},onBlur:function(){eP(void 0)},onMouseDown:function(t){return eD(n,t)},onMouseUp:function(){eL(!1)}})}),eW=function(){return en(function(){var t,e=new Map,n=null===(t=tN.current)||void 0===t?void 0:t.getBoundingClientRect();return tT.forEach(function(t){var a,o=t.key,c=null===(a=tN.current)||void 0===a?void 0:a.querySelector('[data-node-key="'.concat(T(o),'"]'));if(c){var r=H(c,n),i=(0,f.Z)(r,4),l=i[0],d=i[1],s=i[2],u=i[3];e.set(o,{width:l,height:d,left:s,top:u})}}),e})};(0,a.useEffect)(function(){eW()},[tT.map(function(t){return t.key}).join("_")]);var eG=C(function(){var t=W(tI),e=W(tM),n=W(tL);tU([t[0]-e[0]-n[0],t[1]-e[1]-n[1]]);var a=W(tD);t6(a),t3(W(tB));var o=W(tN);t0([o[0]-a[0],o[1]-a[1]]),eW()}),eA=tT.slice(0,e_),eX=tT.slice(eS+1),eK=[].concat((0,g.Z)(eA),(0,g.Z)(eX)),eq=ea.get(th),eF=_({activeTabOffset:eq,horizontal:tz,indicator:tC,rtl:tg}).style;(0,a.useEffect)(function(){eE()},[th,eu,ef,P(eq),P(ea),tz]),(0,a.useEffect)(function(){eG()},[tg]);var eV=!!eK.length,eY="".concat(tP,"-nav-wrap");return tz?tg?(ts=tW>0,td=tW!==ef):(td=tW<0,ts=tW!==eu):(tu=tK<0,tf=tK!==eu),a.createElement(k.Z,{onResize:eG},a.createElement("div",{ref:(0,w.x1)(e,tI),role:"tablist","aria-orientation":tz?"horizontal":"vertical",className:l()("".concat(tP,"-nav"),tv),style:tb,onKeyDown:function(){ek()}},a.createElement(L,{ref:tM,position:"left",extra:tk,prefixCls:tP}),a.createElement(k.Z,{onResize:eG},a.createElement("div",{className:l()(eY,(0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)({},"".concat(eY,"-ping-left"),td),"".concat(eY,"-ping-right"),ts),"".concat(eY,"-ping-top"),tu),"".concat(eY,"-ping-bottom"),tf)),ref:tO},a.createElement(k.Z,{onResize:eG},a.createElement("div",{ref:tN,className:"".concat(tP,"-nav-list"),style:{transform:"translate(".concat(tW,"px, ").concat(tK,"px)"),transition:eh?"none":void 0}},eH,a.createElement(M,{ref:tD,prefixCls:tP,locale:tw,editable:ty,style:(0,u.Z)((0,u.Z)({},0===eH.length?void 0:ej),{},{visibility:eV?"hidden":null})}),a.createElement("div",{className:l()("".concat(tP,"-ink-bar"),(0,s.Z)({},"".concat(tP,"-ink-bar-animated"),tm.inkBar)),style:eF}))))),a.createElement(z,(0,d.Z)({},t,{removeAriaLabel:null==tw?void 0:tw.removeAriaLabel,ref:tB,prefixCls:tP,tabs:eK,className:!eV&&es,tabMoving:!!eh})),a.createElement(L,{ref:tL,position:"right",extra:tk,prefixCls:tP})))}),X=a.forwardRef(function(t,e){var n=t.prefixCls,o=t.className,c=t.style,r=t.id,i=t.active,d=t.tabKey,s=t.children;return a.createElement("div",{id:r&&"".concat(r,"-panel-").concat(d),role:"tabpanel",tabIndex:i?0:-1,"aria-labelledby":r&&"".concat(r,"-tab-").concat(d),"aria-hidden":!i,style:c,className:l()(n,i&&"".concat(n,"-active"),o),ref:e},s)}),K=["renderTabBar"],q=["label","key"],F=function(t){var e=t.renderTabBar,n=(0,b.Z)(t,K),o=a.useContext(h).tabs;return e?e((0,u.Z)((0,u.Z)({},n),{},{panes:o.map(function(t){var e=t.label,n=t.key,o=(0,b.Z)(t,q);return a.createElement(X,(0,d.Z)({tab:e,key:n,tabKey:n},o))})}),A):a.createElement(A,n)},V=n(66632),Y=["key","forceRender","style","className","destroyInactiveTabPane"],U=function(t){var e=t.id,n=t.activeKey,o=t.animated,c=t.tabPosition,r=t.destroyInactiveTabPane,i=a.useContext(h),f=i.prefixCls,v=i.tabs,p=o.tabPane,m="".concat(f,"-tabpane");return a.createElement("div",{className:l()("".concat(f,"-content-holder"))},a.createElement("div",{className:l()("".concat(f,"-content"),"".concat(f,"-content-").concat(c),(0,s.Z)({},"".concat(f,"-content-animated"),p))},v.map(function(t){var c=t.key,i=t.forceRender,s=t.style,f=t.className,v=t.destroyInactiveTabPane,h=(0,b.Z)(t,Y),g=c===n;return a.createElement(V.ZP,(0,d.Z)({key:c,visible:g,forceRender:i,removeOnLeave:!!(r||v),leavedClassName:"".concat(m,"-hidden")},o.tabPaneMotion),function(t,n){var o=t.style,r=t.className;return a.createElement(X,(0,d.Z)({},h,{prefixCls:m,id:e,tabKey:c,animated:p,active:g,style:(0,u.Z)((0,u.Z)({},s),o),className:l()(f,r),ref:n}))})})))};n(32559);var Q=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","more","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],J=0,$=a.forwardRef(function(t,e){var n=t.id,o=t.prefixCls,c=void 0===o?"rc-tabs":o,r=t.className,i=t.items,g=t.direction,k=t.activeKey,y=t.defaultActiveKey,w=t.editable,x=t.animated,_=t.tabPosition,S=void 0===_?"top":_,E=t.tabBarGutter,Z=t.tabBarStyle,C=t.tabBarExtraContent,R=t.locale,P=t.more,T=t.destroyInactiveTabPane,I=t.renderTabBar,M=t.onChange,L=t.onTabClick,O=t.onTabScroll,N=t.getPopupContainer,B=t.popupClassName,D=t.indicator,z=(0,b.Z)(t,Q),j=a.useMemo(function(){return(i||[]).filter(function(t){return t&&"object"===(0,v.Z)(t)&&"key"in t})},[i]),H="rtl"===g,W=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{inkBar:!0,tabPane:!1};return(t=!1===e?{inkBar:!1,tabPane:!1}:!0===e?{inkBar:!0,tabPane:!1}:(0,u.Z)({inkBar:!0},"object"===(0,v.Z)(e)?e:{})).tabPaneMotion&&void 0===t.tabPane&&(t.tabPane=!0),!t.tabPaneMotion&&t.tabPane&&(t.tabPane=!1),t}(x),G=(0,a.useState)(!1),A=(0,f.Z)(G,2),X=A[0],K=A[1];(0,a.useEffect)(function(){K((0,m.Z)())},[]);var q=(0,p.Z)(function(){var t;return null===(t=j[0])||void 0===t?void 0:t.key},{value:k,defaultValue:y}),V=(0,f.Z)(q,2),Y=V[0],$=V[1],tt=(0,a.useState)(function(){return j.findIndex(function(t){return t.key===Y})}),te=(0,f.Z)(tt,2),tn=te[0],ta=te[1];(0,a.useEffect)(function(){var t,e=j.findIndex(function(t){return t.key===Y});-1===e&&(e=Math.max(0,Math.min(tn,j.length-1)),$(null===(t=j[e])||void 0===t?void 0:t.key)),ta(e)},[j.map(function(t){return t.key}).join("_"),Y,tn]);var to=(0,p.Z)(null,{value:n}),tc=(0,f.Z)(to,2),tr=tc[0],ti=tc[1];(0,a.useEffect)(function(){n||(ti("rc-tabs-".concat(J)),J+=1)},[]);var tl={id:tr,activeKey:Y,animated:W,tabPosition:S,rtl:H,mobile:X},td=(0,u.Z)((0,u.Z)({},tl),{},{editable:w,locale:R,more:P,tabBarGutter:E,onTabClick:function(t,e){null==L||L(t,e);var n=t!==Y;$(t),n&&(null==M||M(t))},onTabScroll:O,extra:C,style:Z,panes:null,getPopupContainer:N,popupClassName:B,indicator:D});return a.createElement(h.Provider,{value:{tabs:j,prefixCls:c}},a.createElement("div",(0,d.Z)({ref:e,id:n,className:l()(c,"".concat(c,"-").concat(S),(0,s.Z)((0,s.Z)((0,s.Z)({},"".concat(c,"-mobile"),X),"".concat(c,"-editable"),w),"".concat(c,"-rtl"),H),r)},z),a.createElement(F,(0,d.Z)({},td,{renderTabBar:I})),a.createElement(U,(0,d.Z)({destroyInactiveTabPane:T},tl,{animated:W}))))}),tt=n(71744),te=n(64024),tn=n(33759),ta=n(68710);let to={motionAppear:!1,motionEnter:!0,motionLeave:!0};var tc=n(45287),tr=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n},ti=n(93463),tl=n(12918),td=n(99320),ts=n(71140),tu=n(18544),tf=t=>{let{componentCls:e,motionDurationSlow:n}=t;return[{[e]:{["".concat(e,"-switch")]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:"opacity ".concat(n)}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:"opacity ".concat(n)}}}}},[(0,tu.oN)(t,"slide-up"),(0,tu.oN)(t,"slide-down")]]};let tv=t=>{let{componentCls:e,tabsCardPadding:n,cardBg:a,cardGutter:o,colorBorderSecondary:c,itemSelectedColor:r}=t;return{["".concat(e,"-card")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{margin:0,padding:n,background:a,border:"".concat((0,ti.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(c),transition:"all ".concat(t.motionDurationSlow," ").concat(t.motionEaseInOut)},["".concat(e,"-tab-active")]:{color:r,background:t.colorBgContainer},["".concat(e,"-tab-focus:has(").concat(e,"-tab-btn:focus-visible)")]:(0,tl.oN)(t,-3),["& ".concat(e,"-tab").concat(e,"-tab-focus ").concat(e,"-tab-btn:focus-visible")]:{outline:"none"},["".concat(e,"-ink-bar")]:{visibility:"hidden"}},["&".concat(e,"-top, &").concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab + ").concat(e,"-tab")]:{marginLeft:{_skip_check_:!0,value:(0,ti.bf)(o)}}}},["&".concat(e,"-top")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:"".concat((0,ti.bf)(t.borderRadiusLG)," ").concat((0,ti.bf)(t.borderRadiusLG)," 0 0")},["".concat(e,"-tab-active")]:{borderBottomColor:t.colorBgContainer}}},["&".concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:"0 0 ".concat((0,ti.bf)(t.borderRadiusLG)," ").concat((0,ti.bf)(t.borderRadiusLG))},["".concat(e,"-tab-active")]:{borderTopColor:t.colorBgContainer}}},["&".concat(e,"-left, &").concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab + ").concat(e,"-tab")]:{marginTop:(0,ti.bf)(o)}}},["&".concat(e,"-left")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,ti.bf)(t.borderRadiusLG)," 0 0 ").concat((0,ti.bf)(t.borderRadiusLG))}},["".concat(e,"-tab-active")]:{borderRightColor:{_skip_check_:!0,value:t.colorBgContainer}}}},["&".concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,ti.bf)(t.borderRadiusLG)," ").concat((0,ti.bf)(t.borderRadiusLG)," 0")}},["".concat(e,"-tab-active")]:{borderLeftColor:{_skip_check_:!0,value:t.colorBgContainer}}}}}}},tb=t=>{let{componentCls:e,itemHoverColor:n,dropdownEdgeChildVerticalPadding:a}=t;return{["".concat(e,"-dropdown")]:Object.assign(Object.assign({},(0,tl.Wf)(t)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:t.zIndexPopup,display:"block","&-hidden":{display:"none"},["".concat(e,"-dropdown-menu")]:{maxHeight:t.tabsDropdownHeight,margin:0,padding:"".concat((0,ti.bf)(a)," 0"),overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:t.colorBgContainer,backgroundClip:"padding-box",borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,"&-item":Object.assign(Object.assign({},tl.vS),{display:"flex",alignItems:"center",minWidth:t.tabsDropdownWidth,margin:0,padding:"".concat((0,ti.bf)(t.paddingXXS)," ").concat((0,ti.bf)(t.paddingSM)),color:t.colorText,fontWeight:"normal",fontSize:t.fontSize,lineHeight:t.lineHeight,cursor:"pointer",transition:"all ".concat(t.motionDurationSlow),"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:t.marginSM},color:t.colorIcon,fontSize:t.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:t.controlItemBgHover},"&-disabled":{"&, &:hover":{color:t.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},tp=t=>{let{componentCls:e,margin:n,colorBorderSecondary:a,horizontalMargin:o,verticalItemPadding:c,verticalItemMargin:r,calc:i}=t;return{["".concat(e,"-top, ").concat(e,"-bottom")]:{flexDirection:"column",["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:"".concat((0,ti.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(a),content:"''"},["".concat(e,"-ink-bar")]:{height:t.lineWidthBold,"&-animated":{transition:"width ".concat(t.motionDurationSlow,", left ").concat(t.motionDurationSlow,",\n right ").concat(t.motionDurationSlow)}},["".concat(e,"-nav-wrap")]:{"&::before, &::after":{top:0,bottom:0,width:t.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:t.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:t.boxShadowTabsOverflowRight},["&".concat(e,"-nav-wrap-ping-left::before")]:{opacity:1},["&".concat(e,"-nav-wrap-ping-right::after")]:{opacity:1}}}},["".concat(e,"-top")]:{["> ".concat(e,"-nav,\n > div > ").concat(e,"-nav")]:{"&::before":{bottom:0},["".concat(e,"-ink-bar")]:{bottom:0}}},["".concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},["".concat(e,"-ink-bar")]:{top:0}},["> ".concat(e,"-content-holder, > div > ").concat(e,"-content-holder")]:{order:0}},["".concat(e,"-left, ").concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{flexDirection:"column",minWidth:i(t.controlHeight).mul(1.25).equal(),["".concat(e,"-tab")]:{padding:c,textAlign:"center"},["".concat(e,"-tab + ").concat(e,"-tab")]:{margin:r},["".concat(e,"-nav-wrap")]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:t.controlHeight},"&::before":{top:0,boxShadow:t.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:t.boxShadowTabsOverflowBottom},["&".concat(e,"-nav-wrap-ping-top::before")]:{opacity:1},["&".concat(e,"-nav-wrap-ping-bottom::after")]:{opacity:1}},["".concat(e,"-ink-bar")]:{width:t.lineWidthBold,"&-animated":{transition:"height ".concat(t.motionDurationSlow,", top ").concat(t.motionDurationSlow)}},["".concat(e,"-nav-list, ").concat(e,"-nav-operations")]:{flex:"1 0 auto",flexDirection:"column"}}},["".concat(e,"-left")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-ink-bar")]:{right:{_skip_check_:!0,value:0}}},["> ".concat(e,"-content-holder, > div > ").concat(e,"-content-holder")]:{marginLeft:{_skip_check_:!0,value:(0,ti.bf)(i(t.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:"".concat((0,ti.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorder)},["> ".concat(e,"-content > ").concat(e,"-tabpane")]:{paddingLeft:{_skip_check_:!0,value:t.paddingLG}}}},["".concat(e,"-right")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{order:1,["".concat(e,"-ink-bar")]:{left:{_skip_check_:!0,value:0}}},["> ".concat(e,"-content-holder, > div > ").concat(e,"-content-holder")]:{order:0,marginRight:{_skip_check_:!0,value:i(t.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:"".concat((0,ti.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorder)},["> ".concat(e,"-content > ").concat(e,"-tabpane")]:{paddingRight:{_skip_check_:!0,value:t.paddingLG}}}}}},tm=t=>{let{componentCls:e,cardPaddingSM:n,cardPaddingLG:a,cardHeightSM:o,cardHeightLG:c,horizontalItemPaddingSM:r,horizontalItemPaddingLG:i}=t;return{[e]:{"&-small":{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:r,fontSize:t.titleFontSizeSM}}},"&-large":{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:i,fontSize:t.titleFontSizeLG,lineHeight:t.lineHeightLG}}}},["".concat(e,"-card")]:{["&".concat(e,"-small")]:{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:n},["".concat(e,"-nav-add")]:{minWidth:o,minHeight:o}},["&".concat(e,"-bottom")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:"0 0 ".concat((0,ti.bf)(t.borderRadius)," ").concat((0,ti.bf)(t.borderRadius))}},["&".concat(e,"-top")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:"".concat((0,ti.bf)(t.borderRadius)," ").concat((0,ti.bf)(t.borderRadius)," 0 0")}},["&".concat(e,"-right")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,ti.bf)(t.borderRadius)," ").concat((0,ti.bf)(t.borderRadius)," 0")}}},["&".concat(e,"-left")]:{["> ".concat(e,"-nav ").concat(e,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,ti.bf)(t.borderRadius)," 0 0 ").concat((0,ti.bf)(t.borderRadius))}}}},["&".concat(e,"-large")]:{["> ".concat(e,"-nav")]:{["".concat(e,"-tab")]:{padding:a},["".concat(e,"-nav-add")]:{minWidth:c,minHeight:c}}}}}},th=t=>{let{componentCls:e,itemActiveColor:n,itemHoverColor:a,iconCls:o,tabsHorizontalItemMargin:c,horizontalItemPadding:r,itemSelectedColor:i,itemColor:l}=t,d="".concat(e,"-tab");return{[d]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:r,fontSize:t.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:l,"&-btn, &-remove":{"&:focus:not(:focus-visible), &:active":{color:n}},"&-btn":{outline:"none",transition:"all ".concat(t.motionDurationSlow),["".concat(d,"-icon:not(:last-child)")]:{marginInlineEnd:t.marginSM}},"&-remove":Object.assign({flex:"none",lineHeight:1,marginRight:{_skip_check_:!0,value:t.calc(t.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:t.marginXS},color:t.colorIcon,fontSize:t.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:"all ".concat(t.motionDurationSlow),"&:hover":{color:t.colorTextHeading}},(0,tl.Qy)(t)),"&:hover":{color:a},["&".concat(d,"-active ").concat(d,"-btn")]:{color:i,textShadow:t.tabsActiveTextShadow},["&".concat(d,"-focus ").concat(d,"-btn:focus-visible")]:(0,tl.oN)(t),["&".concat(d,"-disabled")]:{color:t.colorTextDisabled,cursor:"not-allowed"},["&".concat(d,"-disabled ").concat(d,"-btn, &").concat(d,"-disabled ").concat(e,"-remove")]:{"&:focus, &:active":{color:t.colorTextDisabled}},["& ".concat(d,"-remove ").concat(o)]:{margin:0,verticalAlign:"middle"},["".concat(o,":not(:last-child)")]:{marginRight:{_skip_check_:!0,value:t.marginSM}}},["".concat(d," + ").concat(d)]:{margin:{_skip_check_:!0,value:c}}}},tg=t=>{let{componentCls:e,tabsHorizontalItemMarginRTL:n,iconCls:a,cardGutter:o,calc:c}=t;return{["".concat(e,"-rtl")]:{direction:"rtl",["".concat(e,"-nav")]:{["".concat(e,"-tab")]:{margin:{_skip_check_:!0,value:n},["".concat(e,"-tab:last-of-type")]:{marginLeft:{_skip_check_:!0,value:0}},[a]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:(0,ti.bf)(t.marginSM)}},["".concat(e,"-tab-remove")]:{marginRight:{_skip_check_:!0,value:(0,ti.bf)(t.marginXS)},marginLeft:{_skip_check_:!0,value:(0,ti.bf)(c(t.marginXXS).mul(-1).equal())},[a]:{margin:0}}}},["&".concat(e,"-left")]:{["> ".concat(e,"-nav")]:{order:1},["> ".concat(e,"-content-holder")]:{order:0}},["&".concat(e,"-right")]:{["> ".concat(e,"-nav")]:{order:0},["> ".concat(e,"-content-holder")]:{order:1}},["&".concat(e,"-card").concat(e,"-top, &").concat(e,"-card").concat(e,"-bottom")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-tab + ").concat(e,"-tab")]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},["".concat(e,"-dropdown-rtl")]:{direction:"rtl"},["".concat(e,"-menu-item")]:{["".concat(e,"-dropdown-rtl")]:{textAlign:{_skip_check_:!0,value:"right"}}}}},tk=t=>{let{componentCls:e,tabsCardPadding:n,cardHeight:a,cardGutter:o,itemHoverColor:c,itemActiveColor:r,colorBorderSecondary:i}=t;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,tl.Wf)(t)),{display:"flex",["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{position:"relative",display:"flex",flex:"none",alignItems:"center",["".concat(e,"-nav-wrap")]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:"opacity ".concat(t.motionDurationSlow),content:"''",pointerEvents:"none"}},["".concat(e,"-nav-list")]:{position:"relative",display:"flex",transition:"opacity ".concat(t.motionDurationSlow)},["".concat(e,"-nav-operations")]:{display:"flex",alignSelf:"stretch"},["".concat(e,"-nav-operations-hidden")]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},["".concat(e,"-nav-more")]:{position:"relative",padding:n,background:"transparent",border:0,color:t.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:t.calc(t.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},["".concat(e,"-nav-add")]:Object.assign({minWidth:a,minHeight:a,marginLeft:{_skip_check_:!0,value:o},background:"transparent",border:"".concat((0,ti.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(i),borderRadius:"".concat((0,ti.bf)(t.borderRadiusLG)," ").concat((0,ti.bf)(t.borderRadiusLG)," 0 0"),outline:"none",cursor:"pointer",color:t.colorText,transition:"all ".concat(t.motionDurationSlow," ").concat(t.motionEaseInOut),"&:hover":{color:c},"&:active, &:focus:not(:focus-visible)":{color:r}},(0,tl.Qy)(t,-3))},["".concat(e,"-extra-content")]:{flex:"none"},["".concat(e,"-ink-bar")]:{position:"absolute",background:t.inkBarColor,pointerEvents:"none"}}),th(t)),{["".concat(e,"-content")]:{position:"relative",width:"100%"},["".concat(e,"-content-holder")]:{flex:"auto",minWidth:0,minHeight:0},["".concat(e,"-tabpane")]:Object.assign(Object.assign({},(0,tl.Qy)(t)),{"&-hidden":{display:"none"}})}),["".concat(e,"-centered")]:{["> ".concat(e,"-nav, > div > ").concat(e,"-nav")]:{["".concat(e,"-nav-wrap")]:{["&:not([class*='".concat(e,"-nav-wrap-ping']) > ").concat(e,"-nav-list")]:{margin:"auto"}}}}}};var ty=(0,td.I$)("Tabs",t=>{let e=(0,ts.IX)(t,{tabsCardPadding:t.cardPadding,dropdownEdgeChildVerticalPadding:t.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:"0 0 0 ".concat((0,ti.bf)(t.horizontalItemGutter)),tabsHorizontalItemMarginRTL:"0 0 0 ".concat((0,ti.bf)(t.horizontalItemGutter))});return[tm(e),tg(e),tp(e),tb(e),tv(e),tk(e),tf(e)]},t=>{let{cardHeight:e,cardHeightSM:n,cardHeightLG:a,controlHeight:o,controlHeightLG:c}=t,r=e||c,i=n||o,l=a||c+8;return{zIndexPopup:t.zIndexPopupBase+50,cardBg:t.colorFillAlter,cardHeight:r,cardHeightSM:i,cardHeightLG:l,cardPadding:"".concat((r-t.fontHeight)/2-t.lineWidth,"px ").concat(t.padding,"px"),cardPaddingSM:"".concat((i-t.fontHeight)/2-t.lineWidth,"px ").concat(t.paddingXS,"px"),cardPaddingLG:"".concat((l-t.fontHeightLG)/2-t.lineWidth,"px ").concat(t.padding,"px"),titleFontSize:t.fontSize,titleFontSizeLG:t.fontSizeLG,titleFontSizeSM:t.fontSize,inkBarColor:t.colorPrimary,horizontalMargin:"0 0 ".concat(t.margin,"px 0"),horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:"".concat(t.paddingSM,"px 0"),horizontalItemPaddingSM:"".concat(t.paddingXS,"px 0"),horizontalItemPaddingLG:"".concat(t.padding,"px 0"),verticalItemPadding:"".concat(t.paddingXS,"px ").concat(t.paddingLG,"px"),verticalItemMargin:"".concat(t.margin,"px 0 0 0"),itemColor:t.colorText,itemSelectedColor:t.colorPrimary,itemHoverColor:t.colorPrimaryHover,itemActiveColor:t.colorPrimaryActive,cardGutter:t.marginXXS/2}}),tw=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&0>e.indexOf(a)&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(t);oe.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(t,a[o])&&(n[a[o]]=t[a[o]]);return n};let tx=a.forwardRef((t,e)=>{var n,i,d,s,u,f,v,b,p,m,h;let g;let{type:k,className:y,rootClassName:w,size:x,onEdit:_,hideAdd:S,centered:E,addIcon:Z,removeIcon:C,moreIcon:R,more:P,popupClassName:T,children:I,items:M,animated:L,style:O,indicatorSize:N,indicator:B,destroyInactiveTabPane:D,destroyOnHidden:z}=t,j=tw(t,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","removeIcon","moreIcon","more","popupClassName","children","items","animated","style","indicatorSize","indicator","destroyInactiveTabPane","destroyOnHidden"]),{prefixCls:H}=j,{direction:W,tabs:G,getPrefixCls:A,getPopupContainer:X}=a.useContext(tt.E_),K=A("tabs",H),q=(0,te.Z)(K),[F,V,Y]=ty(K,q),U=a.useRef(null);a.useImperativeHandle(e,()=>({nativeElement:U.current})),"editable-card"===k&&(g={onEdit:(t,e)=>{let{key:n,event:a}=e;null==_||_("add"===t?a:n,t)},removeIcon:null!==(n=null!=C?C:null==G?void 0:G.removeIcon)&&void 0!==n?n:a.createElement(o.Z,null),addIcon:(null!=Z?Z:null==G?void 0:G.addIcon)||a.createElement(r.Z,null),showAdd:!0!==S});let Q=A(),J=(0,tn.Z)(x),ti=M?M.map(t=>{var e;let n=null!==(e=t.destroyOnHidden)&&void 0!==e?e:t.destroyInactiveTabPane;return Object.assign(Object.assign({},t),{destroyInactiveTabPane:n})}):(0,tc.Z)(I).map(t=>{if(a.isValidElement(t)){let{key:e,props:n}=t,a=n||{},{tab:o}=a,c=tr(a,["tab"]);return Object.assign(Object.assign({key:String(e)},c),{label:o})}return null}).filter(t=>t),tl=function(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{inkBar:!0,tabPane:!1};return(e=!1===n?{inkBar:!1,tabPane:!1}:!0===n?{inkBar:!0,tabPane:!0}:Object.assign({inkBar:!0},"object"==typeof n?n:{})).tabPane&&(e.tabPaneMotion=Object.assign(Object.assign({},to),{motionName:(0,ta.m)(t,"switch")})),e}(K,L),td=Object.assign(Object.assign({},null==G?void 0:G.style),O),ts={align:null!==(i=null==B?void 0:B.align)&&void 0!==i?i:null===(d=null==G?void 0:G.indicator)||void 0===d?void 0:d.align,size:null!==(v=null!==(u=null!==(s=null==B?void 0:B.size)&&void 0!==s?s:N)&&void 0!==u?u:null===(f=null==G?void 0:G.indicator)||void 0===f?void 0:f.size)&&void 0!==v?v:null==G?void 0:G.indicatorSize};return F(a.createElement($,Object.assign({ref:U,direction:W,getPopupContainer:X},j,{items:ti,className:l()({["".concat(K,"-").concat(J)]:J,["".concat(K,"-card")]:["card","editable-card"].includes(k),["".concat(K,"-editable-card")]:"editable-card"===k,["".concat(K,"-centered")]:E},null==G?void 0:G.className,y,w,V,Y,q),popupClassName:l()(T,V,Y,q),style:td,editable:g,more:Object.assign({icon:null!==(h=null!==(m=null!==(p=null===(b=null==G?void 0:G.more)||void 0===b?void 0:b.icon)&&void 0!==p?p:null==G?void 0:G.moreIcon)&&void 0!==m?m:R)&&void 0!==h?h:a.createElement(c.Z,null),transitionName:"".concat(Q,"-slide-up")},P),prefixCls:K,animated:tl,indicator:ts,destroyInactiveTabPane:null!=z?z:D})))});tx.TabPane=()=>null;var t_=tx}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6043-4308da67f056896d.js b/litellm/proxy/_experimental/out/_next/static/chunks/6043-4308da67f056896d.js deleted file mode 100644 index 5c930593bc1..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/6043-4308da67f056896d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6043],{51653:function(e,o,r){r.d(o,{Z:function(){return H}});var t=r(2265),n=r(8900),a=r(39725),l=r(49638),s=r(54537),i=r(55726),c=r(36760),d=r.n(c),m=r(66632),p=r(18242),u=r(28791),b=r(19722),f=r(71744),g=r(93463),h=r(12918),v=r(99320);let k=(e,o,r,t,n)=>({background:e,border:"".concat((0,g.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(o),["".concat(n,"-icon")]:{color:r}}),x=e=>{let{componentCls:o,motionDurationSlow:r,marginXS:t,marginSM:n,fontSize:a,fontSizeLG:l,lineHeight:s,borderRadiusLG:i,motionEaseInOutCirc:c,withDescriptionIconSize:d,colorText:m,colorTextHeading:p,withDescriptionPadding:u,defaultPadding:b}=e;return{[o]:Object.assign(Object.assign({},(0,h.Wf)(e)),{position:"relative",display:"flex",alignItems:"center",padding:b,wordWrap:"break-word",borderRadius:i,["&".concat(o,"-rtl")]:{direction:"rtl"},["".concat(o,"-content")]:{flex:1,minWidth:0},["".concat(o,"-icon")]:{marginInlineEnd:t,lineHeight:0},"&-description":{display:"none",fontSize:a,lineHeight:s},"&-message":{color:p},["&".concat(o,"-motion-leave")]:{overflow:"hidden",opacity:1,transition:"max-height ".concat(r," ").concat(c,", opacity ").concat(r," ").concat(c,",\n padding-top ").concat(r," ").concat(c,", padding-bottom ").concat(r," ").concat(c,",\n margin-bottom ").concat(r," ").concat(c)},["&".concat(o,"-motion-leave-active")]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),["".concat(o,"-with-description")]:{alignItems:"flex-start",padding:u,["".concat(o,"-icon")]:{marginInlineEnd:n,fontSize:d,lineHeight:0},["".concat(o,"-message")]:{display:"block",marginBottom:t,color:p,fontSize:l},["".concat(o,"-description")]:{display:"block",color:m}},["".concat(o,"-banner")]:{marginBottom:0,border:"0 !important",borderRadius:0}}},w=e=>{let{componentCls:o,colorSuccess:r,colorSuccessBorder:t,colorSuccessBg:n,colorWarning:a,colorWarningBorder:l,colorWarningBg:s,colorError:i,colorErrorBorder:c,colorErrorBg:d,colorInfo:m,colorInfoBorder:p,colorInfoBg:u}=e;return{[o]:{"&-success":k(n,t,r,e,o),"&-info":k(u,p,m,e,o),"&-warning":k(s,l,a,e,o),"&-error":Object.assign(Object.assign({},k(d,c,i,e,o)),{["".concat(o,"-description > pre")]:{margin:0,padding:0}})}}},y=e=>{let{componentCls:o,iconCls:r,motionDurationMid:t,marginXS:n,fontSizeIcon:a,colorIcon:l,colorIconHover:s}=e;return{[o]:{"&-action":{marginInlineStart:n},["".concat(o,"-close-icon")]:{marginInlineStart:n,padding:0,overflow:"hidden",fontSize:a,lineHeight:(0,g.bf)(a),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",["".concat(r,"-close")]:{color:l,transition:"color ".concat(t),"&:hover":{color:s}}},"&-close-text":{color:l,transition:"color ".concat(t),"&:hover":{color:s}}}}};var z=(0,v.I$)("Alert",e=>[x(e),w(e),y(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:"".concat(e.paddingContentVerticalSM,"px ").concat(12,"px"),withDescriptionPadding:"".concat(e.paddingMD,"px ").concat(e.paddingContentHorizontalLG,"px")})),j=function(e,o){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&0>o.indexOf(t)&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,t=Object.getOwnPropertySymbols(e);no.indexOf(t[n])&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]]);return r};let N={success:n.Z,info:i.Z,error:a.Z,warning:s.Z},O=e=>{let{icon:o,prefixCls:r,type:n}=e,a=N[n]||null;return o?(0,b.wm)(o,t.createElement("span",{className:"".concat(r,"-icon")},o),()=>({className:d()("".concat(r,"-icon"),o.props.className)})):t.createElement(a,{className:"".concat(r,"-icon")})},C=e=>{let{isClosable:o,prefixCls:r,closeIcon:n,handleClose:a,ariaProps:s}=e,i=!0===n||void 0===n?t.createElement(l.Z,null):n;return o?t.createElement("button",Object.assign({type:"button",onClick:a,className:"".concat(r,"-close-icon"),tabIndex:0},s),i):null},I=t.forwardRef((e,o)=>{let{description:r,prefixCls:n,message:a,banner:l,className:s,rootClassName:i,style:c,onMouseEnter:b,onMouseLeave:g,onClick:h,afterClose:v,showIcon:k,closable:x,closeText:w,closeIcon:y,action:N,id:I}=e,E=j(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[S,M]=t.useState(!1),Z=t.useRef(null);t.useImperativeHandle(o,()=>({nativeElement:Z.current}));let{getPrefixCls:G,direction:W,closable:P,closeIcon:H,className:$,style:A}=(0,f.dj)("alert"),D=G("alert",n),[L,T,_]=z(D),B=o=>{var r;M(!0),null===(r=e.onClose)||void 0===r||r.call(e,o)},R=t.useMemo(()=>void 0!==e.type?e.type:l?"warning":"info",[e.type,l]),q=t.useMemo(()=>"object"==typeof x&&!!x.closeIcon||!!w||("boolean"==typeof x?x:!1!==y&&null!=y||!!P),[w,y,x,P]),V=!!l&&void 0===k||k,Q=d()(D,"".concat(D,"-").concat(R),{["".concat(D,"-with-description")]:!!r,["".concat(D,"-no-icon")]:!V,["".concat(D,"-banner")]:!!l,["".concat(D,"-rtl")]:"rtl"===W},$,s,i,_,T),X=(0,p.Z)(E,{aria:!0,data:!0}),F=t.useMemo(()=>"object"==typeof x&&x.closeIcon?x.closeIcon:w||(void 0!==y?y:"object"==typeof P&&P.closeIcon?P.closeIcon:H),[y,x,P,w,H]),J=t.useMemo(()=>{let e=null!=x?x:P;if("object"==typeof e){let{closeIcon:o}=e;return j(e,["closeIcon"])}return{}},[x,P]);return L(t.createElement(m.ZP,{visible:!S,motionName:"".concat(D,"-motion"),motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:v},(o,n)=>{let{className:l,style:s}=o;return t.createElement("div",Object.assign({id:I,ref:(0,u.sQ)(Z,n),"data-show":!S,className:d()(Q,l),style:Object.assign(Object.assign(Object.assign({},A),c),s),onMouseEnter:b,onMouseLeave:g,onClick:h,role:"alert"},X),V?t.createElement(O,{description:r,icon:e.icon,prefixCls:D,type:R}):null,t.createElement("div",{className:"".concat(D,"-content")},a?t.createElement("div",{className:"".concat(D,"-message")},a):null,r?t.createElement("div",{className:"".concat(D,"-description")},r):null),N?t.createElement("div",{className:"".concat(D,"-action")},N):null,t.createElement(C,{isClosable:q,prefixCls:D,closeIcon:F,handleClose:B,ariaProps:J}))}))});var E=r(76405),S=r(25049),M=r(24995),Z=r(63929),G=r(37977),W=r(41690);let P=function(e){function o(){var e,r,t;return(0,E.Z)(this,o),r=o,t=arguments,r=(0,M.Z)(r),(e=(0,G.Z)(this,(0,Z.Z)()?Reflect.construct(r,t||[],(0,M.Z)(this).constructor):r.apply(this,t))).state={error:void 0,info:{componentStack:""}},e}return(0,W.Z)(o,e),(0,S.Z)(o,[{key:"componentDidCatch",value:function(e,o){this.setState({error:e,info:o})}},{key:"render",value:function(){let{message:e,description:o,id:r,children:n}=this.props,{error:a,info:l}=this.state,s=(null==l?void 0:l.componentStack)||null,i=void 0===e?(a||"").toString():e;return a?t.createElement(I,{id:r,type:"error",message:i,description:t.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},void 0===o?s:o)}):n}}])}(t.Component);I.ErrorBoundary=P;var H=I},49096:function(e,o,r){r.d(o,{ZD:function(){return a}});var t=r(87602);let n=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=e=>{let o=function(){for(var o,r,n=arguments.length,a=Array(n),l=0;l{let t=Object.fromEntries(Object.entries(e||{}).filter(e=>{let[o]=e;return!["class","className"].includes(o)}));return o(r.map(e=>e(t)),null==e?void 0:e.class,null==e?void 0:e.className)}},cva:e=>r=>{var t;if((null==e?void 0:e.variants)==null)return o(null==e?void 0:e.base,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:a,defaultVariants:l}=e,s=Object.keys(a).map(e=>{let o=null==r?void 0:r[e],t=null==l?void 0:l[e],s=n(o)||n(t);return a[e][s]}),i={...l,...r&&Object.entries(r).reduce((e,o)=>{let[r,t]=o;return void 0===t?e:{...e,[r]:t}},{})},c=null==e?void 0:null===(t=e.compoundVariants)||void 0===t?void 0:t.reduce((e,o)=>{let{class:r,className:t,...n}=o;return Object.entries(n).every(e=>{let[o,r]=e,t=i[o];return Array.isArray(r)?r.includes(t):t===r})?[...e,r,t]:e},[]);return o(null==e?void 0:e.base,s,c,null==r?void 0:r.class,null==r?void 0:r.className)},cx:o}},{compose:l,cva:s,cx:i}=a()},53335:function(e,o,r){r.d(o,{m6:function(){return ek}});let t=(e,o)=>{let r=Array(e.length+o.length);for(let o=0;o({classGroupId:e,validator:o}),a=(e=new Map,o=null,r)=>({nextPart:e,validators:o,classGroupId:r}),l=[],s=e=>{let o=d(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return c(e);let r=e.split("-"),t=""===r[0]&&r.length>1?1:0;return i(r,t,o)},getConflictingClassGroupIds:(e,o)=>{if(o){let o=n[e],a=r[e];return o?a?t(a,o):o:a||l}return r[e]||l}}},i=(e,o,r)=>{if(0==e.length-o)return r.classGroupId;let t=e[o],n=r.nextPart.get(t);if(n){let r=i(e,o+1,n);if(r)return r}let a=r.validators;if(null===a)return;let l=0===o?e.join("-"):e.slice(o).join("-"),s=a.length;for(let e=0;e-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{let o=e.slice(1,-1),r=o.indexOf(":"),t=o.slice(0,r);return t?"arbitrary.."+t:void 0})(),d=e=>{let{theme:o,classGroups:r}=e;return m(r,o)},m=(e,o)=>{let r=a();for(let t in e)p(e[t],r,t,o);return r},p=(e,o,r,t)=>{let n=e.length;for(let a=0;a{if("string"==typeof e){b(e,o,r);return}if("function"==typeof e){f(e,o,r,t);return}g(e,o,r,t)},b=(e,o,r)=>{(""===e?o:h(o,e)).classGroupId=r},f=(e,o,r,t)=>{if(v(e)){p(e(t),o,r,t);return}null===o.validators&&(o.validators=[]),o.validators.push(n(r,e))},g=(e,o,r,t)=>{let n=Object.entries(e),a=n.length;for(let e=0;e{let r=e,t=o.split("-"),n=t.length;for(let e=0;e"isThemeGetter"in e&&!0===e.isThemeGetter,k=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let o=0,r=Object.create(null),t=Object.create(null),n=(n,a)=>{r[n]=a,++o>e&&(o=0,t=r,r=Object.create(null))};return{get(e){let o=r[e];return void 0!==o?o:void 0!==(o=t[e])?(n(e,o),o):void 0},set(e,o){e in r?r[e]=o:n(e,o)}}},x=[],w=(e,o,r,t,n)=>({modifiers:e,hasImportantModifier:o,baseClassName:r,maybePostfixModifierPosition:t,isExternal:n}),y=e=>{let{prefix:o,experimentalParseClassName:r}=e,t=e=>{let o;let r=[],t=0,n=0,a=0,l=e.length;for(let s=0;sa?o-a:void 0)};if(o){let e=o+":",r=t;t=o=>o.startsWith(e)?r(o.slice(e.length)):w(x,!1,o,void 0,!0)}if(r){let e=t;t=o=>r({className:o,parseClassName:e})}return t},z=e=>{let o=new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{o.set(e,1e6+r)}),e=>{let r=[],t=[];for(let n=0;n0&&(t.sort(),r.push(...t),t=[]),r.push(a)):t.push(a)}return t.length>0&&(t.sort(),r.push(...t)),r}},j=e=>({cache:k(e.cacheSize),parseClassName:y(e),sortModifiers:z(e),...s(e)}),N=/\s+/,O=(e,o)=>{let{parseClassName:r,getClassGroupId:t,getConflictingClassGroupIds:n,sortModifiers:a}=o,l=[],s=e.trim().split(N),i="";for(let e=s.length-1;e>=0;e-=1){let o=s[e],{isExternal:c,modifiers:d,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:u}=r(o);if(c){i=o+(i.length>0?" "+i:i);continue}let b=!!u,f=t(b?p.substring(0,u):p);if(!f){if(!b||!(f=t(p))){i=o+(i.length>0?" "+i:i);continue}b=!1}let g=0===d.length?"":1===d.length?d[0]:a(d).join(":"),h=m?g+"!":g,v=h+f;if(l.indexOf(v)>-1)continue;l.push(v);let k=n(f,b);for(let e=0;e0?" "+i:i)}return i},C=(...e)=>{let o,r,t=0,n="";for(;t{let o;if("string"==typeof e)return e;let r="";for(let t=0;t{let o=o=>o[e]||E;return o.isThemeGetter=!0,o},M=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Z=/^\((?:(\w[\w-]*):)?(.+)\)$/i,G=/^\d+\/\d+$/,W=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,P=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,H=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,A=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,D=e=>G.test(e),L=e=>!!e&&!Number.isNaN(Number(e)),T=e=>!!e&&Number.isInteger(Number(e)),_=e=>e.endsWith("%")&&L(e.slice(0,-1)),B=e=>W.test(e),R=()=>!0,q=e=>P.test(e)&&!H.test(e),V=()=>!1,Q=e=>$.test(e),X=e=>A.test(e),F=e=>!K(e)&&!et(e),J=e=>ed(e,eb,V),K=e=>M.test(e),U=e=>ed(e,ef,q),Y=e=>ed(e,eg,L),ee=e=>ed(e,ep,V),eo=e=>ed(e,eu,X),er=e=>ed(e,ev,Q),et=e=>Z.test(e),en=e=>em(e,ef),ea=e=>em(e,eh),el=e=>em(e,ep),es=e=>em(e,eb),ei=e=>em(e,eu),ec=e=>em(e,ev,!0),ed=(e,o,r)=>{let t=M.exec(e);return!!t&&(t[1]?o(t[1]):r(t[2]))},em=(e,o,r=!1)=>{let t=Z.exec(e);return!!t&&(t[1]?o(t[1]):r)},ep=e=>"position"===e||"percentage"===e,eu=e=>"image"===e||"url"===e,eb=e=>"length"===e||"size"===e||"bg-size"===e,ef=e=>"length"===e,eg=e=>"number"===e,eh=e=>"family-name"===e,ev=e=>"shadow"===e,ek=((e,...o)=>{let r,t,n,a;let l=e=>{let o=t(e);if(o)return o;let a=O(e,r);return n(e,a),a};return a=s=>(t=(r=j(o.reduce((e,o)=>o(e),e()))).cache.get,n=r.cache.set,a=l,l(s)),(...e)=>a(C(...e))})(()=>{let e=S("color"),o=S("font"),r=S("text"),t=S("font-weight"),n=S("tracking"),a=S("leading"),l=S("breakpoint"),s=S("container"),i=S("spacing"),c=S("radius"),d=S("shadow"),m=S("inset-shadow"),p=S("text-shadow"),u=S("drop-shadow"),b=S("blur"),f=S("perspective"),g=S("aspect"),h=S("ease"),v=S("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...x(),et,K],y=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],j=()=>[et,K,i],N=()=>[D,"full","auto",...j()],O=()=>[T,"none","subgrid",et,K],C=()=>["auto",{span:["full",T,et,K]},T,et,K],I=()=>[T,"auto",et,K],E=()=>["auto","min","max","fr",et,K],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...j()],W=()=>[D,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],P=()=>[e,et,K],H=()=>[...x(),el,ee,{position:[et,K]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",es,J,{size:[et,K]}],q=()=>[_,en,U],V=()=>["","none","full",c,et,K],Q=()=>["",L,en,U],X=()=>["solid","dashed","dotted","double"],ed=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],em=()=>[L,_,el,ee],ep=()=>["","none",b,et,K],eu=()=>["none",L,et,K],eb=()=>["none",L,et,K],ef=()=>[L,et,K],eg=()=>[D,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[B],breakpoint:[B],color:[R],container:[B],"drop-shadow":[B],ease:["in","out","in-out"],font:[F],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[B],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[B],shadow:[B],spacing:["px",L],text:[B],"text-shadow":[B],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",D,K,et,g]}],container:["container"],columns:[{columns:[L,K,et,s]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:y()}],"overflow-x":[{"overflow-x":y()}],"overflow-y":[{"overflow-y":y()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{start:N()}],end:[{end:N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[T,"auto",et,K]}],basis:[{basis:[D,"full","auto",s,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[L,D,"auto","initial","none",K]}],grow:[{grow:["",L,et,K]}],shrink:[{shrink:["",L,et,K]}],order:[{order:[T,"first","last","none",et,K]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:C()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:C()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],w:[{w:[s,"screen",...W()]}],"min-w":[{"min-w":[s,"screen","none",...W()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[l]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",r,en,U]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[t,et,Y]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_,K]}],"font-family":[{font:[ea,K,o]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,et,K]}],"line-clamp":[{"line-clamp":[L,"none",et,Y]}],leading:[{leading:[a,...j()]}],"list-image":[{"list-image":["none",et,K]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",et,K]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:[L,"from-font","auto",et,U]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[L,"auto",et,K]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",et,K]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",et,K]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},T,et,K],radial:["",et,K],conic:[T,et,K]},ei,eo]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...X(),"hidden","none"]}],"divide-style":[{divide:[...X(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...X(),"none","hidden"]}],"outline-offset":[{"outline-offset":[L,et,K]}],"outline-w":[{outline:["",L,en,U]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",d,ec,er]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",m,ec,er]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[L,U]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",p,ec,er]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[L,et,K]}],"mix-blend":[{"mix-blend":[...ed(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ed()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[L]}],"mask-image-linear-from-pos":[{"mask-linear-from":em()}],"mask-image-linear-to-pos":[{"mask-linear-to":em()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":em()}],"mask-image-t-to-pos":[{"mask-t-to":em()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":em()}],"mask-image-r-to-pos":[{"mask-r-to":em()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":em()}],"mask-image-b-to-pos":[{"mask-b-to":em()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":em()}],"mask-image-l-to-pos":[{"mask-l-to":em()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":em()}],"mask-image-x-to-pos":[{"mask-x-to":em()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":em()}],"mask-image-y-to-pos":[{"mask-y-to":em()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[et,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":em()}],"mask-image-radial-to-pos":[{"mask-radial-to":em()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[L]}],"mask-image-conic-from-pos":[{"mask-conic-from":em()}],"mask-image-conic-to-pos":[{"mask-conic-to":em()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",et,K]}],filter:[{filter:["","none",et,K]}],blur:[{blur:ep()}],brightness:[{brightness:[L,et,K]}],contrast:[{contrast:[L,et,K]}],"drop-shadow":[{"drop-shadow":["","none",u,ec,er]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",L,et,K]}],"hue-rotate":[{"hue-rotate":[L,et,K]}],invert:[{invert:["",L,et,K]}],saturate:[{saturate:[L,et,K]}],sepia:[{sepia:["",L,et,K]}],"backdrop-filter":[{"backdrop-filter":["","none",et,K]}],"backdrop-blur":[{"backdrop-blur":ep()}],"backdrop-brightness":[{"backdrop-brightness":[L,et,K]}],"backdrop-contrast":[{"backdrop-contrast":[L,et,K]}],"backdrop-grayscale":[{"backdrop-grayscale":["",L,et,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[L,et,K]}],"backdrop-invert":[{"backdrop-invert":["",L,et,K]}],"backdrop-opacity":[{"backdrop-opacity":[L,et,K]}],"backdrop-saturate":[{"backdrop-saturate":[L,et,K]}],"backdrop-sepia":[{"backdrop-sepia":["",L,et,K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",et,K]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[L,"initial",et,K]}],ease:[{ease:["linear","initial",h,et,K]}],delay:[{delay:[L,et,K]}],animate:[{animate:["none",v,et,K]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,et,K]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:eu()}],"rotate-x":[{"rotate-x":eu()}],"rotate-y":[{"rotate-y":eu()}],"rotate-z":[{"rotate-z":eu()}],scale:[{scale:eb()}],"scale-x":[{"scale-x":eb()}],"scale-y":[{"scale-y":eb()}],"scale-z":[{"scale-z":eb()}],"scale-3d":["scale-3d"],skew:[{skew:ef()}],"skew-x":[{"skew-x":ef()}],"skew-y":[{"skew-y":ef()}],transform:[{transform:[et,K,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:eg()}],"translate-x":[{"translate-x":eg()}],"translate-y":[{"translate-y":eg()}],"translate-z":[{"translate-z":eg()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",et,K]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",et,K]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[L,en,U,Y]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/611-3b24a9c382a17460.js b/litellm/proxy/_experimental/out/_next/static/chunks/611-3b24a9c382a17460.js deleted file mode 100644 index 08473ddc9ff..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/611-3b24a9c382a17460.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[611],{83669:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),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"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},44625:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},29271:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),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:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},50010:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={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"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},38434:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},92403:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},62272:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),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"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},99890:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}}]},name:"picture",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},55322:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},25980:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={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"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},71891:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(1119),a=n(2265),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-.2-4.7.6-6.3 2.3L137.7 444.8a8.03 8.03 0 000 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0zm62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9zm60.16 186.23a48 48 0 1067.88-67.89 48 48 0 10-67.88 67.89zM889.7 539.8l-39.6-39.5a8.03 8.03 0 00-11.3 0l-362 361.3-237.6-237a8.03 8.03 0 00-11.3 0l-39.6 39.5a8.03 8.03 0 000 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z"}}]},name:"tags",theme:"outlined"},i=n(55015),o=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:s}))})},85847:function(e,t,n){n.d(t,{Z:function(){return en}});var r=n(2265),a=n(36760),s=n.n(a),i=n(31686),o=n(11993),l=n(83145),c=n(41154),u=n(26365),d=n(58525),h=n(50506),f=n(16671),p=n(32559),g=n(1119),m=n(6989),b=n(54887);function v(e,t,n,r){var a=(t-n)/(r-n),s={};switch(e){case"rtl":s.right="".concat(100*a,"%"),s.transform="translateX(50%)";break;case"btt":s.bottom="".concat(100*a,"%"),s.transform="translateY(50%)";break;case"ttb":s.top="".concat(100*a,"%"),s.transform="translateY(-50%)";break;default:s.left="".concat(100*a,"%"),s.transform="translateX(-50%)"}return s}function y(e,t){return Array.isArray(e)?e[t]:e}var w=n(95814),_=r.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}}),k=r.createContext({}),S=["prefixCls","value","valueIndex","onStartMove","onDelete","style","render","dragging","draggingDelete","onOffsetChange","onChangeComplete","onFocus","onMouseEnter"],x=r.forwardRef(function(e,t){var n,a=e.prefixCls,l=e.value,c=e.valueIndex,u=e.onStartMove,d=e.onDelete,h=e.style,f=e.render,p=e.dragging,b=e.draggingDelete,k=e.onOffsetChange,x=e.onChangeComplete,M=e.onFocus,E=e.onMouseEnter,C=(0,m.Z)(e,S),R=r.useContext(_),P=R.min,O=R.max,j=R.direction,I=R.disabled,A=R.keyboard,L=R.range,Z=R.tabIndex,T=R.ariaLabelForHandle,N=R.ariaLabelledByForHandle,z=R.ariaRequired,$=R.ariaValueTextFormatterForHandle,q=R.styles,D=R.classNames,B="".concat(a,"-handle"),H=function(e){I||u(e,c)},U=v(j,l,P,O),W={};null!==c&&(W={tabIndex:I?null:y(Z,c),role:"slider","aria-valuemin":P,"aria-valuemax":O,"aria-valuenow":l,"aria-disabled":I,"aria-label":y(T,c),"aria-labelledby":y(N,c),"aria-required":y(z,c),"aria-valuetext":null===(n=y($,c))||void 0===n?void 0:n(l),"aria-orientation":"ltr"===j||"rtl"===j?"horizontal":"vertical",onMouseDown:H,onTouchStart:H,onFocus:function(e){null==M||M(e,c)},onMouseEnter:function(e){E(e,c)},onKeyDown:function(e){if(!I&&A){var t=null;switch(e.which||e.keyCode){case w.Z.LEFT:t="ltr"===j||"btt"===j?-1:1;break;case w.Z.RIGHT:t="ltr"===j||"btt"===j?1:-1;break;case w.Z.UP:t="ttb"!==j?1:-1;break;case w.Z.DOWN:t="ttb"!==j?-1:1;break;case w.Z.HOME:t="min";break;case w.Z.END:t="max";break;case w.Z.PAGE_UP:t=2;break;case w.Z.PAGE_DOWN:t=-2;break;case w.Z.BACKSPACE:case w.Z.DELETE:null==d||d(c)}null!==t&&(e.preventDefault(),k(t,c))}},onKeyUp:function(e){switch(e.which||e.keyCode){case w.Z.LEFT:case w.Z.RIGHT:case w.Z.UP:case w.Z.DOWN:case w.Z.HOME:case w.Z.END:case w.Z.PAGE_UP:case w.Z.PAGE_DOWN:null==x||x()}}});var F=r.createElement("div",(0,g.Z)({ref:t,className:s()(B,(0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(B,"-").concat(c+1),null!==c&&L),"".concat(B,"-dragging"),p),"".concat(B,"-dragging-delete"),b),D.handle),style:(0,i.Z)((0,i.Z)((0,i.Z)({},U),h),q.handle)},W,C));return f&&(F=f(F,{index:c,prefixCls:a,value:l,dragging:p,draggingDelete:b})),F}),M=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","activeHandleRender","draggingIndex","draggingDelete","onFocus"],E=r.forwardRef(function(e,t){var n=e.prefixCls,a=e.style,s=e.onStartMove,o=e.onOffsetChange,l=e.values,c=e.handleRender,d=e.activeHandleRender,h=e.draggingIndex,f=e.draggingDelete,p=e.onFocus,v=(0,m.Z)(e,M),w=r.useRef({}),_=r.useState(!1),k=(0,u.Z)(_,2),S=k[0],E=k[1],C=r.useState(-1),R=(0,u.Z)(C,2),P=R[0],O=R[1],j=function(e){O(e),E(!0)};r.useImperativeHandle(t,function(){return{focus:function(e){var t;null===(t=w.current[e])||void 0===t||t.focus()},hideHelp:function(){(0,b.flushSync)(function(){E(!1)})}}});var I=(0,i.Z)({prefixCls:n,onStartMove:s,onOffsetChange:o,render:c,onFocus:function(e,t){j(t),null==p||p(e)},onMouseEnter:function(e,t){j(t)}},v);return r.createElement(r.Fragment,null,l.map(function(e,t){var n=h===t;return r.createElement(x,(0,g.Z)({ref:function(e){e?w.current[t]=e:delete w.current[t]},dragging:n,draggingDelete:n&&f,style:y(a,t),key:t,value:e,valueIndex:t},I))}),d&&S&&r.createElement(x,(0,g.Z)({key:"a11y"},I,{value:l[P],valueIndex:null,dragging:-1!==h,draggingDelete:f,render:d,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))}),C=function(e){var t=e.prefixCls,n=e.style,a=e.children,l=e.value,c=e.onClick,u=r.useContext(_),d=u.min,h=u.max,f=u.direction,p=u.includedStart,g=u.includedEnd,m=u.included,b="".concat(t,"-text"),y=v(f,l,d,h);return r.createElement("span",{className:s()(b,(0,o.Z)({},"".concat(b,"-active"),m&&p<=l&&l<=g)),style:(0,i.Z)((0,i.Z)({},y),n),onMouseDown:function(e){e.stopPropagation()},onClick:function(){c(l)}},a)},R=function(e){var t=e.prefixCls,n=e.marks,a=e.onClick,s="".concat(t,"-mark");return n.length?r.createElement("div",{className:s},n.map(function(e){var t=e.value,n=e.style,i=e.label;return r.createElement(C,{key:t,prefixCls:s,style:n,value:t,onClick:a},i)})):null},P=function(e){var t=e.prefixCls,n=e.value,a=e.style,l=e.activeStyle,c=r.useContext(_),u=c.min,d=c.max,h=c.direction,f=c.included,p=c.includedStart,g=c.includedEnd,m="".concat(t,"-dot"),b=f&&p<=n&&n<=g,y=(0,i.Z)((0,i.Z)({},v(h,n,u,d)),"function"==typeof a?a(n):a);return b&&(y=(0,i.Z)((0,i.Z)({},y),"function"==typeof l?l(n):l)),r.createElement("span",{className:s()(m,(0,o.Z)({},"".concat(m,"-active"),b)),style:y})},O=function(e){var t=e.prefixCls,n=e.marks,a=e.dots,s=e.style,i=e.activeStyle,o=r.useContext(_),l=o.min,c=o.max,u=o.step,d=r.useMemo(function(){var e=new Set;if(n.forEach(function(t){e.add(t.value)}),a&&null!==u)for(var t=l;t<=c;)e.add(t),t+=u;return Array.from(e)},[l,c,u,a,n]);return r.createElement("div",{className:"".concat(t,"-step")},d.map(function(e){return r.createElement(P,{prefixCls:t,key:e,value:e,style:s,activeStyle:i})}))},j=function(e){var t=e.prefixCls,n=e.style,a=e.start,l=e.end,c=e.index,u=e.onStartMove,d=e.replaceCls,h=r.useContext(_),f=h.direction,p=h.min,g=h.max,m=h.disabled,b=h.range,v=h.classNames,y="".concat(t,"-track"),w=(a-p)/(g-p),k=(l-p)/(g-p),S=function(e){!m&&u&&u(e,-1)},x={};switch(f){case"rtl":x.right="".concat(100*w,"%"),x.width="".concat(100*k-100*w,"%");break;case"btt":x.bottom="".concat(100*w,"%"),x.height="".concat(100*k-100*w,"%");break;case"ttb":x.top="".concat(100*w,"%"),x.height="".concat(100*k-100*w,"%");break;default:x.left="".concat(100*w,"%"),x.width="".concat(100*k-100*w,"%")}var M=d||s()(y,(0,o.Z)((0,o.Z)({},"".concat(y,"-").concat(c+1),null!==c&&b),"".concat(t,"-track-draggable"),u),v.track);return r.createElement("div",{className:M,style:(0,i.Z)((0,i.Z)({},x),n),onMouseDown:S,onTouchStart:S})},I=function(e){var t=e.prefixCls,n=e.style,a=e.values,o=e.startPoint,l=e.onStartMove,c=r.useContext(_),u=c.included,d=c.range,h=c.min,f=c.styles,p=c.classNames,g=r.useMemo(function(){if(!d){if(0===a.length)return[];var e=null!=o?o:h,t=a[0];return[{start:Math.min(e,t),end:Math.max(e,t)}]}for(var n=[],r=0;r130&&p=0&&en},[en,eT]),ez=r.useMemo(function(){return Object.keys(ef||{}).map(function(e){var t=ef[e],n={value:Number(e)};return t&&"object"===(0,c.Z)(t)&&!r.isValidElement(t)&&("label"in t||"style"in t)?(n.style=t.style,n.label=t.label):n.label=t,n}).filter(function(e){var t=e.label;return t||"number"==typeof t}).sort(function(e,t){return e.value-t.value})},[ef]),e$=(n=void 0===ee||ee,a=r.useCallback(function(e){return Math.max(eL,Math.min(eZ,e))},[eL,eZ]),g=r.useCallback(function(e){if(null!==eT){var t=eL+Math.round((a(e)-eL)/eT)*eT,n=function(e){return(String(e).split(".")[1]||"").length},r=Math.max(n(eT),n(eZ),n(eL)),s=Number(t.toFixed(r));return eL<=s&&s<=eZ?s:null}return null},[eT,eL,eZ,a]),m=r.useCallback(function(e){var t=a(e),n=ez.map(function(e){return e.value});null!==eT&&n.push(g(e)),n.push(eL,eZ);var r=n[0],s=eZ-eL;return n.forEach(function(e){var n=Math.abs(t-e);n<=s&&(r=e,s=n)}),r},[eL,eZ,ez,eT,a,g]),b=function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit";if("number"==typeof n){var s,i=t[r],o=i+n,c=[];ez.forEach(function(e){c.push(e.value)}),c.push(eL,eZ),c.push(g(i));var u=n>0?1:-1;"unit"===a?c.push(g(i+u*eT)):c.push(g(o)),c=c.filter(function(e){return null!==e}).filter(function(e){return n<0?e<=i:e>=i}),"unit"===a&&(c=c.filter(function(e){return e!==i}));var d="unit"===a?i:o,h=Math.abs((s=c[0])-d);if(c.forEach(function(e){var t=Math.abs(e-d);t1){var f=(0,l.Z)(t);return f[r]=s,e(f,n-u,r,a)}return s}return"min"===n?eL:"max"===n?eZ:void 0},v=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",a=e[n],s=b(e,t,n,r);return{value:s,changed:s!==a}},y=function(e){return null===eN&&0===e||"number"==typeof eN&&e3&&void 0!==arguments[3]?arguments[3]:"unit",s=e.map(m),i=s[r],o=b(s,t,r,a);if(s[r]=o,!1===n){var l=eN||0;r>0&&s[r-1]!==i&&(s[r]=Math.max(s[r],s[r-1]+l)),r0;h-=1)for(var f=!0;y(s[h]-s[h-1])&&f;){var p=v(s,-1,h-1);s[h-1]=p.value,f=p.changed}for(var g=s.length-1;g>0;g-=1)for(var w=!0;y(s[g]-s[g-1])&&w;){var _=v(s,-1,g-1);s[g-1]=_.value,w=_.changed}for(var k=0;k=0?J+1:2;for(r=r.slice(0,s);r.length=0&&ex.current.focus(e)}e9(null)},[e5]);var e7=r.useMemo(function(){return(!ej||null!==eT)&&ej},[ej,eT]),te=(0,d.Z)(function(e,t){e3(e,t),null==K||K(eX(eV))}),tt=-1!==eQ;r.useEffect(function(){if(!tt){var e=eV.lastIndexOf(e0);ex.current.focus(e)}},[tt]);var tn=r.useMemo(function(){return(0,l.Z)(e2).sort(function(e,t){return e-t})},[e2]),tr=r.useMemo(function(){return eP?[tn[0],tn[tn.length-1]]:[eL,tn[0]]},[tn,eP,eL]),ta=(0,u.Z)(tr,2),ts=ta[0],ti=ta[1];r.useImperativeHandle(t,function(){return{focus:function(){ex.current.focus(0)},blur:function(){var e,t=document.activeElement;null!==(e=eM.current)&&void 0!==e&&e.contains(t)&&(null==t||t.blur())}}}),r.useEffect(function(){N&&ex.current.focus(0)},[]);var to=r.useMemo(function(){return{min:eL,max:eZ,direction:eE,disabled:A,keyboard:T,step:eT,included:ei,includedStart:ts,includedEnd:ti,range:eP,tabIndex:ey,ariaLabelForHandle:ew,ariaLabelledByForHandle:e_,ariaRequired:ek,ariaValueTextFormatterForHandle:eS,styles:C||{},classNames:M||{}}},[eL,eZ,eE,A,T,eT,ei,ts,ti,eP,ey,ew,e_,ek,eS,C,M]);return r.createElement(_.Provider,{value:to},r.createElement("div",{ref:eM,className:s()(k,S,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(k,"-disabled"),A),"".concat(k,"-vertical"),ea),"".concat(k,"-horizontal"),!ea),"".concat(k,"-with-marks"),ez.length)),style:x,onMouseDown:function(e){e.preventDefault();var t,n=eM.current.getBoundingClientRect(),r=n.width,a=n.height,s=n.left,i=n.top,o=n.bottom,l=n.right,c=e.clientX,u=e.clientY;switch(eE){case"btt":t=(o-u)/a;break;case"ttb":t=(u-i)/a;break;case"rtl":t=(l-c)/r;break;default:t=(c-s)/r}e4(eD(eL+t*(eZ-eL)),e)},id:P},r.createElement("div",{className:s()("".concat(k,"-rail"),null==M?void 0:M.rail),style:(0,i.Z)((0,i.Z)({},eu),null==C?void 0:C.rail)}),!1!==eb&&r.createElement(I,{prefixCls:k,style:el,values:eV,startPoint:eo,onStartMove:e7?te:void 0}),r.createElement(O,{prefixCls:k,marks:ez,dots:ep,style:ed,activeStyle:eh}),r.createElement(E,{ref:ex,prefixCls:k,style:ec,values:e2,draggingIndex:eQ,draggingDelete:e1,onStartMove:te,onOffsetChange:function(e,t){if(!A){var n=eB(eV,e,t);null==K||K(eX(eV)),eJ(n.values),e9(n.value)}},onFocus:z,onBlur:$,handleRender:eg,activeHandleRender:em,onChangeComplete:eG,onDelete:eO?function(e){if(!A&&eO&&!(eV.length<=eI)){var t=(0,l.Z)(eV);t.splice(e,1),null==K||K(eX(t)),eJ(t),ex.current.hideHelp(),ex.current.focus(Math.max(0,e-1))}}:void 0}),r.createElement(R,{prefixCls:k,marks:ez,onClick:e4})))}),N=n(53346),z=n(86586);let $=(0,r.createContext)({});var q=n(28791),D=n(99981);let B=r.forwardRef((e,t)=>{let{open:n,draggingDelete:a,value:s}=e,i=(0,r.useRef)(null),o=n&&!a,l=(0,r.useRef)(null);function c(){N.Z.cancel(l.current),l.current=null}return r.useEffect(()=>(o?l.current=(0,N.Z)(()=>{var e;null===(e=i.current)||void 0===e||e.forceAlign(),l.current=null}):c(),c),[o,e.title,s]),r.createElement(D.Z,Object.assign({ref:(0,q.sQ)(i,t)},e,{open:o}))});var H=n(93463),U=n(54558),W=n(12918),F=n(99320),V=n(71140);let X=e=>{let{componentCls:t,antCls:n,controlSize:r,dotSize:a,marginFull:s,marginPart:i,colorFillContentHover:o,handleColorDisabled:l,calc:c,handleSize:u,handleSizeHover:d,handleActiveColor:h,handleActiveOutlineColor:f,handleLineWidth:p,handleLineWidthHover:g,motionDurationMid:m}=e;return{[t]:Object.assign(Object.assign({},(0,W.Wf)(e)),{position:"relative",height:r,margin:"".concat((0,H.bf)(i)," ").concat((0,H.bf)(s)),padding:0,cursor:"pointer",touchAction:"none","&-vertical":{margin:"".concat((0,H.bf)(s)," ").concat((0,H.bf)(i))},["".concat(t,"-rail")]:{position:"absolute",backgroundColor:e.railBg,borderRadius:e.borderRadiusXS,transition:"background-color ".concat(m)},["".concat(t,"-track,").concat(t,"-tracks")]:{position:"absolute",transition:"background-color ".concat(m)},["".concat(t,"-track")]:{backgroundColor:e.trackBg,borderRadius:e.borderRadiusXS},["".concat(t,"-track-draggable")]:{boxSizing:"content-box",backgroundClip:"content-box",border:"solid rgba(0,0,0,0)"},"&:hover":{["".concat(t,"-rail")]:{backgroundColor:e.railHoverBg},["".concat(t,"-track")]:{backgroundColor:e.trackHoverBg},["".concat(t,"-dot")]:{borderColor:o},["".concat(t,"-handle::after")]:{boxShadow:"0 0 0 ".concat((0,H.bf)(p)," ").concat(e.colorPrimaryBorderHover)},["".concat(t,"-dot-active")]:{borderColor:e.dotActiveBorderColor}},["".concat(t,"-handle")]:{position:"absolute",width:u,height:u,outline:"none",userSelect:"none","&-dragging-delete":{opacity:0},"&::before":{content:'""',position:"absolute",insetInlineStart:c(p).mul(-1).equal(),insetBlockStart:c(p).mul(-1).equal(),width:c(u).add(c(p).mul(2)).equal(),height:c(u).add(c(p).mul(2)).equal(),backgroundColor:"transparent"},"&::after":{content:'""',position:"absolute",insetBlockStart:0,insetInlineStart:0,width:u,height:u,backgroundColor:e.colorBgElevated,boxShadow:"0 0 0 ".concat((0,H.bf)(p)," ").concat(e.handleColor),outline:"0px solid transparent",borderRadius:"50%",cursor:"pointer",transition:"\n inset-inline-start ".concat(m,",\n inset-block-start ").concat(m,",\n width ").concat(m,",\n height ").concat(m,",\n box-shadow ").concat(m,",\n outline ").concat(m,"\n ")},"&:hover, &:active, &:focus":{"&::before":{insetInlineStart:c(d).sub(u).div(2).add(g).mul(-1).equal(),insetBlockStart:c(d).sub(u).div(2).add(g).mul(-1).equal(),width:c(d).add(c(g).mul(2)).equal(),height:c(d).add(c(g).mul(2)).equal()},"&::after":{boxShadow:"0 0 0 ".concat((0,H.bf)(g)," ").concat(h),outline:"6px solid ".concat(f),width:d,height:d,insetInlineStart:e.calc(u).sub(d).div(2).equal(),insetBlockStart:e.calc(u).sub(d).div(2).equal()}}},["&-lock ".concat(t,"-handle")]:{"&::before, &::after":{transition:"none"}},["".concat(t,"-mark")]:{position:"absolute",fontSize:e.fontSize},["".concat(t,"-mark-text")]:{position:"absolute",display:"inline-block",color:e.colorTextDescription,textAlign:"center",wordBreak:"keep-all",cursor:"pointer",userSelect:"none","&-active":{color:e.colorText}},["".concat(t,"-step")]:{position:"absolute",background:"transparent",pointerEvents:"none"},["".concat(t,"-dot")]:{position:"absolute",width:a,height:a,backgroundColor:e.colorBgElevated,border:"".concat((0,H.bf)(p)," solid ").concat(e.dotBorderColor),borderRadius:"50%",cursor:"pointer",transition:"border-color ".concat(e.motionDurationSlow),pointerEvents:"auto","&-active":{borderColor:e.dotActiveBorderColor}},["&".concat(t,"-disabled")]:{cursor:"not-allowed",["".concat(t,"-rail")]:{backgroundColor:"".concat(e.railBg," !important")},["".concat(t,"-track")]:{backgroundColor:"".concat(e.trackBgDisabled," !important")},["\n ".concat(t,"-dot\n ")]:{backgroundColor:e.colorBgElevated,borderColor:e.trackBgDisabled,boxShadow:"none",cursor:"not-allowed"},["".concat(t,"-handle::after")]:{backgroundColor:e.colorBgElevated,cursor:"not-allowed",width:u,height:u,boxShadow:"0 0 0 ".concat((0,H.bf)(p)," ").concat(l),insetInlineStart:0,insetBlockStart:0},["\n ".concat(t,"-mark-text,\n ").concat(t,"-dot\n ")]:{cursor:"not-allowed !important"}},["&-tooltip ".concat(n,"-tooltip-inner")]:{minWidth:"unset"}})}},J=(e,t)=>{let{componentCls:n,railSize:r,handleSize:a,dotSize:s,marginFull:i,calc:o}=e,l=t?"width":"height",c=t?"height":"width",u=t?"insetBlockStart":"insetInlineStart",d=t?"top":"insetInlineStart",h=o(r).mul(3).sub(a).div(2).equal(),f=o(a).sub(r).div(2).equal(),p=t?{borderWidth:"".concat((0,H.bf)(f)," 0"),transform:"translateY(".concat((0,H.bf)(o(f).mul(-1).equal()),")")}:{borderWidth:"0 ".concat((0,H.bf)(f)),transform:"translateX(".concat((0,H.bf)(e.calc(f).mul(-1).equal()),")")};return{[t?"paddingBlock":"paddingInline"]:r,[c]:o(r).mul(3).equal(),["".concat(n,"-rail")]:{[l]:"100%",[c]:r},["".concat(n,"-track,").concat(n,"-tracks")]:{[c]:r},["".concat(n,"-track-draggable")]:Object.assign({},p),["".concat(n,"-handle")]:{[u]:h},["".concat(n,"-mark")]:{insetInlineStart:0,top:0,[d]:o(r).mul(3).add(t?0:i).equal(),[l]:"100%"},["".concat(n,"-step")]:{insetInlineStart:0,top:0,[d]:r,[l]:"100%",[c]:r},["".concat(n,"-dot")]:{position:"absolute",[u]:o(r).sub(s).div(2).equal()}}},G=e=>{let{componentCls:t,marginPartWithMark:n}=e;return{["".concat(t,"-horizontal")]:Object.assign(Object.assign({},J(e,!0)),{["&".concat(t,"-with-marks")]:{marginBottom:n}})}},K=e=>{let{componentCls:t}=e;return{["".concat(t,"-vertical")]:Object.assign(Object.assign({},J(e,!1)),{height:"100%"})}};var Y=(0,F.I$)("Slider",e=>{let t=(0,V.IX)(e,{marginPart:e.calc(e.controlHeight).sub(e.controlSize).div(2).equal(),marginFull:e.calc(e.controlSize).div(2).equal(),marginPartWithMark:e.calc(e.controlHeightLG).sub(e.controlSize).equal()});return[X(t),G(t),K(t)]},e=>{let t=e.controlHeightLG/4,n=e.controlHeightSM/2,r=e.lineWidth+1,a=e.lineWidth+1.5,s=e.colorPrimary,i=new U.t(s).setA(.2).toRgbString();return{controlSize:t,railSize:4,handleSize:t,handleSizeHover:n,dotSize:8,handleLineWidth:r,handleLineWidthHover:a,railBg:e.colorFillTertiary,railHoverBg:e.colorFillSecondary,trackBg:e.colorPrimaryBorder,trackHoverBg:e.colorPrimaryBorderHover,handleColor:e.colorPrimaryBorder,handleActiveColor:s,handleActiveOutlineColor:i,handleColorDisabled:new U.t(e.colorTextDisabled).onBackground(e.colorBgContainer).toHexString(),dotBorderColor:e.colorBorderSecondary,dotActiveBorderColor:e.colorPrimaryBorder,trackBgDisabled:e.colorBgContainerDisabled}});function Q(){let[e,t]=r.useState(!1),n=r.useRef(null),a=()=>{N.Z.cancel(n.current)};return r.useEffect(()=>a,[]),[e,e=>{a(),e?t(e):n.current=(0,N.Z)(()=>{t(e)})}]}var ee=n(71744),et=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},en=r.forwardRef((e,t)=>{let{prefixCls:n,range:a,className:i,rootClassName:o,style:l,disabled:c,tooltipPrefixCls:u,tipFormatter:d,tooltipVisible:h,getTooltipPopupContainer:f,tooltipPlacement:p,tooltip:g={},onChangeComplete:m,classNames:b,styles:v}=e,y=et(e,["prefixCls","range","className","rootClassName","style","disabled","tooltipPrefixCls","tipFormatter","tooltipVisible","getTooltipPopupContainer","tooltipPlacement","tooltip","onChangeComplete","classNames","styles"]),{vertical:w}=e,{getPrefixCls:_,direction:k,className:S,style:x,classNames:M,styles:E,getPopupContainer:C}=(0,ee.dj)("slider"),R=r.useContext(z.Z),{handleRender:P,direction:O}=r.useContext($),j="rtl"===(O||k),[I,A]=Q(),[L,Z]=Q(),q=Object.assign({},g),{open:D,placement:H,getPopupContainer:U,prefixCls:W,formatter:F}=q,V=null!=D?D:h,X=(I||L)&&!1!==V,J=F||null===F?F:d||null===d?d:e=>"number"==typeof e?e.toString():"",[G,K]=Q(),en=(e,t)=>e||(t?j?"left":"right":"top"),er=_("slider",n),[ea,es,ei]=Y(er),eo=s()(i,S,M.root,null==b?void 0:b.root,o,{["".concat(er,"-rtl")]:j,["".concat(er,"-lock")]:G},es,ei);j&&!y.vertical&&(y.reverse=!y.reverse),r.useEffect(()=>{let e=()=>{(0,N.Z)(()=>{Z(!1)},1)};return document.addEventListener("mouseup",e),()=>{document.removeEventListener("mouseup",e)}},[]);let el=a&&!V,ec=P||((e,t)=>{let{index:n}=t,a=e.props;function s(e,t,n){var r,s;n&&(null===(r=y[e])||void 0===r||r.call(y,t)),null===(s=a[e])||void 0===s||s.call(a,t)}let i=Object.assign(Object.assign({},a),{onMouseEnter:e=>{A(!0),s("onMouseEnter",e)},onMouseLeave:e=>{A(!1),s("onMouseLeave",e)},onMouseDown:e=>{Z(!0),K(!0),s("onMouseDown",e)},onFocus:e=>{var t;Z(!0),null===(t=y.onFocus)||void 0===t||t.call(y,e),s("onFocus",e,!0)},onBlur:e=>{var t;Z(!1),null===(t=y.onBlur)||void 0===t||t.call(y,e),s("onBlur",e,!0)}}),o=r.cloneElement(e,i),l=(!!V||X)&&null!==J;return el?o:r.createElement(B,Object.assign({},q,{prefixCls:_("tooltip",null!=W?W:u),title:J?J(t.value):"",value:t.value,open:l,placement:en(null!=H?H:p,w),key:n,classNames:{root:"".concat(er,"-tooltip")},getPopupContainer:U||f||C}),o)}),eu=el?(e,t)=>{let n=r.cloneElement(e,{style:Object.assign(Object.assign({},e.props.style),{visibility:"hidden"})});return r.createElement(B,Object.assign({},q,{prefixCls:_("tooltip",null!=W?W:u),title:J?J(t.value):"",open:null!==J&&X,placement:en(null!=H?H:p,w),key:"tooltip",classNames:{root:"".concat(er,"-tooltip")},getPopupContainer:U||f||C,draggingDelete:t.draggingDelete}),n)}:void 0,ed=Object.assign(Object.assign(Object.assign(Object.assign({},E.root),x),null==v?void 0:v.root),l),eh=Object.assign(Object.assign({},E.tracks),null==v?void 0:v.tracks),ef=s()(M.tracks,null==b?void 0:b.tracks);return ea(r.createElement(T,Object.assign({},y,{classNames:Object.assign({handle:s()(M.handle,null==b?void 0:b.handle),rail:s()(M.rail,null==b?void 0:b.rail),track:s()(M.track,null==b?void 0:b.track)},ef?{tracks:ef}:{}),styles:Object.assign({handle:Object.assign(Object.assign({},E.handle),null==v?void 0:v.handle),rail:Object.assign(Object.assign({},E.rail),null==v?void 0:v.rail),track:Object.assign(Object.assign({},E.track),null==v?void 0:v.track)},Object.keys(eh).length?{tracks:eh}:{}),step:y.step,range:a,className:eo,style:ed,disabled:null!=c?c:R,ref:t,prefixCls:er,handleRender:ec,activeHandleRender:eu,onChangeComplete:e=>{null==m||m(e),K(!1)}})))})},33145:function(e,t,n){n.d(t,{default:function(){return a.a}});var r=n(48461),a=n.n(r)},65878:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return y}});let r=n(47043),a=n(53099),s=n(57437),i=a._(n(2265)),o=r._(n(54887)),l=r._(n(38293)),c=n(55346),u=n(90128),d=n(62589);n(31765);let h=n(25523),f=r._(n(5084)),p={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function g(e,t,n,r,a,s,i){let o=null==e?void 0: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),null==n?void 0:n.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,a=!1;n.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>a,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{a=!0,t.stopPropagation()}})}(null==r?void 0:r.current)&&r.current(e)}}))}function m(e){return i.use?{fetchPriority:e}:{fetchpriority:e}}"undefined"==typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let b=(0,i.forwardRef)((e,t)=>{let{src:n,srcSet:r,sizes:a,height:o,width:l,decoding:c,className:u,style:d,fetchPriority:h,placeholder:f,loading:p,unoptimized:b,fill:v,onLoadRef:y,onLoadingCompleteRef:w,setBlurComplete:_,setShowAltText:k,sizesInput:S,onLoad:x,onError:M,...E}=e;return(0,s.jsx)("img",{...E,...m(h),loading:p,width:l,height:o,decoding:c,"data-nimg":v?"fill":"1",className:u,style:d,sizes:a,srcSet:r,src:n,ref:(0,i.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(M&&(e.src=e.src),e.complete&&g(e,f,y,w,_,b,S))},[n,f,y,w,_,M,b,S,t]),onLoad:e=>{g(e.currentTarget,f,y,w,_,b,S)},onError:e=>{k(!0),"empty"!==f&&_(!0),M&&M(e)}})});function v(e){let{isAppRouter:t,imgAttributes:n}=e,r={as:"image",imageSrcSet:n.srcSet,imageSizes:n.sizes,crossOrigin:n.crossOrigin,referrerPolicy:n.referrerPolicy,...m(n.fetchPriority)};return t&&o.default.preload?(o.default.preload(n.src,r),null):(0,s.jsx)(l.default,{children:(0,s.jsx)("link",{rel:"preload",href:n.srcSet?void 0:n.src,...r},"__nimg-"+n.src+n.srcSet+n.sizes)})}let y=(0,i.forwardRef)((e,t)=>{let n=(0,i.useContext)(h.RouterContext),r=(0,i.useContext)(d.ImageConfigContext),a=(0,i.useMemo)(()=>{var e;let t=p||r||u.imageConfigDefault,n=[...t.deviceSizes,...t.imageSizes].sort((e,t)=>e-t),a=t.deviceSizes.sort((e,t)=>e-t),s=null==(e=t.qualities)?void 0:e.sort((e,t)=>e-t);return{...t,allSizes:n,deviceSizes:a,qualities:s}},[r]),{onLoad:o,onLoadingComplete:l}=e,g=(0,i.useRef)(o);(0,i.useEffect)(()=>{g.current=o},[o]);let m=(0,i.useRef)(l);(0,i.useEffect)(()=>{m.current=l},[l]);let[y,w]=(0,i.useState)(!1),[_,k]=(0,i.useState)(!1),{props:S,meta:x}=(0,c.getImgProps)(e,{defaultLoader:f.default,imgConf:a,blurComplete:y,showAltText:_});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b,{...S,unoptimized:x.unoptimized,placeholder:x.placeholder,fill:x.fill,onLoadRef:g,onLoadingCompleteRef:m,setBlurComplete:w,setShowAltText:k,sizesInput:e.sizes,ref:t}),x.priority?(0,s.jsx)(v,{isAppRouter:!n,imgAttributes:S}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},91436:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return r}});let r=n(47043)._(n(2265)).default.createContext({})},23964:function(e,t){function n(e){let{ampFirst:t=!1,hybrid:n=!1,hasQuery:r=!1}=void 0===e?{}:e;return t||n&&r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return n}})},55346:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return o}}),n(31765);let r=n(96496),a=n(90128);function s(e){return void 0!==e.default}function i(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 o(e,t){var n,o;let l,c,u,{src:d,sizes:h,unoptimized:f=!1,priority:p=!1,loading:g,className:m,quality:b,width:v,height:y,fill:w=!1,style:_,overrideSrc:k,onLoad:S,onLoadingComplete:x,placeholder:M="empty",blurDataURL:E,fetchPriority:C,decoding:R="async",layout:P,objectFit:O,objectPosition:j,lazyBoundary:I,lazyRoot:A,...L}=e,{imgConf:Z,showAltText:T,blurComplete:N,defaultLoader:z}=t,$=Z||a.imageConfigDefault;if("allSizes"in $)l=$;else{let e=[...$.deviceSizes,...$.imageSizes].sort((e,t)=>e-t),t=$.deviceSizes.sort((e,t)=>e-t),r=null==(n=$.qualities)?void 0:n.sort((e,t)=>e-t);l={...$,allSizes:e,deviceSizes:t,qualities:r}}if(void 0===z)throw Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config");let q=L.loader||z;delete L.loader,delete L.srcSet;let D="__next_img_default"in q;if(D){if("custom"===l.loader)throw Error('Image with src "'+d+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=q;q=t=>{let{config:n,...r}=t;return e(r)}}if(P){"fill"===P&&(w=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[P];e&&(_={..._,...e});let t={responsive:"100vw",fill:"100vw"}[P];t&&!h&&(h=t)}let B="",H=i(v),U=i(y);if("object"==typeof(o=d)&&(s(o)||void 0!==o.src)){let e=s(d)?d.default:d;if(!e.src)throw 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(e));if(!e.height||!e.width)throw 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(e));if(c=e.blurWidth,u=e.blurHeight,E=E||e.blurDataURL,B=e.src,!w){if(H||U){if(H&&!U){let t=H/e.width;U=Math.round(e.height*t)}else if(!H&&U){let t=U/e.height;H=Math.round(e.width*t)}}else H=e.width,U=e.height}}let W=!p&&("lazy"===g||void 0===g);(!(d="string"==typeof d?d:B)||d.startsWith("data:")||d.startsWith("blob:"))&&(f=!0,W=!1),l.unoptimized&&(f=!0),D&&d.endsWith(".svg")&&!l.dangerouslyAllowSVG&&(f=!0),p&&(C="high");let F=i(b),V=Object.assign(w?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:O,objectPosition:j}:{},T?{}:{color:"transparent"},_),X=N||"empty"===M?null:"blur"===M?'url("data:image/svg+xml;charset=utf-8,'+(0,r.getImageBlurSvg)({widthInt:H,heightInt:U,blurWidth:c,blurHeight:u,blurDataURL:E||"",objectFit:V.objectFit})+'")':'url("'+M+'")',J=X?{backgroundSize:V.objectFit||"cover",backgroundPosition:V.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:X}:{},G=function(e){let{config:t,src:n,unoptimized:r,width:a,quality:s,sizes:i,loader:o}=e;if(r)return{src:n,srcSet:void 0,sizes:void 0};let{widths:l,kind:c}=function(e,t,n){let{deviceSizes:r,allSizes:a}=e;if(n){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let r;r=e.exec(n);r)t.push(parseInt(r[2]));if(t.length){let e=.01*Math.min(...t);return{widths:a.filter(t=>t>=r[0]*e),kind:"w"}}return{widths:a,kind:"w"}}return"number"!=typeof t?{widths:r,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>a.find(t=>t>=e)||a[a.length-1]))],kind:"x"}}(t,a,i),u=l.length-1;return{sizes:i||"w"!==c?i:"100vw",srcSet:l.map((e,r)=>o({config:t,src:n,quality:s,width:e})+" "+("w"===c?e:r+1)+c).join(", "),src:o({config:t,src:n,quality:s,width:l[u]})}}({config:l,src:d,unoptimized:f,width:H,quality:F,sizes:h,loader:q});return{props:{...L,loading:W?"lazy":g,fetchPriority:C,width:H,height:U,decoding:R,className:m,style:{...V,...J},sizes:G.sizes,srcSet:G.srcSet,src:k||G.src},meta:{unoptimized:f,priority:p,placeholder:M,fill:w}}}},38293:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return g},defaultHead:function(){return d}});let r=n(47043),a=n(53099),s=n(57437),i=a._(n(2265)),o=r._(n(17421)),l=n(91436),c=n(48701),u=n(23964);function d(e){void 0===e&&(e=!1);let t=[(0,s.jsx)("meta",{charSet:"utf-8"})];return e||t.push((0,s.jsx)("meta",{name:"viewport",content:"width=device-width"})),t}function h(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===i.default.Fragment?e.concat(i.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}n(31765);let f=["name","httpEquiv","charSet","itemProp"];function p(e,t){let{inAmpMode:n}=t;return e.reduce(h,[]).reverse().concat(d(n).reverse()).filter(function(){let e=new Set,t=new Set,n=new Set,r={};return a=>{let s=!0,i=!1;if(a.key&&"number"!=typeof a.key&&a.key.indexOf("$")>0){i=!0;let t=a.key.slice(a.key.indexOf("$")+1);e.has(t)?s=!1:e.add(t)}switch(a.type){case"title":case"base":t.has(a.type)?s=!1:t.add(a.type);break;case"meta":for(let e=0,t=f.length;e{let r=e.key||t;if(!n&&"link"===e.type&&e.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(t=>e.props.href.startsWith(t))){let t={...e.props||{}};return t["data-href"]=t.href,t.href=void 0,t["data-optimized-fonts"]=!0,i.default.cloneElement(e,t)}return i.default.cloneElement(e,{key:r})})}let g=function(e){let{children:t}=e,n=(0,i.useContext)(l.AmpStateContext),r=(0,i.useContext)(c.HeadManagerContext);return(0,s.jsx)(o.default,{reduceComponentsToState:p,headManager:r,inAmpMode:(0,u.isInAmpMode)(n),children:t})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},96496:function(e,t){function n(e){let{widthInt:t,heightInt:n,blurWidth:r,blurHeight:a,blurDataURL:s,objectFit:i}=e,o=r?40*r:t,l=a?40*a:n,c=o&&l?"viewBox='0 0 "+o+" "+l+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+c+"%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='"+(c?"none":"contain"===i?"xMidYMid":"cover"===i?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+s+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},62589:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return s}});let r=n(47043)._(n(2265)),a=n(90128),s=r.default.createContext(a.imageConfigDefault)},90128:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{VALID_LOADERS:function(){return n},imageConfigDefault:function(){return r}});let n=["default","imgix","cloudinary","akamai","custom"],r={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"inline",localPatterns:void 0,remotePatterns:[],qualities:void 0,unoptimized:!1}},48461:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return l},getImageProps:function(){return o}});let r=n(47043),a=n(55346),s=n(65878),i=r._(n(5084));function o(e){let{props:t}=(0,a.getImgProps)(e,{defaultLoader:i.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,n]of Object.entries(t))void 0===n&&delete t[e];return{props:t}}let l=s.Image},5084:function(e,t){function n(e){var t;let{config:n,src:r,width:a,quality:s}=e,i=s||(null==(t=n.qualities)?void 0:t.reduce((e,t)=>Math.abs(t-75){}:r.useLayoutEffect,i=a?()=>{}:r.useEffect;function o(e){let{headManager:t,reduceComponentsToState:n}=e;function o(){if(t&&t.mountedInstances){let a=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(n(a,e))}}if(a){var l;null==t||null==(l=t.mountedInstances)||l.add(e.children),o()}return s(()=>{var n;return null==t||null==(n=t.mountedInstances)||n.add(e.children),()=>{var n;null==t||null==(n=t.mountedInstances)||n.delete(e.children)}}),s(()=>(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}},85498:function(e,t,n){var r,a,s,i,o,l,c,u,d,h,f,p,g,m,b,v,y,w,_,k,S,x,M,E,C,R,P,O,j,I,A,L,Z,T,N,z,$,q,D,B,H,U,W,F,V,X,J,G,K;let Y,Q,ee;function et(e,t,n,r,a){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!a)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,n):a?a.value=n:t.set(e,n),n}function en(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}n.d(t,{ZP:function(){return tD}});let er=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return er=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>255*Math.random()&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^n()&15>>+e/4).toString(16))};function ea(e){return"object"==typeof e&&null!==e&&("name"in e&&"AbortError"===e.name||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}let es=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e){try{if("[object Error]"===Object.prototype.toString.call(e)){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};class ei extends Error{}class eo extends ei{constructor(e,t,n,r){super(`${eo.makeMessage(e,t,n)}`),this.status=e,this.headers=r,this.requestID=r?.get("request-id"),this.error=t}static makeMessage(e,t,n){let r=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,t,n,r){return e&&r?400===e?new ed(e,t,n,r):401===e?new eh(e,t,n,r):403===e?new ef(e,t,n,r):404===e?new ep(e,t,n,r):409===e?new eg(e,t,n,r):422===e?new em(e,t,n,r):429===e?new eb(e,t,n,r):e>=500?new ev(e,t,n,r):new eo(e,t,n,r):new ec({message:n,cause:es(t)})}}class el extends eo{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class ec extends eo{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class eu extends ec{constructor({message:e}={}){super({message:e??"Request timed out."})}}class ed extends eo{}class eh extends eo{}class ef extends eo{}class ep extends eo{}class eg extends eo{}class em extends eo{}class eb extends eo{}class ev extends eo{}let ey=/^[a-z][a-z0-9+.-]*:/i,ew=e=>ey.test(e);function e_(e){return"object"!=typeof e?{}:e??{}}let ek=(e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new ei(`${e} must be an integer`);if(t<0)throw new ei(`${e} must be a positive integer`);return t},eS=e=>{try{return JSON.parse(e)}catch(e){return}},ex=e=>new Promise(t=>setTimeout(t,e)),eM={off:0,error:200,warn:300,info:400,debug:500},eE=(e,t,n)=>{if(e){if(Object.prototype.hasOwnProperty.call(eM,e))return e;ej(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(eM))}`)}};function eC(){}function eR(e,t,n){return!t||eM[e]>eM[n]?eC:t[e].bind(t)}let eP={error:eC,warn:eC,info:eC,debug:eC},eO=new WeakMap;function ej(e){let t=e.logger,n=e.logLevel??"off";if(!t)return eP;let r=eO.get(t);if(r&&r[0]===n)return r[1];let a={error:eR("error",t,n),warn:eR("warn",t,n),info:eR("info",t,n),debug:eR("debug",t,n)};return eO.set(t,[n,a]),a}let eI=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,"x-api-key"===e.toLowerCase()||"authorization"===e.toLowerCase()||"cookie"===e.toLowerCase()||"set-cookie"===e.toLowerCase()?"***":t]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e),eA="0.54.0",eL=()=>"undefined"!=typeof window&&void 0!==window.document&&"undefined"!=typeof navigator,eZ=()=>{let e="undefined"!=typeof Deno&&null!=Deno.build?"deno":"undefined"!=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":eA,"X-Stainless-OS":eN(Deno.build.os),"X-Stainless-Arch":eT(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("undefined"!=typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eA,"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":eA,"X-Stainless-OS":eN(globalThis.process.platform??"unknown"),"X-Stainless-Arch":eT(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=function(){if("undefined"==typeof navigator||!navigator)return null;for(let{key:e,pattern:t}of[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n){let t=n[1]||0,r=n[2]||0,a=n[3]||0;return{browser:e,version:`${t}.${r}.${a}`}}}return null}();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eA,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eA,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},eT=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",eN=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown",ez=()=>Y??(Y=eZ());function e$(...e){let t=globalThis.ReadableStream;if(void 0===t)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function eq(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return e$({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function eD(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function eB(e){if(null===e||"object"!=typeof e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}let eH=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function eU(e){let t;return(Q??(Q=(t=new globalThis.TextEncoder).encode.bind(t)))(e)}function eW(e){let t;return(ee??(ee=(t=new globalThis.TextDecoder).decode.bind(t)))(e)}class eF{constructor(){r.set(this,void 0),a.set(this,void 0),et(this,r,new Uint8Array,"f"),et(this,a,null,"f")}decode(e){let t;if(null==e)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):"string"==typeof e?eU(e):e;et(this,r,function(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}([en(this,r,"f"),n]),"f");let s=[];for(;null!=(t=function(e,t){for(let n=t??0;n({next:()=>{if(0===r.length){let r=n.next();e.push(r),t.push(r)}return r.shift()}});return[new eV(()=>r(e),this.controller),new eV(()=>r(t),this.controller)]}toReadableStream(){let e;let t=this;return e$({async start(){e=t[Symbol.asyncIterator]()},async pull(t){try{let{value:n,done:r}=await e.next();if(r)return t.close();let a=eU(JSON.stringify(n)+"\n");t.enqueue(a)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}}async function*eX(e,t){if(!e.body){if(t.abort(),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product)throw new ei("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ei("Attempted to iterate over a response with no body")}let n=new eG,r=new eF;for await(let t of eJ(eD(e.body)))for(let e of r.decode(t)){let t=n.decode(e);t&&(yield t)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*eJ(e){let t=new Uint8Array;for await(let n of e){let e;if(null==n)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):"string"==typeof n?eU(n):n,a=new Uint8Array(t.length+r.length);for(a.set(t),a.set(r,t.length),t=a;-1!==(e=function(e){for(let t=0;t0&&(yield t)}class eG{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join("\n"),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,n,r]=function(e,t){let n=e.indexOf(":");return -1!==n?[e.substring(0,n),":",e.substring(n+t.length)]:[e,"",""]}(e,":");return r.startsWith(" ")&&(r=r.substring(1)),"event"===t?this.event=r:"data"===t&&this.data.push(r),null}}async function eK(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:a,startTime:s}=t,i=await (async()=>{if(t.options.stream)return(ej(e).debug("response",n.status,n.url,n.headers,n.body),t.options.__streamClass)?t.options.__streamClass.fromSSEResponse(n,t.controller):eV.fromSSEResponse(n,t.controller);if(204===n.status)return null;if(t.options.__binaryResponse)return n;let r=n.headers.get("content-type"),a=r?.split(";")[0]?.trim();return a?.includes("application/json")||a?.endsWith("+json")?eY(await n.json(),n):await n.text()})();return ej(e).debug(`[${r}] response parsed`,eI({retryOfRequestLogID:a,url:n.url,status:n.status,body:i,durationMs:Date.now()-s})),i}function eY(e,t){return!e||"object"!=typeof e||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}class eQ extends Promise{constructor(e,t,n=eK){super(e=>{e(null)}),this.responsePromise=t,this.parseResponse=n,s.set(this,void 0),et(this,s,e,"f")}_thenUnwrap(e){return new eQ(en(this,s,"f"),this.responsePromise,async(t,n)=>eY(e(await this.parseResponse(t,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(en(this,s,"f"),e))),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}s=new WeakMap;class e0{constructor(e,t,n,r){i.set(this,void 0),et(this,i,e,"f"),this.options=r,this.response=t,this.body=n}hasNextPage(){return!!this.getPaginatedItems().length&&null!=this.nextPageRequestOptions()}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new ei("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await en(this,i,"f").requestAPIList(this.constructor,e)}async *iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async *[(i=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}}class e1 extends eQ{constructor(e,t,n){super(e,t,async(e,t)=>new n(e,t.response,await eK(e,t),t.options))}async *[Symbol.asyncIterator](){for await(let e of(await this))yield e}}class e2 extends e0{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return!1!==this.has_more&&super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let e=this.first_id;return e?{...this.options,query:{...e_(this.options.query),before_id:e}}:null}let e=this.last_id;return e?{...this.options,query:{...e_(this.options.query),after_id:e}}:null}}let e3=()=>{if("undefined"==typeof File){let{process:e}=globalThis;throw Error("`File` is not defined as a global, which is required for file uploads."+("string"==typeof e?.versions?.node&&20>parseInt(e.versions.node.split("."))?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function e4(e,t,n){return e3(),new File(e,t??"unknown_file",n)}function e6(e){return("object"==typeof e&&null!==e&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}let e8=e=>null!=e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator],e5=async(e,t)=>({...e,body:await e7(e.body,t)}),e9=new WeakMap,e7=async(e,t)=>{if(!await function(e){let t="function"==typeof e?e:e.fetch,n=e9.get(t);if(n)return n;let r=(async()=>{try{let e="Response"in t?t.Response:(await t("data:,")).constructor,n=new FormData;if(n.toString()===await new e(n).text())return!1;return!0}catch{return!0}})();return e9.set(t,r),r}(t))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(e||{}).map(([e,t])=>tr(n,e,t))),n},te=e=>e instanceof Blob&&"name"in e,tt=e=>"object"==typeof e&&null!==e&&(e instanceof Response||e8(e)||te(e)),tn=e=>{if(tt(e))return!0;if(Array.isArray(e))return e.some(tn);if(e&&"object"==typeof e){for(let t in e)if(tn(e[t]))return!0}return!1},tr=async(e,t,n)=>{if(void 0!==n){if(null==n)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)e.append(t,String(n));else if(n instanceof Response){let r={},a=n.headers.get("Content-Type");a&&(r={type:a}),e.append(t,e4([await n.blob()],e6(n),r))}else if(e8(n))e.append(t,e4([await new Response(eq(n)).blob()],e6(n)));else if(te(n))e.append(t,e4([n],e6(n),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(n=>tr(e,t+"[]",n)));else if("object"==typeof n)await Promise.all(Object.entries(n).map(([n,r])=>tr(e,`${t}[${n}]`,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}},ta=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer,ts=e=>null!=e&&"object"==typeof e&&"string"==typeof e.name&&"number"==typeof e.lastModified&&ta(e),ti=e=>null!=e&&"object"==typeof e&&"string"==typeof e.url&&"function"==typeof e.blob;async function to(e,t,n){if(e3(),e=await e,t||(t=e6(e)),ts(e))return e instanceof File&&null==t&&null==n?e:e4([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(ti(e)){let r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),e4(await tl(r),t,n)}let r=await tl(e);if(!n?.type){let e=r.find(e=>"object"==typeof e&&"type"in e&&e.type);"string"==typeof e&&(n={...n,type:e})}return e4(r,t,n)}async function tl(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(ta(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(e8(e))for await(let n of e)t.push(...await tl(n));else{let t=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${t?`; constructor: ${t}`:""}${function(e){if("object"!=typeof e||null===e)return"";let t=Object.getOwnPropertyNames(e);return`; props: [${t.map(e=>`"${e}"`).join(", ")}]`}(e)}`)}return t}class tc{constructor(e){this._client=e}}let tu=Symbol.for("brand.privateNullableHeaders"),td=Array.isArray,th=e=>{let t=new Headers,n=new Set;for(let r of e){let e=new Set;for(let[a,s]of function*(e){let t;if(!e)return;if(tu in e){let{values:t,nulls:n}=e;for(let e of(yield*t.entries(),n))yield[e,null];return}let n=!1;for(let r of(e instanceof Headers?t=e.entries():td(e)?t=e:(n=!0,t=Object.entries(e??{})),t)){let e=r[0];if("string"!=typeof e)throw TypeError("expected header name to be a string");let t=td(r[1])?r[1]:[r[1]],a=!1;for(let r of t)void 0!==r&&(n&&!a&&(a=!0,yield[e,null]),yield[e,r])}}(r)){let r=a.toLowerCase();e.has(r)||(t.delete(a),e.add(r)),null===s?(t.delete(a),n.add(r)):(t.append(a,s),n.delete(r))}}return{[tu]:!0,values:t,nulls:n}};function tf(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}let tp=((e=tf)=>function(t,...n){let r;if(1===t.length)return t[0];let a=!1,s=t.reduce((t,r,s)=>(/[?#]/.test(r)&&(a=!0),t+r+(s===n.length?"":(a?encodeURIComponent:e)(String(n[s])))),""),i=s.split(/[?#]/,1)[0],o=[],l=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;for(;null!==(r=l.exec(i));)o.push({start:r.index,length:r[0].length});if(o.length>0){let e=0,t=o.reduce((t,n)=>{let r=" ".repeat(n.start-e),a="^".repeat(n.length);return e=n.start+n.length,t+r+a},"");throw new ei(`Path parameters result in path with invalid segments: -${s} -${t}`)}return s})(tf);class tg extends tc{list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/files",e2,{query:r,...t,headers:th([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(tp`/v1/files/${e}`,{...n,headers:th([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,t={},n){let{betas:r}=t??{};return this._client.get(tp`/v1/files/${e}/content`,{...n,headers:th([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,t={},n){let{betas:r}=t??{};return this._client.get(tp`/v1/files/${e}`,{...n,headers:th([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,t){let{betas:n,...r}=e;return this._client.post("/v1/files",e5({body:r,...t,headers:th([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},t?.headers])},this._client))}}class tm extends tc{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(tp`/v1/models/${e}?beta=true`,{...n,headers:th([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/models?beta=true",e2,{query:r,...t,headers:th([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers])})}}class tb{constructor(e,t){this.iterator=e,this.controller=t}async *decoder(){let e=new eF;for await(let t of this.iterator)for(let n of e.decode(t))yield JSON.parse(n);for(let t of e.flush())yield JSON.parse(t)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,t){if(!e.body){if(t.abort(),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product)throw new ei("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ei("Attempted to iterate over a response with no body")}return new tb(eD(e.body),t)}}class tv extends tc{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/messages/batches?beta=true",{body:r,...t,headers:th([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(tp`/v1/messages/batches/${e}?beta=true`,{...n,headers:th([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",e2,{query:r,...t,headers:th([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(tp`/v1/messages/batches/${e}?beta=true`,{...n,headers:th([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,t={},n){let{betas:r}=t??{};return this._client.post(tp`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:th([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,t={},n){let r=await this.retrieve(e);if(!r.results_url)throw new ei(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{betas:a}=t??{};return this._client.get(r.results_url,{...n,headers:th([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((e,t)=>tb.fromResponse(t.response,t.controller))}}let ty=e=>{let t=0,n=[];for(;t{if(0===e.length)return e;let t=e[e.length-1];switch(t.type){case"separator":return tw(e=e.slice(0,e.length-1));case"number":let n=t.value[t.value.length-1];if("."===n||"-"===n)return tw(e=e.slice(0,e.length-1));case"string":let r=e[e.length-2];if(r?.type==="delimiter"||r?.type==="brace"&&"{"===r.value)return tw(e=e.slice(0,e.length-1));break;case"delimiter":return tw(e=e.slice(0,e.length-1))}return e},t_=e=>{let t=[];return e.map(e=>{"brace"===e.type&&("{"===e.value?t.push("}"):t.splice(t.lastIndexOf("}"),1)),"paren"===e.type&&("["===e.value?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(t=>{"}"===t?e.push({type:"brace",value:"}"}):"]"===t&&e.push({type:"paren",value:"]"})}),e},tk=e=>{let t="";return e.map(e=>{"string"===e.type?t+='"'+e.value+'"':t+=e.value}),t},tS=e=>JSON.parse(tk(t_(tw(ty(e))))),tx="__json_buf";function tM(e){return"tool_use"===e.type||"server_tool_use"===e.type||"mcp_tool_use"===e.type}class tE{constructor(){o.add(this),this.messages=[],this.receivedMessages=[],l.set(this,void 0),this.controller=new AbortController,c.set(this,void 0),u.set(this,()=>{}),d.set(this,()=>{}),h.set(this,void 0),f.set(this,()=>{}),p.set(this,()=>{}),g.set(this,{}),m.set(this,!1),b.set(this,!1),v.set(this,!1),y.set(this,!1),w.set(this,void 0),_.set(this,void 0),x.set(this,e=>{if(et(this,b,!0,"f"),ea(e)&&(e=new el),e instanceof el)return et(this,v,!0,"f"),this._emit("abort",e);if(e instanceof ei)return this._emit("error",e);if(e instanceof Error){let t=new ei(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new ei(String(e)))}),et(this,c,new Promise((e,t)=>{et(this,u,e,"f"),et(this,d,t,"f")}),"f"),et(this,h,new Promise((e,t)=>{et(this,f,e,"f"),et(this,p,t,"f")}),"f"),en(this,c,"f").catch(()=>{}),en(this,h,"f").catch(()=>{})}get response(){return en(this,w,"f")}get request_id(){return en(this,_,"f")}async withResponse(){let e=await en(this,c,"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 tE;return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,n){let r=new tE;for(let e of t.messages)r._addMessageParam(e);return r._run(()=>r._createMessage(e,{...t,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},en(this,x,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit("message",e)}async _createMessage(e,t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),en(this,o,"m",M).call(this);let{response:a,data:s}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();for await(let e of(this._connected(a),s))en(this,o,"m",E).call(this,e);if(s.controller.signal?.aborted)throw new el;en(this,o,"m",C).call(this)}_connected(e){this.ended||(et(this,w,e,"f"),et(this,_,e?.headers.get("request-id"),"f"),en(this,u,"f").call(this,e),this._emit("connect"))}get ended(){return en(this,m,"f")}get errored(){return en(this,b,"f")}get aborted(){return en(this,v,"f")}abort(){this.controller.abort()}on(e,t){return(en(this,g,"f")[e]||(en(this,g,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=en(this,g,"f")[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(en(this,g,"f")[e]||(en(this,g,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{et(this,y,!0,"f"),"error"!==e&&this.once("error",n),this.once(e,t)})}async done(){et(this,y,!0,"f"),await en(this,h,"f")}get currentMessage(){return en(this,l,"f")}async finalMessage(){return await this.done(),en(this,o,"m",k).call(this)}async finalText(){return await this.done(),en(this,o,"m",S).call(this)}_emit(e,...t){if(en(this,m,"f"))return;"end"===e&&(et(this,m,!0,"f"),en(this,f,"f").call(this));let n=en(this,g,"f")[e];if(n&&(en(this,g,"f")[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];en(this,y,"f")||n?.length||Promise.reject(e),en(this,d,"f").call(this,e),en(this,p,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];en(this,y,"f")||n?.length||Promise.reject(e),en(this,d,"f").call(this,e),en(this,p,"f").call(this,e),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",en(this,o,"m",k).call(this))}async _fromReadableStream(e,t){let n=t?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),en(this,o,"m",M).call(this),this._connected(null);let r=eV.fromReadableStream(e,this.controller);for await(let e of r)en(this,o,"m",E).call(this,e);if(r.controller.signal?.aborted)throw new el;en(this,o,"m",C).call(this)}[(l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,g=new WeakMap,m=new WeakMap,b=new WeakMap,v=new WeakMap,y=new WeakMap,w=new WeakMap,_=new WeakMap,x=new WeakMap,o=new WeakSet,k=function(){if(0===this.receivedMessages.length)throw new ei("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},S=function(){if(0===this.receivedMessages.length)throw new ei("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 ei("stream ended without producing a content block with type=text");return e.join(" ")},M=function(){this.ended||et(this,l,void 0,"f")},E=function(e){if(this.ended)return;let t=en(this,o,"m",R).call(this,e);switch(this._emit("streamEvent",e,t),e.type){case"content_block_delta":{let n=t.content.at(-1);switch(e.delta.type){case"text_delta":"text"===n.type&&this._emit("text",e.delta.text,n.text||"");break;case"citations_delta":"text"===n.type&&this._emit("citation",e.delta.citation,n.citations??[]);break;case"input_json_delta":tM(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break;case"thinking_delta":"thinking"===n.type&&this._emit("thinking",e.delta.thinking,n.thinking);break;case"signature_delta":"thinking"===n.type&&this._emit("signature",n.signature);break;default: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":et(this,l,t,"f")}},C=function(){if(this.ended)throw new ei("stream has ended, this shouldn't happen");let e=en(this,l,"f");if(!e)throw new ei("request ended without sending any chunks");return et(this,l,void 0,"f"),e},R=function(e){let t=en(this,l,"f");if("message_start"===e.type){if(t)throw new ei(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!t)throw new ei(`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.container=e.delta.container,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 n=t.content.at(e.index);switch(e.delta.type){case"text_delta":n?.type==="text"&&(n.text+=e.delta.text);break;case"citations_delta":n?.type==="text"&&(n.citations??(n.citations=[]),n.citations.push(e.delta.citation));break;case"input_json_delta":if(n&&tM(n)){let t=n[tx]||"";if(Object.defineProperty(n,tx,{value:t+=e.delta.partial_json,enumerable:!1,writable:!0}),t)try{n.input=tS(t)}catch(n){let e=new ei(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${n}. JSON: ${t}`);en(this,x,"f").call(this,e)}}break;case"thinking_delta":n?.type==="thinking"&&(n.thinking+=e.delta.thinking);break;case"signature_delta":n?.type==="thinking"&&(n.signature=e.delta.signature);break;default:e.delta}return t}}},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on("streamEvent",n=>{let r=t.shift();r?r.resolve(n):e.push(n)}),this.on("end",()=>{for(let e of(n=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),this.on("error",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((e,n)=>t.push({resolve:e,reject:n})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new eV(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}let tC={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192},tR={"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"};class tP extends tc{constructor(){super(...arguments),this.batches=new tv(this._client)}create(e,t){let{betas:n,...r}=e;r.model in tR&&console.warn(`The model '${r.model}' is deprecated and will reach end-of-life on ${tR[r.model]} -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=tC[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:th([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}stream(e,t){return tE.createMessage(this,e,t)}countTokens(e,t){let{betas:n,...r}=e;return this._client.post("/v1/messages/count_tokens?beta=true",{body:r,...t,headers:th([{"anthropic-beta":[...n??[],"token-counting-2024-11-01"].toString()},t?.headers])})}}tP.Batches=tv;class tO extends tc{constructor(){super(...arguments),this.models=new tm(this._client),this.messages=new tP(this._client),this.files=new tg(this._client)}}tO.Models=tm,tO.Messages=tP,tO.Files=tg;class tj extends tc{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/complete",{body:r,timeout:this._client._options.timeout??6e5,...t,headers:th([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}}let tI="__json_buf";function tA(e){return"tool_use"===e.type||"server_tool_use"===e.type}class tL{constructor(){P.add(this),this.messages=[],this.receivedMessages=[],O.set(this,void 0),this.controller=new AbortController,j.set(this,void 0),I.set(this,()=>{}),A.set(this,()=>{}),L.set(this,void 0),Z.set(this,()=>{}),T.set(this,()=>{}),N.set(this,{}),z.set(this,!1),$.set(this,!1),q.set(this,!1),D.set(this,!1),B.set(this,void 0),H.set(this,void 0),F.set(this,e=>{if(et(this,$,!0,"f"),ea(e)&&(e=new el),e instanceof el)return et(this,q,!0,"f"),this._emit("abort",e);if(e instanceof ei)return this._emit("error",e);if(e instanceof Error){let t=new ei(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new ei(String(e)))}),et(this,j,new Promise((e,t)=>{et(this,I,e,"f"),et(this,A,t,"f")}),"f"),et(this,L,new Promise((e,t)=>{et(this,Z,e,"f"),et(this,T,t,"f")}),"f"),en(this,j,"f").catch(()=>{}),en(this,L,"f").catch(()=>{})}get response(){return en(this,B,"f")}get request_id(){return en(this,H,"f")}async withResponse(){let e=await en(this,j,"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 tL;return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,n){let r=new tL;for(let e of t.messages)r._addMessageParam(e);return r._run(()=>r._createMessage(e,{...t,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},en(this,F,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit("message",e)}async _createMessage(e,t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),en(this,P,"m",V).call(this);let{response:a,data:s}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();for await(let e of(this._connected(a),s))en(this,P,"m",X).call(this,e);if(s.controller.signal?.aborted)throw new el;en(this,P,"m",J).call(this)}_connected(e){this.ended||(et(this,B,e,"f"),et(this,H,e?.headers.get("request-id"),"f"),en(this,I,"f").call(this,e),this._emit("connect"))}get ended(){return en(this,z,"f")}get errored(){return en(this,$,"f")}get aborted(){return en(this,q,"f")}abort(){this.controller.abort()}on(e,t){return(en(this,N,"f")[e]||(en(this,N,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=en(this,N,"f")[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(en(this,N,"f")[e]||(en(this,N,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{et(this,D,!0,"f"),"error"!==e&&this.once("error",n),this.once(e,t)})}async done(){et(this,D,!0,"f"),await en(this,L,"f")}get currentMessage(){return en(this,O,"f")}async finalMessage(){return await this.done(),en(this,P,"m",U).call(this)}async finalText(){return await this.done(),en(this,P,"m",W).call(this)}_emit(e,...t){if(en(this,z,"f"))return;"end"===e&&(et(this,z,!0,"f"),en(this,Z,"f").call(this));let n=en(this,N,"f")[e];if(n&&(en(this,N,"f")[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];en(this,D,"f")||n?.length||Promise.reject(e),en(this,A,"f").call(this,e),en(this,T,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];en(this,D,"f")||n?.length||Promise.reject(e),en(this,A,"f").call(this,e),en(this,T,"f").call(this,e),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",en(this,P,"m",U).call(this))}async _fromReadableStream(e,t){let n=t?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),en(this,P,"m",V).call(this),this._connected(null);let r=eV.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 el;en(this,P,"m",J).call(this)}[(O=new WeakMap,j=new WeakMap,I=new WeakMap,A=new WeakMap,L=new WeakMap,Z=new WeakMap,T=new WeakMap,N=new WeakMap,z=new WeakMap,$=new WeakMap,q=new WeakMap,D=new WeakMap,B=new WeakMap,H=new WeakMap,F=new WeakMap,P=new WeakSet,U=function(){if(0===this.receivedMessages.length)throw new ei("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},W=function(){if(0===this.receivedMessages.length)throw new ei("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 ei("stream ended without producing a content block with type=text");return e.join(" ")},V=function(){this.ended||et(this,O,void 0,"f")},X=function(e){if(this.ended)return;let t=en(this,P,"m",G).call(this,e);switch(this._emit("streamEvent",e,t),e.type){case"content_block_delta":{let n=t.content.at(-1);switch(e.delta.type){case"text_delta":"text"===n.type&&this._emit("text",e.delta.text,n.text||"");break;case"citations_delta":"text"===n.type&&this._emit("citation",e.delta.citation,n.citations??[]);break;case"input_json_delta":tA(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break;case"thinking_delta":"thinking"===n.type&&this._emit("thinking",e.delta.thinking,n.thinking);break;case"signature_delta":"thinking"===n.type&&this._emit("signature",n.signature);break;default: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":et(this,O,t,"f")}},J=function(){if(this.ended)throw new ei("stream has ended, this shouldn't happen");let e=en(this,O,"f");if(!e)throw new ei("request ended without sending any chunks");return et(this,O,void 0,"f"),e},G=function(e){let t=en(this,O,"f");if("message_start"===e.type){if(t)throw new ei(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!t)throw new ei(`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 n=t.content.at(e.index);switch(e.delta.type){case"text_delta":n?.type==="text"&&(n.text+=e.delta.text);break;case"citations_delta":n?.type==="text"&&(n.citations??(n.citations=[]),n.citations.push(e.delta.citation));break;case"input_json_delta":if(n&&tA(n)){let t=n[tI]||"";Object.defineProperty(n,tI,{value:t+=e.delta.partial_json,enumerable:!1,writable:!0}),t&&(n.input=tS(t))}break;case"thinking_delta":n?.type==="thinking"&&(n.thinking+=e.delta.thinking);break;case"signature_delta":n?.type==="thinking"&&(n.signature=e.delta.signature);break;default:e.delta}return t}}},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on("streamEvent",n=>{let r=t.shift();r?r.resolve(n):e.push(n)}),this.on("end",()=>{for(let e of(n=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),this.on("error",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((e,n)=>t.push({resolve:e,reject:n})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new eV(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}class tZ extends tc{create(e,t){return this._client.post("/v1/messages/batches",{body:e,...t})}retrieve(e,t){return this._client.get(tp`/v1/messages/batches/${e}`,t)}list(e={},t){return this._client.getAPIList("/v1/messages/batches",e2,{query:e,...t})}delete(e,t){return this._client.delete(tp`/v1/messages/batches/${e}`,t)}cancel(e,t){return this._client.post(tp`/v1/messages/batches/${e}/cancel`,t)}async results(e,t){let n=await this.retrieve(e);if(!n.results_url)throw new ei(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...t,headers:th([{Accept:"application/binary"},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((e,t)=>tb.fromResponse(t.response,t.controller))}}class tT extends tc{constructor(){super(...arguments),this.batches=new tZ(this._client)}create(e,t){e.model in tN&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${tN[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let n=this._client._options.timeout;if(!e.stream&&null==n){let t=tC[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,t)}return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...t,stream:e.stream??!1})}stream(e,t){return tL.createMessage(this,e,t)}countTokens(e,t){return this._client.post("/v1/messages/count_tokens",{body:e,...t})}}let tN={"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"};tT.Batches=tZ;class tz extends tc{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(tp`/v1/models/${e}`,{...n,headers:th([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/models",e2,{query:r,...t,headers:th([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers])})}}let t$=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 tq{constructor({baseURL:e=t$("ANTHROPIC_BASE_URL"),apiKey:t=t$("ANTHROPIC_API_KEY")??null,authToken:n=t$("ANTHROPIC_AUTH_TOKEN")??null,...r}={}){K.set(this,void 0);let a={apiKey:t,authToken:n,...r,baseURL:e||"https://api.anthropic.com"};if(!a.dangerouslyAllowBrowser&&eL())throw new ei("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??tD.DEFAULT_TIMEOUT,this.logger=a.logger??console;let s="warn";this.logLevel=s,this.logLevel=eE(a.logLevel,"ClientOptions.logLevel",this)??eE(t$("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??s,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??function(){if("undefined"!=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`")}(),et(this,K,eH,"f"),this._options=a,this.apiKey=t,this.authToken=n}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 th([this.apiKeyAuth(e),this.bearerAuth(e)])}apiKeyAuth(e){if(null!=this.apiKey)return th([{"X-Api-Key":this.apiKey}])}bearerAuth(e){if(null!=this.authToken)return th([{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 ei(`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 ${eA}`}defaultIdempotencyKey(){return`stainless-node-retry-${er()}`}makeStatusError(e,t,n,r){return eo.generate(e,t,n,r)}buildURL(e,t){let n=new URL(ew(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)&&(n.search=this.stringifyQuery(t)),n.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new ei("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:n}){}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,n){return this.request(Promise.resolve(n).then(n=>({method:e,path:t,...n})))}request(e,t=null){return new eQ(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,n){let r=await e,a=r.maxRetries??this.maxRetries;null==t&&(t=a),await this.prepareOptions(r);let{req:s,url:i,timeout:o}=this.buildRequest(r,{retryCount:a-t});await this.prepareRequest(s,{url:i,options:r});let l="log_"+(16777216*Math.random()|0).toString(16).padStart(6,"0"),c=void 0===n?"":`, retryOf: ${n}`,u=Date.now();if(ej(this).debug(`[${l}] sending request`,eI({retryOfRequestLogID:n,method:r.method,url:i,options:r,headers:s.headers})),r.signal?.aborted)throw new el;let d=new AbortController,h=await this.fetchWithTimeout(i,s,o,d).catch(es),f=Date.now();if(h instanceof Error){let e=`retrying, ${t} attempts remaining`;if(r.signal?.aborted)throw new el;let a=ea(h)||/timed? ?out/i.test(String(h)+("cause"in h?String(h.cause):""));if(t)return ej(this).info(`[${l}] connection ${a?"timed out":"failed"} - ${e}`),ej(this).debug(`[${l}] connection ${a?"timed out":"failed"} (${e})`,eI({retryOfRequestLogID:n,url:i,durationMs:f-u,message:h.message})),this.retryRequest(r,t,n??l);if(ej(this).info(`[${l}] connection ${a?"timed out":"failed"} - error; no more retries left`),ej(this).debug(`[${l}] connection ${a?"timed out":"failed"} (error; no more retries left)`,eI({retryOfRequestLogID:n,url:i,durationMs:f-u,message:h.message})),a)throw new eu;throw new ec({cause:h})}let p=[...h.headers.entries()].filter(([e])=>"request-id"===e).map(([e,t])=>", "+e+": "+JSON.stringify(t)).join(""),g=`[${l}${c}${p}] ${s.method} ${i} ${h.ok?"succeeded":"failed"} with status ${h.status} in ${f-u}ms`;if(!h.ok){let e=this.shouldRetry(h);if(t&&e){let e=`retrying, ${t} attempts remaining`;return await eB(h.body),ej(this).info(`${g} - ${e}`),ej(this).debug(`[${l}] response error (${e})`,eI({retryOfRequestLogID:n,url:h.url,status:h.status,headers:h.headers,durationMs:f-u})),this.retryRequest(r,t,n??l,h.headers)}let a=e?"error; no more retries left":"error; not retryable";ej(this).info(`${g} - ${a}`);let s=await h.text().catch(e=>es(e).message),i=eS(s),o=i?void 0:s;throw ej(this).debug(`[${l}] response error (${a})`,eI({retryOfRequestLogID:n,url:h.url,status:h.status,headers:h.headers,message:o,durationMs:Date.now()-u})),this.makeStatusError(h.status,i,o,h.headers)}return ej(this).info(g),ej(this).debug(`[${l}] response start`,eI({retryOfRequestLogID:n,url:h.url,status:h.status,headers:h.headers,durationMs:f-u})),{response:h,options:r,controller:d,requestLogID:l,retryOfRequestLogID:n,startTime:u}}getAPIList(e,t,n){return this.requestAPIList(t,{method:"get",path:e,...n})}requestAPIList(e,t){return new e1(this,this.makeRequest(t,null,void 0),e)}async fetchWithTimeout(e,t,n,r){let{signal:a,method:s,...i}=t||{};a&&a.addEventListener("abort",()=>r.abort());let o=setTimeout(()=>r.abort(),n),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};s&&(c.method=s.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,n,r){let a;let s=r?.get("retry-after-ms");if(s){let e=parseFloat(s);Number.isNaN(e)||(a=e)}let i=r?.get("retry-after");if(i&&!a){let e=parseFloat(i);a=Number.isNaN(e)?Date.parse(i)-Date.now():1e3*e}if(!(a&&0<=a&&a<6e4)){let n=e.maxRetries??this.maxRetries;a=this.calculateDefaultRetryTimeoutMillis(t,n)}return await ex(a),this.makeRequest(e,t-1,n)}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 ei("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 n={...e},{method:r,path:a,query:s}=n,i=this.buildURL(a,s);"timeout"in n&&ek("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:o,body:l}=this.buildBody({options:n}),c=this.buildHeaders({options:e,method:r,bodyHeaders:o,retryCount:t});return{req:{method:r,headers:c,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&l instanceof globalThis.ReadableStream&&{duplex:"half"},...l&&{body:l},...this.fetchOptions??{},...n.fetchOptions??{}},url:i,timeout:n.timeout}}buildHeaders({options:e,method:t,bodyHeaders:n,retryCount:r}){let a={};this.idempotencyHeader&&"get"!==t&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),a[this.idempotencyHeader]=e.idempotencyKey);let s=th([a,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...ez(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(s),s.values}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=th([t]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||"string"==typeof e&&n.values.has("content-type")||e instanceof Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:"object"==typeof e&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&"function"==typeof e.next)?{bodyHeaders:void 0,body:eq(e)}:en(this,K,"f").call(this,{body:e,headers:n})}}K=new WeakMap,tq.Anthropic=tq,tq.HUMAN_PROMPT="\n\nHuman:",tq.AI_PROMPT="\n\nAssistant:",tq.DEFAULT_TIMEOUT=6e5,tq.AnthropicError=ei,tq.APIError=eo,tq.APIConnectionError=ec,tq.APIConnectionTimeoutError=eu,tq.APIUserAbortError=el,tq.NotFoundError=ep,tq.ConflictError=eg,tq.RateLimitError=eb,tq.BadRequestError=ed,tq.AuthenticationError=eh,tq.InternalServerError=ev,tq.PermissionDeniedError=ef,tq.UnprocessableEntityError=em,tq.toFile=to;class tD extends tq{constructor(){super(...arguments),this.completions=new tj(this),this.messages=new tT(this),this.models=new tz(this),this.beta=new tO(this)}}tD.Completions=tj,tD.Messages=tT,tD.Models=tz,tD.Beta=tO;let{HUMAN_PROMPT:tB,AI_PROMPT:tH}=tD},93837:function(e,t,n){let r;n.d(t,{Z:function(){return o}});var a={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let s=new Uint8Array(16),i=[];for(let e=0;e<256;++e)i.push((e+256).toString(16).slice(1));var o=function(e,t,n){if(a.randomUUID&&!t&&!e)return a.randomUUID();let o=(e=e||{}).random??e.rng?.()??function(){if(!r){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(s)}();if(o.length<16)throw Error("Random bytes length must be >= 16");if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){if((n=n||0)<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=o[e];return t}return function(e,t=0){return(i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]).toLowerCase()}(o)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/630-9c30ebb65854ac3f.js b/litellm/proxy/_experimental/out/_next/static/chunks/630-9c30ebb65854ac3f.js deleted file mode 100644 index 8fc423a056d..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/630-9c30ebb65854ac3f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[630],{1309:function(e,l,a){a.d(l,{C:function(){return t.Z}});var t=a(41649)},2967:function(e,l,a){a.d(l,{JO:function(){return i.Z},RM:function(){return s.Z},SC:function(){return c.Z},iA:function(){return r.Z},pj:function(){return n.Z},ss:function(){return o.Z},xs:function(){return d.Z},zx:function(){return t.Z}});var t=a(78489),i=a(47323),r=a(21626),s=a(97214),n=a(28241),o=a(58834),d=a(69552),c=a(71876)},50630:function(e,l,a){a.d(l,{Z:function(){return lC}});var t,i,r,s,n=a(57437),o=a(2265),d=a(78489),c=a(12485),u=a(18135),m=a(35242),x=a(29706),p=a(77991),h=a(19250),g=a(57840),f=a(37592),j=a(15690),v=a(10032),y=a(3810),_=a(22116),b=a(64504);(t=r||(r={})).PresidioPII="Presidio PII",t.Bedrock="Bedrock Guardrail",t.Lakera="Lakera";let N={},w=e=>{let l={};return l.PresidioPII="Presidio PII",l.Bedrock="Bedrock Guardrail",l.Lakera="Lakera",Object.entries(e).forEach(e=>{let[a,t]=e;t&&"object"==typeof t&&"ui_friendly_name"in t&&(l[a.split("_").map((e,l)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=t.ui_friendly_name)}),N=l,l},k=()=>Object.keys(N).length>0?N:r,C={PresidioPII:"presidio",Bedrock:"bedrock",Lakera:"lakera_v2",LitellmContentFilter:"litellm_content_filter",ToolPermission:"tool_permission"},S=e=>{Object.entries(e).forEach(e=>{let[l,a]=e;a&&"object"==typeof a&&"ui_friendly_name"in a&&(C[l.split("_").map((e,l)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=l)})},Z=e=>!!e&&"Presidio PII"===k()[e],P=e=>!!e&&"LiteLLM Content Filter"===k()[e],O="../ui/assets/logos/",I={"Presidio PII":"".concat(O,"presidio.png"),"Bedrock Guardrail":"".concat(O,"bedrock.svg"),Lakera:"".concat(O,"lakeraai.jpeg"),"Azure Content Safety Prompt Shield":"".concat(O,"presidio.png"),"Azure Content Safety Text Moderation":"".concat(O,"presidio.png"),"Aporia AI":"".concat(O,"aporia.png"),"PANW Prisma AIRS":"".concat(O,"palo_alto_networks.jpeg"),"Noma Security":"".concat(O,"noma_security.png"),"Javelin Guardrails":"".concat(O,"javelin.png"),"Pillar Guardrail":"".concat(O,"pillar.jpeg"),"Google Cloud Model Armor":"".concat(O,"google.svg"),"Guardrails AI":"".concat(O,"guardrails_ai.jpeg"),"Lasso Guardrail":"".concat(O,"lasso.png"),"Pangea Guardrail":"".concat(O,"pangea.png"),"AIM Guardrail":"".concat(O,"aim_security.jpeg"),"OpenAI Moderation":"".concat(O,"openai_small.svg"),EnkryptAI:"".concat(O,"enkrypt_ai.avif"),"Prompt Security":"".concat(O,"prompt_security.png"),"LiteLLM Content Filter":"".concat(O,"litellm_logo.jpg")},A=e=>{if(!e)return{logo:"",displayName:"-"};let l=Object.keys(C).find(l=>C[l].toLowerCase()===e.toLowerCase());if(!l)return{logo:"",displayName:e};let a=k()[l];return{logo:I[a]||"",displayName:a||e}};var L=a(99981),E=a(5545),T=a(61994),z=a(97416),B=a(8881),G=a(10798),M=a(49638);let{Text:F}=g.default,{Option:K}=f.default,D=e=>e.replace(/_/g," "),R=e=>{switch(e){case"MASK":return(0,n.jsx)(z.Z,{style:{marginRight:4}});case"BLOCK":return(0,n.jsx)(B.Z,{style:{marginRight:4}});default:return null}},J=e=>{let{categories:l,selectedCategories:a,onChange:t}=e;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center mb-2",children:[(0,n.jsx)(G.Z,{className:"text-gray-500 mr-1"}),(0,n.jsx)(F,{className:"text-gray-500 font-medium",children:"Filter by category"})]}),(0,n.jsx)(f.default,{mode:"multiple",placeholder:"Select categories to filter by",style:{width:"100%"},onChange:t,value:a,allowClear:!0,showSearch:!0,optionFilterProp:"children",className:"mb-4",tagRender:e=>(0,n.jsx)(y.Z,{color:"blue",closable:e.closable,onClose:e.onClose,className:"mr-2 mb-2",children:e.label}),children:l.map(e=>(0,n.jsx)(K,{value:e.category,children:e.category},e.category))})]})},V=e=>{let{onSelectAll:l,onUnselectAll:a,hasSelectedEntities:t}=e;return(0,n.jsxs)("div",{className:"bg-gray-50 p-5 rounded-lg mb-6 border border-gray-200 shadow-sm",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(F,{strong:!0,className:"text-gray-700 text-base",children:"Quick Actions"}),(0,n.jsx)(L.Z,{title:"Apply action to all PII types at once",children:(0,n.jsx)("div",{className:"ml-2 text-gray-400 cursor-help text-xs",children:"ⓘ"})})]}),(0,n.jsx)(E.ZP,{color:"danger",variant:"outlined",onClick:a,disabled:!t,icon:(0,n.jsx)(M.Z,{}),children:"Unselect All"})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,n.jsx)(E.ZP,{color:"primary",variant:"outlined",onClick:()=>l("MASK"),className:"h-10",block:!0,icon:(0,n.jsx)(z.Z,{}),children:"Select All & Mask"}),(0,n.jsx)(E.ZP,{color:"danger",variant:"outlined",onClick:()=>l("BLOCK"),className:"h-10 hover:bg-red-100",block:!0,icon:(0,n.jsx)(B.Z,{}),children:"Select All & Block"})]})]})},U=e=>{let{entities:l,selectedEntities:a,selectedActions:t,actions:i,onEntitySelect:r,onActionSelect:s,entityToCategoryMap:o}=e;return(0,n.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,n.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,n.jsx)(F,{strong:!0,className:"flex-1 text-gray-700",children:"PII Type"}),(0,n.jsx)(F,{strong:!0,className:"w-32 text-right text-gray-700",children:"Action"})]}),(0,n.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:0===l.length?(0,n.jsx)("div",{className:"py-10 text-center text-gray-500",children:"No PII types match your filter criteria"}):l.map(e=>(0,n.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between hover:bg-gray-50 border-b ".concat(a.includes(e)?"bg-blue-50":""),children:[(0,n.jsxs)("div",{className:"flex items-center flex-1",children:[(0,n.jsx)(T.Z,{checked:a.includes(e),onChange:()=>r(e),className:"mr-3"}),(0,n.jsx)(F,{className:a.includes(e)?"font-medium text-gray-900":"text-gray-700",children:D(e)}),o.get(e)&&(0,n.jsx)(y.Z,{className:"ml-2 text-xs",color:"blue",children:o.get(e)})]}),(0,n.jsx)("div",{className:"w-32",children:(0,n.jsx)(f.default,{value:a.includes(e)&&t[e]||"MASK",onChange:l=>s(e,l),style:{width:120},disabled:!a.includes(e),className:"".concat(a.includes(e)?"":"opacity-50"),dropdownMatchSelectWidth:!1,children:i.map(e=>(0,n.jsx)(K,{value:e,children:(0,n.jsxs)("div",{className:"flex items-center",children:[R(e),e]})},e))})})]},e))})]})},{Title:q,Text:W}=g.default;var Y=e=>{let{entities:l,actions:a,selectedEntities:t,selectedActions:i,onEntitySelect:r,onActionSelect:s,entityCategories:d=[]}=e,[c,u]=(0,o.useState)([]),m=new Map;d.forEach(e=>{e.entities.forEach(l=>{m.set(l,e.category)})});let x=l.filter(e=>0===c.length||c.includes(m.get(e)||""));return(0,n.jsxs)("div",{className:"pii-configuration",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,n.jsx)("div",{className:"flex items-center",children:(0,n.jsx)(q,{level:4,className:"!m-0 font-semibold text-gray-800",children:"Configure PII Protection"})}),(0,n.jsxs)(W,{className:"text-gray-500",children:[t.length," items selected"]})]}),(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)(J,{categories:d,selectedCategories:c,onChange:u}),(0,n.jsx)(V,{onSelectAll:e=>{l.forEach(l=>{t.includes(l)||r(l),s(l,e)})},onUnselectAll:()=>{t.forEach(e=>{r(e)})},hasSelectedEntities:t.length>0})]}),(0,n.jsx)(U,{entities:x,selectedEntities:t,selectedActions:i,actions:a,onEntitySelect:r,onActionSelect:s,entityToCategoryMap:m})]})},H=a(10353),$=a(31283),Q=a(24199),X=e=>{var l;let{selectedProvider:a,accessToken:t,providerParams:i=null,value:r=null}=e,[s,d]=(0,o.useState)(!1),[c,u]=(0,o.useState)(i),[m,x]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(i){u(i);return}let e=async()=>{if(t){d(!0),x(null);try{let e=await (0,h.getGuardrailProviderSpecificParams)(t);console.log("Provider params API response:",e),u(e),w(e),S(e)}catch(e){console.error("Error fetching provider params:",e),x("Failed to load provider parameters")}finally{d(!1)}}};i||e()},[t,i]),!a)return null;if(s)return(0,n.jsx)(H.Z,{tip:"Loading provider parameters..."});if(m)return(0,n.jsx)("div",{className:"text-red-500",children:m});let p=null===(l=C[a])||void 0===l?void 0:l.toLowerCase(),g=c&&c[p];if(console.log("Provider key:",p),console.log("Provider fields:",g),!g||0===Object.keys(g).length)return(0,n.jsx)("div",{children:"No configuration fields available for this provider."});console.log("Value:",r);let j=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0;return Object.entries(e).map(e=>{let[t,i]=e,s=l?"".concat(l,".").concat(t):t,o=a?a[t]:null==r?void 0:r[t];return(console.log("Field value:",o),"ui_friendly_name"===t||"optional_params"===t&&"nested"===i.type&&i.fields)?null:"nested"===i.type&&i.fields?(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-2 font-medium",children:t}),(0,n.jsx)("div",{className:"ml-4 border-l-2 border-gray-200 pl-4",children:j(i.fields,s,o)})]},s):(0,n.jsx)(v.Z.Item,{name:s,label:t,tooltip:i.description,rules:i.required?[{required:!0,message:"".concat(t," is required")}]:void 0,children:"select"===i.type&&i.options?(0,n.jsx)(f.default,{placeholder:i.description,defaultValue:o||i.default_value,children:i.options.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}):"multiselect"===i.type&&i.options?(0,n.jsx)(f.default,{mode:"multiple",placeholder:i.description,defaultValue:o||i.default_value,children:i.options.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}):"bool"===i.type||"boolean"===i.type?(0,n.jsxs)(f.default,{placeholder:i.description,defaultValue:void 0!==o?String(o):i.default_value,children:[(0,n.jsx)(f.default.Option,{value:"true",children:"True"}),(0,n.jsx)(f.default.Option,{value:"false",children:"False"})]}):"number"===i.type?(0,n.jsx)(Q.Z,{step:1,width:400,placeholder:i.description,defaultValue:void 0!==o?Number(o):void 0}):t.includes("password")||t.includes("secret")||t.includes("key")?(0,n.jsx)($.o,{placeholder:i.description,type:"password",defaultValue:o||""}):(0,n.jsx)($.o,{placeholder:i.description,type:"text",defaultValue:o||""})},s)})};return(0,n.jsx)(n.Fragment,{children:j(g)})};let{Title:ee}=g.default,el=e=>{let{field:l,fieldKey:a,fullFieldKey:t,value:i}=e,[r,s]=o.useState([]),[d,c]=o.useState(l.dict_key_options||[]);o.useEffect(()=>{if(i&&"object"==typeof i){let e=Object.keys(i);s(e.map(e=>({key:e,id:"".concat(e,"_").concat(Date.now(),"_").concat(Math.random())}))),c((l.dict_key_options||[]).filter(l=>!e.includes(l)))}},[i,l.dict_key_options]);let u=e=>{e&&(s([...r,{key:e,id:"".concat(e,"_").concat(Date.now())}]),c(d.filter(l=>l!==e)))},m=(e,l)=>{s(r.filter(l=>l.id!==e)),c([...d,l].sort())};return(0,n.jsxs)("div",{className:"space-y-3",children:[r.map(e=>(0,n.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[(0,n.jsx)("div",{className:"w-24 font-medium text-sm",children:e.key}),(0,n.jsx)("div",{className:"flex-1",children:(0,n.jsx)(v.Z.Item,{name:Array.isArray(t)?[...t,e.key]:[t,e.key],style:{marginBottom:0},initialValue:i&&"object"==typeof i?i[e.key]:void 0,normalize:"number"===l.dict_value_type?e=>{if(null==e||""===e)return;let l=Number(e);return isNaN(l)?e:l}:void 0,children:"number"===l.dict_value_type?(0,n.jsx)(Q.Z,{step:1,width:200,placeholder:"Enter ".concat(e.key," value")}):"boolean"===l.dict_value_type?(0,n.jsxs)(f.default,{placeholder:"Select ".concat(e.key," value"),children:[(0,n.jsx)(f.default.Option,{value:!0,children:"True"}),(0,n.jsx)(f.default.Option,{value:!1,children:"False"})]}):(0,n.jsx)($.o,{placeholder:"Enter ".concat(e.key," value"),type:"text"})})}),(0,n.jsx)("button",{type:"button",className:"text-red-500 hover:text-red-700 text-sm",onClick:()=>m(e.id,e.key),children:"Remove"})]},e.id)),d.length>0&&(0,n.jsxs)("div",{className:"flex items-center space-x-3 mt-2",children:[(0,n.jsx)(f.default,{placeholder:"Select category to configure",style:{width:200},onSelect:e=>e&&u(e),value:void 0,children:d.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}),(0,n.jsx)("span",{className:"text-sm text-gray-500",children:"Select a category to add threshold configuration"})]})]})};var ea=e=>{let{optionalParams:l,parentFieldKey:a,values:t}=e,i=(e,l)=>{let i="".concat(a,".").concat(e),r=null==t?void 0:t[e];return(console.log("value",r),"dict"===l.type&&l.dict_key_options)?(0,n.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,n.jsx)("div",{className:"mb-4 font-medium text-gray-900 text-base",children:e}),(0,n.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:l.description}),(0,n.jsx)(el,{field:l,fieldKey:e,fullFieldKey:[a,e],value:r})]},i):(0,n.jsx)("div",{className:"mb-8 p-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:(0,n.jsx)(v.Z.Item,{name:[a,e],label:(0,n.jsxs)("div",{className:"mb-2",children:[(0,n.jsx)("div",{className:"font-medium text-gray-900 text-base",children:e}),(0,n.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:l.description})]}),rules:l.required?[{required:!0,message:"".concat(e," is required")}]:void 0,className:"mb-0",initialValue:void 0!==r?r:l.default_value,normalize:"number"===l.type?e=>{if(null==e||""===e)return;let l=Number(e);return isNaN(l)?e:l}:void 0,children:"select"===l.type&&l.options?(0,n.jsx)(f.default,{placeholder:l.description,children:l.options.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}):"multiselect"===l.type&&l.options?(0,n.jsx)(f.default,{mode:"multiple",placeholder:l.description,children:l.options.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}):"bool"===l.type||"boolean"===l.type?(0,n.jsxs)(f.default,{placeholder:l.description,children:[(0,n.jsx)(f.default.Option,{value:"true",children:"True"}),(0,n.jsx)(f.default.Option,{value:"false",children:"False"})]}):"number"===l.type?(0,n.jsx)(Q.Z,{step:1,width:400,placeholder:l.description}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,n.jsx)($.o,{placeholder:l.description,type:"password"}):(0,n.jsx)($.o,{placeholder:l.description,type:"text"})})},i)};return l.fields&&0!==Object.keys(l.fields).length?(0,n.jsxs)("div",{className:"guardrail-optional-params",children:[(0,n.jsxs)("div",{className:"mb-8 pb-4 border-b border-gray-100",children:[(0,n.jsx)(ee,{level:3,className:"mb-2 font-semibold text-gray-900",children:"Optional Parameters"}),(0,n.jsx)("p",{className:"text-gray-600 text-sm",children:l.description||"Configure additional settings for this guardrail provider"})]}),(0,n.jsx)("div",{className:"space-y-8",children:Object.entries(l.fields).map(e=>{let[l,a]=e;return i(l,a)})})]}):null},et=a(9114),ei=a(5945),er=a(58760),es=a(65319),en=a(96473),eo=a(3632),ed=a(16312);let{Text:ec}=g.default,{Option:eu}=f.default;var em=e=>{let{visible:l,prebuiltPatterns:a,categories:t,selectedPatternName:i,patternAction:r,onPatternNameChange:s,onActionChange:o,onAdd:d,onCancel:c}=e;return(0,n.jsxs)(_.Z,{title:"Add prebuilt pattern",open:l,onCancel:c,footer:null,width:800,children:[(0,n.jsxs)(er.Z,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(ec,{strong:!0,children:"Pattern type"}),(0,n.jsx)(f.default,{placeholder:"Choose pattern type",value:i,onChange:s,style:{width:"100%",marginTop:8},showSearch:!0,filterOption:(e,l)=>{let t=a.find(e=>e.name===(null==l?void 0:l.value));return!!t&&(t.display_name.toLowerCase().includes(e.toLowerCase())||t.name.toLowerCase().includes(e.toLowerCase()))},children:t.map(e=>{let l=a.filter(l=>l.category===e);return 0===l.length?null:(0,n.jsx)(f.default.OptGroup,{label:e,children:l.map(e=>(0,n.jsx)(eu,{value:e.name,children:e.display_name},e.name))},e)})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ec,{strong:!0,children:"Action"}),(0,n.jsx)(ec,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,n.jsxs)(f.default,{value:r,onChange:o,style:{width:"100%"},children:[(0,n.jsx)(eu,{value:"BLOCK",children:"Block"}),(0,n.jsx)(eu,{value:"MASK",children:"Mask"})]})]})]}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,n.jsx)(ed.z,{variant:"secondary",onClick:c,children:"Cancel"}),(0,n.jsx)(ed.z,{onClick:d,children:"Add"})]})]})};let{Text:ex}=g.default,{Option:ep}=f.default;var eh=e=>{let{visible:l,patternName:a,patternRegex:t,patternAction:i,onNameChange:r,onRegexChange:s,onActionChange:o,onAdd:d,onCancel:c}=e;return(0,n.jsxs)(_.Z,{title:"Add custom regex pattern",open:l,onCancel:c,footer:null,width:800,children:[(0,n.jsxs)(er.Z,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(ex,{strong:!0,children:"Pattern name"}),(0,n.jsx)(b.o,{placeholder:"e.g., internal_id, employee_code",value:a,onValueChange:r,style:{marginTop:8}})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ex,{strong:!0,children:"Regex pattern"}),(0,n.jsx)(b.o,{placeholder:"e.g., ID-[0-9]{6}",value:t,onValueChange:s,style:{marginTop:8}}),(0,n.jsx)(ex,{type:"secondary",style:{fontSize:12},children:"Enter a valid regular expression to match sensitive data"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ex,{strong:!0,children:"Action"}),(0,n.jsx)(ex,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,n.jsxs)(f.default,{value:i,onChange:o,style:{width:"100%"},children:[(0,n.jsx)(ep,{value:"BLOCK",children:"Block"}),(0,n.jsx)(ep,{value:"MASK",children:"Mask"})]})]})]}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,n.jsx)(b.z,{variant:"secondary",onClick:c,children:"Cancel"}),(0,n.jsx)(b.z,{onClick:d,children:"Add"})]})]})},eg=a(49566),ef=a(16853);let{Text:ej}=g.default,{Option:ev}=f.default;var ey=e=>{let{visible:l,keyword:a,action:t,description:i,onKeywordChange:r,onActionChange:s,onDescriptionChange:o,onAdd:c,onCancel:u}=e;return(0,n.jsxs)(_.Z,{title:"Add blocked keyword",open:l,onCancel:u,footer:null,width:800,children:[(0,n.jsxs)(er.Z,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(ej,{strong:!0,children:"Keyword"}),(0,n.jsx)(eg.Z,{placeholder:"Enter sensitive keyword or phrase",value:a,onValueChange:r,style:{marginTop:8}})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ej,{strong:!0,children:"Action"}),(0,n.jsx)(ej,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this keyword is detected"}),(0,n.jsxs)(f.default,{value:t,onChange:s,style:{width:"100%"},children:[(0,n.jsx)(ev,{value:"BLOCK",children:"Block"}),(0,n.jsx)(ev,{value:"MASK",children:"Mask"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ej,{strong:!0,children:"Description (optional)"}),(0,n.jsx)(ef.Z,{placeholder:"Explain why this keyword is sensitive",value:i,onValueChange:o,rows:3,style:{marginTop:8}})]})]}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,n.jsx)(d.Z,{variant:"secondary",onClick:u,children:"Cancel"}),(0,n.jsx)(d.Z,{onClick:c,children:"Add"})]})]})},e_=a(56609),eb=a(26349);let{Text:eN}=g.default,{Option:ew}=f.default;var ek=e=>{let{patterns:l,onActionChange:a,onRemove:t}=e,i=[{title:"Type",dataIndex:"type",key:"type",width:100,render:e=>(0,n.jsx)(y.Z,{color:"prebuilt"===e?"blue":"green",children:"prebuilt"===e?"Prebuilt":"Custom"})},{title:"Pattern name",dataIndex:"name",key:"name",render:(e,l)=>l.display_name||l.name},{title:"Regex pattern",dataIndex:"pattern",key:"pattern",render:e=>e?(0,n.jsxs)(eN,{code:!0,style:{fontSize:12},children:[e.substring(0,40),"..."]}):"-"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,l)=>(0,n.jsxs)(f.default,{value:e,onChange:e=>a(l.id,e),style:{width:120},size:"small",children:[(0,n.jsx)(ew,{value:"BLOCK",children:"Block"}),(0,n.jsx)(ew,{value:"MASK",children:"Mask"})]})},{title:"",key:"actions",width:100,render:(e,l)=>(0,n.jsx)(ed.z,{type:"button",variant:"light",color:"red",size:"xs",icon:eb.Z,onClick:()=>t(l.id),children:"Delete"})}];return 0===l.length?(0,n.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No patterns added."}):(0,n.jsx)(e_.Z,{dataSource:l,columns:i,rowKey:"id",pagination:!1,size:"small"})};let{Text:eC}=g.default,{Option:eS}=f.default;var eZ=e=>{let{keywords:l,onActionChange:a,onRemove:t}=e,i=[{title:"Keyword",dataIndex:"keyword",key:"keyword"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,l)=>(0,n.jsxs)(f.default,{value:e,onChange:e=>a(l.id,"action",e),style:{width:120},size:"small",children:[(0,n.jsx)(eS,{value:"BLOCK",children:"Block"}),(0,n.jsx)(eS,{value:"MASK",children:"Mask"})]})},{title:"Description",dataIndex:"description",key:"description",render:e=>e||"-"},{title:"",key:"actions",width:100,render:(e,l)=>(0,n.jsx)(ed.z,{type:"button",variant:"light",color:"red",size:"xs",icon:eb.Z,onClick:()=>t(l.id),children:"Delete"})}];return 0===l.length?(0,n.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No keywords added."}):(0,n.jsx)(e_.Z,{dataSource:l,columns:i,rowKey:"id",pagination:!1,size:"small"})};let{Title:eP,Text:eO}=g.default;var eI=e=>{let{prebuiltPatterns:l,categories:a,selectedPatterns:t,blockedWords:i,onPatternAdd:r,onPatternRemove:s,onPatternActionChange:d,onBlockedWordAdd:c,onBlockedWordRemove:u,onBlockedWordUpdate:m,onFileUpload:x,accessToken:p,showStep:g}=e,[f,j]=(0,o.useState)(!1),[v,y]=(0,o.useState)(!1),[_,b]=(0,o.useState)(!1),[N,w]=(0,o.useState)(""),[k,C]=(0,o.useState)("BLOCK"),[S,Z]=(0,o.useState)(""),[P,O]=(0,o.useState)(""),[I,A]=(0,o.useState)("BLOCK"),[L,E]=(0,o.useState)(""),[T,z]=(0,o.useState)("BLOCK"),[B,G]=(0,o.useState)(""),[M,F]=(0,o.useState)(!1),K=async e=>{F(!0);try{let l=await e.text();if(p){let e=await (0,h.validateBlockedWordsFile)(p,l);if(e.valid)x&&x(l),et.Z.success(e.message||"File uploaded successfully");else{let l=e.error||e.errors&&e.errors.join(", ")||"Invalid file";et.Z.error("Validation failed: ".concat(l))}}}catch(e){et.Z.error("Failed to upload file: ".concat(e))}finally{F(!1)}return!1};return(0,n.jsxs)("div",{className:"space-y-6",children:[!g&&(0,n.jsx)("div",{children:(0,n.jsx)(eO,{type:"secondary",children:"Configure patterns and keywords to detect and filter sensitive information in requests and responses."})}),(!g||"patterns"===g)&&(0,n.jsxs)(ei.Z,{title:(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,n.jsx)(eP,{level:5,style:{margin:0},children:"Pattern Detection"}),(0,n.jsx)(eO,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Detect sensitive information using regex patterns (SSN, credit cards, API keys, etc.)"})]}),size:"small",children:[(0,n.jsx)("div",{style:{marginBottom:16},children:(0,n.jsxs)(er.Z,{children:[(0,n.jsx)(ed.z,{type:"button",onClick:()=>j(!0),icon:en.Z,children:"Add prebuilt pattern"}),(0,n.jsx)(ed.z,{type:"button",onClick:()=>b(!0),variant:"secondary",icon:en.Z,children:"Add custom regex"})]})}),(0,n.jsx)(ek,{patterns:t,onActionChange:d,onRemove:s})]}),(!g||"keywords"===g)&&(0,n.jsxs)(ei.Z,{title:(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,n.jsx)(eP,{level:5,style:{margin:0},children:"Blocked Keywords"}),(0,n.jsx)(eO,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Block or mask specific sensitive terms and phrases"})]}),size:"small",children:[(0,n.jsx)("div",{style:{marginBottom:16},children:(0,n.jsxs)(er.Z,{children:[(0,n.jsx)(ed.z,{type:"button",onClick:()=>y(!0),icon:en.Z,children:"Add keyword"}),(0,n.jsx)(es.default,{beforeUpload:K,accept:".yaml,.yml",showUploadList:!1,children:(0,n.jsx)(ed.z,{type:"button",variant:"secondary",icon:eo.Z,loading:M,children:"Upload YAML file"})})]})}),(0,n.jsx)(eZ,{keywords:i,onActionChange:m,onRemove:u})]}),(0,n.jsx)(em,{visible:f,prebuiltPatterns:l,categories:a,selectedPatternName:N,patternAction:k,onPatternNameChange:w,onActionChange:e=>C(e),onAdd:()=>{if(!N){et.Z.error("Please select a pattern");return}let e=l.find(e=>e.name===N);r({id:"pattern-".concat(Date.now()),type:"prebuilt",name:N,display_name:null==e?void 0:e.display_name,action:k}),j(!1),w(""),C("BLOCK")},onCancel:()=>{j(!1),w(""),C("BLOCK")}}),(0,n.jsx)(eh,{visible:_,patternName:S,patternRegex:P,patternAction:I,onNameChange:Z,onRegexChange:O,onActionChange:e=>A(e),onAdd:()=>{if(!S||!P){et.Z.error("Please provide pattern name and regex");return}r({id:"custom-".concat(Date.now()),type:"custom",name:S,pattern:P,action:I}),b(!1),Z(""),O(""),A("BLOCK")},onCancel:()=>{b(!1),Z(""),O(""),A("BLOCK")}}),(0,n.jsx)(ey,{visible:v,keyword:L,action:T,description:B,onKeywordChange:E,onActionChange:e=>z(e),onDescriptionChange:G,onAdd:()=>{if(!L){et.Z.error("Please enter a keyword");return}c({id:"word-".concat(Date.now()),keyword:L,action:T,description:B||void 0}),y(!1),E(""),G(""),z("BLOCK")},onCancel:()=>{y(!1),E(""),G(""),z("BLOCK")}})]})},eA=a(78801),eL=a(4260),eE=a(23496),eT=a(85180),ez=a(15424);let eB={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},eG=e=>({...eB,...e||{},rules:(null==e?void 0:e.rules)?[...e.rules]:[]});var eM=e=>{let{value:l,onChange:a,disabled:t=!1}=e,i=eG(l),r=e=>{let l={...i,...e};null==a||a(l)},s=(e,l)=>{r({rules:i.rules.map((a,t)=>t===e?{...a,...l}:a)})},o=e=>{r({rules:i.rules.filter((l,a)=>a!==e)})},d=(e,l)=>{let a=i.rules[e];if(!a)return;let t=Object.entries(a.allowed_param_patterns||{});l(t);let r={};t.forEach(e=>{let[l,a]=e;r[l]=a}),s(e,{allowed_param_patterns:Object.keys(r).length>0?r:void 0})},c=(e,l,a)=>{d(e,e=>{if(!e[l])return;let[,t]=e[l];e[l]=[a,t]})},u=(e,l,a)=>{d(e,e=>{if(!e[l])return;let[t]=e[l];e[l]=[t,a]})},m=(e,l)=>{let a=Object.entries(e.allowed_param_patterns||{});return 0===a.length?(0,n.jsx)(E.ZP,{disabled:t,size:"small",onClick:()=>s(l,{allowed_param_patterns:{"":""}}),children:"+ Restrict tool arguments (optional)"}):(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(eA.x,{className:"text-sm text-gray-600",children:"Argument constraints (dot or array paths)"}),a.map((a,i)=>{let[r,s]=a;return(0,n.jsxs)(er.Z,{align:"start",children:[(0,n.jsx)(eL.default,{disabled:t,placeholder:"messages[0].content",value:r,onChange:e=>c(l,i,e.target.value)}),(0,n.jsx)(eL.default,{disabled:t,placeholder:"^email@.*$",value:s,onChange:e=>u(l,i,e.target.value)}),(0,n.jsx)(E.ZP,{disabled:t,icon:(0,n.jsx)(eb.Z,{}),danger:!0,onClick:()=>d(l,e=>{e.splice(i,1)})})]},"".concat(e.id||l,"-").concat(i))}),(0,n.jsx)(E.ZP,{disabled:t,size:"small",onClick:()=>s(l,{allowed_param_patterns:{...e.allowed_param_patterns||{},"":""}}),children:"+ Add another constraint"})]})};return(0,n.jsxs)(eA.Z,{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(eA.x,{className:"text-lg font-semibold",children:"LiteLLM Tool Permission Guardrail"}),(0,n.jsx)(eA.x,{className:"text-sm text-gray-500",children:"Provide regex patterns (e.g., ^mcp__github_.*$) for tool names or types and optionally constrain payload fields."})]}),!t&&(0,n.jsx)(E.ZP,{icon:(0,n.jsx)(en.Z,{}),type:"primary",onClick:()=>{r({rules:[...i.rules,{id:"rule_".concat(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,n.jsx)(eE.Z,{}),0===i.rules.length?(0,n.jsx)(eT.Z,{description:"No tool rules added yet"}):(0,n.jsx)("div",{className:"space-y-4",children:i.rules.map((e,l)=>{var a,i;return(0,n.jsxs)(eA.Z,{className:"bg-gray-50",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,n.jsxs)(eA.x,{className:"font-semibold",children:["Rule ",l+1]}),(0,n.jsx)(E.ZP,{icon:(0,n.jsx)(eb.Z,{}),danger:!0,type:"text",disabled:t,onClick:()=>o(l),children:"Remove"})]}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(eA.x,{className:"text-sm font-medium",children:"Rule ID"}),(0,n.jsx)(eL.default,{disabled:t,placeholder:"unique_rule_id",value:e.id,onChange:e=>s(l,{id:e.target.value})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(eA.x,{className:"text-sm font-medium",children:"Tool Name (optional)"}),(0,n.jsx)(eL.default,{disabled:t,placeholder:"^mcp__github_.*$",value:null!==(a=e.tool_name)&&void 0!==a?a:"",onChange:e=>s(l,{tool_name:""===e.target.value.trim()?void 0:e.target.value})})]})]}),(0,n.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 mt-4",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(eA.x,{className:"text-sm font-medium",children:"Tool Type (optional)"}),(0,n.jsx)(eL.default,{disabled:t,placeholder:"^function$",value:null!==(i=e.tool_type)&&void 0!==i?i:"",onChange:e=>s(l,{tool_type:""===e.target.value.trim()?void 0:e.target.value})})]})}),(0,n.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[(0,n.jsx)(eA.x,{className:"text-sm font-medium",children:"Decision"}),(0,n.jsxs)(f.default,{disabled:t,value:e.decision,style:{width:200},onChange:e=>s(l,{decision:e}),children:[(0,n.jsx)(f.default.Option,{value:"allow",children:"Allow"}),(0,n.jsx)(f.default.Option,{value:"deny",children:"Deny"})]})]}),(0,n.jsx)("div",{className:"mt-4",children:m(e,l)})]},e.id||l)})}),(0,n.jsx)(eE.Z,{}),(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(eA.x,{className:"text-sm font-medium",children:"Default action"}),(0,n.jsxs)(f.default,{disabled:t,value:i.default_action,onChange:e=>r({default_action:e}),children:[(0,n.jsx)(f.default.Option,{value:"allow",children:"Allow"}),(0,n.jsx)(f.default.Option,{value:"deny",children:"Deny"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)(eA.x,{className:"text-sm font-medium flex items-center gap-1",children:["On disallowed action",(0,n.jsx)(L.Z,{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,n.jsx)(ez.Z,{})})]}),(0,n.jsxs)(f.default,{disabled:t,value:i.on_disallowed_action,onChange:e=>r({on_disallowed_action:e}),children:[(0,n.jsx)(f.default.Option,{value:"block",children:"Block"}),(0,n.jsx)(f.default.Option,{value:"rewrite",children:"Rewrite"})]})]})]}),(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsx)(eA.x,{className:"text-sm font-medium",children:"Violation message (optional)"}),(0,n.jsx)(eL.default.TextArea,{disabled:t,rows:3,placeholder:"This violates our org policy...",value:i.violation_message_template,onChange:e=>r({violation_message_template:e.target.value})})]})]})};let{Title:eF,Text:eK,Link:eD}=g.default,{Option:eR}=f.default,{Step:eJ}=j.default,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"};var eU=e=>{let{visible:l,onClose:a,accessToken:t,onSuccess:i}=e,[r]=v.Z.useForm(),[s,d]=(0,o.useState)(!1),[c,u]=(0,o.useState)(null),[m,x]=(0,o.useState)(null),[p,g]=(0,o.useState)([]),[N,O]=(0,o.useState)({}),[A,L]=(0,o.useState)(0),[E,T]=(0,o.useState)(null),[z,B]=(0,o.useState)([]),[G,M]=(0,o.useState)(2),[F,K]=(0,o.useState)({}),[D,R]=(0,o.useState)([]),[J,V]=(0,o.useState)([]),[U,q]=(0,o.useState)({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),W=(0,o.useMemo)(()=>!!c&&"tool_permission"===(C[c]||"").toLowerCase(),[c]);(0,o.useEffect)(()=>{t&&(async()=>{try{let[e,l]=await Promise.all([(0,h.getGuardrailUISettings)(t),(0,h.getGuardrailProviderSpecificParams)(t)]);x(e),T(l),w(l),S(l)}catch(e){console.error("Error fetching guardrail data:",e),et.Z.fromBackend("Failed to load guardrail configuration")}})()},[t]);let H=e=>{u(e),r.setFieldsValue({config:void 0,presidio_analyzer_api_base:void 0,presidio_anonymizer_api_base:void 0}),g([]),O({}),B([]),M(2),K({}),q({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""})},$=e=>{g(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},Q=(e,l)=>{O(a=>({...a,[e]:l}))},ee=async()=>{try{if(0===A&&(await r.validateFields(["guardrail_name","provider","mode","default_on"]),c)){let e=["guardrail_name","provider","mode","default_on"];"PresidioPII"===c&&e.push("presidio_analyzer_api_base","presidio_anonymizer_api_base"),await r.validateFields(e)}if(1===A&&Z(c)&&0===p.length){et.Z.fromBackend("Please select at least one PII entity to continue");return}L(A+1)}catch(e){console.error("Form validation failed:",e)}},el=()=>{L(A-1)},ei=()=>{r.resetFields(),u(null),g([]),O({}),B([]),M(2),K({}),R([]),V([]),q({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),L(0)},er=()=>{ei(),a()},es=async()=>{try{d(!0),await r.validateFields();let l=r.getFieldsValue(!0),s=C[l.provider],n={guardrail_name:l.guardrail_name,litellm_params:{guardrail:s,mode:l.mode,default_on:l.default_on},guardrail_info:{}};if("PresidioPII"===l.provider&&p.length>0){let e={};p.forEach(l=>{e[l]=N[l]||"MASK"}),n.litellm_params.pii_entities_config=e,l.presidio_analyzer_api_base&&(n.litellm_params.presidio_analyzer_api_base=l.presidio_analyzer_api_base),l.presidio_anonymizer_api_base&&(n.litellm_params.presidio_anonymizer_api_base=l.presidio_anonymizer_api_base)}if(P(l.provider))D.length>0&&(n.litellm_params.patterns=D.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}))),J.length>0&&(n.litellm_params.blocked_words=J.map(e=>({keyword:e.keyword,action:e.action,description:e.description})));else if(l.config)try{let e=JSON.parse(l.config);n.guardrail_info=e}catch(e){et.Z.fromBackend("Invalid JSON in configuration"),d(!1);return}if("tool_permission"===s){if(0===U.rules.length){et.Z.fromBackend("Add at least one tool permission rule"),d(!1);return}n.litellm_params.rules=U.rules,n.litellm_params.default_action=U.default_action,n.litellm_params.on_disallowed_action=U.on_disallowed_action,U.violation_message_template&&(n.litellm_params.violation_message_template=U.violation_message_template)}if(console.log("values: ",JSON.stringify(l)),E&&c){var e;let a=null===(e=C[c])||void 0===e?void 0:e.toLowerCase();console.log("providerKey: ",a);let t=E[a]||{},i=new Set;console.log("providerSpecificParams: ",JSON.stringify(t)),Object.keys(t).forEach(e=>{"optional_params"!==e&&i.add(e)}),t.optional_params&&t.optional_params.fields&&Object.keys(t.optional_params.fields).forEach(e=>{i.add(e)}),console.log("allowedParams: ",i),i.forEach(e=>{let a=l[e];if(null==a||""===a){var t;a=null===(t=l.optional_params)||void 0===t?void 0:t[e]}null!=a&&""!==a&&(n.litellm_params[e]=a)})}if(!t)throw Error("No access token available");console.log("Sending guardrail data:",JSON.stringify(n)),await (0,h.createGuardrailCall)(t,n),et.Z.success("Guardrail created successfully"),ei(),i(),a()}catch(e){console.error("Failed to create guardrail:",e),et.Z.fromBackend("Failed to create guardrail: "+(e instanceof Error?e.message:String(e)))}finally{d(!1)}},en=()=>{var e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,n.jsx)(b.o,{placeholder:"Enter a name for this guardrail"})}),(0,n.jsx)(v.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,n.jsx)(f.default,{placeholder:"Select a guardrail provider",onChange:H,labelInValue:!1,optionLabelProp:"label",dropdownRender:e=>e,showSearch:!0,children:Object.entries(k()).map(e=>{let[l,a]=e;return(0,n.jsx)(eR,{value:l,label:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[I[a]&&(0,n.jsx)("img",{src:I[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,n.jsx)("span",{children:a})]}),children:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[I[a]&&(0,n.jsx)("img",{src:I[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,n.jsx)("span",{children:a})]})},l)})})}),(0,n.jsx)(v.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,n.jsx)(f.default,{optionLabelProp:"label",mode:"multiple",children:(null==m?void 0:null===(e=m.supported_modes)||void 0===e?void 0:e.map(e=>(0,n.jsx)(eR,{value:e,label:e,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:e}),"pre_call"===e&&(0,n.jsx)(y.Z,{color:"green",style:{marginLeft:"8px"},children:"Recommended"})]}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV[e]})]})},e)))||(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eR,{value:"pre_call",label:"pre_call",children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"pre_call"})," ",(0,n.jsx)(y.Z,{color:"green",children:"Recommended"})]}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.pre_call})]})}),(0,n.jsx)(eR,{value:"during_call",label:"during_call",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:(0,n.jsx)("strong",{children:"during_call"})}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.during_call})]})}),(0,n.jsx)(eR,{value:"post_call",label:"post_call",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:(0,n.jsx)("strong",{children:"post_call"})}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.post_call})]})}),(0,n.jsx)(eR,{value:"logging_only",label:"logging_only",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:(0,n.jsx)("strong",{children:"logging_only"})}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.logging_only})]})})]})})}),(0,n.jsx)(v.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default.",children:(0,n.jsxs)(f.default,{children:[(0,n.jsx)(f.default.Option,{value:!0,children:"Yes"}),(0,n.jsx)(f.default.Option,{value:!1,children:"No"})]})}),!W&&(0,n.jsx)(X,{selectedProvider:c,accessToken:t,providerParams:E})]})},eo=()=>m&&"PresidioPII"===c?(0,n.jsx)(Y,{entities:m.supported_entities,actions:m.supported_actions,selectedEntities:p,selectedActions:N,onEntitySelect:$,onActionSelect:Q,entityCategories:m.pii_entity_categories}):null,ed=e=>{if(!m||!P(c))return null;let l=m.content_filter_settings;return l?(0,n.jsx)(eI,{prebuiltPatterns:l.prebuilt_patterns||[],categories:l.pattern_categories||[],selectedPatterns:D,blockedWords:J,onPatternAdd:e=>R([...D,e]),onPatternRemove:e=>R(D.filter(l=>l.id!==e)),onPatternActionChange:(e,l)=>{R(D.map(a=>a.id===e?{...a,action:l}:a))},onBlockedWordAdd:e=>V([...J,e]),onBlockedWordRemove:e=>V(J.filter(l=>l.id!==e)),onBlockedWordUpdate:(e,l,a)=>{V(J.map(t=>t.id===e?{...t,[l]:a}:t))},accessToken:t,showStep:e}):null},ec=()=>{var e;if(!c)return null;if(W)return(0,n.jsx)(eM,{value:U,onChange:q});if(!E)return null;console.log("guardrail_provider_map: ",C),console.log("selectedProvider: ",c);let l=null===(e=C[c])||void 0===e?void 0:e.toLowerCase(),a=E&&E[l];return a&&a.optional_params?(0,n.jsx)(ea,{optionalParams:a.optional_params,parentFieldKey:"optional_params"}):null};return(0,n.jsx)(_.Z,{title:"Add Guardrail",open:l,onCancel:er,footer:null,width:700,children:(0,n.jsxs)(v.Z,{form:r,layout:"vertical",initialValues:{mode:"pre_call",default_on:!1},children:[(0,n.jsxs)(j.default,{current:A,className:"mb-6",children:[(0,n.jsx)(eJ,{title:"Basic Info"}),(0,n.jsx)(eJ,{title:Z(c)?"PII Configuration":P(c)?"Pattern Detection":"Provider Configuration"}),P(c)&&(0,n.jsx)(eJ,{title:"Blocked Keywords"})]}),(()=>{switch(A){case 0:return en();case 1:if(Z(c))return eo();if(P(c))return ed("patterns");return ec();case 2:if(P(c))return ed("keywords");return null;default:return null}})(),(()=>{let e=A===(P(c)?3:2)-1;return(0,n.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[A>0&&(0,n.jsx)(b.z,{variant:"secondary",onClick:el,children:"Previous"}),!e&&(0,n.jsx)(b.z,{onClick:ee,children:"Next"}),e&&(0,n.jsx)(b.z,{onClick:es,loading:s,children:"Create Guardrail"}),(0,n.jsx)(b.z,{variant:"secondary",onClick:er,children:"Cancel"})]})})()]})})},eq=a(2967),eW=a(74998),eY=a(44633),eH=a(86462),e$=a(49084),eQ=a(1309),eX=a(71594),e0=a(24525),e1=a(63709);let{Title:e4,Text:e2}=g.default,{Option:e5}=f.default;var e8=e=>{var l;let{visible:a,onClose:t,accessToken:i,onSuccess:r,guardrailId:s,initialValues:d}=e,[c]=v.Z.useForm(),[u,m]=(0,o.useState)(!1),[x,p]=(0,o.useState)((null==d?void 0:d.provider)||null),[g,j]=(0,o.useState)(null),[y,N]=(0,o.useState)([]),[w,S]=(0,o.useState)({});(0,o.useEffect)(()=>{(async()=>{try{if(!i)return;let e=await (0,h.getGuardrailUISettings)(i);j(e)}catch(e){console.error("Error fetching guardrail settings:",e),et.Z.fromBackend("Failed to load guardrail settings")}})()},[i]),(0,o.useEffect)(()=>{(null==d?void 0:d.pii_entities_config)&&Object.keys(d.pii_entities_config).length>0&&(N(Object.keys(d.pii_entities_config)),S(d.pii_entities_config))},[d]);let Z=e=>{N(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},P=(e,l)=>{S(a=>({...a,[e]:l}))},O=async()=>{try{m(!0);let e=await c.validateFields(),l=C[e.provider],a={guardrail_id:s,guardrail:{guardrail_name:e.guardrail_name,litellm_params:{guardrail:l,mode:e.mode,default_on:e.default_on},guardrail_info:{}}};if("PresidioPII"===e.provider&&y.length>0){let e={};y.forEach(l=>{e[l]=w[l]||"MASK"}),a.guardrail.litellm_params.pii_entities_config=e}else if(e.config)try{let l=JSON.parse(e.config);"Bedrock"===e.provider&&l?(l.guardrail_id&&(a.guardrail.litellm_params.guardrailIdentifier=l.guardrail_id),l.guardrail_version&&(a.guardrail.litellm_params.guardrailVersion=l.guardrail_version)):a.guardrail.guardrail_info=l}catch(e){et.Z.fromBackend("Invalid JSON in configuration"),m(!1);return}if(!i)throw Error("No access token available");console.log("Sending guardrail update data:",JSON.stringify(a));let n=await fetch("/guardrails/".concat(s),{method:"PUT",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(a)});if(!n.ok){let e=await n.text();throw Error(e||"Failed to update guardrail")}et.Z.success("Guardrail updated successfully"),r(),t()}catch(e){console.error("Failed to update guardrail:",e),et.Z.fromBackend("Failed to update guardrail: "+(e instanceof Error?e.message:String(e)))}finally{m(!1)}},A=()=>g&&x&&"PresidioPII"===x?(0,n.jsx)(Y,{entities:g.supported_entities,actions:g.supported_actions,selectedEntities:y,selectedActions:w,onEntitySelect:Z,onActionSelect:P,entityCategories:g.pii_entity_categories}):null;return(0,n.jsx)(_.Z,{title:"Edit Guardrail",open:a,onCancel:t,footer:null,width:700,children:(0,n.jsxs)(v.Z,{form:c,layout:"vertical",initialValues:d,children:[(0,n.jsx)(v.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,n.jsx)(b.o,{placeholder:"Enter a name for this guardrail"})}),(0,n.jsx)(v.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,n.jsx)(f.default,{placeholder:"Select a guardrail provider",onChange:e=>{p(e),c.setFieldsValue({config:void 0}),N([]),S({})},disabled:!0,optionLabelProp:"label",children:Object.entries(k()).map(e=>{let[l,a]=e;return(0,n.jsx)(e5,{value:l,label:a,children:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[I[a]&&(0,n.jsx)("img",{src:I[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,n.jsx)("span",{children:a})]})},l)})})}),(0,n.jsx)(v.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,n.jsx)(f.default,{children:(null==g?void 0:null===(l=g.supported_modes)||void 0===l?void 0:l.map(e=>(0,n.jsx)(e5,{value:e,children:e},e)))||(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e5,{value:"pre_call",children:"pre_call"}),(0,n.jsx)(e5,{value:"post_call",children:"post_call"})]})})}),(0,n.jsx)(v.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default",valuePropName:"checked",children:(0,n.jsx)(e1.Z,{})}),(()=>{if(!x)return null;if("PresidioPII"===x)return A();switch(x){case"Aporia":return(0,n.jsx)(v.Z.Item,{label:"Aporia Configuration",name:"config",tooltip:"JSON configuration for Aporia",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aporia_api_key",\n "project_name": "your_project_name"\n}'})});case"AimSecurity":return(0,n.jsx)(v.Z.Item,{label:"Aim Security Configuration",name:"config",tooltip:"JSON configuration for Aim Security",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aim_api_key"\n}'})});case"Bedrock":return(0,n.jsx)(v.Z.Item,{label:"Amazon Bedrock Configuration",name:"config",tooltip:"JSON configuration for Amazon Bedrock guardrails",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "guardrail_id": "your_guardrail_id",\n "guardrail_version": "your_guardrail_version"\n}'})});case"GuardrailsAI":return(0,n.jsx)(v.Z.Item,{label:"Guardrails.ai Configuration",name:"config",tooltip:"JSON configuration for Guardrails.ai",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_guardrails_api_key",\n "guardrail_id": "your_guardrail_id"\n}'})});case"LakeraAI":return(0,n.jsx)(v.Z.Item,{label:"Lakera AI Configuration",name:"config",tooltip:"JSON configuration for Lakera AI",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_lakera_api_key"\n}'})});case"PromptInjection":return(0,n.jsx)(v.Z.Item,{label:"Prompt Injection Configuration",name:"config",tooltip:"JSON configuration for prompt injection detection",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "threshold": 0.8\n}'})});default:return(0,n.jsx)(v.Z.Item,{label:"Custom Configuration",name:"config",tooltip:"JSON configuration for your custom guardrail",children:(0,n.jsx)(eL.default.TextArea,{rows:4,placeholder:'{\n "key1": "value1",\n "key2": "value2"\n}'})})}})(),(0,n.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[(0,n.jsx)(b.z,{variant:"secondary",onClick:t,children:"Cancel"}),(0,n.jsx)(b.z,{onClick:O,loading:u,children:"Update Guardrail"})]})]})})};(i=s||(s={})).DB="db",i.CONFIG="config";var e6=e=>{let{guardrailsList:l,isLoading:a,onDeleteClick:t,accessToken:i,onGuardrailUpdated:r,isAdmin:d=!1,onGuardrailClick:c}=e,[u,m]=(0,o.useState)([{id:"created_at",desc:!0}]),[x,p]=(0,o.useState)(!1),[h,g]=(0,o.useState)(null),f=e=>e?new Date(e).toLocaleString():"-",j=[{header:"Guardrail ID",accessorKey:"guardrail_id",cell:e=>(0,n.jsx)(L.Z,{title:String(e.getValue()||""),children:(0,n.jsx)(eq.zx,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>e.getValue()&&c(e.getValue()),children:e.getValue()?"".concat(String(e.getValue()).slice(0,7),"..."):""})})},{header:"Name",accessorKey:"guardrail_name",cell:e=>{let{row:l}=e,a=l.original;return(0,n.jsx)(L.Z,{title:a.guardrail_name,children:(0,n.jsx)("span",{className:"text-xs font-medium",children:a.guardrail_name||"-"})})}},{header:"Provider",accessorKey:"litellm_params.guardrail",cell:e=>{let{row:l}=e,{logo:a,displayName:t}=A(l.original.litellm_params.guardrail);return(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,n.jsx)("img",{src:a,alt:"".concat(t," logo"),className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,n.jsx)("span",{className:"text-xs",children:t})]})}},{header:"Mode",accessorKey:"litellm_params.mode",cell:e=>{let{row:l}=e,a=l.original;return(0,n.jsx)("span",{className:"text-xs",children:a.litellm_params.mode})}},{header:"Default On",accessorKey:"litellm_params.default_on",cell:e=>{var l,a;let{row:t}=e,i=t.original;return(0,n.jsx)(eQ.C,{color:(null===(l=i.litellm_params)||void 0===l?void 0:l.default_on)?"green":"gray",className:"text-xs font-normal",size:"xs",children:(null===(a=i.litellm_params)||void 0===a?void 0:a.default_on)?"Default On":"Default Off"})}},{header:"Created At",accessorKey:"created_at",cell:e=>{let{row:l}=e,a=l.original;return(0,n.jsx)(L.Z,{title:a.created_at,children:(0,n.jsx)("span",{className:"text-xs",children:f(a.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:e=>{let{row:l}=e,a=l.original;return(0,n.jsx)(L.Z,{title:a.updated_at,children:(0,n.jsx)("span",{className:"text-xs",children:f(a.updated_at)})})}},{id:"actions",header:"Actions",cell:e=>{let{row:l}=e,a=l.original,i=a.guardrail_definition_location===s.CONFIG;return(0,n.jsx)("div",{className:"flex space-x-2",children:i?(0,n.jsx)(L.Z,{title:"Config guardrail cannot be deleted on the dashboard. Please delete it from the config file.",children:(0,n.jsx)(eq.JO,{"data-testid":"config-delete-icon",icon:eW.Z,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,n.jsx)(L.Z,{title:"Delete guardrail",children:(0,n.jsx)(eq.JO,{icon:eW.Z,size:"sm",onClick:()=>a.guardrail_id&&t(a.guardrail_id,a.guardrail_name||"Unnamed Guardrail"),className:"cursor-pointer hover:text-red-500"})})})}}],v=(0,eX.b7)({data:l,columns:j,state:{sorting:u},onSortingChange:m,getCoreRowModel:(0,e0.sC)(),getSortedRowModel:(0,e0.tj)(),enableSorting:!0});return(0,n.jsxs)("div",{className:"rounded-lg custom-border relative",children:[(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)(eq.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,n.jsx)(eq.ss,{children:v.getHeaderGroups().map(e=>(0,n.jsx)(eq.SC,{children:e.headers.map(e=>(0,n.jsx)(eq.xs,{className:"py-1 h-8 ".concat("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,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,eX.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,n.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,n.jsx)(eY.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,n.jsx)(eH.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,n.jsx)(e$.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,n.jsx)(eq.RM,{children:a?(0,n.jsx)(eq.SC,{children:(0,n.jsx)(eq.pj,{colSpan:j.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"Loading..."})})})}):l.length>0?v.getRowModel().rows.map(e=>(0,n.jsx)(eq.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,n.jsx)(eq.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,eX.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,n.jsx)(eq.SC,{children:(0,n.jsx)(eq.pj,{colSpan:j.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"No guardrails found"})})})})})]})}),h&&(0,n.jsx)(e8,{visible:x,onClose:()=>p(!1),accessToken:i,onSuccess:()=>{p(!1),g(null),r()},guardrailId:h.guardrail_id||"",initialValues:{guardrail_name:h.guardrail_name||"",provider:Object.keys(C).find(e=>C[e]===(null==h?void 0:h.litellm_params.guardrail))||"",mode:h.litellm_params.mode,default_on:h.litellm_params.default_on,pii_entities_config:h.litellm_params.pii_entities_config,...h.guardrail_info}})]})},e3=a(20347),e9=a(30078),e7=a(41649),le=a(12514),ll=a(84264),la=e=>{let{patterns:l,blockedWords:a,readOnly:t=!0,onPatternActionChange:i,onPatternRemove:r,onBlockedWordUpdate:s,onBlockedWordRemove:o}=e;if(0===l.length&&0===a.length)return null;let d=()=>{};return(0,n.jsxs)(n.Fragment,{children:[l.length>0&&(0,n.jsxs)(le.Z,{className:"mt-6",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(ll.Z,{className:"text-lg font-semibold",children:"Pattern Detection"}),(0,n.jsxs)(e7.Z,{color:"blue",children:[l.length," patterns configured"]})]}),(0,n.jsx)(ek,{patterns:l,onActionChange:t?d:i||d,onRemove:t?d:r||d})]}),a.length>0&&(0,n.jsxs)(le.Z,{className:"mt-6",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(ll.Z,{className:"text-lg font-semibold",children:"Blocked Keywords"}),(0,n.jsxs)(e7.Z,{color:"blue",children:[a.length," keywords configured"]})]}),(0,n.jsx)(eZ,{keywords:a,onActionChange:t?d:s||d,onRemove:t?d:o||d})]})]})},lt=e=>{var l;let{guardrailData:a,guardrailSettings:t,isEditing:i,accessToken:r,onDataChange:s,onUnsavedChanges:d}=e,[c,u]=(0,o.useState)([]),[m,x]=(0,o.useState)([]),[p,h]=(0,o.useState)([]),[g,f]=(0,o.useState)([]);(0,o.useEffect)(()=>{var e,l;if(null==a?void 0:null===(e=a.litellm_params)||void 0===e?void 0:e.patterns){let e=a.litellm_params.patterns.map((e,l)=>({id:"pattern-".concat(l),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"}));u(e),h(e)}else u([]),h([]);if(null==a?void 0:null===(l=a.litellm_params)||void 0===l?void 0:l.blocked_words){let e=a.litellm_params.blocked_words.map((e,l)=>({id:"word-".concat(l),keyword:e.keyword,action:e.action||"BLOCK",description:e.description}));x(e),f(e)}else x([]),f([])},[a]),(0,o.useEffect)(()=>{s&&s(c,m)},[c,m,s]);let j=o.useMemo(()=>{let e=JSON.stringify(c)!==JSON.stringify(p),l=JSON.stringify(m)!==JSON.stringify(g);return e||l},[c,m,p,g]);return((0,o.useEffect)(()=>{i&&d&&d(j)},[j,i,d]),(null==a?void 0:null===(l=a.litellm_params)||void 0===l?void 0:l.guardrail)!=="litellm_content_filter")?null:i?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eE.Z,{orientation:"left",children:"Content Filter Configuration"}),j&&(0,n.jsx)("div",{className:"mb-4 px-4 py-3 bg-yellow-50 border border-yellow-200 rounded-md",children:(0,n.jsx)("p",{className:"text-sm text-yellow-800 font-medium",children:'⚠️ You have unsaved changes to patterns or keywords. Remember to click "Save Changes" at the bottom.'})}),(0,n.jsx)("div",{className:"mb-6",children:t&&t.content_filter_settings&&(0,n.jsx)(eI,{prebuiltPatterns:t.content_filter_settings.prebuilt_patterns||[],categories:t.content_filter_settings.pattern_categories||[],selectedPatterns:c,blockedWords:m,onPatternAdd:e=>u([...c,e]),onPatternRemove:e=>u(c.filter(l=>l.id!==e)),onPatternActionChange:(e,l)=>u(c.map(a=>a.id===e?{...a,action:l}:a)),onBlockedWordAdd:e=>x([...m,e]),onBlockedWordRemove:e=>x(m.filter(l=>l.id!==e)),onBlockedWordUpdate:(e,l,a)=>x(m.map(t=>t.id===e?{...t,[l]:a}:t)),onFileUpload:e=>{console.log("File uploaded:",e)},accessToken:r})})]}):(0,n.jsx)(la,{patterns:c,blockedWords:m,readOnly:!0})};let li=(e,l)=>({patterns:e.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:l.map(e=>({keyword:e.keyword,action:e.action,description:e.description}))});var lr=a(10900),ls=a(59872),ln=a(30401),lo=a(78867),ld=e=>{var l,a,t,i,r,s,d,c,u,m,x,p,g,j,y,_;let{guardrailId:b,onClose:N,accessToken:w,isAdmin:k}=e,[S,Z]=(0,o.useState)(null),[P,O]=(0,o.useState)(null),[I,T]=(0,o.useState)(!0),[G,M]=(0,o.useState)(!1),[F]=v.Z.useForm(),[K,D]=(0,o.useState)([]),[R,J]=(0,o.useState)({}),[V,U]=(0,o.useState)(null),[q,W]=(0,o.useState)({}),[H,$]=(0,o.useState)(!1),Q={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},[ee,el]=(0,o.useState)(Q),[ei,er]=(0,o.useState)(!1),es=o.useRef({patterns:[],blockedWords:[]}),en=(0,o.useCallback)((e,l)=>{es.current={patterns:e,blockedWords:l}},[]),eo=async()=>{try{var e;if(T(!0),!w)return;let l=await (0,h.getGuardrailInfo)(w,b);if(Z(l),null===(e=l.litellm_params)||void 0===e?void 0:e.pii_entities_config){let e=l.litellm_params.pii_entities_config;if(D([]),J({}),Object.keys(e).length>0){let l=[],a={};Object.entries(e).forEach(e=>{let[t,i]=e;l.push(t),a[t]="string"==typeof i?i:"MASK"}),D(l),J(a)}}else D([]),J({})}catch(e){et.Z.fromBackend("Failed to load guardrail information"),console.error("Error fetching guardrail info:",e)}finally{T(!1)}},ed=async()=>{try{if(!w)return;let e=await (0,h.getGuardrailProviderSpecificParams)(w);O(e)}catch(e){console.error("Error fetching guardrail provider specific params:",e)}},ec=async()=>{try{if(!w)return;let e=await (0,h.getGuardrailUISettings)(w);U(e)}catch(e){console.error("Error fetching guardrail UI settings:",e)}};(0,o.useEffect)(()=>{ed()},[w]),(0,o.useEffect)(()=>{eo(),ec()},[b,w]),(0,o.useEffect)(()=>{if(S&&F){var e;F.setFieldsValue({guardrail_name:S.guardrail_name,...S.litellm_params,guardrail_info:S.guardrail_info?JSON.stringify(S.guardrail_info,null,2):"",...(null===(e=S.litellm_params)||void 0===e?void 0:e.optional_params)&&{optional_params:S.litellm_params.optional_params}})}},[S,P,F]);let eu=(0,o.useCallback)(()=>{var e,l,a,t,i;(null==S?void 0:null===(e=S.litellm_params)||void 0===e?void 0:e.guardrail)==="tool_permission"?el({rules:(null===(l=S.litellm_params)||void 0===l?void 0:l.rules)||[],default_action:((null===(a=S.litellm_params)||void 0===a?void 0:a.default_action)||"deny").toLowerCase(),on_disallowed_action:((null===(t=S.litellm_params)||void 0===t?void 0:t.on_disallowed_action)||"block").toLowerCase(),violation_message_template:(null===(i=S.litellm_params)||void 0===i?void 0:i.violation_message_template)||""}):el(Q),er(!1)},[S]);(0,o.useEffect)(()=>{eu()},[eu]);let em=async e=>{try{var l,a,t,i,r,s,n,o,d,c,u,m;if(!w)return;let x={litellm_params:{}};e.guardrail_name!==S.guardrail_name&&(x.guardrail_name=e.guardrail_name),e.default_on!==(null===(l=S.litellm_params)||void 0===l?void 0:l.default_on)&&(x.litellm_params.default_on=e.default_on);let p=S.guardrail_info,g=e.guardrail_info?JSON.parse(e.guardrail_info):void 0;JSON.stringify(p)!==JSON.stringify(g)&&(x.guardrail_info=g);let f=(null===(a=S.litellm_params)||void 0===a?void 0:a.pii_entities_config)||{},j={};if(K.forEach(e=>{j[e]=R[e]||"MASK"}),JSON.stringify(f)!==JSON.stringify(j)&&(x.litellm_params.pii_entities_config=j),(null===(t=S.litellm_params)||void 0===t?void 0:t.guardrail)==="litellm_content_filter"){let e=(null===(s=S.litellm_params)||void 0===s?void 0:s.patterns)||[],l=(null===(n=S.litellm_params)||void 0===n?void 0:n.blocked_words)||[],a=li(es.current.patterns,es.current.blockedWords);JSON.stringify(e)!==JSON.stringify(a.patterns)&&(x.litellm_params.patterns=a.patterns),JSON.stringify(l)!==JSON.stringify(a.blocked_words)&&(x.litellm_params.blocked_words=a.blocked_words)}if((null===(i=S.litellm_params)||void 0===i?void 0:i.guardrail)==="tool_permission"){let e=(null===(o=S.litellm_params)||void 0===o?void 0:o.rules)||[],l=ee.rules||[],a=JSON.stringify(e)!==JSON.stringify(l),t=((null===(d=S.litellm_params)||void 0===d?void 0:d.default_action)||"deny").toLowerCase(),i=(ee.default_action||"deny").toLowerCase(),r=t!==i,s=((null===(c=S.litellm_params)||void 0===c?void 0:c.on_disallowed_action)||"block").toLowerCase(),n=(ee.on_disallowed_action||"block").toLowerCase(),m=s!==n,p=(null===(u=S.litellm_params)||void 0===u?void 0:u.violation_message_template)||"",h=ee.violation_message_template||"",g=p!==h;(ei||a||r||m||g)&&(x.litellm_params.rules=l,x.litellm_params.default_action=i,x.litellm_params.on_disallowed_action=n,x.litellm_params.violation_message_template=h||null)}let v=Object.keys(C).find(e=>{var l;return C[e]===(null===(l=S.litellm_params)||void 0===l?void 0:l.guardrail)});console.log("values: ",JSON.stringify(e)),console.log("currentProvider: ",v);let y=(null===(r=S.litellm_params)||void 0===r?void 0:r.guardrail)==="tool_permission";if(P&&v&&!y){let l=P[null===(m=C[v])||void 0===m?void 0:m.toLowerCase()]||{},a=new Set;console.log("providerSpecificParams: ",JSON.stringify(l)),Object.keys(l).forEach(e=>{"optional_params"!==e&&a.add(e)}),l.optional_params&&l.optional_params.fields&&Object.keys(l.optional_params.fields).forEach(e=>{a.add(e)}),console.log("allowedParams: ",a),a.forEach(l=>{var a,t;let i=e[l];(null==i||""===i)&&(i=null===(t=e.optional_params)||void 0===t?void 0:t[l]);let r=null===(a=S.litellm_params)||void 0===a?void 0:a[l];JSON.stringify(i)!==JSON.stringify(r)&&(null!=i&&""!==i?x.litellm_params[l]=i:null!=r&&""!==r&&(x.litellm_params[l]=null))})}if(0===Object.keys(x.litellm_params).length&&delete x.litellm_params,0===Object.keys(x).length){et.Z.info("No changes detected"),M(!1);return}await (0,h.updateGuardrailCall)(w,b,x),et.Z.success("Guardrail updated successfully"),$(!1),eo(),M(!1)}catch(e){console.error("Error updating guardrail:",e),et.Z.fromBackend("Failed to update guardrail")}};if(I)return(0,n.jsx)("div",{className:"p-4",children:"Loading..."});if(!S)return(0,n.jsx)("div",{className:"p-4",children:"Guardrail not found"});let ex=e=>e?new Date(e).toLocaleString():"-",{logo:ep,displayName:eh}=A((null===(l=S.litellm_params)||void 0===l?void 0:l.guardrail)||""),eg=async(e,l)=>{await (0,ls.vQ)(e)&&(W(e=>({...e,[l]:!0})),setTimeout(()=>{W(e=>({...e,[l]:!1}))},2e3))},ef="config"===S.guardrail_definition_location;return(0,n.jsxs)("div",{className:"p-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(e9.zx,{icon:lr.Z,variant:"light",onClick:N,className:"mb-4",children:"Back to Guardrails"}),(0,n.jsx)(e9.Dx,{children:S.guardrail_name||"Unnamed Guardrail"}),(0,n.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,n.jsx)(e9.xv,{className:"text-gray-500 font-mono",children:S.guardrail_id}),(0,n.jsx)(E.ZP,{type:"text",size:"small",icon:q["guardrail-id"]?(0,n.jsx)(ln.Z,{size:12}):(0,n.jsx)(lo.Z,{size:12}),onClick:()=>eg(S.guardrail_id,"guardrail-id"),className:"left-2 z-10 transition-all duration-200 ".concat(q["guardrail-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,n.jsxs)(e9.v0,{children:[(0,n.jsxs)(e9.td,{className:"mb-4",children:[(0,n.jsx)(e9.OK,{children:"Overview"},"overview"),k?(0,n.jsx)(e9.OK,{children:"Settings"},"settings"):(0,n.jsx)(n.Fragment,{})]}),(0,n.jsxs)(e9.nP,{children:[(0,n.jsxs)(e9.x4,{children:[(0,n.jsxs)(e9.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,n.jsxs)(e9.Zb,{children:[(0,n.jsx)(e9.xv,{children:"Provider"}),(0,n.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[ep&&(0,n.jsx)("img",{src:ep,alt:"".concat(eh," logo"),className:"w-6 h-6",onError:e=>{e.target.style.display="none"}}),(0,n.jsx)(e9.Dx,{children:eh})]})]}),(0,n.jsxs)(e9.Zb,{children:[(0,n.jsx)(e9.xv,{children:"Mode"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(e9.Dx,{children:(null===(a=S.litellm_params)||void 0===a?void 0:a.mode)||"-"}),(0,n.jsx)(e9.Ct,{color:(null===(t=S.litellm_params)||void 0===t?void 0:t.default_on)?"green":"gray",children:(null===(i=S.litellm_params)||void 0===i?void 0:i.default_on)?"Default On":"Default Off"})]})]}),(0,n.jsxs)(e9.Zb,{children:[(0,n.jsx)(e9.xv,{children:"Created At"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(e9.Dx,{children:ex(S.created_at)}),(0,n.jsxs)(e9.xv,{children:["Last Updated: ",ex(S.updated_at)]})]})]})]}),(null===(r=S.litellm_params)||void 0===r?void 0:r.pii_entities_config)&&Object.keys(S.litellm_params.pii_entities_config).length>0&&(0,n.jsx)(e9.Zb,{className:"mt-6",children:(0,n.jsxs)("div",{className:"flex justify-between items-center",children:[(0,n.jsx)(e9.xv,{className:"font-medium",children:"PII Protection"}),(0,n.jsxs)(e9.Ct,{color:"blue",children:[Object.keys(S.litellm_params.pii_entities_config).length," PII entities configured"]})]})}),(null===(s=S.litellm_params)||void 0===s?void 0:s.pii_entities_config)&&Object.keys(S.litellm_params.pii_entities_config).length>0&&(0,n.jsxs)(e9.Zb,{className:"mt-6",children:[(0,n.jsx)(e9.xv,{className:"mb-4 text-lg font-semibold",children:"PII Entity Configuration"}),(0,n.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,n.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,n.jsx)(e9.xv,{className:"flex-1 font-semibold text-gray-700",children:"Entity Type"}),(0,n.jsx)(e9.xv,{className:"flex-1 font-semibold text-gray-700",children:"Configuration"})]}),(0,n.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:Object.entries(null===(d=S.litellm_params)||void 0===d?void 0:d.pii_entities_config).map(e=>{let[l,a]=e;return(0,n.jsxs)("div",{className:"px-5 py-3 flex border-b hover:bg-gray-50 transition-colors",children:[(0,n.jsx)(e9.xv,{className:"flex-1 font-medium text-gray-900",children:l}),(0,n.jsx)(e9.xv,{className:"flex-1",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5 ".concat("MASK"===a?"text-blue-600":"text-red-600"),children:["MASK"===a?(0,n.jsx)(z.Z,{}):(0,n.jsx)(B.Z,{}),String(a)]})})]},l)})})]})]}),(null===(c=S.litellm_params)||void 0===c?void 0:c.guardrail)==="tool_permission"&&(0,n.jsx)(e9.Zb,{className:"mt-6",children:(0,n.jsx)(eM,{value:ee,disabled:!0})}),(0,n.jsx)(lt,{guardrailData:S,guardrailSettings:V,isEditing:!1,accessToken:w})]}),k&&(0,n.jsx)(e9.x4,{children:(0,n.jsxs)(e9.Zb,{children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(e9.Dx,{children:"Guardrail Settings"}),ef&&(0,n.jsx)(L.Z,{title:"Guardrail is defined in the config file and cannot be edited.",children:(0,n.jsx)(ez.Z,{})}),!G&&!ef&&(0,n.jsx)(e9.zx,{onClick:()=>M(!0),children:"Edit Settings"})]}),G?(0,n.jsxs)(v.Z,{form:F,onFinish:em,initialValues:{guardrail_name:S.guardrail_name,...S.litellm_params,guardrail_info:S.guardrail_info?JSON.stringify(S.guardrail_info,null,2):"",...(null===(u=S.litellm_params)||void 0===u?void 0:u.optional_params)&&{optional_params:S.litellm_params.optional_params}},layout:"vertical",children:[(0,n.jsx)(v.Z.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Please input a guardrail name"}],children:(0,n.jsx)(e9.oi,{})}),(0,n.jsx)(v.Z.Item,{label:"Default On",name:"default_on",children:(0,n.jsxs)(f.default,{children:[(0,n.jsx)(f.default.Option,{value:!0,children:"Yes"}),(0,n.jsx)(f.default.Option,{value:!1,children:"No"})]})}),(null===(m=S.litellm_params)||void 0===m?void 0:m.guardrail)==="presidio"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eE.Z,{orientation:"left",children:"PII Protection"}),(0,n.jsx)("div",{className:"mb-6",children:V&&(0,n.jsx)(Y,{entities:V.supported_entities,actions:V.supported_actions,selectedEntities:K,selectedActions:R,onEntitySelect:e=>{D(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},onActionSelect:(e,l)=>{J(a=>({...a,[e]:l}))},entityCategories:V.pii_entity_categories})})]}),(0,n.jsx)(lt,{guardrailData:S,guardrailSettings:V,isEditing:!0,accessToken:w,onDataChange:en,onUnsavedChanges:$}),(0,n.jsx)(eE.Z,{orientation:"left",children:"Provider Settings"}),(null===(x=S.litellm_params)||void 0===x?void 0:x.guardrail)==="tool_permission"?(0,n.jsx)(eM,{value:ee,onChange:el}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(X,{selectedProvider:Object.keys(C).find(e=>{var l;return C[e]===(null===(l=S.litellm_params)||void 0===l?void 0:l.guardrail)})||null,accessToken:w,providerParams:P,value:S.litellm_params}),P&&(()=>{var e;let l=Object.keys(C).find(e=>{var l;return C[e]===(null===(l=S.litellm_params)||void 0===l?void 0:l.guardrail)});if(!l)return null;let a=P[null===(e=C[l])||void 0===e?void 0:e.toLowerCase()];return a&&a.optional_params?(0,n.jsx)(ea,{optionalParams:a.optional_params,parentFieldKey:"optional_params",values:S.litellm_params}):null})()]}),(0,n.jsx)(eE.Z,{orientation:"left",children:"Advanced Settings"}),(0,n.jsx)(v.Z.Item,{label:"Guardrail Information",name:"guardrail_info",children:(0,n.jsx)(eL.default.TextArea,{rows:5})}),(0,n.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,n.jsx)(E.ZP,{onClick:()=>{M(!1),$(!1),eu()},children:"Cancel"}),(0,n.jsx)(e9.zx,{children:"Save Changes"})]})]}):(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(e9.xv,{className:"font-medium",children:"Guardrail ID"}),(0,n.jsx)("div",{className:"font-mono",children:S.guardrail_id})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(e9.xv,{className:"font-medium",children:"Guardrail Name"}),(0,n.jsx)("div",{children:S.guardrail_name||"Unnamed Guardrail"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(e9.xv,{className:"font-medium",children:"Provider"}),(0,n.jsx)("div",{children:eh})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(e9.xv,{className:"font-medium",children:"Mode"}),(0,n.jsx)("div",{children:(null===(p=S.litellm_params)||void 0===p?void 0:p.mode)||"-"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(e9.xv,{className:"font-medium",children:"Default On"}),(0,n.jsx)(e9.Ct,{color:(null===(g=S.litellm_params)||void 0===g?void 0:g.default_on)?"green":"gray",children:(null===(j=S.litellm_params)||void 0===j?void 0:j.default_on)?"Yes":"No"})]}),(null===(y=S.litellm_params)||void 0===y?void 0:y.pii_entities_config)&&Object.keys(S.litellm_params.pii_entities_config).length>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)(e9.xv,{className:"font-medium",children:"PII Protection"}),(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsxs)(e9.Ct,{color:"blue",children:[Object.keys(S.litellm_params.pii_entities_config).length," PII entities configured"]})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(e9.xv,{className:"font-medium",children:"Created At"}),(0,n.jsx)("div",{children:ex(S.created_at)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(e9.xv,{className:"font-medium",children:"Last Updated"}),(0,n.jsx)("div",{children:ex(S.updated_at)})]}),(null===(_=S.litellm_params)||void 0===_?void 0:_.guardrail)==="tool_permission"&&(0,n.jsx)(eM,{value:ee,disabled:!0})]})]})})]})]})]})},lc=a(96761),lu=a(35631),lm=a(29436),lx=a(41169),lp=a(23639),lh=a(77565),lg=a(70464),lf=a(83669),lj=a(5540);let{Text:lv}=g.default;var ly=function(e){let{results:l,errors:a}=e,[t,i]=(0,o.useState)(new Set),r=e=>{let l=new Set(t);l.has(e)?l.delete(e):l.add(e),i(l)},s=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let l=document.createElement("textarea");l.value=e,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.focus(),l.select();let a=document.execCommand("copy");if(document.body.removeChild(l),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}};return l||a?(0,n.jsxs)("div",{className:"space-y-3 pt-4 border-t border-gray-200",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Results"}),l&&l.map(e=>{let l=t.has(e.guardrailName);return(0,n.jsx)(le.Z,{className:"bg-green-50 border-green-200",children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer flex-1",onClick:()=>r(e.guardrailName),children:[l?(0,n.jsx)(lh.Z,{className:"text-gray-500 text-xs"}):(0,n.jsx)(lg.Z,{className:"text-gray-500 text-xs"}),(0,n.jsx)(lf.Z,{className:"text-green-600 text-lg"}),(0,n.jsx)("span",{className:"text-sm font-medium text-green-800",children:e.guardrailName})]}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,n.jsx)(lj.Z,{}),(0,n.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]}),!l&&(0,n.jsx)(d.Z,{size:"xs",variant:"secondary",icon:lp.Z,onClick:async()=>{await s(e.response_text)?et.Z.success("Result copied to clipboard"):et.Z.fromBackend("Failed to copy result")},children:"Copy"})]})]}),!l&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"bg-white border border-green-200 rounded p-3",children:[(0,n.jsx)("label",{className:"text-xs font-medium text-gray-600 mb-2 block",children:"Output Text"}),(0,n.jsx)("div",{className:"font-mono text-sm text-gray-900 whitespace-pre-wrap break-words",children:e.response_text})]}),(0,n.jsxs)("div",{className:"text-xs text-gray-600",children:[(0,n.jsx)("span",{className:"font-medium",children:"Characters:"})," ",e.response_text.length]})]})]})},e.guardrailName)}),a&&a.map(e=>{let l=t.has(e.guardrailName);return(0,n.jsx)(le.Z,{className:"bg-red-50 border-red-200",children:(0,n.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,n.jsx)("div",{className:"cursor-pointer mt-0.5",onClick:()=>r(e.guardrailName),children:l?(0,n.jsx)(lh.Z,{className:"text-gray-500 text-xs"}):(0,n.jsx)(lg.Z,{className:"text-gray-500 text-xs"})}),(0,n.jsx)("div",{className:"text-red-600 mt-0.5",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,n.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,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,n.jsxs)("p",{className:"text-sm font-medium text-red-800 cursor-pointer",onClick:()=>r(e.guardrailName),children:[e.guardrailName," - Error"]}),(0,n.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,n.jsx)(lj.Z,{}),(0,n.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]})]}),!l&&(0,n.jsx)("p",{className:"text-sm text-red-700 mt-1",children:e.error.message})]})]})},e.guardrailName)})]}):null};let{TextArea:l_}=eL.default,{Text:lb}=g.default;var lN=function(e){let{guardrailNames:l,onSubmit:a,isLoading:t,results:i,errors:r,onClose:s}=e,[d,c]=(0,o.useState)(""),u=()=>{if(!d.trim()){et.Z.fromBackend("Please enter text to test");return}a(d)},m=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let l=document.createElement("textarea");l.value=e,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.focus(),l.select();let a=document.execCommand("copy");if(document.body.removeChild(l),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},x=async()=>{await m(d)?et.Z.success("Input copied to clipboard"):et.Z.fromBackend("Failed to copy input")};return(0,n.jsxs)("div",{className:"space-y-4 h-full flex flex-col",children:[(0,n.jsx)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:(0,n.jsx)("div",{className:"flex items-center space-x-3",children:(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Guardrails:"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:l.map(e=>(0,n.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,n.jsx)("span",{className:"font-mono text-blue-700 font-medium text-sm",children:e})},e))})]}),(0,n.jsxs)("p",{className:"text-sm text-gray-500",children:["Test ",l.length>1?"guardrails":"guardrail"," and compare results"]})]})})}),(0,n.jsxs)("div",{className:"flex-1 overflow-auto space-y-4",children:[(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Input Text"}),(0,n.jsx)(L.Z,{title:"Press Enter to submit. Use Shift+Enter for new line.",children:(0,n.jsx)(ez.Z,{className:"text-gray-400 cursor-help"})})]}),d&&(0,n.jsx)(ed.z,{size:"xs",variant:"secondary",icon:lp.Z,onClick:x,children:"Copy Input"})]}),(0,n.jsx)(l_,{value:d,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey||(e.preventDefault(),u())},placeholder:"Enter text to test with guardrails...",rows:8,className:"font-mono text-sm"}),(0,n.jsxs)("div",{className:"flex justify-between items-center mt-1",children:[(0,n.jsxs)(lb,{className:"text-xs text-gray-500",children:["Press ",(0,n.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 border border-gray-300 rounded text-xs",children:"Enter"})," to submit • ",(0,n.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,n.jsxs)(lb,{className:"text-xs text-gray-500",children:["Characters: ",d.length]})]})]}),(0,n.jsx)("div",{className:"pt-2",children:(0,n.jsx)(ed.z,{onClick:u,loading:t,disabled:!d.trim(),className:"w-full",children:t?"Testing ".concat(l.length," guardrail").concat(l.length>1?"s":"","..."):"Test ".concat(l.length," guardrail").concat(l.length>1?"s":"")})})]}),(0,n.jsx)(ly,{results:i,errors:r})]})]})},lw=e=>{let{guardrailsList:l,isLoading:a,accessToken:t,onClose:i}=e,[r,s]=(0,o.useState)(new Set),[d,c]=(0,o.useState)(""),[u,m]=(0,o.useState)([]),[x,p]=(0,o.useState)([]),[g,f]=(0,o.useState)(!1),j=l.filter(e=>{var l;return null===(l=e.guardrail_name)||void 0===l?void 0:l.toLowerCase().includes(d.toLowerCase())}),v=e=>{let l=new Set(r);l.has(e)?l.delete(e):l.add(e),s(l)},y=async e=>{if(0===r.size||!t)return;f(!0),m([]),p([]);let l=[],a=[];await Promise.all(Array.from(r).map(async i=>{let r=Date.now();try{let a=await (0,h.applyGuardrail)(t,i,e,null,null),s=Date.now()-r;l.push({guardrailName:i,response_text:a.response_text,latency:s})}catch(l){let e=Date.now()-r;console.error("Error testing guardrail ".concat(i,":"),l),a.push({guardrailName:i,error:l,latency:e})}})),m(l),p(a),f(!1),l.length>0&&et.Z.success("".concat(l.length," guardrail").concat(l.length>1?"s":""," applied successfully")),a.length>0&&et.Z.fromBackend("".concat(a.length," guardrail").concat(a.length>1?"s":""," failed"))};return(0,n.jsx)("div",{className:"w-full h-[calc(100vh-200px)]",children:(0,n.jsx)(le.Z,{className:"h-full",children:(0,n.jsxs)("div",{className:"flex h-full",children:[(0,n.jsxs)("div",{className:"w-1/4 border-r border-gray-200 flex flex-col overflow-hidden",children:[(0,n.jsx)("div",{className:"p-4 border-b border-gray-200",children:(0,n.jsxs)("div",{className:"mb-3",children:[(0,n.jsx)(lc.Z,{className:"text-lg font-semibold mb-3",children:"Guardrails"}),(0,n.jsx)(eg.Z,{icon:lm.Z,placeholder:"Search guardrails...",value:d,onValueChange:c})]})}),(0,n.jsx)("div",{className:"flex-1 overflow-auto",children:a?(0,n.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,n.jsx)(H.Z,{})}):0===j.length?(0,n.jsx)("div",{className:"p-4",children:(0,n.jsx)(eT.Z,{description:d?"No guardrails match your search":"No guardrails available"})}):(0,n.jsx)(lu.Z,{dataSource:j,renderItem:e=>(0,n.jsx)(lu.Z.Item,{onClick:()=>{e.guardrail_name&&v(e.guardrail_name)},className:"cursor-pointer hover:bg-gray-50 transition-colors px-4 ".concat(r.has(e.guardrail_name||"")?"bg-blue-50 border-l-4 border-l-blue-500":"border-l-4 border-l-transparent"),children:(0,n.jsx)(lu.Z.Item.Meta,{avatar:(0,n.jsx)(T.Z,{checked:r.has(e.guardrail_name||""),onClick:l=>{l.stopPropagation(),e.guardrail_name&&v(e.guardrail_name)}}),title:(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(lx.Z,{className:"text-gray-400"}),(0,n.jsx)("span",{className:"font-medium text-gray-900",children:e.guardrail_name})]}),description:(0,n.jsxs)("div",{className:"text-xs space-y-1 mt-1",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Type: "}),(0,n.jsx)("span",{className:"text-gray-600",children:e.litellm_params.guardrail})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Mode: "}),(0,n.jsx)("span",{className:"text-gray-600",children:e.litellm_params.mode})]})]})})})})}),(0,n.jsx)("div",{className:"p-3 border-t border-gray-200 bg-gray-50",children:(0,n.jsxs)(ll.Z,{className:"text-xs text-gray-600",children:[r.size," of ",j.length," selected"]})})]}),(0,n.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,n.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,n.jsx)(lc.Z,{className:"text-xl font-semibold mb-0",children:"Guardrail Testing Playground"})}),(0,n.jsx)("div",{className:"flex-1 overflow-auto p-4",children:0===r.size?(0,n.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,n.jsx)(lx.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,n.jsx)(ll.Z,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select Guardrails to Test"}),(0,n.jsx)(ll.Z,{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,n.jsx)("div",{className:"h-full",children:(0,n.jsx)(lN,{guardrailNames:Array.from(r),onSubmit:y,results:u.length>0?u:null,errors:x.length>0?x:null,isLoading:g,onClose:()=>s(new Set)})})})]})]})})})},lk=a(21609),lC=e=>{let{accessToken:l,userRole:a}=e,[t,i]=(0,o.useState)([]),[r,s]=(0,o.useState)(!1),[g,f]=(0,o.useState)(!1),[j,v]=(0,o.useState)(!1),[y,_]=(0,o.useState)(null),[b,N]=(0,o.useState)(!1),[w,k]=(0,o.useState)(null),[C,S]=(0,o.useState)(0),Z=!!a&&(0,e3.tY)(a),P=async()=>{if(l){f(!0);try{let e=await (0,h.getGuardrailsList)(l);console.log("guardrails: ".concat(JSON.stringify(e))),i(e.guardrails)}catch(e){console.error("Error fetching guardrails:",e)}finally{f(!1)}}};(0,o.useEffect)(()=>{P()},[l]);let O=async()=>{if(y&&l){v(!0);try{await (0,h.deleteGuardrailCall)(l,y.guardrail_id),et.Z.success('Guardrail "'.concat(y.guardrail_name,'" deleted successfully')),await P()}catch(e){console.error("Error deleting guardrail:",e),et.Z.fromBackend("Failed to delete guardrail")}finally{v(!1),N(!1),_(null)}}},I=y&&y.litellm_params?A(y.litellm_params.guardrail).displayName:void 0;return(0,n.jsx)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:(0,n.jsxs)(u.Z,{index:C,onIndexChange:S,children:[(0,n.jsxs)(m.Z,{className:"mb-4",children:[(0,n.jsx)(c.Z,{children:"Guardrails"}),(0,n.jsx)(c.Z,{disabled:!l||0===t.length,children:"Test Playground"})]}),(0,n.jsxs)(p.Z,{children:[(0,n.jsxs)(x.Z,{children:[(0,n.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,n.jsx)(d.Z,{onClick:()=>{w&&k(null),s(!0)},disabled:!l,children:"+ Add New Guardrail"})}),w?(0,n.jsx)(ld,{guardrailId:w,onClose:()=>k(null),accessToken:l,isAdmin:Z}):(0,n.jsx)(e6,{guardrailsList:t,isLoading:g,onDeleteClick:(e,l)=>{_(t.find(l=>l.guardrail_id===e)||null),N(!0)},accessToken:l,onGuardrailUpdated:P,isAdmin:Z,onGuardrailClick:e=>k(e)}),(0,n.jsx)(eU,{visible:r,onClose:()=>{s(!1)},accessToken:l,onSuccess:()=>{P()}}),(0,n.jsx)(lk.Z,{isOpen:b,title:"Delete Guardrail",message:"Are you sure you want to delete guardrail: ".concat(null==y?void 0:y.guardrail_name,"? This action cannot be undone."),resourceInformationTitle:"Guardrail Information",resourceInformation:[{label:"Name",value:null==y?void 0:y.guardrail_name},{label:"ID",value:null==y?void 0:y.guardrail_id,code:!0},{label:"Provider",value:I},{label:"Mode",value:null==y?void 0:y.litellm_params.mode},{label:"Default On",value:(null==y?void 0:y.litellm_params.default_on)?"Yes":"No"}],onCancel:()=>{N(!1),_(null)},onOk:O,confirmLoading:j})]}),(0,n.jsx)(x.Z,{children:(0,n.jsx)(lw,{guardrailsList:t,isLoading:g,accessToken:l,onClose:()=>S(0)})})]})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6399-58526c1aee70c3e8.js b/litellm/proxy/_experimental/out/_next/static/chunks/6399-58526c1aee70c3e8.js new file mode 100644 index 00000000000..92874eef0da --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/6399-58526c1aee70c3e8.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6399],{12579:function(e,t,s){s.d(t,{RM:function(){return a.Z},SC:function(){return c.Z},iA:function(){return r.Z},pj:function(){return l.Z},ss:function(){return o.Z},xs:function(){return i.Z},zx:function(){return n.Z}});var n=s(78489),r=s(21626),a=s(97214),l=s(28241),o=s(58834),i=s(69552),c=s(71876)},56399:function(e,t,s){s.d(t,{Z:function(){return eG}});var n=s(57437),r=s(2265),a=s(16312),l=s(22116),o=s(19250),i=s(12579),c=s(74998),d=s(44633),m=s(86462),p=s(49084),x=s(99981),u=s(23639),h=s(71594),g=s(24525),v=s(42673);let f=e=>{let t=new Set,s=/\{\{(\w+)\}\}/g;if(e.messages.forEach(e=>{let n;for(;null!==(n=s.exec(e.content));)t.add(n[1])}),e.developerMessage){let n;for(;null!==(n=s.exec(e.developerMessage));)t.add(n[1])}return Array.from(t)},j=e=>{let t=f(e),s="---\nmodel: ".concat(e.model,"\n");return void 0!==e.config.temperature&&(s+="temperature: ".concat(e.config.temperature,"\n")),void 0!==e.config.max_tokens&&(s+="max_tokens: ".concat(e.config.max_tokens,"\n")),void 0!==e.config.top_p&&(s+="top_p: ".concat(e.config.top_p,"\n")),s+="input:\n schema:\n",t.forEach(e=>{s+=" ".concat(e,": string\n")}),s+="output:\n format: text\n",e.tools&&e.tools.length>0&&(s+="tools:\n",e.tools.forEach(e=>{let t=JSON.parse(e.json);s+=" - ".concat(JSON.stringify(t),"\n")})),s+="---\n\n",e.developerMessage&&""!==e.developerMessage.trim()&&(s+="Developer: ".concat(e.developerMessage.trim(),"\n\n")),e.messages.forEach(e=>{let t=e.role.charAt(0).toUpperCase()+e.role.slice(1);s+="".concat(t,": ").concat(e.content,"\n\n")}),s.trim()},b=e=>{var t,s,n;let r=(null==e?void 0:null===(s=e.prompt_spec)||void 0===s?void 0:null===(t=s.litellm_params)||void 0===t?void 0:t.dotprompt_content)||"";if(!r)throw Error("No dotprompt_content found in API response");let a=r.split("---");if(a.length<3)throw Error("Invalid dotprompt format");let l=a[1],o=a.slice(2).join("---").trim(),i={};l.split("\n").forEach(e=>{let t=e.trim();if(t&&!t.startsWith("input:")&&!t.startsWith("output:")&&!t.startsWith("schema:")&&!t.startsWith("format:")){let e=t.indexOf(":");if(e>0){let s=t.substring(0,e).trim(),n=t.substring(e+1).trim();"temperature"===s||"max_tokens"===s||"top_p"===s?i[s]=parseFloat(n):"model"===s&&(i[s]=n)}}});let c="",d=[],m=o.split("\n"),p=null,x="";for(let e of m)e.startsWith("Developer:")?c=e.substring(10).trim():e.startsWith("User:")?(p&&x&&d.push({role:p,content:x.trim()}),p="user",x=e.substring(5).trim()):e.startsWith("Assistant:")?(p&&x&&d.push({role:p,content:x.trim()}),p="assistant",x=e.substring(10).trim()):e.trim()&&p&&(x+="\n"+e.trim());p&&x&&d.push({role:p,content:x.trim()});let u=(null==e?void 0:null===(n=e.prompt_spec)||void 0===n?void 0:n.prompt_id)||"Unnamed Prompt";return{name:N(u)||u,model:i.model||"gpt-4o",config:{temperature:i.temperature,max_tokens:i.max_tokens,top_p:i.top_p},tools:[],developerMessage:c,messages:d.length>0?d:[{role:"user",content:"Enter task specifics. Use {{template_variables}} for dynamic inputs"}]}},y=e=>{if(!e)return"1";let t=e.match(/[._-]v(\d+)$/);return t?t[1]:"1"},N=e=>e?e.replace(/[._-]v\d+$/,""):"",w=e=>{let t;if(!e)return{};let s={},n=/\{\{(\w+)\}\}/g;for(;null!==(t=n.exec(e));){let e=t[1];s[e]||(s[e]="example_".concat(e))}return s},_=e=>(null==e?void 0:e.prompt_id)||"",C=e=>{var t;let s=_(e);return(null==e?void 0:null===(t=e.litellm_params)||void 0===t?void 0:t.prompt_id)||s},k=e=>(null==e?void 0:e.version)?String(e.version):y(C(e)),S=e=>{try{var t;let s=e.litellm_params;if(null==s?void 0:s.dotprompt_content){let e=s.dotprompt_content.match(/model:\s*([^\n]+)/);if(e)return e[1].trim()}if(null==s?void 0:null===(t=s.prompt_data)||void 0===t?void 0:t.model)return s.prompt_data.model;if(null==s?void 0:s.model)return s.model;return null}catch(e){return console.error("Error extracting model:",e),null}},Z=(e,t)=>{if(!e)return null;let s=t.get(e);return s&&s.providers&&s.providers.length>0?s.providers[0]:null};var P=e=>{let{promptsList:t,isLoading:s,onPromptClick:a,onDeleteClick:l,accessToken:f,isAdmin:j}=e,[b,y]=(0,r.useState)([{id:"created_at",desc:!0}]),[N,w]=(0,r.useState)(new Map);(0,r.useEffect)(()=>{(async()=>{if(f)try{let e=await (0,o.modelHubCall)(f);if(null==e?void 0:e.data){let t=new Map;e.data.forEach(e=>{t.set(e.model_group,e)}),w(t)}}catch(e){console.error("Error fetching model hub data:",e)}})()},[f]);let _=e=>e?new Date(e).toLocaleString():"-",C=e=>{navigator.clipboard.writeText(e)},k=[{header:"Prompt ID",accessorKey:"prompt_id",cell:e=>{let t=String(e.getValue()||""),s=t.length>25?"".concat(t.slice(0,25),"..."):t;return(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(x.Z,{title:t,children:(0,n.jsx)(i.zx,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate min-w-[220px] justify-start",onClick:()=>e.getValue()&&(null==a?void 0:a(e.getValue())),children:s})}),(0,n.jsx)(x.Z,{title:"Copy prompt ID",children:(0,n.jsx)(u.Z,{onClick:e=>{e.stopPropagation(),C(t)},className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]})}},{header:"Model",accessorKey:"model",cell:e=>{let{row:t}=e,s=S(t.original);if(!s)return(0,n.jsx)("span",{className:"text-xs text-gray-400",children:"-"});let r=Z(s,N),{logo:a}=(0,v.dr)(r||"");return(0,n.jsx)(x.Z,{title:s,children:(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)("div",{className:"flex-shrink-0",children:r&&a?(0,n.jsx)("img",{src:a,alt:"".concat(r," logo"),className:"w-4 h-4",onError:e=>{let t=e.currentTarget,s=t.parentElement;if(s&&s.contains(t))try{let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null==r?void 0:r.charAt(0))||"-",s.replaceChild(e,t)}catch(e){console.error("Failed to replace provider logo fallback:",e)}}}):(0,n.jsx)("div",{className:"w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:"-"})}),(0,n.jsx)("span",{className:"max-w-[15ch] truncate block",children:s})]})})}},{header:"Created At",accessorKey:"created_at",cell:e=>{let{row:t}=e,s=t.original;return(0,n.jsx)(x.Z,{title:s.created_at,children:(0,n.jsx)("span",{className:"text-xs",children:_(s.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:e=>{let{row:t}=e,s=t.original;return(0,n.jsx)(x.Z,{title:s.updated_at,children:(0,n.jsx)("span",{className:"text-xs",children:_(s.updated_at)})})}},{header:"Type",accessorKey:"prompt_info.prompt_type",cell:e=>{let{row:t}=e,s=t.original;return(0,n.jsx)(x.Z,{title:s.prompt_info.prompt_type,children:(0,n.jsx)("span",{className:"text-xs",children:s.prompt_info.prompt_type})})}},...j?[{header:"Actions",id:"actions",enableSorting:!1,cell:e=>{let{row:t}=e,s=t.original,r=s.prompt_id||"Unknown Prompt";return(0,n.jsx)("div",{className:"flex items-center gap-1",children:(0,n.jsx)(x.Z,{title:"Delete prompt",children:(0,n.jsx)(i.zx,{size:"xs",variant:"light",color:"red",onClick:e=>{e.stopPropagation(),null==l||l(s.prompt_id,r)},icon:c.Z,className:"text-red-500 hover:text-red-700 hover:bg-red-50"})})})}}]:[]],P=(0,h.b7)({data:t,columns:k,state:{sorting:b},onSortingChange:y,getCoreRowModel:(0,g.sC)(),getSortedRowModel:(0,g.tj)(),enableSorting:!0});return(0,n.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)(i.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,n.jsx)(i.ss,{children:P.getHeaderGroups().map(e=>(0,n.jsx)(i.SC,{children:e.headers.map(e=>(0,n.jsx)(i.xs,{className:"py-1 h-8",onClick:e.column.getToggleSortingHandler(),children:(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,h.ie)(e.column.columnDef.header,e.getContext())}),(0,n.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,n.jsx)(d.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,n.jsx)(m.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,n.jsx)(p.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,n.jsx)(i.RM,{children:s?(0,n.jsx)(i.SC,{children:(0,n.jsx)(i.pj,{colSpan:k.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"Loading..."})})})}):t.length>0?P.getRowModel().rows.map(e=>(0,n.jsx)(i.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,n.jsx)(i.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,h.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,n.jsx)(i.SC,{children:(0,n.jsx)(i.pj,{colSpan:k.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"No prompts found"})})})})})]})})})},T=s(84717),D=s(5545),E=s(10900),z=s(93416),O=s(59872),A=s(30401),I=s(78867),L=s(9114),M=s(37592),F=s(65869),B=s(11894),R=s(19431),J=s(17906),U=s(94263),V=e=>{let{promptId:t,model:s,promptVariables:a={},accessToken:o,version:i="1",proxySettings:c}=e,[d,m]=(0,r.useState)(!1),[p,x]=(0,r.useState)("curl"),[u,h]=(0,r.useState)("basic"),[g,v]=(0,r.useState)(""),f=window.location.origin,j=null==c?void 0:c.LITELLM_UI_API_DOC_BASE_URL;j&&j.trim()?f=j:(null==c?void 0:c.PROXY_BASE_URL)&&(f=c.PROXY_BASE_URL);let b=o||"sk-1234",y=()=>{let e=Object.keys(a).length>0;if("curl"===p)return"basic"===u?"curl -X POST '".concat(f,"/chat/completions' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer ").concat(b,'\' \\\n -d \'{\n "model": "').concat(s,'",\n "prompt_id": "').concat(t,'"').concat(e?',\n "prompt_variables": '.concat(JSON.stringify(a,null,6).replace(/\n/g,"\n ")):"","\n }' | jq"):"messages"===u?"curl -X POST '".concat(f,"/chat/completions' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer ").concat(b,'\' \\\n -d \'{\n "model": "').concat(s,'",\n "prompt_id": "').concat(t,'"').concat(e?',\n "prompt_variables": '.concat(JSON.stringify(a,null,6).replace(/\n/g,"\n ")):"",',\n "messages": [\n {\n "role": "user",\n "content": "hi"\n }\n ]\n }\' | jq'):"curl -X POST '".concat(f,"/chat/completions' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer ").concat(b,'\' \\\n -d \'{\n "model": "').concat(s,'",\n "prompt_id": "').concat(t,'",\n "prompt_version": ').concat(i,',\n "messages": [\n {\n "role": "user",\n "content": "Who are u"\n }\n ]\n }\' | jq');if("python"===p){let n='import openai\n\nclient = openai.OpenAI(\n api_key="'.concat(b,'",\n base_url="').concat(f,'"\n)\n');return"basic"===u?"".concat(n,'\nresponse = client.chat.completions.create(\n model="').concat(s,'",\n extra_body={\n "prompt_id": "').concat(t,'"').concat(e?',\n "prompt_variables": '.concat(JSON.stringify(a,null,8).replace(/\n/g,"\n ")):"","\n }\n)\n\nprint(response)"):"messages"===u?"".concat(n,'\nresponse = client.chat.completions.create(\n model="').concat(s,'",\n messages=[\n {"role": "user", "content": "hi"}\n ],\n extra_body={\n "prompt_id": "').concat(t,'"').concat(e?',\n "prompt_variables": '.concat(JSON.stringify(a,null,8).replace(/\n/g,"\n ")):"","\n }\n)\n\nprint(response)"):"".concat(n,'\nresponse = client.chat.completions.create(\n model="').concat(s,'",\n messages=[\n {"role": "user", "content": "Who are u"}\n ],\n extra_body={\n "prompt_id": "').concat(t,'",\n "prompt_version": ').concat(i,"\n }\n)\n\nprint(response)")}{let n="import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: \"".concat(b,'",\n baseURL: "').concat(f,'"\n});\n');return"basic"===u?"".concat(n,'\nasync function main() {\n const response = await client.chat.completions.create({\n model: "').concat(s,'",\n ').concat(e?'prompt_id: "'.concat(t,'",\n prompt_variables: ').concat(JSON.stringify(a,null,8).replace(/\n/g,"\n ")):'prompt_id: "'.concat(t,'"'),"\n });\n \n console.log(response);\n}\n\nmain();"):"messages"===u?"".concat(n,'\nasync function main() {\n const response = await client.chat.completions.create({\n model: "').concat(s,'",\n messages: [\n { role: "user", content: "hi" }\n ],\n ').concat(e?'prompt_id: "'.concat(t,'",\n prompt_variables: ').concat(JSON.stringify(a,null,8).replace(/\n/g,"\n ")):'prompt_id: "'.concat(t,'"'),"\n });\n \n console.log(response);\n}\n\nmain();"):"".concat(n,'\nasync function main() {\n const response = await client.chat.completions.create({\n model: "').concat(s,'",\n messages: [\n { role: "user", content: "Who are u" }\n ],\n prompt_id: "').concat(t,'",\n prompt_version: ').concat(i,"\n });\n \n console.log(response);\n}\n\nmain();")}};return r.useEffect(()=>{d&&v(y())},[d,p,u,t,s,a]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(R.z,{variant:"secondary",icon:B.Z,onClick:()=>{m(!0)},children:"Get Code"}),(0,n.jsxs)(l.Z,{title:"Generated Code",open:d,onCancel:()=>{m(!1)},footer:null,width:800,children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(R.x,{className:"font-medium block mb-1 text-gray-700",children:"Language"}),(0,n.jsx)(M.default,{value:p,onChange:e=>x(e),style:{width:180},options:[{value:"curl",label:"cURL"},{value:"python",label:"Python (OpenAI SDK)"},{value:"javascript",label:"JavaScript (OpenAI SDK)"}]})]}),(0,n.jsx)(D.ZP,{onClick:()=>{navigator.clipboard.writeText(g),L.Z.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,n.jsx)(F.default,{activeKey:u,onChange:h,items:[{label:"Basic",key:"basic"},{label:"With Messages",key:"messages"},{label:"With Version",key:"version"}]}),(0,n.jsx)(J.Z,{language:"curl"===p?"bash":"python"===p?"python":"javascript",style:U.Z,wrapLines:!0,wrapLongLines:!0,className:"rounded-md mt-0",customStyle:{maxHeight:"60vh",overflowY:"auto",marginTop:0,borderTopLeftRadius:0,borderTopRightRadius:0},children:g})]})]})},W=e=>{var t,s,a;let{promptId:i,onClose:d,accessToken:m,isAdmin:p,onDelete:x,onEdit:u}=e,[h,g]=(0,r.useState)(null),[v,f]=(0,r.useState)(null),[j,b]=(0,r.useState)(null),[y,N]=(0,r.useState)(!0),[C,Z]=(0,r.useState)({}),[P,M]=(0,r.useState)(!1),[F,B]=(0,r.useState)(!1),R=async()=>{try{if(N(!0),!m)return;let e=await (0,o.getPromptInfo)(m,i);g(e.prompt_spec),f(e.raw_prompt_template),b(e)}catch(e){L.Z.fromBackend("Failed to load prompt information"),console.error("Error fetching prompt info:",e)}finally{N(!1)}};if((0,r.useEffect)(()=>{R()},[i,m]),y)return(0,n.jsx)("div",{className:"p-4",children:"Loading..."});if(!h)return(0,n.jsx)("div",{className:"p-4",children:"Prompt not found"});let J=e=>e?new Date(e).toLocaleString():"-",U=async(e,t)=>{await (0,O.vQ)(e)&&(Z(e=>({...e,[t]:!0})),setTimeout(()=>{Z(e=>({...e,[t]:!1}))},2e3))},W=async()=>{if(m&&h){B(!0);try{await (0,o.deletePromptCall)(m,H),L.Z.success('Prompt "'.concat(H,'" deleted successfully')),null==x||x(),d()}catch(e){console.error("Error deleting prompt:",e),L.Z.fromBackend("Failed to delete prompt")}finally{B(!1),M(!1)}}},K=h&&S(h)||"gpt-4o",H=_(h),q=k(h);return(0,n.jsxs)("div",{className:"p-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(T.zx,{icon:E.Z,variant:"light",onClick:d,className:"mb-4",children:"Back to Prompts"}),(0,n.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(T.Dx,{children:"Prompt Details"}),(0,n.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,n.jsx)(T.xv,{className:"text-gray-500 font-mono",children:H}),(0,n.jsx)(D.ZP,{type:"text",size:"small",icon:C["prompt-id"]?(0,n.jsx)(A.Z,{size:12}):(0,n.jsx)(I.Z,{size:12}),onClick:()=>U(H,"prompt-id"),className:"left-2 z-10 transition-all duration-200 ".concat(C["prompt-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(V,{promptId:H,model:K,promptVariables:w(null==v?void 0:v.content),accessToken:m,version:q}),(0,n.jsx)(T.zx,{icon:z.Z,variant:"primary",onClick:()=>null==u?void 0:u(j),className:"flex items-center",children:"Prompt Studio"}),p&&(0,n.jsx)(T.zx,{icon:c.Z,variant:"secondary",onClick:()=>{M(!0)},className:"flex items-center",children:"Delete Prompt"})]})]})]}),(0,n.jsxs)(T.v0,{children:[(0,n.jsxs)(T.td,{className:"mb-4",children:[(0,n.jsx)(T.OK,{children:"Overview"},"overview"),v?(0,n.jsx)(T.OK,{children:"Prompt Template"},"prompt-template"):(0,n.jsx)(n.Fragment,{}),p?(0,n.jsx)(T.OK,{children:"Details"},"details"):(0,n.jsx)(n.Fragment,{}),(0,n.jsx)(T.OK,{children:"Raw JSON"},"raw-json")]}),(0,n.jsxs)(T.nP,{children:[(0,n.jsxs)(T.x4,{children:[(0,n.jsxs)(T.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,n.jsxs)(T.Zb,{children:[(0,n.jsx)(T.xv,{children:"Prompt ID"}),(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)(T.Dx,{className:"font-mono text-sm",children:H})})]}),(0,n.jsxs)(T.Zb,{children:[(0,n.jsx)(T.xv,{children:"Version"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(T.Dx,{children:q}),(0,n.jsxs)(T.Ct,{color:"blue",className:"mt-1",children:["v",q]})]})]}),(0,n.jsxs)(T.Zb,{children:[(0,n.jsx)(T.xv,{children:"Prompt Type"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(T.Dx,{children:(null===(t=h.prompt_info)||void 0===t?void 0:t.prompt_type)||"-"}),(0,n.jsx)(T.Ct,{color:"blue",className:"mt-1",children:(null===(s=h.prompt_info)||void 0===s?void 0:s.prompt_type)||"Unknown"})]})]}),(0,n.jsxs)(T.Zb,{children:[(0,n.jsx)(T.xv,{children:"Created At"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(T.Dx,{children:J(h.created_at)}),(0,n.jsxs)(T.xv,{children:["Last Updated: ",J(h.updated_at)]})]})]})]}),h.litellm_params&&Object.keys(h.litellm_params).length>0&&(0,n.jsxs)(T.Zb,{className:"mt-6",children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"LiteLLM Parameters"}),(0,n.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap",children:JSON.stringify(h.litellm_params,null,2)})})]})]}),v&&(0,n.jsx)(T.x4,{children:(0,n.jsxs)(T.Zb,{children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(T.Dx,{children:"Prompt Template"}),(0,n.jsx)(D.ZP,{type:"text",size:"small",icon:C["prompt-content"]?(0,n.jsx)(A.Z,{size:16}):(0,n.jsx)(I.Z,{size:16}),onClick:()=>U(v.content,"prompt-content"),className:"transition-all duration-200 ".concat(C["prompt-content"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:C["prompt-content"]?"Copied!":"Copy Content"})]}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Template ID"}),(0,n.jsx)("div",{className:"font-mono text-sm bg-gray-50 p-2 rounded",children:v.litellm_prompt_id})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Content"}),(0,n.jsx)("div",{className:"mt-2 p-4 bg-gray-50 rounded-md border overflow-auto max-h-96",children:(0,n.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:v.content})})]}),v.metadata&&Object.keys(v.metadata).length>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Template Metadata"}),(0,n.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md border",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap overflow-auto max-h-64",children:JSON.stringify(v.metadata,null,2)})})]})]})]})}),p&&(0,n.jsx)(T.x4,{children:(0,n.jsxs)(T.Zb,{children:[(0,n.jsx)(T.Dx,{className:"mb-4",children:"Prompt Details"}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Prompt ID"}),(0,n.jsx)("div",{className:"font-mono text-sm bg-gray-50 p-2 rounded",children:H})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Prompt Type"}),(0,n.jsx)("div",{children:(null===(a=h.prompt_info)||void 0===a?void 0:a.prompt_type)||"-"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Created At"}),(0,n.jsx)("div",{children:J(h.created_at)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Last Updated"}),(0,n.jsx)("div",{children:J(h.updated_at)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"LiteLLM Parameters"}),(0,n.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md border",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap overflow-auto max-h-96",children:JSON.stringify(h.litellm_params,null,2)})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Prompt Info"}),(0,n.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md border",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap",children:JSON.stringify(h.prompt_info,null,2)})})]})]})]})}),(0,n.jsx)(T.x4,{children:(0,n.jsxs)(T.Zb,{children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(T.Dx,{children:"Raw API Response"}),(0,n.jsx)(D.ZP,{type:"text",size:"small",icon:C["raw-json"]?(0,n.jsx)(A.Z,{size:16}):(0,n.jsx)(I.Z,{size:16}),onClick:()=>U(JSON.stringify(j,null,2),"raw-json"),className:"transition-all duration-200 ".concat(C["raw-json"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:C["raw-json"]?"Copied!":"Copy JSON"})]}),(0,n.jsx)("div",{className:"p-4 bg-gray-50 rounded-md border overflow-auto",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap",children:JSON.stringify(j,null,2)})})]})})]})]}),(0,n.jsxs)(l.Z,{title:"Delete Prompt",open:P,onOk:W,onCancel:()=>{M(!1)},confirmLoading:F,okText:"Delete",okButtonProps:{danger:!0},children:[(0,n.jsxs)("p",{children:["Are you sure you want to delete prompt: ",(0,n.jsx)("strong",{children:H}),"?"]}),(0,n.jsx)("p",{children:"This action cannot be undone."})]})]})},K=s(10032),H=s(23496),q=s(65319),G=s(31283),X=s(3632);let{Option:Y}=M.default;var $=e=>{let{visible:t,onClose:s,accessToken:a,onSuccess:i}=e,[c]=K.Z.useForm(),[d,m]=(0,r.useState)(!1),[p,x]=(0,r.useState)([]),[u,h]=(0,r.useState)("dotprompt"),g=()=>{c.resetFields(),x([]),h("dotprompt"),s()},v=async()=>{try{let e=await c.validateFields();if(console.log("values: ",e),!a){L.Z.fromBackend("Access token is required");return}if("dotprompt"===u&&0===p.length){L.Z.fromBackend("Please upload a .prompt file");return}m(!0);let t={};if("dotprompt"===u&&p.length>0){let s=p[0].originFileObj;try{let n=await (0,o.convertPromptFileToJson)(a,s);console.log("Conversion result:",n),t={prompt_id:e.prompt_id,litellm_params:{prompt_integration:"dotprompt",prompt_id:n.prompt_id,prompt_data:n.json_data},prompt_info:{prompt_type:"db"}}}catch(e){console.error("Error converting prompt file:",e),L.Z.fromBackend("Failed to convert prompt file to JSON"),m(!1);return}}try{await (0,o.createPromptCall)(a,t),L.Z.success("Prompt created successfully!"),g(),i()}catch(e){console.error("Error creating prompt:",e),L.Z.fromBackend("Failed to create prompt")}}catch(e){console.error("Form validation error:",e)}finally{m(!1)}};return(0,n.jsx)(l.Z,{title:"Add New Prompt",open:t,onCancel:g,footer:[(0,n.jsx)(D.ZP,{onClick:g,children:"Cancel"},"cancel"),(0,n.jsx)(D.ZP,{loading:d,onClick:v,children:"Create Prompt"},"submit")],width:600,children:(0,n.jsxs)(K.Z,{form:c,layout:"vertical",requiredMark:!1,children:[(0,n.jsx)(K.Z.Item,{label:"Prompt ID",name:"prompt_id",rules:[{required:!0,message:"Please enter a prompt ID"},{pattern:/^[a-zA-Z0-9_-]+$/,message:"Prompt ID can only contain letters, numbers, underscores, and hyphens"}],children:(0,n.jsx)(G.o,{placeholder:"Enter unique prompt ID (e.g., my_prompt_id)"})}),(0,n.jsx)(K.Z.Item,{label:"Prompt Integration",name:"prompt_integration",initialValue:"dotprompt",children:(0,n.jsx)(M.default,{value:u,onChange:h,children:(0,n.jsx)(Y,{value:"dotprompt",children:"dotprompt"})})}),"dotprompt"===u&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(H.Z,{}),(0,n.jsxs)(K.Z.Item,{label:"Prompt File",extra:"Upload a .prompt file that follows the Dotprompt specification",children:[(0,n.jsx)(q.default,{beforeUpload:e=>(e.name.endsWith(".prompt")||L.Z.fromBackend("Please upload a .prompt file"),!1),fileList:p,onChange:e=>{let{fileList:t}=e;x(t.slice(-1))},onRemove:()=>{x([])},children:(0,n.jsx)(D.ZP,{icon:(0,n.jsx)(X.Z,{}),children:"Select .prompt File"})}),p.length>0&&(0,n.jsxs)("div",{className:"mt-2 text-sm text-gray-600",children:["Selected: ",p[0].name]})]})]})]})})},Q=e=>{let{visible:t,initialJson:s,onSave:a,onClose:o}=e,[i,c]=(0,r.useState)(s||'{\n "type": "function",\n "function": {\n "name": "get_current_weather",\n "description": "Get the current weather in a given location",\n "parameters": {\n "type": "object",\n "properties": {\n "location": {\n "type": "string",\n "description": "The city and state, e.g. San Francisco, CA"\n },\n "unit": {\n "type": "string",\n "enum": ["celsius", "fahrenheit"]\n }\n },\n "required": ["location"]\n }\n }\n}'),[d,m]=(0,r.useState)(null),p=()=>{m(null),o()};return(0,n.jsx)(l.Z,{title:(0,n.jsx)("div",{className:"flex items-center justify-between",children:(0,n.jsx)("span",{className:"text-lg font-medium",children:"Add Tool"})}),open:t,onCancel:p,width:800,footer:[(0,n.jsx)(D.ZP,{onClick:p,children:"Cancel"},"cancel"),(0,n.jsx)(D.ZP,{type:"primary",onClick:()=>{try{JSON.parse(i),m(null),a(i)}catch(e){m("Invalid JSON format. Please check your syntax.")}},children:"Add"},"save")],children:(0,n.jsxs)("div",{className:"space-y-3",children:[d&&(0,n.jsx)("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-red-600 text-sm",children:d}),(0,n.jsx)("textarea",{value:i,onChange:e=>c(e.target.value),className:"w-full min-h-[400px] px-4 py-3 border border-gray-300 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none",placeholder:"Paste your tool JSON here..."})]})})},ee=s(4260),et=s(32660),es=s(91723),en=s(83229),er=e=>{let{promptName:t,onNameChange:s,onBack:r,onSave:l,isSaving:o,editMode:i=!1,onShowHistory:c,version:d,promptModel:m="gpt-4o",promptVariables:p={},accessToken:x,proxySettings:u}=e;return(0,n.jsxs)("div",{className:"bg-white border-b border-gray-200 px-6 py-3 flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,n.jsx)(a.z,{icon:et.Z,variant:"light",onClick:r,size:"xs",children:"Back"}),(0,n.jsx)(ee.default,{value:t,onChange:e=>s(e.target.value),className:"text-base font-medium border-none shadow-none",style:{width:"200px"}}),d&&(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium",children:d}),(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs bg-gray-100 text-gray-600 rounded",children:"Draft"}),(0,n.jsx)("span",{className:"text-xs text-gray-400",children:"Unsaved changes"})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(V,{promptId:t,model:m,promptVariables:p,accessToken:x,version:(null==d?void 0:d.replace("v",""))||"1",proxySettings:u}),i&&c&&(0,n.jsx)(a.z,{icon:es.Z,variant:"secondary",onClick:c,children:"History"}),(0,n.jsx)(a.z,{icon:en.Z,onClick:l,loading:o,disabled:o,children:i?"Update":"Save"})]})]})},ea=s(92280),el=s(98728),eo=s(76593),ei=e=>{let{model:t,temperature:s=1,maxTokens:a=1e3,accessToken:l,onModelChange:o,onTemperatureChange:i,onMaxTokensChange:c}=e,[d,m]=(0,r.useState)(!1);return(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"w-[300px]",children:(0,n.jsx)(eo.Z,{accessToken:l||"",value:t,onChange:o,showLabel:!1})}),(0,n.jsxs)("button",{onClick:()=>m(!d),className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50",children:[(0,n.jsx)(el.Z,{size:16}),(0,n.jsx)("span",{children:"Parameters"})]}),d&&(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-30",children:(0,n.jsxs)("div",{className:"bg-white rounded-lg shadow-xl p-6 w-96",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold",children:"Model Parameters"}),(0,n.jsx)("button",{onClick:()=>m(!1),className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("div",{children:(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsx)(ea.x,{className:"text-sm text-gray-700",children:"Temperature"}),(0,n.jsx)(ee.default,{type:"number",size:"small",min:0,max:2,step:.1,value:s,onChange:e=>i(parseFloat(e.target.value)||0),className:"w-20"})]})}),(0,n.jsx)("div",{children:(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsx)(ea.x,{className:"text-sm text-gray-700",children:"Max Tokens"}),(0,n.jsx)(ee.default,{type:"number",size:"small",min:1,max:32768,value:a,onChange:e=>c(parseInt(e.target.value)||1e3),className:"w-24"})]})})]})]})})]})},ec=s(78801),ed=s(99397),em=s(27413),ep=e=>{let{tools:t,onAddTool:s,onEditTool:r,onRemoveTool:a}=e;return(0,n.jsxs)(ec.Z,{className:"p-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsx)(ec.x,{className:"text-sm font-medium",children:"Tools"}),(0,n.jsxs)("button",{onClick:s,className:"text-xs text-blue-600 hover:text-blue-700 flex items-center",children:[(0,n.jsx)(ed.Z,{size:14,className:"mr-1"}),"Add"]})]}),0===t.length?(0,n.jsx)(ec.x,{className:"text-gray-500 text-xs",children:"No tools added"}):(0,n.jsx)("div",{className:"space-y-2",children:t.map((e,t)=>(0,n.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 border border-gray-200 rounded",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"font-medium text-xs truncate",children:e.name}),(0,n.jsx)("div",{className:"text-xs text-gray-500 truncate",children:e.description})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-1 ml-2",children:[(0,n.jsx)("button",{onClick:()=>r(t),className:"text-xs text-blue-600 hover:text-blue-700",children:"Edit"}),(0,n.jsx)("button",{onClick:()=>a(t),className:"text-gray-400 hover:text-red-500",children:(0,n.jsx)(em.Z,{size:14})})]})]},t))})]})},ex=s(79326),eu=s(3810),eh=s(13377);let{TextArea:eg}=ee.default;var ev=e=>{let{value:t,onChange:s,placeholder:a,rows:l=4,className:o}=e,[i,c]=(0,r.useState)(null),[d,m]=(0,r.useState)(""),p=()=>{d.trim()&&i&&(s(t.substring(0,i.start)+"{{".concat(d,"}}")+t.substring(i.end)),c(null),m(""))},x=(()=>{let e;let s=/\{\{(\w+)\}\}/g,n=[];for(;null!==(e=s.exec(t));)n.push({name:e[1],start:e.index,end:e.index+e[0].length});return n})();return(0,n.jsxs)("div",{className:"variable-textarea-container ".concat(o),children:[(0,n.jsx)("style",{children:"\n .variable-highlight-text {\n color: #f97316;\n background-color: #fff7ed;\n border-radius: 4px;\n padding: 0 2px;\n border: 1px solid #fed7aa;\n font-family: monospace;\n }\n "}),(0,n.jsx)(eg,{value:t,onChange:e=>s(e.target.value),placeholder:a,rows:l,className:"font-sans"}),x.length>0&&(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2 items-center",children:[(0,n.jsx)("span",{className:"text-xs text-gray-500 mr-1",children:"Detected variables:"}),x.map((e,t)=>(0,n.jsx)(ex.Z,{content:(0,n.jsxs)("div",{className:"p-2",style:{minWidth:"200px"},children:[(0,n.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:"Edit variable name"}),(0,n.jsx)(ee.default,{size:"small",value:d,onChange:e=>m(e.target.value),onPressEnter:p,placeholder:"Variable name",autoFocus:!0}),(0,n.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,n.jsx)("button",{onClick:p,className:"text-xs px-2 py-1 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Save"}),(0,n.jsx)("button",{onClick:()=>{c(null),m("")},className:"text-xs px-2 py-1 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",children:"Cancel"})]})]}),open:(null==i?void 0:i.start)===e.start,onOpenChange:e=>{e||(c(null),m(""))},trigger:"click",children:(0,n.jsx)(eu.Z,{color:"orange",className:"cursor-pointer hover:opacity-80 transition-all m-0",icon:(0,n.jsx)(eh.Z,{}),onClick:()=>{c({oldName:e.name,start:e.start,end:e.end}),m(e.name)},children:e.name})},"".concat(e.start,"-").concat(t)))]})]})},ef=e=>{let{value:t,onChange:s}=e;return(0,n.jsxs)(ec.Z,{className:"p-3",children:[(0,n.jsx)(ec.x,{className:"block mb-2 text-sm font-medium",children:"Developer message"}),(0,n.jsx)(ec.x,{className:"text-gray-500 text-xs mb-2",children:"Optional system instructions for the model"}),(0,n.jsx)(ev,{value:t,onChange:s,rows:3,placeholder:"e.g., You are a helpful assistant..."})]})},ej=s(41905);let{Option:eb}=M.default;var ey=e=>{let{messages:t,onAddMessage:s,onUpdateMessage:a,onRemoveMessage:l,onMoveMessage:o}=e,[i,c]=(0,r.useState)(null),[d,m]=(0,r.useState)(null),p=e=>{c(e)},x=(e,t)=>{e.preventDefault(),m(t)},u=(e,t)=>{e.preventDefault(),null!==i&&i!==t&&o(i,t),c(null),m(null)},h=()=>{c(null),m(null)};return(0,n.jsxs)(ec.Z,{className:"p-3",children:[(0,n.jsxs)("div",{className:"mb-2",children:[(0,n.jsx)(ec.x,{className:"text-sm font-medium",children:"Prompt messages"}),(0,n.jsxs)(ec.x,{className:"text-gray-500 text-xs mt-1",children:["Use ",(0,n.jsx)("code",{className:"bg-gray-100 px-1 rounded text-xs",children:"{{variable}}"})," syntax for template variables"]})]}),(0,n.jsx)("div",{className:"space-y-2",children:t.map((e,s)=>(0,n.jsxs)("div",{draggable:!0,onDragStart:()=>p(s),onDragOver:e=>x(e,s),onDrop:e=>u(e,s),onDragEnd:h,className:"border border-gray-300 rounded overflow-hidden bg-white transition-all ".concat(i===s?"opacity-50":""," ").concat(d===s&&i!==s?"border-blue-500 border-2":""),children:[(0,n.jsxs)("div",{className:"bg-gray-50 px-2 py-1.5 border-b border-gray-300 flex items-center justify-between",children:[(0,n.jsxs)(M.default,{value:e.role,onChange:e=>a(s,"role",e),style:{width:100},size:"small",bordered:!1,children:[(0,n.jsx)(eb,{value:"user",children:"User"}),(0,n.jsx)(eb,{value:"assistant",children:"Assistant"}),(0,n.jsx)(eb,{value:"system",children:"System"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[t.length>1&&(0,n.jsx)("button",{onClick:()=>l(s),className:"text-gray-400 hover:text-red-500",children:(0,n.jsx)(em.Z,{size:14})}),(0,n.jsx)("div",{className:"cursor-grab active:cursor-grabbing text-gray-400 hover:text-gray-600",children:(0,n.jsx)(ej.Z,{size:16})})]})]}),(0,n.jsx)("div",{className:"p-2",children:(0,n.jsx)(ev,{value:e.content,onChange:e=>a(s,"content",e),rows:3,placeholder:"Enter prompt content..."})})]},s))}),(0,n.jsxs)("button",{onClick:s,className:"mt-2 text-xs text-blue-600 hover:text-blue-700 flex items-center",children:[(0,n.jsx)(ed.Z,{size:14,className:"mr-1"}),"Add message"]})]})},eN=s(26430);let ew=(e,t)=>{let[s,n]=(0,r.useState)(!1),[a,l]=(0,r.useState)([]),[i,c]=(0,r.useState)(""),[d,m]=(0,r.useState)({}),[p,x]=(0,r.useState)(!1),[u,h]=(0,r.useState)(null),g=(0,r.useRef)(null),v=f(e),b=v.every(e=>d[e]&&""!==d[e].trim()),y=()=>{g.current&&setTimeout(()=>{var e;null===(e=g.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},100)};(0,r.useEffect)(()=>{y()},[a]);let N=async()=>{let s;if(!t){L.Z.fromBackend("Access token is required");return}if(v.length>0&&!b){L.Z.fromBackend("Please fill in all template variables");return}if(!i.trim())return;!p&&v.length>0&&x(!0);let r={role:"user",content:i};l(e=>[...e,r]),c("");let m=new AbortController;h(m),n(!0);let u=Date.now();try{let n,r;let c=j(e),p=(0,o.getProxyBaseUrl)(),x={dotprompt_content:c};0===a.length?x.prompt_variables=d:x.conversation_history=[...a.map(e=>({role:e.role,content:e.content})),{role:"user",content:i}];let h=await fetch("".concat(p,"/prompts/test"),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},body:JSON.stringify(x),signal:m.signal});if(!h.ok){let e=await h.text();throw Error("HTTP error! status: ".concat(h.status,", ").concat(e))}if(!h.body)throw Error("No response body");let v=h.body.getReader(),b=new TextDecoder,N="";for(l(e=>[...e,{role:"assistant",content:""}]);;){let{done:e,value:t}=await v.read();if(e)break;for(let e of b.decode(t).split("\n"))if(e.startsWith("data: ")){let t=e.slice(6);if("[DONE]"===t)continue;try{var g,f,y;let e=JSON.parse(t);!n&&e.model&&(n=e.model),e.usage&&(r=e.usage);let a=null===(y=e.choices)||void 0===y?void 0:null===(f=y[0])||void 0===f?void 0:null===(g=f.delta)||void 0===g?void 0:g.content;a&&(s||(s=Date.now()-u),N+=a,l(e=>{let t=[...e];return t[t.length-1]={role:"assistant",content:N,model:n,timeToFirstToken:s},t}))}catch(e){console.error("Error parsing chunk:",e)}}}let w=Date.now()-u;l(e=>{let t=[...e];return t[t.length-1]={...t[t.length-1],totalLatency:w,usage:r},t})}catch(e){"AbortError"===e.name?console.log("Request was cancelled"):(console.error("Error testing prompt:",e),l(t=>{let s=t[t.length-1];return s&&"assistant"===s.role&&""===s.content?[...t.slice(0,-1),{role:"assistant",content:"Error: ".concat(e.message)}]:[...t,{role:"assistant",content:"Error: ".concat(e.message)}]}))}finally{n(!1),h(null)}};return{isLoading:s,messages:a,inputMessage:i,variables:d,variablesFilled:p,extractedVariables:v,allVariablesFilled:b,messagesEndRef:g,setInputMessage:c,handleSendMessage:N,handleCancelRequest:()=>{u&&(u.abort(),h(null),n(!1),L.Z.info("Request cancelled"))},handleClearConversation:()=>{l([]),x(!1),L.Z.success("Chat history cleared.")},handleKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),N())},handleVariableChange:(e,t)=>{m({...d,[e]:t})}}};var e_=e=>{let{extractedVariables:t,variables:s,onVariableChange:r}=e;return 0===t.length?null:(0,n.jsxs)("div",{className:"p-4 border-b border-gray-200 bg-blue-50",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Fill in template variables to start testing"}),(0,n.jsx)("div",{className:"space-y-2",children:t.map(e=>(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-xs text-gray-600 mb-1 font-medium",children:["{{",e,"}}"]}),(0,n.jsx)(ee.default,{value:s[e]||"",onChange:t=>r(e,t.target.value),placeholder:"Enter value for ".concat(e),size:"small"})]},e))})]})},eC=s(61935),ek=s(10353),eS=s(69993),eZ=e=>{let{hasVariables:t}=e;return(0,n.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,n.jsx)(eS.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,n.jsx)("span",{className:"text-base",children:t?"Fill in the variables above, then type a message to start testing":"Type a message below to start testing your prompt"})]})},eP=s(15883),eT=s(62831),eD=s(38398),eE=e=>{let{message:t}=e;return(0,n.jsx)("div",{className:"mb-4 flex ".concat("user"===t.role?"justify-end":"justify-start"),children:(0,n.jsxs)("div",{className:"max-w-[85%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===t.role?"#f0f8ff":"#ffffff",border:"user"===t.role?"1px solid #e6f0fa":"1px solid #f0f0f0"},children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,n.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===t.role?"#e6f0fa":"#f5f5f5"},children:"user"===t.role?(0,n.jsx)(eP.Z,{style:{fontSize:"12px",color:"#2563eb"}}):(0,n.jsx)(eS.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,n.jsx)("strong",{className:"text-sm capitalize",children:t.role}),"assistant"===t.role&&t.model&&(0,n.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:t.model})]}),(0,n.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:["assistant"===t.role?(0,n.jsx)(eT.UG,{components:{code(e){let{node:t,inline:s,className:r,children:a,...l}=e,o=/language-(\w+)/.exec(r||"");return!s&&o?(0,n.jsx)(J.Z,{style:U.Z,language:o[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...l,children:String(a).replace(/\n$/,"")}):(0,n.jsx)("code",{className:"".concat(r," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),style:{wordBreak:"break-word"},...l,children:a})},pre:e=>{let{node:t,...s}=e;return(0,n.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...s})}},children:t.content}):(0,n.jsx)("div",{className:"whitespace-pre-wrap",children:t.content}),"assistant"===t.role&&(t.timeToFirstToken||t.totalLatency||t.usage)&&(0,n.jsx)(eD.Z,{timeToFirstToken:t.timeToFirstToken,totalLatency:t.totalLatency,usage:t.usage})]})]})})},ez=e=>{let{messages:t,isLoading:s,hasVariables:r,messagesEndRef:a}=e,l=(0,n.jsx)(eC.Z,{style:{fontSize:24},spin:!0});return(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 pb-0",children:[0===t.length&&(0,n.jsx)(eZ,{hasVariables:r}),t.map((e,t)=>(0,n.jsx)(eE,{message:e},t)),s&&(0,n.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,n.jsx)(ek.Z,{indicator:l})}),(0,n.jsx)("div",{ref:a,style:{height:"1px"}})]})},eO=e=>{let{extractedVariables:t,variables:s}=e,r=t.filter(e=>!s[e]||""===s[e].trim());return 0===r.length?null:(0,n.jsx)("div",{className:"mb-3 p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)("span",{className:"text-yellow-600 text-sm",children:"⚠️"}),(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsx)("p",{className:"text-sm text-yellow-800 font-medium mb-1",children:"Please fill in all template variables above"}),(0,n.jsxs)("p",{className:"text-xs text-yellow-700",children:["Missing: ",r.map(e=>"{{".concat(e,"}}")).join(", ")]})]})]})})},eA=s(79276);let{TextArea:eI}=ee.default;var eL=e=>{let{inputMessage:t,isLoading:s,isDisabled:r,onInputChange:l,onSend:o,onKeyDown:i,onCancel:c}=e;return(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[(0,n.jsx)(eI,{value:t,onChange:e=>l(e.target.value),onKeyDown:i,placeholder:"Type your message... (Shift+Enter for new line)",disabled:s,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,n.jsx)(a.z,{onClick:o,disabled:r,className:"flex-shrink-0 ml-2 !w-8 !h-8 !min-w-8 !p-0 !rounded-full !bg-blue-600 hover:!bg-blue-700 disabled:!bg-gray-300 !border-none !text-white disabled:!text-gray-500 !flex !items-center !justify-center",children:(0,n.jsx)(eA.Z,{style:{fontSize:"14px"}})})]}),s&&(0,n.jsx)(a.z,{onClick:c,className:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200",children:"Cancel"})]})},eM=e=>{let{prompt:t,accessToken:s}=e,{isLoading:r,messages:l,inputMessage:o,variables:i,variablesFilled:c,extractedVariables:d,allVariablesFilled:m,messagesEndRef:p,setInputMessage:x,handleSendMessage:u,handleCancelRequest:h,handleClearConversation:g,handleKeyDown:v,handleVariableChange:f}=ew(t,s);return(0,n.jsxs)("div",{className:"flex flex-col h-full bg-white",children:[!c&&(0,n.jsx)(e_,{extractedVariables:d,variables:i,onVariableChange:f}),l.length>0&&(0,n.jsx)("div",{className:"p-3 border-b border-gray-200 bg-white flex justify-end",children:(0,n.jsx)(a.z,{onClick:g,className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:eN.Z,children:"Clear Chat"})}),(0,n.jsx)(ez,{messages:l,isLoading:r,hasVariables:d.length>0,messagesEndRef:p}),(0,n.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[(0,n.jsx)(eO,{extractedVariables:d,variables:i}),(0,n.jsx)(eL,{inputMessage:o,isLoading:r,isDisabled:r||!o.trim()||d.length>0&&!m,onInputChange:x,onSend:u,onKeyDown:v,onCancel:h})]})]})},eF=e=>{let{visible:t,promptName:s,isSaving:r,onNameChange:a,onPublish:o,onCancel:i}=e;return(0,n.jsx)(l.Z,{title:"Publish Prompt",open:t,onCancel:i,footer:[(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(R.z,{variant:"secondary",onClick:i,children:"Cancel"}),(0,n.jsx)(R.z,{onClick:o,loading:r,children:"Publish"})]},"footer")],children:(0,n.jsxs)("div",{className:"py-4",children:[(0,n.jsx)(R.x,{className:"mb-2",children:"Name"}),(0,n.jsx)(ee.default,{value:s,onChange:e=>a(e.target.value),placeholder:"Enter prompt name",onPressEnter:o,autoFocus:!0}),(0,n.jsx)(R.x,{className:"text-gray-500 text-xs mt-2",children:"Published prompts can be used in API calls and are versioned for easy tracking."})]})})},eB=e=>{let{prompt:t}=e,s=j(t);return(0,n.jsxs)("div",{className:"p-6",children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:"Generated .prompt file"}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:"This is the dotprompt format that will be saved to the database"})]}),(0,n.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 overflow-auto",children:(0,n.jsx)("pre",{className:"text-sm text-gray-900 font-mono whitespace-pre-wrap",children:s})})]})},eR=s(57840),eJ=s(63134),eU=s(50337),eV=s(35631);let{Text:eW}=eR.default;var eK=e=>{let{isOpen:t,onClose:s,accessToken:a,promptId:l,activeVersionId:i,onSelectVersion:c}=e,[d,m]=(0,r.useState)([]),[p,x]=(0,r.useState)(!1);(0,r.useEffect)(()=>{t&&a&&l&&u()},[t,a,l]);let u=async()=>{x(!0);try{let e=l.includes(".v")?l.split(".v")[0]:l,t=await (0,o.getPromptVersions)(a,e);m(t.prompts)}catch(e){console.error("Error fetching prompt versions:",e)}finally{x(!1)}},h=e=>{var t;if(e.version)return"v".concat(e.version);let s=(null===(t=e.litellm_params)||void 0===t?void 0:t.prompt_id)||e.prompt_id;return s.includes(".v")?"v".concat(s.split(".v")[1]):s.includes("_v")?"v".concat(s.split("_v")[1]):"v1"},g=e=>e?new Date(e).toLocaleString():"-";return(0,n.jsx)(eJ.Z,{title:"Version History",placement:"right",onClose:s,open:t,width:400,mask:!1,maskClosable:!1,children:p?(0,n.jsx)(eU.Z,{active:!0,paragraph:{rows:4}}):0===d.length?(0,n.jsx)("div",{className:"text-center py-8 text-gray-500",children:"No version history available."}):(0,n.jsx)(eV.Z,{dataSource:d,renderItem:(e,t)=>{var s;let r=e.version||parseInt(h(e).replace("v","")),a=null;i&&(i.includes(".v")?a=parseInt(i.split(".v")[1]):i.includes("_v")&&(a=parseInt(i.split("_v")[1])));let l=a?r===a:0===t;return(0,n.jsxs)("div",{className:"mb-4 p-4 rounded-lg border cursor-pointer transition-all hover:shadow-md ".concat(l?"border-blue-500 bg-blue-50":"border-gray-200 bg-white hover:border-blue-300"),onClick:()=>null==c?void 0:c(e),children:[(0,n.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(eu.Z,{className:"m-0",children:h(e)}),0===t&&(0,n.jsx)(eu.Z,{color:"blue",className:"m-0",children:"Latest"})]}),l&&(0,n.jsx)(eu.Z,{color:"green",className:"m-0",children:"Active"})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)(eW,{className:"text-sm text-gray-600 font-medium",children:g(e.created_at)}),(0,n.jsx)(eW,{type:"secondary",className:"text-xs",children:(null===(s=e.prompt_info)||void 0===s?void 0:s.prompt_type)==="db"?"Saved to Database":"Config Prompt"})]})]},"".concat(e.prompt_id,"-v").concat(e.version||r))}})})},eH=e=>{var t;let{onClose:s,onSuccess:a,accessToken:l,initialPromptData:i}=e,[c,d]=(0,r.useState)((()=>{if(i)try{return b(i)}catch(e){console.error("Error parsing existing prompt:",e),L.Z.fromBackend("Failed to parse prompt data")}return{name:"New prompt",model:"gpt-4o",config:{temperature:1,max_tokens:1e3},tools:[],developerMessage:"",messages:[{role:"user",content:"Enter task specifics. Use {{template_variables}} for dynamic inputs"}]}})()),[m,p]=(0,r.useState)(!!i),[x,u]=(0,r.useState)(!1),[h,g]=(0,r.useState)((()=>{var e;if(!(null==i?void 0:i.prompt_spec))return;let t=i.prompt_spec.prompt_id,s=i.prompt_spec.version||(null===(e=i.prompt_spec.litellm_params)||void 0===e?void 0:e.prompt_id);return"number"==typeof s?"".concat(t,".v").concat(s):"string"==typeof s&&(s.includes(".v")||s.includes("_v"))?s:t})()),[v,f]=(0,r.useState)(!1),[y,N]=(0,r.useState)(!1),[w,_]=(0,r.useState)(null),[C,k]=(0,r.useState)(!1),[S,Z]=(0,r.useState)("pretty"),P=e=>{void 0!==e?_(e):_(null),f(!0)},T=async()=>{if(!l){L.Z.fromBackend("Access token is required");return}if(!c.name||""===c.name.trim()){L.Z.fromBackend("Please enter a valid prompt name");return}k(!0);try{var e;let t=c.name.replace(/[^a-zA-Z0-9_-]/g,"_").toLowerCase(),n=j(c),r={prompt_id:t,litellm_params:{prompt_integration:"dotprompt",prompt_id:t,dotprompt_content:n},prompt_info:{prompt_type:"db"}};m&&(null==i?void 0:null===(e=i.prompt_spec)||void 0===e?void 0:e.prompt_id)?(await (0,o.updatePromptCall)(l,i.prompt_spec.prompt_id,r),L.Z.success("Prompt updated successfully!")):(await (0,o.createPromptCall)(l,r),L.Z.success("Prompt created successfully!")),a(),s()}catch(e){console.error("Error saving prompt:",e),L.Z.fromBackend(m?"Failed to update prompt":"Failed to save prompt")}finally{k(!1),N(!1)}},D=h&&h.includes(".v")?"v".concat(h.split(".v")[1]):null;return(0,n.jsxs)("div",{className:"flex h-full bg-white",children:[(0,n.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,n.jsx)(er,{promptName:c.name,onNameChange:e=>d({...c,name:e}),onBack:s,onSave:()=>{c.name&&""!==c.name.trim()&&"New prompt"!==c.name?T():N(!0)},isSaving:C,editMode:m,onShowHistory:()=>u(!0),version:D,promptModel:c.model,promptVariables:(()=>{let e;let t={},s=[c.developerMessage,...c.messages.map(e=>e.content)].join(" "),n=/\{\{(\w+)\}\}/g;for(;null!==(e=n.exec(s));){let s=e[1];t[s]||(t[s]="example_".concat(s))}return t})(),accessToken:l}),(0,n.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,n.jsxs)("div",{className:"w-1/2 overflow-y-auto bg-white border-r border-gray-200 flex-shrink-0",children:[(0,n.jsxs)("div",{className:"border-b border-gray-200 bg-white px-6 py-4 flex items-center gap-3",children:[(0,n.jsx)(ei,{model:c.model,temperature:c.config.temperature,maxTokens:c.config.max_tokens,accessToken:l,onModelChange:e=>d({...c,model:e}),onTemperatureChange:e=>d({...c,config:{...c.config,temperature:e}}),onMaxTokensChange:e=>d({...c,config:{...c.config,max_tokens:e}})}),(0,n.jsxs)("div",{className:"ml-auto inline-flex items-center bg-gray-200 rounded-full p-0.5",children:[(0,n.jsx)("button",{className:"px-3 py-1 text-xs font-medium rounded-full transition-colors ".concat("pretty"===S?"bg-white text-gray-900 shadow-sm":"text-gray-600"),onClick:()=>Z("pretty"),children:"PRETTY"}),(0,n.jsx)("button",{className:"px-3 py-1 text-xs font-medium rounded-full transition-colors ".concat("dotprompt"===S?"bg-white text-gray-900 shadow-sm":"text-gray-600"),onClick:()=>Z("dotprompt"),children:"DOTPROMPT"})]})]}),"pretty"===S?(0,n.jsxs)("div",{className:"p-6 space-y-4 pb-20",children:[(0,n.jsx)(ep,{tools:c.tools,onAddTool:()=>P(),onEditTool:P,onRemoveTool:e=>{d({...c,tools:c.tools.filter((t,s)=>s!==e)})}}),(0,n.jsx)(ef,{value:c.developerMessage,onChange:e=>d({...c,developerMessage:e})}),(0,n.jsx)(ey,{messages:c.messages,onAddMessage:()=>{d({...c,messages:[...c.messages,{role:"user",content:""}]})},onUpdateMessage:(e,t,s)=>{let n=[...c.messages];n[e][t]=s,d({...c,messages:n})},onRemoveMessage:e=>{c.messages.length>1&&d({...c,messages:c.messages.filter((t,s)=>s!==e)})},onMoveMessage:(e,t)=>{let s=[...c.messages],[n]=s.splice(e,1);s.splice(t,0,n),d({...c,messages:s})}})]}):(0,n.jsx)(eB,{prompt:c})]}),(0,n.jsx)("div",{className:"w-1/2 flex-shrink-0",children:(0,n.jsx)(eM,{prompt:c,accessToken:l})})]})]}),(0,n.jsx)(eF,{visible:y,promptName:c.name,isSaving:C,onNameChange:e=>d({...c,name:e}),onPublish:T,onCancel:()=>N(!1)}),v&&(0,n.jsx)(Q,{visible:v,initialJson:null!==w?c.tools[w].json:"",onSave:e=>{try{var t,s;let n=JSON.parse(e),r={name:(null===(t=n.function)||void 0===t?void 0:t.name)||"Unnamed Tool",description:(null===(s=n.function)||void 0===s?void 0:s.description)||"",json:e};if(null!==w){let e=[...c.tools];e[w]=r,d({...c,tools:e})}else d({...c,tools:[...c.tools,r]});f(!1),_(null)}catch(e){L.Z.fromBackend("Invalid JSON format")}},onClose:()=>{f(!1),_(null)}}),(0,n.jsx)(eK,{isOpen:x,onClose:()=>u(!1),accessToken:l,promptId:(null==i?void 0:null===(t=i.prompt_spec)||void 0===t?void 0:t.prompt_id)||c.name,activeVersionId:h,onSelectVersion:e=>{try{let t=b({prompt_spec:e});d(t);let s=e.version||1;g("".concat(e.prompt_id,".v").concat(s))}catch(e){console.error("Error loading version:",e),L.Z.fromBackend("Failed to load prompt version")}}})]})},eq=s(20347),eG=e=>{let{accessToken:t,userRole:s}=e,[i,c]=(0,r.useState)([]),[d,m]=(0,r.useState)(!1),[p,x]=(0,r.useState)(null),[u,h]=(0,r.useState)(!1),[g,v]=(0,r.useState)(!1),[f,j]=(0,r.useState)(null),[b,y]=(0,r.useState)(!1),[N,w]=(0,r.useState)(null),_=!!s&&(0,eq.tY)(s),C=async()=>{if(t){m(!0);try{let e=await (0,o.getPromptsList)(t);console.log("prompts: ".concat(JSON.stringify(e))),c(e.prompts)}catch(e){console.error("Error fetching prompts:",e)}finally{m(!1)}}};(0,r.useEffect)(()=>{C()},[t]);let k=()=>{C(),v(!1),j(null),x(null)},S=async()=>{if(N&&t){y(!0);try{await (0,o.deletePromptCall)(t,N.id),L.Z.success('Prompt "'.concat(N.name,'" deleted successfully')),C()}catch(e){console.error("Error deleting prompt:",e),L.Z.fromBackend("Failed to delete prompt")}finally{y(!1),w(null)}}};return(0,n.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[g?(0,n.jsx)(eH,{onClose:()=>{v(!1),j(null)},onSuccess:k,accessToken:t,initialPromptData:f}):p?(0,n.jsx)(W,{promptId:p,onClose:()=>x(null),accessToken:t,isAdmin:_,onDelete:C,onEdit:e=>{j(e),v(!0)}}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(a.z,{onClick:()=>{p&&x(null),j(null),v(!0)},disabled:!t,children:"+ Add New Prompt"}),(0,n.jsx)(a.z,{onClick:()=>{p&&x(null),h(!0)},disabled:!t,variant:"secondary",children:"Upload .prompt File"})]})}),(0,n.jsx)(P,{promptsList:i,isLoading:d,onPromptClick:e=>{x(e)},onDeleteClick:(e,t)=>{w({id:e,name:t})},accessToken:t,isAdmin:_})]}),(0,n.jsx)($,{visible:u,onClose:()=>{h(!1)},accessToken:t,onSuccess:k}),N&&(0,n.jsxs)(l.Z,{title:"Delete Prompt",open:null!==N,onOk:S,onCancel:()=>{w(null)},confirmLoading:b,okText:"Delete",okButtonProps:{danger:!0},children:[(0,n.jsxs)("p",{children:["Are you sure you want to delete prompt: ",N.name," ?"]}),(0,n.jsx)("p",{children:"This action cannot be undone."})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6600-f82a8329e442461d.js b/litellm/proxy/_experimental/out/_next/static/chunks/6600-232dc85820ec987e.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/6600-f82a8329e442461d.js rename to litellm/proxy/_experimental/out/_next/static/chunks/6600-232dc85820ec987e.js index 4ddbaf8b54c..4f8d7a7683d 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/6600-f82a8329e442461d.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/6600-232dc85820ec987e.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6600],{66600:function(e,s,t){t.d(s,{Z:function(){return X}});var l=t(57437),a=t(2265),r=t(40278),n=t(12514),i=t(49804),c=t(67101),o=t(47323),d=t(92414),m=t(46030),u=t(97765),h=t(12485),x=t(18135),p=t(35242),f=t(29706),g=t(77991),v=t(84264),_=t(39789),y=t(9114),j=t(23628),N=t(19250),b=t(78489),k=t(51853),C=t(44643),w=t(71157);let S=e=>{let{responseTimeMs:s}=e;return null==s?null:(0,l.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-500 font-mono",children:[(0,l.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M12 6V12L16 14M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,l.jsxs)("span",{children:[s.toFixed(0),"ms"]})]})},Z=e=>{let s=e;if("string"==typeof s)try{s=JSON.parse(s)}catch(e){}return s},A=e=>{let{label:s,value:t}=e,[r,n]=a.useState(!1),[i,c]=a.useState(!1),o=(null==t?void 0:t.toString())||"N/A",d=o.length>50?o.substring(0,50)+"...":o;return(0,l.jsx)("tr",{className:"hover:bg-gray-50",children:(0,l.jsx)("td",{className:"px-4 py-2 align-top",colSpan:2,children:(0,l.jsxs)("div",{className:"flex items-center justify-between group",children:[(0,l.jsxs)("div",{className:"flex items-center flex-1",children:[(0,l.jsx)("button",{onClick:()=>n(!r),className:"text-gray-400 hover:text-gray-600 mr-2",children:r?"▼":"▶"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-sm text-gray-600",children:s}),(0,l.jsx)("pre",{className:"mt-1 text-sm font-mono text-gray-800 whitespace-pre-wrap",children:r?o:d})]})]}),(0,l.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(o),c(!0),setTimeout(()=>c(!1),2e3)},className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-gray-600",children:(0,l.jsx)(k.Z,{className:"h-4 w-4"})})]})})})},T=e=>{var s,t,a,r,n,i,c,o,d,m,u,_,y,j;let{response:N}=e,b=null,k={},S={};try{if(null==N?void 0:N.error)try{let e="string"==typeof N.error.message?JSON.parse(N.error.message):N.error.message;b={message:(null==e?void 0:e.message)||"Unknown error",traceback:(null==e?void 0:e.traceback)||"No traceback available",litellm_params:(null==e?void 0:e.litellm_cache_params)||{},health_check_cache_params:(null==e?void 0:e.health_check_cache_params)||{}},k=Z(b.litellm_params)||{},S=Z(b.health_check_cache_params)||{}}catch(e){console.warn("Error parsing error details:",e),b={message:String(N.error.message||"Unknown error"),traceback:"Error parsing details",litellm_params:{},health_check_cache_params:{}}}else k=Z(null==N?void 0:N.litellm_cache_params)||{},S=Z(null==N?void 0:N.health_check_cache_params)||{}}catch(e){console.warn("Error in response parsing:",e),k={},S={}}let T={redis_host:(null==S?void 0:null===(a=S.redis_client)||void 0===a?void 0:null===(t=a.connection_pool)||void 0===t?void 0:null===(s=t.connection_kwargs)||void 0===s?void 0:s.host)||(null==S?void 0:null===(i=S.redis_async_client)||void 0===i?void 0:null===(n=i.connection_pool)||void 0===n?void 0:null===(r=n.connection_kwargs)||void 0===r?void 0:r.host)||(null==S?void 0:null===(c=S.connection_kwargs)||void 0===c?void 0:c.host)||(null==S?void 0:S.host)||"N/A",redis_port:(null==S?void 0:null===(m=S.redis_client)||void 0===m?void 0:null===(d=m.connection_pool)||void 0===d?void 0:null===(o=d.connection_kwargs)||void 0===o?void 0:o.port)||(null==S?void 0:null===(y=S.redis_async_client)||void 0===y?void 0:null===(_=y.connection_pool)||void 0===_?void 0:null===(u=_.connection_kwargs)||void 0===u?void 0:u.port)||(null==S?void 0:null===(j=S.connection_kwargs)||void 0===j?void 0:j.port)||(null==S?void 0:S.port)||"N/A",redis_version:(null==S?void 0:S.redis_version)||"N/A",startup_nodes:(()=>{try{var e,s,t,l,a,r,n,i,c,o,d,m,u;if(null==S?void 0:null===(e=S.redis_kwargs)||void 0===e?void 0:e.startup_nodes)return JSON.stringify(S.redis_kwargs.startup_nodes);let h=(null==S?void 0:null===(l=S.redis_client)||void 0===l?void 0:null===(t=l.connection_pool)||void 0===t?void 0:null===(s=t.connection_kwargs)||void 0===s?void 0:s.host)||(null==S?void 0:null===(n=S.redis_async_client)||void 0===n?void 0:null===(r=n.connection_pool)||void 0===r?void 0:null===(a=r.connection_kwargs)||void 0===a?void 0:a.host),x=(null==S?void 0:null===(o=S.redis_client)||void 0===o?void 0:null===(c=o.connection_pool)||void 0===c?void 0:null===(i=c.connection_kwargs)||void 0===i?void 0:i.port)||(null==S?void 0:null===(u=S.redis_async_client)||void 0===u?void 0:null===(m=u.connection_pool)||void 0===m?void 0:null===(d=m.connection_kwargs)||void 0===d?void 0:d.port);return h&&x?JSON.stringify([{host:h,port:x}]):"N/A"}catch(e){return"N/A"}})(),namespace:(null==S?void 0:S.namespace)||"N/A"};return(0,l.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,l.jsxs)(x.Z,{children:[(0,l.jsxs)(p.Z,{className:"border-b border-gray-200 px-4",children:[(0,l.jsx)(h.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Summary"}),(0,l.jsx)(h.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Raw Response"})]}),(0,l.jsxs)(g.Z,{children:[(0,l.jsx)(f.Z,{className:"p-4",children:(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center mb-6",children:[(null==N?void 0:N.status)==="healthy"?(0,l.jsx)(C.Z,{className:"h-5 w-5 text-green-500 mr-2"}):(0,l.jsx)(w.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,l.jsxs)(v.Z,{className:"text-sm font-medium ".concat((null==N?void 0:N.status)==="healthy"?"text-green-500":"text-red-500"),children:["Cache Status: ",(null==N?void 0:N.status)||"unhealthy"]})]}),(0,l.jsx)("table",{className:"w-full border-collapse",children:(0,l.jsxs)("tbody",{children:[b&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold text-red-600",children:"Error Details"})}),(0,l.jsx)(A,{label:"Error Message",value:b.message}),(0,l.jsx)(A,{label:"Traceback",value:b.traceback})]}),(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Cache Details"})}),(0,l.jsx)(A,{label:"Cache Configuration",value:String(null==k?void 0:k.type)}),(0,l.jsx)(A,{label:"Ping Response",value:String(N.ping_response)}),(0,l.jsx)(A,{label:"Set Cache Response",value:N.set_cache_response||"N/A"}),(0,l.jsx)(A,{label:"litellm_settings.cache_params",value:JSON.stringify(k,null,2)}),(null==k?void 0:k.type)==="redis"&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Redis Details"})}),(0,l.jsx)(A,{label:"Redis Host",value:T.redis_host||"N/A"}),(0,l.jsx)(A,{label:"Redis Port",value:T.redis_port||"N/A"}),(0,l.jsx)(A,{label:"Redis Version",value:T.redis_version||"N/A"}),(0,l.jsx)(A,{label:"Startup Nodes",value:T.startup_nodes||"N/A"}),(0,l.jsx)(A,{label:"Namespace",value:T.namespace||"N/A"})]})]})})]})}),(0,l.jsx)(f.Z,{className:"p-4",children:(0,l.jsx)("div",{className:"bg-gray-50 rounded-md p-4 font-mono text-sm",children:(0,l.jsx)("pre",{className:"whitespace-pre-wrap break-words overflow-auto max-h-[500px]",children:(()=>{try{let e={...N,litellm_cache_params:k,health_check_cache_params:S},s=JSON.parse(JSON.stringify(e,(e,s)=>{if("string"==typeof s)try{return JSON.parse(s)}catch(e){}return s}));return JSON.stringify(s,null,2)}catch(e){return"Error formatting JSON: "+e.message}})()})})})]})]})})},R=e=>{let{accessToken:s,healthCheckResponse:t,runCachingHealthCheck:r,responseTimeMs:n}=e,[i,c]=a.useState(null),[o,d]=a.useState(!1),m=async()=>{d(!0);let e=performance.now();await r(),c(performance.now()-e),d(!1)};return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(b.Z,{onClick:m,disabled:o,className:"bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 text-white text-sm px-4 py-2 rounded-md",children:o?"Running Health Check...":"Run Health Check"}),(0,l.jsx)(S,{responseTimeMs:i})]}),t&&(0,l.jsx)(T,{response:t})]})};var E=t(87452),L=t(88829),F=t(72208),O=t(25512),D=e=>{let{redisType:s,redisTypeDescriptions:t,onTypeChange:a}=e;return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Redis Type"}),(0,l.jsxs)(O.P,{value:s,onValueChange:a,children:[(0,l.jsx)(O.Q,{value:"node",children:"Node (Single Instance)"}),(0,l.jsx)(O.Q,{value:"cluster",children:"Cluster"}),(0,l.jsx)(O.Q,{value:"sentinel",children:"Sentinel"}),(0,l.jsx)(O.Q,{value:"semantic",children:"Semantic"})]}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:t[s]||"Select the type of Redis deployment you're using"})]})},I=t(80443),H=t(30150),V=t(49566),J=t(37592),B=t(10703),P=t(24199),M=e=>{let{field:s,currentValue:t}=e,[r,n]=(0,a.useState)([]),[i,c]=(0,a.useState)(t||""),{accessToken:o}=(0,I.Z)();if((0,a.useEffect)(()=>{o&&(async()=>{try{let e=await (0,B.p)(o);console.log("Fetched models for selector:",e),e.length>0&&n(e)}catch(e){console.error("Error fetching model info:",e)}})()},[o]),"Boolean"===s.field_type)return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:s.ui_field_name}),(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)("input",{type:"checkbox",name:s.field_name,defaultChecked:!0===t||"true"===t,className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded"}),(0,l.jsx)("span",{className:"ml-2 text-sm text-gray-500",children:s.field_description})]})]});if("Integer"===s.field_type||"Float"===s.field_type)return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:s.ui_field_name}),(0,l.jsx)(P.Z,{name:s.field_name,type:"number",defaultValue:t,placeholder:s.field_description}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:s.field_description})]});if("List"===s.field_type)return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:s.ui_field_name}),(0,l.jsx)("textarea",{name:s.field_name,defaultValue:"object"==typeof t?JSON.stringify(t,null,2):t,placeholder:s.field_description,className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500",rows:4}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:s.field_description})]});if("Models_Select"===s.field_type){let e=r.filter(e=>"embedding"===e.mode).map(e=>({value:e.model_group,label:e.model_group}));return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:s.ui_field_name}),(0,l.jsx)(J.default,{value:i,onChange:c,showSearch:!0,placeholder:"Search and select a model...",options:e,style:{width:"100%"},className:"rounded-md",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())}}),(0,l.jsx)("input",{type:"hidden",name:s.field_name,value:i}),s.field_description&&(0,l.jsx)("p",{className:"text-xs text-gray-500",children:s.field_description})]})}if("Integer"===s.field_type||"Float"===s.field_type)return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:s.ui_field_name}),(0,l.jsx)(H.Z,{name:s.field_name,defaultValue:t,placeholder:s.field_description,step:"Float"===s.field_type?.01:1}),s.field_description&&(0,l.jsx)("p",{className:"text-xs text-gray-500",children:s.field_description})]});let d="password"===s.field_name||s.field_name.includes("password")?"password":"text";return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:s.ui_field_name}),(0,l.jsx)(V.Z,{name:s.field_name,type:d,defaultValue:t,placeholder:s.field_description}),s.field_description&&(0,l.jsx)("p",{className:"text-xs text-gray-500",children:s.field_description})]})};let q=(e,s)=>null===e.redis_type||void 0===e.redis_type||e.redis_type===s,G=(e,s)=>e.find(e=>e.field_name===s),U=(e,s)=>{let t=["host","port","password","username"].map(s=>G(e,s)).filter(Boolean),l=["ssl","ssl_cert_reqs","ssl_check_hostname"].map(s=>G(e,s)).filter(Boolean),a=["namespace","ttl","max_connections"].map(s=>G(e,s)).filter(Boolean),r=["gcp_service_account","gcp_ssl_ca_certs"].map(s=>G(e,s)).filter(Boolean);return{basicFields:t,sslFields:l,cacheManagementFields:a,gcpFields:r,clusterFields:e.filter(e=>"cluster"===e.redis_type),sentinelFields:e.filter(e=>"sentinel"===e.redis_type),semanticFields:e.filter(e=>"semantic"===e.redis_type)}},Q=(e,s)=>{let t={type:"redis"};return e.forEach(e=>{if("redis_type"===e.field_name||!q(e,s))return;let l=e.field_name,a=null;if("Boolean"===e.field_type){let e=document.querySelector('input[name="'.concat(l,'"]'));(null==e?void 0:e.checked)!==void 0&&(a=e.checked)}else if("List"===e.field_type){let e=document.querySelector('textarea[name="'.concat(l,'"]'));if(null==e?void 0:e.value)try{a=JSON.parse(e.value)}catch(e){console.error("Invalid JSON for ".concat(l,":"),e)}}else{let s=document.querySelector('input[name="'.concat(l,'"]'));if(null==s?void 0:s.value){let t=s.value.trim();if(""!==t){if("Integer"===e.field_type){let e=Number(t);isNaN(e)||(a=e)}else if("Float"===e.field_type){let e=Number(t);isNaN(e)||(a=e)}else a=t}}}null!=a&&(t[l]=a)}),t};var z=e=>{let{accessToken:s,userRole:t,userID:r}=e,[n,i]=(0,a.useState)({}),[c,o]=(0,a.useState)([]),[d,m]=(0,a.useState)({}),[u,h]=(0,a.useState)("node"),[x,p]=(0,a.useState)(!1),[f,g]=(0,a.useState)(!1),v=(0,a.useCallback)(async()=>{try{let e=await (0,N.getCacheSettingsCall)(s);console.log("cache settings from API",e),e.fields&&o(e.fields),e.current_values&&(i(e.current_values),e.current_values.redis_type&&h(e.current_values.redis_type)),e.redis_type_descriptions&&m(e.redis_type_descriptions)}catch(e){console.error("Failed to load cache settings:",e),y.Z.fromBackend("Failed to load cache settings")}},[s]);(0,a.useEffect)(()=>{s&&v()},[s,v]);let _=async()=>{if(s){p(!0);try{let e=Q(c,u),t=await (0,N.testCacheConnectionCall)(s,e);"success"===t.status?y.Z.success("Cache connection test successful!"):y.Z.fromBackend("Connection test failed: ".concat(t.message||t.error))}catch(e){console.error("Test connection error:",e),y.Z.fromBackend("Connection test failed: ".concat(e.message||"Unknown error"))}finally{p(!1)}}},j=async()=>{if(s){g(!0);try{let e=Q(c,u);"semantic"===u&&(e.type="redis-semantic"),await (0,N.updateCacheSettingsCall)(s,e),y.Z.success("Cache settings updated successfully"),await v()}catch(e){console.error("Failed to save cache settings:",e),y.Z.fromBackend("Failed to update cache settings")}finally{g(!1)}}};if(!s)return null;let{basicFields:k,sslFields:C,cacheManagementFields:w,gcpFields:S,clusterFields:Z,sentinelFields:A,semanticFields:T}=U(c,u);return(0,l.jsxs)("div",{className:"w-full space-y-8 py-2",children:[(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"max-w-3xl",children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Cache Settings"}),(0,l.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure Redis cache for LiteLLM"})]}),(0,l.jsx)(D,{redisType:u,redisTypeDescriptions:d,onTypeChange:h}),(0,l.jsxs)("div",{className:"space-y-6 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:"Connection Settings"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:k.map(e=>{var s,t;if(!e)return null;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),"cluster"===u&&Z.length>0&&(0,l.jsxs)("div",{className:"space-y-6 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:"Cluster Configuration"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6",children:Z.map(e=>{var s,t;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),"sentinel"===u&&A.length>0&&(0,l.jsxs)("div",{className:"space-y-6 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:"Sentinel Configuration"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:A.map(e=>{var s,t;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),"semantic"===u&&T.length>0&&(0,l.jsxs)("div",{className:"space-y-6 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:"Semantic Configuration"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:T.map(e=>{var s,t;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),(0,l.jsxs)(E.Z,{className:"mt-4",children:[(0,l.jsx)(F.Z,{children:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Advanced Settings"})}),(0,l.jsx)(L.Z,{children:(0,l.jsxs)("div",{className:"space-y-6",children:[C.length>0&&(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("h5",{className:"text-sm font-medium text-gray-700",children:"SSL Settings"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:C.map(e=>{var s,t;if(!e)return null;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),w.length>0&&(0,l.jsxs)("div",{className:"space-y-4 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h5",{className:"text-sm font-medium text-gray-700",children:"Cache Management"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:w.map(e=>{var s,t;if(!e)return null;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),S.length>0&&(0,l.jsxs)("div",{className:"space-y-4 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h5",{className:"text-sm font-medium text-gray-700",children:"GCP Authentication"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:S.map(e=>{var s,t;if(!e)return null;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]})]})})]})]}),(0,l.jsxs)("div",{className:"border-t border-gray-200 pt-6 flex justify-end gap-3",children:[(0,l.jsx)(b.Z,{variant:"secondary",size:"sm",onClick:_,disabled:x,className:"text-sm",children:x?"Testing...":"Test Connection"}),(0,l.jsx)(b.Z,{size:"sm",onClick:j,disabled:f,className:"text-sm font-medium",children:f?"Saving...":"Save Changes"})]})]})};let W=e=>{if(e)return e.toISOString().split("T")[0]};function K(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}var X=e=>{let{accessToken:s,token:t,userRole:b,userID:k,premiumUser:C}=e,[w,S]=(0,a.useState)([]),[Z,A]=(0,a.useState)([]),[T,E]=(0,a.useState)([]),[L,F]=(0,a.useState)([]),[O,D]=(0,a.useState)("0"),[I,H]=(0,a.useState)("0"),[V,J]=(0,a.useState)("0"),[B,P]=(0,a.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[M,q]=(0,a.useState)(""),[G,U]=(0,a.useState)("");(0,a.useEffect)(()=>{s&&B&&((async()=>{F(await (0,N.adminGlobalCacheActivity)(s,W(B.from),W(B.to)))})(),q(new Date().toLocaleString()))},[s]);let Q=Array.from(new Set(L.map(e=>{var s;return null!==(s=null==e?void 0:e.api_key)&&void 0!==s?s:""}))),X=Array.from(new Set(L.map(e=>{var s;return null!==(s=null==e?void 0:e.model)&&void 0!==s?s:""})));Array.from(new Set(L.map(e=>{var s;return null!==(s=null==e?void 0:e.call_type)&&void 0!==s?s:""})));let Y=async(e,t)=>{e&&t&&s&&F(await (0,N.adminGlobalCacheActivity)(s,W(e),W(t)))};(0,a.useEffect)(()=>{console.log("DATA IN CACHE DASHBOARD",L);let e=L;Z.length>0&&(e=e.filter(e=>Z.includes(e.api_key))),T.length>0&&(e=e.filter(e=>T.includes(e.model))),console.log("before processed data in cache dashboard",e);let s=0,t=0,l=0,a=e.reduce((e,a)=>{console.log("Processing item:",a),a.call_type||(console.log("Item has no call_type:",a),a.call_type="Unknown"),s+=(a.total_rows||0)-(a.cache_hit_true_rows||0),t+=a.cache_hit_true_rows||0,l+=a.cached_completion_tokens||0;let r=e.find(e=>e.name===a.call_type);return r?(r["LLM API requests"]+=(a.total_rows||0)-(a.cache_hit_true_rows||0),r["Cache hit"]+=a.cache_hit_true_rows||0,r["Cached Completion Tokens"]+=a.cached_completion_tokens||0,r["Generated Completion Tokens"]+=a.generated_completion_tokens||0):e.push({name:a.call_type,"LLM API requests":(a.total_rows||0)-(a.cache_hit_true_rows||0),"Cache hit":a.cache_hit_true_rows||0,"Cached Completion Tokens":a.cached_completion_tokens||0,"Generated Completion Tokens":a.generated_completion_tokens||0}),e},[]);D(K(t)),H(K(l));let r=t+s;r>0?J((t/r*100).toFixed(2)):J("0"),S(a),console.log("PROCESSED DATA IN CACHE DASHBOARD",a)},[Z,T,B,L]);let $=async()=>{try{y.Z.info("Running cache health check..."),U("");let e=await (0,N.cachingHealthCheckCall)(null!==s?s:"");console.log("CACHING HEALTH CHECK RESPONSE",e),U(e)}catch(s){let e;if(console.error("Error running health check:",s),s&&s.message)try{let t=JSON.parse(s.message);t.error&&(t=t.error),e=t}catch(t){e={message:s.message}}else e={message:"Unknown error occurred"};U({error:e})}};return(0,l.jsxs)(x.Z,{className:"gap-2 p-8 h-full w-full mt-2 mb-8",children:[(0,l.jsxs)(p.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,l.jsxs)("div",{className:"flex",children:[(0,l.jsx)(h.Z,{children:"Cache Analytics"}),(0,l.jsx)(h.Z,{children:(0,l.jsx)("pre",{children:"Cache Health"})}),(0,l.jsx)(h.Z,{children:"Cache Settings"})]}),(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[M&&(0,l.jsxs)(v.Z,{children:["Last Refreshed: ",M]}),(0,l.jsx)(o.Z,{icon:j.Z,variant:"shadow",size:"xs",className:"self-center",onClick:()=>{q(new Date().toLocaleString())}})]})]}),(0,l.jsxs)(g.Z,{children:[(0,l.jsx)(f.Z,{children:(0,l.jsxs)(n.Z,{children:[(0,l.jsxs)(c.Z,{numItems:3,className:"gap-4 mt-4",children:[(0,l.jsx)(i.Z,{children:(0,l.jsx)(d.Z,{placeholder:"Select Virtual Keys",value:Z,onValueChange:A,children:Q.map(e=>(0,l.jsx)(m.Z,{value:e,children:e},e))})}),(0,l.jsx)(i.Z,{children:(0,l.jsx)(d.Z,{placeholder:"Select Models",value:T,onValueChange:E,children:X.map(e=>(0,l.jsx)(m.Z,{value:e,children:e},e))})}),(0,l.jsx)(i.Z,{children:(0,l.jsx)(_.Z,{value:B,onValueChange:e=>{P(e),Y(e.from,e.to)}})})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 mt-4",children:[(0,l.jsxs)(n.Z,{children:[(0,l.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hit Ratio"}),(0,l.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,l.jsxs)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:[V,"%"]})})]}),(0,l.jsxs)(n.Z,{children:[(0,l.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hits"}),(0,l.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,l.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:O})})]}),(0,l.jsxs)(n.Z,{children:[(0,l.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cached Tokens"}),(0,l.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,l.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:I})})]})]}),(0,l.jsx)(u.Z,{className:"mt-4",children:"Cache Hits vs API Requests"}),(0,l.jsx)(r.Z,{title:"Cache Hits vs API Requests",data:w,stack:!0,index:"name",valueFormatter:K,categories:["LLM API requests","Cache hit"],colors:["sky","teal"],yAxisWidth:48}),(0,l.jsx)(u.Z,{className:"mt-4",children:"Cached Completion Tokens vs Generated Completion Tokens"}),(0,l.jsx)(r.Z,{className:"mt-6",data:w,stack:!0,index:"name",valueFormatter:K,categories:["Generated Completion Tokens","Cached Completion Tokens"],colors:["sky","teal"],yAxisWidth:48})]})}),(0,l.jsx)(f.Z,{children:(0,l.jsx)(R,{accessToken:s,healthCheckResponse:G,runCachingHealthCheck:$})}),(0,l.jsx)(f.Z,{children:(0,l.jsx)(z,{accessToken:s,userRole:b,userID:k})})]})]})}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6600],{66600:function(e,s,t){t.d(s,{Z:function(){return X}});var l=t(57437),a=t(2265),r=t(40278),n=t(12514),i=t(49804),c=t(67101),o=t(47323),d=t(92414),m=t(46030),u=t(97765),h=t(12485),x=t(18135),p=t(35242),f=t(29706),g=t(77991),v=t(84264),_=t(39789),y=t(9114),j=t(23628),N=t(19250),b=t(78489),k=t(51853),C=t(44643),w=t(71157);let S=e=>{let{responseTimeMs:s}=e;return null==s?null:(0,l.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-500 font-mono",children:[(0,l.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M12 6V12L16 14M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,l.jsxs)("span",{children:[s.toFixed(0),"ms"]})]})},Z=e=>{let s=e;if("string"==typeof s)try{s=JSON.parse(s)}catch(e){}return s},A=e=>{let{label:s,value:t}=e,[r,n]=a.useState(!1),[i,c]=a.useState(!1),o=(null==t?void 0:t.toString())||"N/A",d=o.length>50?o.substring(0,50)+"...":o;return(0,l.jsx)("tr",{className:"hover:bg-gray-50",children:(0,l.jsx)("td",{className:"px-4 py-2 align-top",colSpan:2,children:(0,l.jsxs)("div",{className:"flex items-center justify-between group",children:[(0,l.jsxs)("div",{className:"flex items-center flex-1",children:[(0,l.jsx)("button",{onClick:()=>n(!r),className:"text-gray-400 hover:text-gray-600 mr-2",children:r?"▼":"▶"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-sm text-gray-600",children:s}),(0,l.jsx)("pre",{className:"mt-1 text-sm font-mono text-gray-800 whitespace-pre-wrap",children:r?o:d})]})]}),(0,l.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(o),c(!0),setTimeout(()=>c(!1),2e3)},className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-gray-600",children:(0,l.jsx)(k.Z,{className:"h-4 w-4"})})]})})})},T=e=>{var s,t,a,r,n,i,c,o,d,m,u,_,y,j;let{response:N}=e,b=null,k={},S={};try{if(null==N?void 0:N.error)try{let e="string"==typeof N.error.message?JSON.parse(N.error.message):N.error.message;b={message:(null==e?void 0:e.message)||"Unknown error",traceback:(null==e?void 0:e.traceback)||"No traceback available",litellm_params:(null==e?void 0:e.litellm_cache_params)||{},health_check_cache_params:(null==e?void 0:e.health_check_cache_params)||{}},k=Z(b.litellm_params)||{},S=Z(b.health_check_cache_params)||{}}catch(e){console.warn("Error parsing error details:",e),b={message:String(N.error.message||"Unknown error"),traceback:"Error parsing details",litellm_params:{},health_check_cache_params:{}}}else k=Z(null==N?void 0:N.litellm_cache_params)||{},S=Z(null==N?void 0:N.health_check_cache_params)||{}}catch(e){console.warn("Error in response parsing:",e),k={},S={}}let T={redis_host:(null==S?void 0:null===(a=S.redis_client)||void 0===a?void 0:null===(t=a.connection_pool)||void 0===t?void 0:null===(s=t.connection_kwargs)||void 0===s?void 0:s.host)||(null==S?void 0:null===(i=S.redis_async_client)||void 0===i?void 0:null===(n=i.connection_pool)||void 0===n?void 0:null===(r=n.connection_kwargs)||void 0===r?void 0:r.host)||(null==S?void 0:null===(c=S.connection_kwargs)||void 0===c?void 0:c.host)||(null==S?void 0:S.host)||"N/A",redis_port:(null==S?void 0:null===(m=S.redis_client)||void 0===m?void 0:null===(d=m.connection_pool)||void 0===d?void 0:null===(o=d.connection_kwargs)||void 0===o?void 0:o.port)||(null==S?void 0:null===(y=S.redis_async_client)||void 0===y?void 0:null===(_=y.connection_pool)||void 0===_?void 0:null===(u=_.connection_kwargs)||void 0===u?void 0:u.port)||(null==S?void 0:null===(j=S.connection_kwargs)||void 0===j?void 0:j.port)||(null==S?void 0:S.port)||"N/A",redis_version:(null==S?void 0:S.redis_version)||"N/A",startup_nodes:(()=>{try{var e,s,t,l,a,r,n,i,c,o,d,m,u;if(null==S?void 0:null===(e=S.redis_kwargs)||void 0===e?void 0:e.startup_nodes)return JSON.stringify(S.redis_kwargs.startup_nodes);let h=(null==S?void 0:null===(l=S.redis_client)||void 0===l?void 0:null===(t=l.connection_pool)||void 0===t?void 0:null===(s=t.connection_kwargs)||void 0===s?void 0:s.host)||(null==S?void 0:null===(n=S.redis_async_client)||void 0===n?void 0:null===(r=n.connection_pool)||void 0===r?void 0:null===(a=r.connection_kwargs)||void 0===a?void 0:a.host),x=(null==S?void 0:null===(o=S.redis_client)||void 0===o?void 0:null===(c=o.connection_pool)||void 0===c?void 0:null===(i=c.connection_kwargs)||void 0===i?void 0:i.port)||(null==S?void 0:null===(u=S.redis_async_client)||void 0===u?void 0:null===(m=u.connection_pool)||void 0===m?void 0:null===(d=m.connection_kwargs)||void 0===d?void 0:d.port);return h&&x?JSON.stringify([{host:h,port:x}]):"N/A"}catch(e){return"N/A"}})(),namespace:(null==S?void 0:S.namespace)||"N/A"};return(0,l.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,l.jsxs)(x.Z,{children:[(0,l.jsxs)(p.Z,{className:"border-b border-gray-200 px-4",children:[(0,l.jsx)(h.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Summary"}),(0,l.jsx)(h.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Raw Response"})]}),(0,l.jsxs)(g.Z,{children:[(0,l.jsx)(f.Z,{className:"p-4",children:(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center mb-6",children:[(null==N?void 0:N.status)==="healthy"?(0,l.jsx)(C.Z,{className:"h-5 w-5 text-green-500 mr-2"}):(0,l.jsx)(w.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,l.jsxs)(v.Z,{className:"text-sm font-medium ".concat((null==N?void 0:N.status)==="healthy"?"text-green-500":"text-red-500"),children:["Cache Status: ",(null==N?void 0:N.status)||"unhealthy"]})]}),(0,l.jsx)("table",{className:"w-full border-collapse",children:(0,l.jsxs)("tbody",{children:[b&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold text-red-600",children:"Error Details"})}),(0,l.jsx)(A,{label:"Error Message",value:b.message}),(0,l.jsx)(A,{label:"Traceback",value:b.traceback})]}),(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Cache Details"})}),(0,l.jsx)(A,{label:"Cache Configuration",value:String(null==k?void 0:k.type)}),(0,l.jsx)(A,{label:"Ping Response",value:String(N.ping_response)}),(0,l.jsx)(A,{label:"Set Cache Response",value:N.set_cache_response||"N/A"}),(0,l.jsx)(A,{label:"litellm_settings.cache_params",value:JSON.stringify(k,null,2)}),(null==k?void 0:k.type)==="redis"&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Redis Details"})}),(0,l.jsx)(A,{label:"Redis Host",value:T.redis_host||"N/A"}),(0,l.jsx)(A,{label:"Redis Port",value:T.redis_port||"N/A"}),(0,l.jsx)(A,{label:"Redis Version",value:T.redis_version||"N/A"}),(0,l.jsx)(A,{label:"Startup Nodes",value:T.startup_nodes||"N/A"}),(0,l.jsx)(A,{label:"Namespace",value:T.namespace||"N/A"})]})]})})]})}),(0,l.jsx)(f.Z,{className:"p-4",children:(0,l.jsx)("div",{className:"bg-gray-50 rounded-md p-4 font-mono text-sm",children:(0,l.jsx)("pre",{className:"whitespace-pre-wrap break-words overflow-auto max-h-[500px]",children:(()=>{try{let e={...N,litellm_cache_params:k,health_check_cache_params:S},s=JSON.parse(JSON.stringify(e,(e,s)=>{if("string"==typeof s)try{return JSON.parse(s)}catch(e){}return s}));return JSON.stringify(s,null,2)}catch(e){return"Error formatting JSON: "+e.message}})()})})})]})]})})},R=e=>{let{accessToken:s,healthCheckResponse:t,runCachingHealthCheck:r,responseTimeMs:n}=e,[i,c]=a.useState(null),[o,d]=a.useState(!1),m=async()=>{d(!0);let e=performance.now();await r(),c(performance.now()-e),d(!1)};return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(b.Z,{onClick:m,disabled:o,className:"bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 text-white text-sm px-4 py-2 rounded-md",children:o?"Running Health Check...":"Run Health Check"}),(0,l.jsx)(S,{responseTimeMs:i})]}),t&&(0,l.jsx)(T,{response:t})]})};var E=t(87452),L=t(88829),F=t(72208),O=t(25512),D=e=>{let{redisType:s,redisTypeDescriptions:t,onTypeChange:a}=e;return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Redis Type"}),(0,l.jsxs)(O.P,{value:s,onValueChange:a,children:[(0,l.jsx)(O.Q,{value:"node",children:"Node (Single Instance)"}),(0,l.jsx)(O.Q,{value:"cluster",children:"Cluster"}),(0,l.jsx)(O.Q,{value:"sentinel",children:"Sentinel"}),(0,l.jsx)(O.Q,{value:"semantic",children:"Semantic"})]}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:t[s]||"Select the type of Redis deployment you're using"})]})},I=t(39760),H=t(30150),V=t(49566),J=t(37592),B=t(10703),P=t(24199),M=e=>{let{field:s,currentValue:t}=e,[r,n]=(0,a.useState)([]),[i,c]=(0,a.useState)(t||""),{accessToken:o}=(0,I.Z)();if((0,a.useEffect)(()=>{o&&(async()=>{try{let e=await (0,B.p)(o);console.log("Fetched models for selector:",e),e.length>0&&n(e)}catch(e){console.error("Error fetching model info:",e)}})()},[o]),"Boolean"===s.field_type)return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:s.ui_field_name}),(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)("input",{type:"checkbox",name:s.field_name,defaultChecked:!0===t||"true"===t,className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded"}),(0,l.jsx)("span",{className:"ml-2 text-sm text-gray-500",children:s.field_description})]})]});if("Integer"===s.field_type||"Float"===s.field_type)return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:s.ui_field_name}),(0,l.jsx)(P.Z,{name:s.field_name,type:"number",defaultValue:t,placeholder:s.field_description}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:s.field_description})]});if("List"===s.field_type)return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:s.ui_field_name}),(0,l.jsx)("textarea",{name:s.field_name,defaultValue:"object"==typeof t?JSON.stringify(t,null,2):t,placeholder:s.field_description,className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500",rows:4}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:s.field_description})]});if("Models_Select"===s.field_type){let e=r.filter(e=>"embedding"===e.mode).map(e=>({value:e.model_group,label:e.model_group}));return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:s.ui_field_name}),(0,l.jsx)(J.default,{value:i,onChange:c,showSearch:!0,placeholder:"Search and select a model...",options:e,style:{width:"100%"},className:"rounded-md",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())}}),(0,l.jsx)("input",{type:"hidden",name:s.field_name,value:i}),s.field_description&&(0,l.jsx)("p",{className:"text-xs text-gray-500",children:s.field_description})]})}if("Integer"===s.field_type||"Float"===s.field_type)return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:s.ui_field_name}),(0,l.jsx)(H.Z,{name:s.field_name,defaultValue:t,placeholder:s.field_description,step:"Float"===s.field_type?.01:1}),s.field_description&&(0,l.jsx)("p",{className:"text-xs text-gray-500",children:s.field_description})]});let d="password"===s.field_name||s.field_name.includes("password")?"password":"text";return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:s.ui_field_name}),(0,l.jsx)(V.Z,{name:s.field_name,type:d,defaultValue:t,placeholder:s.field_description}),s.field_description&&(0,l.jsx)("p",{className:"text-xs text-gray-500",children:s.field_description})]})};let q=(e,s)=>null===e.redis_type||void 0===e.redis_type||e.redis_type===s,G=(e,s)=>e.find(e=>e.field_name===s),U=(e,s)=>{let t=["host","port","password","username"].map(s=>G(e,s)).filter(Boolean),l=["ssl","ssl_cert_reqs","ssl_check_hostname"].map(s=>G(e,s)).filter(Boolean),a=["namespace","ttl","max_connections"].map(s=>G(e,s)).filter(Boolean),r=["gcp_service_account","gcp_ssl_ca_certs"].map(s=>G(e,s)).filter(Boolean);return{basicFields:t,sslFields:l,cacheManagementFields:a,gcpFields:r,clusterFields:e.filter(e=>"cluster"===e.redis_type),sentinelFields:e.filter(e=>"sentinel"===e.redis_type),semanticFields:e.filter(e=>"semantic"===e.redis_type)}},Q=(e,s)=>{let t={type:"redis"};return e.forEach(e=>{if("redis_type"===e.field_name||!q(e,s))return;let l=e.field_name,a=null;if("Boolean"===e.field_type){let e=document.querySelector('input[name="'.concat(l,'"]'));(null==e?void 0:e.checked)!==void 0&&(a=e.checked)}else if("List"===e.field_type){let e=document.querySelector('textarea[name="'.concat(l,'"]'));if(null==e?void 0:e.value)try{a=JSON.parse(e.value)}catch(e){console.error("Invalid JSON for ".concat(l,":"),e)}}else{let s=document.querySelector('input[name="'.concat(l,'"]'));if(null==s?void 0:s.value){let t=s.value.trim();if(""!==t){if("Integer"===e.field_type){let e=Number(t);isNaN(e)||(a=e)}else if("Float"===e.field_type){let e=Number(t);isNaN(e)||(a=e)}else a=t}}}null!=a&&(t[l]=a)}),t};var z=e=>{let{accessToken:s,userRole:t,userID:r}=e,[n,i]=(0,a.useState)({}),[c,o]=(0,a.useState)([]),[d,m]=(0,a.useState)({}),[u,h]=(0,a.useState)("node"),[x,p]=(0,a.useState)(!1),[f,g]=(0,a.useState)(!1),v=(0,a.useCallback)(async()=>{try{let e=await (0,N.getCacheSettingsCall)(s);console.log("cache settings from API",e),e.fields&&o(e.fields),e.current_values&&(i(e.current_values),e.current_values.redis_type&&h(e.current_values.redis_type)),e.redis_type_descriptions&&m(e.redis_type_descriptions)}catch(e){console.error("Failed to load cache settings:",e),y.Z.fromBackend("Failed to load cache settings")}},[s]);(0,a.useEffect)(()=>{s&&v()},[s,v]);let _=async()=>{if(s){p(!0);try{let e=Q(c,u),t=await (0,N.testCacheConnectionCall)(s,e);"success"===t.status?y.Z.success("Cache connection test successful!"):y.Z.fromBackend("Connection test failed: ".concat(t.message||t.error))}catch(e){console.error("Test connection error:",e),y.Z.fromBackend("Connection test failed: ".concat(e.message||"Unknown error"))}finally{p(!1)}}},j=async()=>{if(s){g(!0);try{let e=Q(c,u);"semantic"===u&&(e.type="redis-semantic"),await (0,N.updateCacheSettingsCall)(s,e),y.Z.success("Cache settings updated successfully"),await v()}catch(e){console.error("Failed to save cache settings:",e),y.Z.fromBackend("Failed to update cache settings")}finally{g(!1)}}};if(!s)return null;let{basicFields:k,sslFields:C,cacheManagementFields:w,gcpFields:S,clusterFields:Z,sentinelFields:A,semanticFields:T}=U(c,u);return(0,l.jsxs)("div",{className:"w-full space-y-8 py-2",children:[(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"max-w-3xl",children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Cache Settings"}),(0,l.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure Redis cache for LiteLLM"})]}),(0,l.jsx)(D,{redisType:u,redisTypeDescriptions:d,onTypeChange:h}),(0,l.jsxs)("div",{className:"space-y-6 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:"Connection Settings"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:k.map(e=>{var s,t;if(!e)return null;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),"cluster"===u&&Z.length>0&&(0,l.jsxs)("div",{className:"space-y-6 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:"Cluster Configuration"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6",children:Z.map(e=>{var s,t;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),"sentinel"===u&&A.length>0&&(0,l.jsxs)("div",{className:"space-y-6 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:"Sentinel Configuration"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:A.map(e=>{var s,t;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),"semantic"===u&&T.length>0&&(0,l.jsxs)("div",{className:"space-y-6 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:"Semantic Configuration"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:T.map(e=>{var s,t;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),(0,l.jsxs)(E.Z,{className:"mt-4",children:[(0,l.jsx)(F.Z,{children:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Advanced Settings"})}),(0,l.jsx)(L.Z,{children:(0,l.jsxs)("div",{className:"space-y-6",children:[C.length>0&&(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("h5",{className:"text-sm font-medium text-gray-700",children:"SSL Settings"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:C.map(e=>{var s,t;if(!e)return null;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),w.length>0&&(0,l.jsxs)("div",{className:"space-y-4 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h5",{className:"text-sm font-medium text-gray-700",children:"Cache Management"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:w.map(e=>{var s,t;if(!e)return null;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),S.length>0&&(0,l.jsxs)("div",{className:"space-y-4 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h5",{className:"text-sm font-medium text-gray-700",children:"GCP Authentication"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:S.map(e=>{var s,t;if(!e)return null;let a=null!==(t=null!==(s=n[e.field_name])&&void 0!==s?s:e.field_default)&&void 0!==t?t:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]})]})})]})]}),(0,l.jsxs)("div",{className:"border-t border-gray-200 pt-6 flex justify-end gap-3",children:[(0,l.jsx)(b.Z,{variant:"secondary",size:"sm",onClick:_,disabled:x,className:"text-sm",children:x?"Testing...":"Test Connection"}),(0,l.jsx)(b.Z,{size:"sm",onClick:j,disabled:f,className:"text-sm font-medium",children:f?"Saving...":"Save Changes"})]})]})};let W=e=>{if(e)return e.toISOString().split("T")[0]};function K(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}var X=e=>{let{accessToken:s,token:t,userRole:b,userID:k,premiumUser:C}=e,[w,S]=(0,a.useState)([]),[Z,A]=(0,a.useState)([]),[T,E]=(0,a.useState)([]),[L,F]=(0,a.useState)([]),[O,D]=(0,a.useState)("0"),[I,H]=(0,a.useState)("0"),[V,J]=(0,a.useState)("0"),[B,P]=(0,a.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[M,q]=(0,a.useState)(""),[G,U]=(0,a.useState)("");(0,a.useEffect)(()=>{s&&B&&((async()=>{F(await (0,N.adminGlobalCacheActivity)(s,W(B.from),W(B.to)))})(),q(new Date().toLocaleString()))},[s]);let Q=Array.from(new Set(L.map(e=>{var s;return null!==(s=null==e?void 0:e.api_key)&&void 0!==s?s:""}))),X=Array.from(new Set(L.map(e=>{var s;return null!==(s=null==e?void 0:e.model)&&void 0!==s?s:""})));Array.from(new Set(L.map(e=>{var s;return null!==(s=null==e?void 0:e.call_type)&&void 0!==s?s:""})));let Y=async(e,t)=>{e&&t&&s&&F(await (0,N.adminGlobalCacheActivity)(s,W(e),W(t)))};(0,a.useEffect)(()=>{console.log("DATA IN CACHE DASHBOARD",L);let e=L;Z.length>0&&(e=e.filter(e=>Z.includes(e.api_key))),T.length>0&&(e=e.filter(e=>T.includes(e.model))),console.log("before processed data in cache dashboard",e);let s=0,t=0,l=0,a=e.reduce((e,a)=>{console.log("Processing item:",a),a.call_type||(console.log("Item has no call_type:",a),a.call_type="Unknown"),s+=(a.total_rows||0)-(a.cache_hit_true_rows||0),t+=a.cache_hit_true_rows||0,l+=a.cached_completion_tokens||0;let r=e.find(e=>e.name===a.call_type);return r?(r["LLM API requests"]+=(a.total_rows||0)-(a.cache_hit_true_rows||0),r["Cache hit"]+=a.cache_hit_true_rows||0,r["Cached Completion Tokens"]+=a.cached_completion_tokens||0,r["Generated Completion Tokens"]+=a.generated_completion_tokens||0):e.push({name:a.call_type,"LLM API requests":(a.total_rows||0)-(a.cache_hit_true_rows||0),"Cache hit":a.cache_hit_true_rows||0,"Cached Completion Tokens":a.cached_completion_tokens||0,"Generated Completion Tokens":a.generated_completion_tokens||0}),e},[]);D(K(t)),H(K(l));let r=t+s;r>0?J((t/r*100).toFixed(2)):J("0"),S(a),console.log("PROCESSED DATA IN CACHE DASHBOARD",a)},[Z,T,B,L]);let $=async()=>{try{y.Z.info("Running cache health check..."),U("");let e=await (0,N.cachingHealthCheckCall)(null!==s?s:"");console.log("CACHING HEALTH CHECK RESPONSE",e),U(e)}catch(s){let e;if(console.error("Error running health check:",s),s&&s.message)try{let t=JSON.parse(s.message);t.error&&(t=t.error),e=t}catch(t){e={message:s.message}}else e={message:"Unknown error occurred"};U({error:e})}};return(0,l.jsxs)(x.Z,{className:"gap-2 p-8 h-full w-full mt-2 mb-8",children:[(0,l.jsxs)(p.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,l.jsxs)("div",{className:"flex",children:[(0,l.jsx)(h.Z,{children:"Cache Analytics"}),(0,l.jsx)(h.Z,{children:(0,l.jsx)("pre",{children:"Cache Health"})}),(0,l.jsx)(h.Z,{children:"Cache Settings"})]}),(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[M&&(0,l.jsxs)(v.Z,{children:["Last Refreshed: ",M]}),(0,l.jsx)(o.Z,{icon:j.Z,variant:"shadow",size:"xs",className:"self-center",onClick:()=>{q(new Date().toLocaleString())}})]})]}),(0,l.jsxs)(g.Z,{children:[(0,l.jsx)(f.Z,{children:(0,l.jsxs)(n.Z,{children:[(0,l.jsxs)(c.Z,{numItems:3,className:"gap-4 mt-4",children:[(0,l.jsx)(i.Z,{children:(0,l.jsx)(d.Z,{placeholder:"Select Virtual Keys",value:Z,onValueChange:A,children:Q.map(e=>(0,l.jsx)(m.Z,{value:e,children:e},e))})}),(0,l.jsx)(i.Z,{children:(0,l.jsx)(d.Z,{placeholder:"Select Models",value:T,onValueChange:E,children:X.map(e=>(0,l.jsx)(m.Z,{value:e,children:e},e))})}),(0,l.jsx)(i.Z,{children:(0,l.jsx)(_.Z,{value:B,onValueChange:e=>{P(e),Y(e.from,e.to)}})})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 mt-4",children:[(0,l.jsxs)(n.Z,{children:[(0,l.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hit Ratio"}),(0,l.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,l.jsxs)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:[V,"%"]})})]}),(0,l.jsxs)(n.Z,{children:[(0,l.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hits"}),(0,l.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,l.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:O})})]}),(0,l.jsxs)(n.Z,{children:[(0,l.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cached Tokens"}),(0,l.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,l.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:I})})]})]}),(0,l.jsx)(u.Z,{className:"mt-4",children:"Cache Hits vs API Requests"}),(0,l.jsx)(r.Z,{title:"Cache Hits vs API Requests",data:w,stack:!0,index:"name",valueFormatter:K,categories:["LLM API requests","Cache hit"],colors:["sky","teal"],yAxisWidth:48}),(0,l.jsx)(u.Z,{className:"mt-4",children:"Cached Completion Tokens vs Generated Completion Tokens"}),(0,l.jsx)(r.Z,{className:"mt-6",data:w,stack:!0,index:"name",valueFormatter:K,categories:["Generated Completion Tokens","Cached Completion Tokens"],colors:["sky","teal"],yAxisWidth:48})]})}),(0,l.jsx)(f.Z,{children:(0,l.jsx)(R,{accessToken:s,healthCheckResponse:G,runCachingHealthCheck:$})}),(0,l.jsx)(f.Z,{children:(0,l.jsx)(z,{accessToken:s,userRole:b,userID:k})})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6609-3e081758ffbe3786.js b/litellm/proxy/_experimental/out/_next/static/chunks/6609-3e081758ffbe3786.js new file mode 100644 index 00000000000..494360f33c9 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/6609-3e081758ffbe3786.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6609],{29967:function(e,t,n){n.d(t,{ZP:function(){return B}});var o=n(2265),r=n(36760),a=n.n(r),l=n(92491),c=n(50506),i=n(18242),d=n(71744),s=n(64024),u=n(33759);let f=o.createContext(null),p=f.Provider,m=o.createContext(null),h=m.Provider;var v=n(20873),g=n(28791),b=n(6694),y=n(34709),x=n(66531),w=n(86586),k=n(39109),C=n(93463),E=n(12918),S=n(99320),Z=n(71140);let N=e=>{let{componentCls:t,antCls:n}=e,o="".concat(t,"-group");return{[o]:Object.assign(Object.assign({},(0,E.Wf)(e)),{display:"inline-block",fontSize:0,["&".concat(o,"-rtl")]:{direction:"rtl"},["&".concat(o,"-block")]:{display:"flex"},["".concat(n,"-badge ").concat(n,"-badge-count")]:{zIndex:1},["> ".concat(n,"-badge:not(:first-child) > ").concat(n,"-button-wrapper")]:{borderInlineStart:"none"}})}},K=e=>{let{componentCls:t,wrapperMarginInlineEnd:n,colorPrimary:o,radioSize:r,motionDurationSlow:a,motionDurationMid:l,motionEaseInOutCirc:c,colorBgContainer:i,colorBorder:d,lineWidth:s,colorBgContainerDisabled:u,colorTextDisabled:f,paddingXS:p,dotColorDisabled:m,lineType:h,radioColor:v,radioBgColor:g,calc:b}=e,y="".concat(t,"-inner"),x=b(r).sub(b(4).mul(2)),w=b(1).mul(r).equal({unit:!0});return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},(0,E.Wf)(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer","&:last-child":{marginInlineEnd:0},["&".concat(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"},["".concat(t,"-checked::after")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:"".concat((0,C.bf)(s)," ").concat(h," ").concat(o),borderRadius:"50%",visibility:"hidden",opacity:0,content:'""'},[t]:Object.assign(Object.assign({},(0,E.Wf)(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),["".concat(t,"-wrapper:hover &,\n &:hover ").concat(y)]:{borderColor:o},["".concat(t,"-input:focus-visible + ").concat(y)]:(0,E.oN)(e),["".concat(t,":hover::after, ").concat(t,"-wrapper:hover &::after")]:{visibility:"visible"},["".concat(t,"-inner")]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:w,height:w,marginBlockStart:b(1).mul(r).div(-2).equal({unit:!0}),marginInlineStart:b(1).mul(r).div(-2).equal({unit:!0}),backgroundColor:v,borderBlockStart:0,borderInlineStart:0,borderRadius:w,transform:"scale(0)",opacity:0,transition:"all ".concat(a," ").concat(c),content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:w,height:w,backgroundColor:i,borderColor:d,borderStyle:"solid",borderWidth:s,borderRadius:"50%",transition:"all ".concat(l)},["".concat(t,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},["".concat(t,"-checked")]:{[y]:{borderColor:o,backgroundColor:g,"&::after":{transform:"scale(".concat(e.calc(e.dotSize).div(r).equal(),")"),opacity:1,transition:"all ".concat(a," ").concat(c)}}},["".concat(t,"-disabled")]:{cursor:"not-allowed",[y]:{backgroundColor:u,borderColor:d,cursor:"not-allowed","&::after":{backgroundColor:m}},["".concat(t,"-input")]:{cursor:"not-allowed"},["".concat(t,"-disabled + span")]:{color:f,cursor:"not-allowed"},["&".concat(t,"-checked")]:{[y]:{"&::after":{transform:"scale(".concat(b(x).div(r).equal(),")")}}}},["span".concat(t," + *")]:{paddingInlineStart:p,paddingInlineEnd:p}})}},O=e=>{let{buttonColor:t,controlHeight:n,componentCls:o,lineWidth:r,lineType:a,colorBorder:l,motionDurationMid:c,buttonPaddingInline:i,fontSize:d,buttonBg:s,fontSizeLG:u,controlHeightLG:f,controlHeightSM:p,paddingXS:m,borderRadius:h,borderRadiusSM:v,borderRadiusLG:g,buttonCheckedBg:b,buttonSolidCheckedColor:y,colorTextDisabled:x,colorBgContainerDisabled:w,buttonCheckedBgDisabled:k,buttonCheckedColorDisabled:S,colorPrimary:Z,colorPrimaryHover:N,colorPrimaryActive:K,buttonSolidCheckedBg:O,buttonSolidCheckedHoverBg:I,buttonSolidCheckedActiveBg:R,calc:P}=e;return{["".concat(o,"-button-wrapper")]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:i,paddingBlock:0,color:t,fontSize:d,lineHeight:(0,C.bf)(P(n).sub(P(r).mul(2)).equal()),background:s,border:"".concat((0,C.bf)(r)," ").concat(a," ").concat(l),borderBlockStartWidth:P(r).add(.02).equal(),borderInlineEndWidth:r,cursor:"pointer",transition:["color ".concat(c),"background ".concat(c),"box-shadow ".concat(c)].join(","),a:{color:t},["> ".concat(o,"-button")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:last-child)":{marginInlineEnd:P(r).mul(-1).equal()},"&:first-child":{borderInlineStart:"".concat((0,C.bf)(r)," ").concat(a," ").concat(l),borderStartStartRadius:h,borderEndStartRadius:h},"&:last-child":{borderStartEndRadius:h,borderEndEndRadius:h},"&:first-child:last-child":{borderRadius:h},["".concat(o,"-group-large &")]:{height:f,fontSize:u,lineHeight:(0,C.bf)(P(f).sub(P(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:g,borderEndStartRadius:g},"&:last-child":{borderStartEndRadius:g,borderEndEndRadius:g}},["".concat(o,"-group-small &")]:{height:p,paddingInline:P(m).sub(r).equal(),paddingBlock:0,lineHeight:(0,C.bf)(P(p).sub(P(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},"&:hover":{position:"relative",color:Z},"&:has(:focus-visible)":(0,E.oN)(e),["".concat(o,"-inner, input[type='checkbox'], input[type='radio']")]:{width:0,height:0,opacity:0,pointerEvents:"none"},["&-checked:not(".concat(o,"-button-wrapper-disabled)")]:{zIndex:1,color:Z,background:b,borderColor:Z,"&::before":{backgroundColor:Z},"&:first-child":{borderColor:Z},"&:hover":{color:N,borderColor:N,"&::before":{backgroundColor:N}},"&:active":{color:K,borderColor:K,"&::before":{backgroundColor:K}}},["".concat(o,"-group-solid &-checked:not(").concat(o,"-button-wrapper-disabled)")]:{color:y,background:O,borderColor:O,"&:hover":{color:y,background:I,borderColor:I},"&:active":{color:y,background:R,borderColor:R}},"&-disabled":{color:x,backgroundColor:w,borderColor:l,cursor:"not-allowed","&:first-child, &:hover":{color:x,backgroundColor:w,borderColor:l}},["&-disabled".concat(o,"-button-wrapper-checked")]:{color:S,backgroundColor:k,borderColor:l,boxShadow:"none"},"&-block":{flex:1,textAlign:"center"}}}};var I=(0,S.I$)("Radio",e=>{let{controlOutline:t,controlOutlineWidth:n}=e,o="0 0 0 ".concat((0,C.bf)(n)," ").concat(t),r=(0,Z.IX)(e,{radioFocusShadow:o,radioButtonFocusShadow:o});return[N(r),K(r),O(r)]},e=>{let{wireframe:t,padding:n,marginXS:o,lineWidth:r,fontSizeLG:a,colorText:l,colorBgContainer:c,colorTextDisabled:i,controlItemBgActiveDisabled:d,colorTextLightSolid:s,colorPrimary:u,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:m}=e;return{radioSize:a,dotSize:t?a-8:a-(4+r)*2,dotColorDisabled:i,buttonSolidCheckedColor:s,buttonSolidCheckedBg:u,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:c,buttonCheckedBg:c,buttonColor:l,buttonCheckedBgDisabled:d,buttonCheckedColorDisabled:i,buttonPaddingInline:n-r,wrapperMarginInlineEnd:o,radioColor:t?u:m,radioBgColor:t?c:u}},{unitless:{radioSize:!0,dotSize:!0}}),R=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let P=o.forwardRef((e,t)=>{var n,r;let l=o.useContext(f),c=o.useContext(m),{getPrefixCls:i,direction:u,radio:p}=o.useContext(d.E_),h=o.useRef(null),C=(0,g.sQ)(t,h),{isFormItemInput:E}=o.useContext(k.aM),{prefixCls:S,className:Z,rootClassName:N,children:K,style:O,title:P}=e,M=R(e,["prefixCls","className","rootClassName","children","style","title"]),T=i("radio",S),D="button"===((null==l?void 0:l.optionType)||c),L=D?"".concat(T,"-button"):T,j=(0,s.Z)(T),[B,H,z]=I(T,j),A=Object.assign({},M),W=o.useContext(w.Z);l&&(A.name=l.name,A.onChange=t=>{var n,o;null===(n=e.onChange)||void 0===n||n.call(e,t),null===(o=null==l?void 0:l.onChange)||void 0===o||o.call(l,t)},A.checked=e.value===l.value,A.disabled=null!==(n=A.disabled)&&void 0!==n?n:l.disabled),A.disabled=null!==(r=A.disabled)&&void 0!==r?r:W;let _=a()("".concat(L,"-wrapper"),{["".concat(L,"-wrapper-checked")]:A.checked,["".concat(L,"-wrapper-disabled")]:A.disabled,["".concat(L,"-wrapper-rtl")]:"rtl"===u,["".concat(L,"-wrapper-in-form-item")]:E,["".concat(L,"-wrapper-block")]:!!(null==l?void 0:l.block)},null==p?void 0:p.className,Z,N,H,z,j),[F,q]=(0,x.Z)(A.onClick);return B(o.createElement(b.Z,{component:"Radio",disabled:A.disabled},o.createElement("label",{className:_,style:Object.assign(Object.assign({},null==p?void 0:p.style),O),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:P,onClick:F},o.createElement(v.Z,Object.assign({},A,{className:a()(A.className,{[y.A]:!D}),type:"radio",prefixCls:L,ref:C,onClick:q})),void 0!==K?o.createElement("span",{className:"".concat(L,"-label")},K):null)))});var M=n(29487);let T=o.forwardRef((e,t)=>{let{getPrefixCls:n,direction:r}=o.useContext(d.E_),{name:f}=o.useContext(k.aM),m=(0,l.Z)((0,M.S)(f)),{prefixCls:h,className:v,rootClassName:g,options:b,buttonStyle:y="outline",disabled:x,children:w,size:C,style:E,id:S,optionType:Z,name:N=m,defaultValue:K,value:O,block:R=!1,onChange:T,onMouseEnter:D,onMouseLeave:L,onFocus:j,onBlur:B}=e,[H,z]=(0,c.Z)(K,{value:O}),A=o.useCallback(t=>{let n=t.target.value;"value"in e||z(n),n!==H&&(null==T||T(t))},[H,z,T]),W=n("radio",h),_="".concat(W,"-group"),F=(0,s.Z)(W),[q,V,X]=I(W,F),U=w;b&&b.length>0&&(U=b.map(e=>"string"==typeof e||"number"==typeof e?o.createElement(P,{key:e.toString(),prefixCls:W,disabled:x,value:e,checked:H===e},e):o.createElement(P,{key:"radio-group-value-options-".concat(e.value),prefixCls:W,disabled:e.disabled||x,value:e.value,checked:H===e.value,title:e.title,style:e.style,className:e.className,id:e.id,required:e.required},e.label)));let G=(0,u.Z)(C),Y=a()(_,"".concat(_,"-").concat(y),{["".concat(_,"-").concat(G)]:G,["".concat(_,"-rtl")]:"rtl"===r,["".concat(_,"-block")]:R},v,g,V,X,F),$=o.useMemo(()=>({onChange:A,value:H,disabled:x,name:N,optionType:Z,block:R}),[A,H,x,N,Z,R]);return q(o.createElement("div",Object.assign({},(0,i.Z)(e,{aria:!0,data:!0}),{className:Y,style:E,onMouseEnter:D,onMouseLeave:L,onFocus:j,onBlur:B,id:S,ref:t}),o.createElement(p,{value:$},U)))});var D=o.memo(T),L=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},j=o.forwardRef((e,t)=>{let{getPrefixCls:n}=o.useContext(d.E_),{prefixCls:r}=e,a=L(e,["prefixCls"]),l=n("radio",r);return o.createElement(h,{value:"button"},o.createElement(P,Object.assign({prefixCls:l},a,{type:"radio",ref:t})))});P.Button=j,P.Group=D,P.__ANT_RADIO=!0;var B=P},56609:function(e,t,n){n.d(t,{Z:function(){return oj}});var o=n(2265),r={},a="rc-table-internal-hook",l=n(26365),c=n(58525),i=n(27380),d=n(16671),s=n(54887);function u(e){var t=o.createContext(void 0);return{Context:t,Provider:function(e){var n=e.value,r=e.children,a=o.useRef(n);a.current=n;var c=o.useState(function(){return{getValue:function(){return a.current},listeners:new Set}}),d=(0,l.Z)(c,1)[0];return(0,i.Z)(function(){(0,s.unstable_batchedUpdates)(function(){d.listeners.forEach(function(e){e(n)})})},[n]),o.createElement(t.Provider,{value:d},r)},defaultValue:e}}function f(e,t){var n=(0,c.Z)("function"==typeof t?t:function(e){if(void 0===t)return e;if(!Array.isArray(t))return e[t];var n={};return t.forEach(function(t){n[t]=e[t]}),n}),r=o.useContext(null==e?void 0:e.Context),a=r||{},s=a.listeners,u=a.getValue,f=o.useRef();f.current=n(r?u():null==e?void 0:e.defaultValue);var p=o.useState({}),m=(0,l.Z)(p,2)[1];return(0,i.Z)(function(){if(r)return s.add(e),function(){s.delete(e)};function e(e){var t=n(e);(0,d.Z)(f.current,t,!0)||m({})}},[r]),f.current}var p=n(1119),m=n(28791);function h(){var e=o.createContext(null);function t(){return o.useContext(e)}return{makeImmutable:function(n,r){var a=(0,m.Yr)(n),l=function(l,c){var i=a?{ref:c}:{},d=o.useRef(0),s=o.useRef(l);return null!==t()?o.createElement(n,(0,p.Z)({},l,i)):((!r||r(s.current,l))&&(d.current+=1),s.current=l,o.createElement(e.Provider,{value:d.current},o.createElement(n,(0,p.Z)({},l,i))))};return a?o.forwardRef(l):l},responseImmutable:function(e,n){var r=(0,m.Yr)(e),a=function(n,a){return t(),o.createElement(e,(0,p.Z)({},n,r?{ref:a}:{}))};return r?o.memo(o.forwardRef(a),n):o.memo(a,n)},useImmutableMark:t}}var v=h();v.makeImmutable,v.responseImmutable,v.useImmutableMark;var g=h(),b=g.makeImmutable,y=g.responseImmutable,x=g.useImmutableMark,w=u(),k=n(41154),C=n(31686),E=n(11993),S=n(36760),Z=n.n(S),N=n(6397),K=n(16847),O=n(32559),I=o.createContext({renderWithProps:!1});function R(e){var t=[],n={};return e.forEach(function(e){for(var o=e||{},r=o.key,a=o.dataIndex,l=r||(null==a?[]:Array.isArray(a)?a:[a]).join("-")||"RC_TABLE_KEY";n[l];)l="".concat(l,"_next");n[l]=!0,t.push(l)}),t}var P=n(74126),M=function(e){var t,n=e.ellipsis,r=e.rowType,a=e.children,l=!0===n?{showTitle:!0}:n;return l&&(l.showTitle||"header"===r)&&("string"==typeof a||"number"==typeof a?t=a.toString():o.isValidElement(a)&&"string"==typeof a.props.children&&(t=a.props.children)),t},T=o.memo(function(e){var t,n,r,a,c,i,s,u,m,h,v=e.component,g=e.children,b=e.ellipsis,y=e.scope,S=e.prefixCls,O=e.className,R=e.align,T=e.record,D=e.render,L=e.dataIndex,j=e.renderIndex,B=e.shouldCellUpdate,H=e.index,z=e.rowType,A=e.colSpan,W=e.rowSpan,_=e.fixLeft,F=e.fixRight,q=e.firstFixLeft,V=e.lastFixLeft,X=e.firstFixRight,U=e.lastFixRight,G=e.appendNode,Y=e.additionalProps,$=void 0===Y?{}:Y,J=e.isSticky,Q="".concat(S,"-cell"),ee=f(w,["supportSticky","allColumnsFixedLeft","rowHoverable"]),et=ee.supportSticky,en=ee.allColumnsFixedLeft,eo=ee.rowHoverable,er=(t=o.useContext(I),n=x(),(0,N.Z)(function(){if(null!=g)return[g];var e=null==L||""===L?[]:Array.isArray(L)?L:[L],n=(0,K.Z)(T,e),r=n,a=void 0;if(D){var l=D(n,T,j);!l||"object"!==(0,k.Z)(l)||Array.isArray(l)||o.isValidElement(l)?r=l:(r=l.children,a=l.props,t.renderWithProps=!0)}return[r,a]},[n,T,g,L,D,j],function(e,n){if(B){var o=(0,l.Z)(e,2)[1];return B((0,l.Z)(n,2)[1],o)}return!!t.renderWithProps||!(0,d.Z)(e,n,!0)})),ea=(0,l.Z)(er,2),el=ea[0],ec=ea[1],ei={},ed="number"==typeof _&&et,es="number"==typeof F&&et;ed&&(ei.position="sticky",ei.left=_),es&&(ei.position="sticky",ei.right=F);var eu=null!==(r=null!==(a=null!==(c=null==ec?void 0:ec.colSpan)&&void 0!==c?c:$.colSpan)&&void 0!==a?a:A)&&void 0!==r?r:1,ef=null!==(i=null!==(s=null!==(u=null==ec?void 0:ec.rowSpan)&&void 0!==u?u:$.rowSpan)&&void 0!==s?s:W)&&void 0!==i?i:1,ep=f(w,function(e){var t,n;return[(t=ef||1,n=e.hoverStartRow,H<=e.hoverEndRow&&H+t-1>=n),e.onHover]}),em=(0,l.Z)(ep,2),eh=em[0],ev=em[1],eg=(0,P.zX)(function(e){var t;T&&ev(H,H+ef-1),null==$||null===(t=$.onMouseEnter)||void 0===t||t.call($,e)}),eb=(0,P.zX)(function(e){var t;T&&ev(-1,-1),null==$||null===(t=$.onMouseLeave)||void 0===t||t.call($,e)});if(0===eu||0===ef)return null;var ey=null!==(m=$.title)&&void 0!==m?m:M({rowType:z,ellipsis:b,children:el}),ex=Z()(Q,O,(h={},(0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)(h,"".concat(Q,"-fix-left"),ed&&et),"".concat(Q,"-fix-left-first"),q&&et),"".concat(Q,"-fix-left-last"),V&&et),"".concat(Q,"-fix-left-all"),V&&en&&et),"".concat(Q,"-fix-right"),es&&et),"".concat(Q,"-fix-right-first"),X&&et),"".concat(Q,"-fix-right-last"),U&&et),"".concat(Q,"-ellipsis"),b),"".concat(Q,"-with-append"),G),"".concat(Q,"-fix-sticky"),(ed||es)&&J&&et),(0,E.Z)(h,"".concat(Q,"-row-hover"),!ec&&eh)),$.className,null==ec?void 0:ec.className),ew={};R&&(ew.textAlign=R);var ek=(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)({},null==ec?void 0:ec.style),ei),ew),$.style),eC=el;return"object"!==(0,k.Z)(eC)||Array.isArray(eC)||o.isValidElement(eC)||(eC=null),b&&(V||X)&&(eC=o.createElement("span",{className:"".concat(Q,"-content")},eC)),o.createElement(v,(0,p.Z)({},ec,$,{className:ex,style:ek,title:ey,scope:y,onMouseEnter:eo?eg:void 0,onMouseLeave:eo?eb:void 0,colSpan:1!==eu?eu:null,rowSpan:1!==ef?ef:null}),G,eC)});function D(e,t,n,o,r){var a,l,c=n[e]||{},i=n[t]||{};"left"===c.fixed?a=o.left["rtl"===r?t:e]:"right"===i.fixed&&(l=o.right["rtl"===r?e:t]);var d=!1,s=!1,u=!1,f=!1,p=n[t+1],m=n[e-1],h=p&&!p.fixed||m&&!m.fixed||n.every(function(e){return"left"===e.fixed});return"rtl"===r?void 0!==a?f=!(m&&"left"===m.fixed)&&h:void 0!==l&&(u=!(p&&"right"===p.fixed)&&h):void 0!==a?d=!(p&&"left"===p.fixed)&&h:void 0!==l&&(s=!(m&&"right"===m.fixed)&&h),{fixLeft:a,fixRight:l,lastFixLeft:d,firstFixRight:s,lastFixRight:u,firstFixLeft:f,isSticky:o.isSticky}}var L=o.createContext({}),j=n(6989),B=["children"];function H(e){return e.children}H.Row=function(e){var t=e.children,n=(0,j.Z)(e,B);return o.createElement("tr",n,t)},H.Cell=function(e){var t=e.className,n=e.index,r=e.children,a=e.colSpan,l=void 0===a?1:a,c=e.rowSpan,i=e.align,d=f(w,["prefixCls","direction"]),s=d.prefixCls,u=d.direction,m=o.useContext(L),h=m.scrollColumnIndex,v=m.stickyOffsets,g=m.flattenColumns,b=n+l-1+1===h?l+1:l,y=D(n,n+b-1,g,v,u);return o.createElement(T,(0,p.Z)({className:t,index:n,component:"td",prefixCls:s,record:null,dataIndex:null,align:i,colSpan:b,rowSpan:c,render:function(){return r}},y))};var z=y(function(e){var t=e.children,n=e.stickyOffsets,r=e.flattenColumns,a=f(w,"prefixCls"),l=r.length-1,c=r[l],i=o.useMemo(function(){return{stickyOffsets:n,flattenColumns:r,scrollColumnIndex:null!=c&&c.scrollbar?l:null}},[c,r,l,n]);return o.createElement(L.Provider,{value:i},o.createElement("tfoot",{className:"".concat(a,"-summary")},t))}),A=n(31474),W=n(10281),_=n(3208),F=n(18242);function q(e,t,n,r){return o.useMemo(function(){if(null!=n&&n.size){for(var o=[],a=0;a<(null==e?void 0:e.length);a+=1)!function e(t,n,o,r,a,l,c){var i=l(n,c);t.push({record:n,indent:o,index:c,rowKey:i});var d=null==a?void 0:a.has(i);if(n&&Array.isArray(n[r])&&d)for(var s=0;s1?n-1:0),r=1;r5&&void 0!==arguments[5]?arguments[5]:[],d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=e.record,u=e.prefixCls,f=e.columnsKey,p=e.fixedInfoList,m=e.expandIconColumnIndex,h=e.nestExpandable,v=e.indentSize,g=e.expandIcon,b=e.expanded,y=e.hasNestChildren,x=e.onTriggerExpand,w=e.expandable,k=e.expandedKeys,C=f[n],E=p[n];n===(m||0)&&h&&(c=o.createElement(o.Fragment,null,o.createElement("span",{style:{paddingLeft:"".concat(v*r,"px")},className:"".concat(u,"-row-indent indent-level-").concat(r)}),g({prefixCls:u,expanded:b,expandable:y,record:s,onExpand:x})));var S=(null===(l=t.onCell)||void 0===l?void 0:l.call(t,s,a))||{};if(d){var Z=S.rowSpan,N=void 0===Z?1:Z;if(w&&N&&n=1)),style:(0,C.Z)((0,C.Z)({},r),null==k?void 0:k.style)}),y.map(function(e,t){var n=e.render,r=e.dataIndex,i=e.className,s=Y(g,e,t,u,l,d,null==v?void 0:v.offset),f=s.key,y=s.fixedInfo,x=s.appendCellNode,w=s.additionalCellProps;return o.createElement(T,(0,p.Z)({className:i,ellipsis:e.ellipsis,align:e.align,scope:e.rowScope,component:e.rowScope?h:m,prefixCls:b,key:f,record:a,index:l,renderIndex:c,dataIndex:r,render:n,shouldCellUpdate:e.shouldCellUpdate},y,{appendNode:x,additionalProps:w}))}));if(N&&(K.current||S)){var R=w(a,l,u+1,S);t=o.createElement(X,{expanded:S,className:Z()("".concat(b,"-expanded-row"),"".concat(b,"-expanded-row-level-").concat(u+1),O),prefixCls:b,component:f,cellComponent:m,colSpan:v?v.colSpan:y.length,stickyOffset:null==v?void 0:v.sticky,isEmpty:!1},R)}return o.createElement(o.Fragment,null,I,t)});function J(e){var t=e.columnKey,n=e.onColumnResize,r=e.prefixCls,a=e.title,l=o.useRef();return(0,i.Z)(function(){l.current&&n(t,l.current.offsetWidth)},[]),o.createElement(A.Z,{data:t},o.createElement("th",{ref:l,className:"".concat(r,"-measure-cell")},o.createElement("div",{className:"".concat(r,"-measure-cell-content")},a||"\xa0")))}var Q=n(2857);function ee(e){var t=e.prefixCls,n=e.columnsKey,r=e.onColumnResize,a=e.columns,l=o.useRef(null),c=f(w,["measureRowRender"]).measureRowRender,i=o.createElement("tr",{"aria-hidden":"true",className:"".concat(t,"-measure-row"),ref:l,tabIndex:-1},o.createElement(A.Z.Collection,{onBatchResize:function(e){(0,Q.Z)(l.current)&&e.forEach(function(e){r(e.data,e.size.offsetWidth)})}},n.map(function(e){var n=a.find(function(t){return t.key===e}),l=null==n?void 0:n.title,c=o.isValidElement(l)?o.cloneElement(l,{ref:null}):l;return o.createElement(J,{prefixCls:t,key:e,columnKey:e,onColumnResize:r,title:c})})));return c?c(i):i}var et=y(function(e){var t,n=e.data,r=e.measureColumnWidth,a=f(w,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode","expandedRowOffset","fixedInfoList","colWidths"]),l=a.prefixCls,c=a.getComponent,i=a.onColumnResize,d=a.flattenColumns,s=a.getRowKey,u=a.expandedKeys,p=a.childrenColumnName,m=a.emptyNode,h=a.expandedRowOffset,v=void 0===h?0:h,g=a.colWidths,b=q(n,p,u,s),y=o.useMemo(function(){return b.map(function(e){return e.rowKey})},[b]),x=o.useRef({renderWithProps:!1}),k=o.useMemo(function(){for(var e=d.length-v,t=0,n=0;n=0;d-=1){var s=t[d],u=n&&n[d],m=void 0,h=void 0;if(u&&(m=u[eo],"auto"===a&&(h=u.minWidth)),s||h||m||i){var v=m||{},g=(v.columnType,(0,j.Z)(v,er));l.unshift(o.createElement("col",(0,p.Z)({key:d,style:{width:s,minWidth:h}},g))),i=!0}}return l.length>0?o.createElement("colgroup",null,l):null},el=n(83145),ec=["className","noData","columns","flattenColumns","colWidths","colGroup","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","scrollX","tableLayout","onScroll","children"],ei=o.forwardRef(function(e,t){var n=e.className,r=e.noData,a=e.columns,l=e.flattenColumns,c=e.colWidths,i=e.colGroup,d=e.columCount,s=e.stickyOffsets,u=e.direction,p=e.fixHeader,h=e.stickyTopOffset,v=e.stickyBottomOffset,g=e.stickyClassName,b=e.scrollX,y=e.tableLayout,x=e.onScroll,k=e.children,S=(0,j.Z)(e,ec),N=f(w,["prefixCls","scrollbarSize","isSticky","getComponent"]),K=N.prefixCls,O=N.scrollbarSize,I=N.isSticky,R=(0,N.getComponent)(["header","table"],"table"),P=I&&!p?0:O,M=o.useRef(null),T=o.useCallback(function(e){(0,m.mH)(t,e),(0,m.mH)(M,e)},[]);o.useEffect(function(){function e(e){var t=e.currentTarget,n=e.deltaX;n&&(x({currentTarget:t,scrollLeft:t.scrollLeft+n}),e.preventDefault())}var t=M.current;return null==t||t.addEventListener("wheel",e,{passive:!1}),function(){null==t||t.removeEventListener("wheel",e)}},[]);var D=l[l.length-1],L={fixed:D?D.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(K,"-cell-scrollbar")}}},B=(0,o.useMemo)(function(){return P?[].concat((0,el.Z)(a),[L]):a},[P,a]),H=(0,o.useMemo)(function(){return P?[].concat((0,el.Z)(l),[L]):l},[P,l]),z=(0,o.useMemo)(function(){var e=s.right,t=s.left;return(0,C.Z)((0,C.Z)({},s),{},{left:"rtl"===u?[].concat((0,el.Z)(t.map(function(e){return e+P})),[0]):t,right:"rtl"===u?e:[].concat((0,el.Z)(e.map(function(e){return e+P})),[0]),isSticky:I})},[P,s,I]),A=(0,o.useMemo)(function(){for(var e=[],t=0;t1?"colgroup":"col":null,ellipsis:l.ellipsis,align:l.align,component:c,prefixCls:u,key:h[t]},i,{additionalProps:n,rowType:"header"}))}))},eu=y(function(e){var t=e.stickyOffsets,n=e.columns,r=e.flattenColumns,a=e.onHeaderRow,l=f(w,["prefixCls","getComponent"]),c=l.prefixCls,i=l.getComponent,d=o.useMemo(function(){return function(e){var t=[];!function e(n,o){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t[r]=t[r]||[];var a=o;return n.filter(Boolean).map(function(n){var o={key:n.key,className:n.className||"",children:n.title,column:n,colStart:a},l=1,c=n.children;return c&&c.length>0&&(l=e(c,a,r+1).reduce(function(e,t){return e+t},0),o.hasSubColumns=!0),"colSpan"in n&&(l=n.colSpan),"rowSpan"in n&&(o.rowSpan=n.rowSpan),o.colSpan=l,o.colEnd=o.colStart+l-1,t[r].push(o),a+=l,l})}(e,0);for(var n=t.length,o=function(e){t[e].forEach(function(t){("rowSpan"in t)||t.hasSubColumns||(t.rowSpan=n-e)})},r=0;r1&&void 0!==arguments[1]?arguments[1]:"";return"number"==typeof t?t:t.endsWith("%")?e*parseFloat(t)/100:null}var em=["children"],eh=["fixed"];function ev(e){return(0,ef.Z)(e).filter(function(e){return o.isValidElement(e)}).map(function(e){var t=e.key,n=e.props,o=n.children,r=(0,j.Z)(n,em),a=(0,C.Z)({key:t},r);return o&&(a.children=ev(o)),a})}function eg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key";return e.filter(function(e){return e&&"object"===(0,k.Z)(e)}).reduce(function(e,n,o){var r=n.fixed,a=!0===r?"left":r,l="".concat(t,"-").concat(o),c=n.children;return c&&c.length>0?[].concat((0,el.Z)(e),(0,el.Z)(eg(c,l).map(function(e){var t;return(0,C.Z)((0,C.Z)({},e),{},{fixed:null!==(t=e.fixed)&&void 0!==t?t:a})}))):[].concat((0,el.Z)(e),[(0,C.Z)((0,C.Z)({key:l},n),{},{fixed:a})])},[])}var eb=function(e,t){var n=e.prefixCls,a=e.columns,c=e.children,i=e.expandable,d=e.expandedKeys,s=e.columnTitle,u=e.getRowKey,f=e.onTriggerExpand,p=e.expandIcon,m=e.rowExpandable,h=e.expandIconColumnIndex,v=e.expandedRowOffset,g=void 0===v?0:v,b=e.direction,y=e.expandRowByClick,x=e.columnWidth,w=e.fixed,S=e.scrollWidth,Z=e.clientWidth,N=o.useMemo(function(){return function e(t){return t.filter(function(e){return e&&"object"===(0,k.Z)(e)&&!e.hidden}).map(function(t){var n=t.children;return n&&n.length>0?(0,C.Z)((0,C.Z)({},t),{},{children:e(n)}):t})}((a||ev(c)||[]).slice())},[a,c]),K=o.useMemo(function(){if(i){var e,t=N.slice();if(!t.includes(r)){var a=h||0,l=0===a&&"right"===w?N.length:a;l>=0&&t.splice(l,0,r)}var c=t.indexOf(r);t=t.filter(function(e,t){return e!==r||t===c});var v=N[c];e=w||(v?v.fixed:null);var b=(0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)({},eo,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",s),"fixed",e),"className","".concat(n,"-row-expand-icon-cell")),"width",x),"render",function(e,t,r){var a=u(t,r),l=p({prefixCls:n,expanded:d.has(a),expandable:!m||m(t),record:t,onExpand:f});return y?o.createElement("span",{onClick:function(e){return e.stopPropagation()}},l):l});return t.map(function(e,t){var n=e===r?b:e;return t=0;t-=1){var n=I[t].fixed;if("left"===n||!0===n){e=t;break}}if(e>=0)for(var o=0;o<=e;o+=1){var r=I[o].fixed;if("left"!==r&&!0!==r)return!0}var a=I.findIndex(function(e){return"right"===e.fixed});if(a>=0){for(var l=a;l0){var e=0,t=0;I.forEach(function(n){var o=ep(S,n.width);o?e+=o:t+=1});var n=Math.max(S,Z),o=Math.max(n-e,t),r=t,a=o/t,l=0,c=I.map(function(e){var t=(0,C.Z)({},e),n=ep(S,t.width);if(n)t.width=n;else{var c=Math.floor(a);t.width=1===r?o:c,o-=c,r-=1}return l+=t.width,t});if(l=n-h})})}})},z=function(e){I(function(t){return(0,C.Z)((0,C.Z)({},t),{},{scrollLeft:y?e/y*x:0})})};return(o.useImperativeHandle(t,function(){return{setScrollLeft:z,checkScrollBarVisible:H}}),o.useEffect(function(){var e=ew(document.body,"mouseup",j,!1),t=ew(document.body,"mousemove",B,!1);return H(),function(){e.remove(),t.remove()}},[k,T]),o.useEffect(function(){if(p.current){for(var e=[],t=(0,eC.bn)(p.current);t;)e.push(t),t=t.parentElement;return e.forEach(function(e){return e.addEventListener("scroll",H,!1)}),window.addEventListener("resize",H,!1),window.addEventListener("scroll",H,!1),v.addEventListener("scroll",H,!1),function(){e.forEach(function(e){return e.removeEventListener("scroll",H)}),window.removeEventListener("resize",H),window.removeEventListener("scroll",H),v.removeEventListener("scroll",H)}}},[v]),o.useEffect(function(){O.isHiddenScrollBar||I(function(e){var t=p.current;return t?(0,C.Z)((0,C.Z)({},e),{},{scrollLeft:t.scrollLeft/t.scrollWidth*t.clientWidth}):e})},[O.isHiddenScrollBar]),y<=x||!k||O.isHiddenScrollBar)?null:o.createElement("div",{style:{height:(0,_.Z)(),width:x,bottom:h},className:"".concat(b,"-sticky-scroll")},o.createElement("div",{onMouseDown:function(e){e.persist(),R.current.delta=e.pageX-O.scrollLeft,R.current.x=0,D(!0),e.preventDefault()},ref:S,className:Z()("".concat(b,"-sticky-scroll-bar"),(0,E.Z)({},"".concat(b,"-sticky-scroll-bar-active"),T)),style:{width:"".concat(k,"px"),transform:"translate3d(".concat(O.scrollLeft,"px, 0, 0)")}}))}),eZ="rc-table",eN=[],eK={};function eO(){return"No Data"}var eI=o.forwardRef(function(e,t){var n,r=(0,C.Z)({rowKey:"key",prefixCls:eZ,emptyText:eO},e),s=r.prefixCls,u=r.className,f=r.rowClassName,m=r.style,h=r.data,v=r.rowKey,g=r.scroll,b=r.tableLayout,y=r.direction,x=r.title,S=r.footer,O=r.summary,I=r.caption,P=r.id,M=r.showHeader,T=r.components,L=r.emptyText,B=r.onRow,q=r.onHeaderRow,V=r.measureRowRender,X=r.onScroll,G=r.internalHooks,Y=r.transformColumns,$=r.internalRefs,J=r.tailor,Q=r.getContainerWidth,ee=r.sticky,eo=r.rowHoverable,er=void 0===eo||eo,ec=h||eN,ei=!!ec.length,es=G===a,ef=o.useCallback(function(e,t){return(0,K.Z)(T,e)||t},[T]),ep=o.useMemo(function(){return"function"==typeof v?v:function(e){return e&&e[v]}},[v]),em=ef(["body"]),eh=(tU=o.useState(-1),tY=(tG=(0,l.Z)(tU,2))[0],t$=tG[1],tJ=o.useState(-1),t0=(tQ=(0,l.Z)(tJ,2))[0],t1=tQ[1],[tY,t0,o.useCallback(function(e,t){t$(e),t1(t)},[])]),ev=(0,l.Z)(eh,3),eg=ev[0],ew=ev[1],ek=ev[2],eE=(t8=(t3=r.expandable,t4=(0,j.Z)(r,en),!1===(t2="expandable"in r?(0,C.Z)((0,C.Z)({},t4),t3):t4).showExpandColumn&&(t2.expandIconColumnIndex=-1),t2).expandIcon,t6=t2.expandedRowKeys,t5=t2.defaultExpandedRowKeys,t7=t2.defaultExpandAllRows,t9=t2.expandedRowRender,ne=t2.onExpand,nt=t2.onExpandedRowsChange,nn=t2.childrenColumnName||"children",no=o.useMemo(function(){return t9?"row":!!(r.expandable&&r.internalHooks===a&&r.expandable.__PARENT_RENDER_ICON__||ec.some(function(e){return e&&"object"===(0,k.Z)(e)&&e[nn]}))&&"nest"},[!!t9,ec]),nr=o.useState(function(){if(t5)return t5;if(t7){var e;return e=[],function t(n){(n||[]).forEach(function(n,o){e.push(ep(n,o)),t(n[nn])})}(ec),e}return[]}),nl=(na=(0,l.Z)(nr,2))[0],nc=na[1],ni=o.useMemo(function(){return new Set(t6||nl||[])},[t6,nl]),nd=o.useCallback(function(e){var t,n=ep(e,ec.indexOf(e)),o=ni.has(n);o?(ni.delete(n),t=(0,el.Z)(ni)):t=[].concat((0,el.Z)(ni),[n]),nc(t),ne&&ne(!o,e),nt&&nt(t)},[ep,ni,ec,ne,nt]),[t2,no,ni,t8||U,nn,nd]),eI=(0,l.Z)(eE,6),eR=eI[0],eP=eI[1],eM=eI[2],eT=eI[3],eD=eI[4],eL=eI[5],ej=null==g?void 0:g.x,eB=o.useState(0),eH=(0,l.Z)(eB,2),ez=eH[0],eA=eH[1],eW=eb((0,C.Z)((0,C.Z)((0,C.Z)({},r),eR),{},{expandable:!!eR.expandedRowRender,columnTitle:eR.columnTitle,expandedKeys:eM,getRowKey:ep,onTriggerExpand:eL,expandIcon:eT,expandIconColumnIndex:eR.expandIconColumnIndex,direction:y,scrollWidth:es&&J&&"number"==typeof ej?ej:null,clientWidth:ez}),es?Y:null),e_=(0,l.Z)(eW,4),eF=e_[0],eq=e_[1],eV=e_[2],eX=e_[3],eU=null!=eV?eV:ej,eG=o.useMemo(function(){return{columns:eF,flattenColumns:eq}},[eF,eq]),eY=o.useRef(),e$=o.useRef(),eJ=o.useRef(),eQ=o.useRef();o.useImperativeHandle(t,function(){return{nativeElement:eY.current,scrollTo:function(e){var t;if(eJ.current instanceof HTMLElement){var n=e.index,o=e.top,r=e.key;if("number"!=typeof o||Number.isNaN(o)){var a,l,c=null!=r?r:ep(ec[n]);null===(l=eJ.current.querySelector('[data-row-key="'.concat(c,'"]')))||void 0===l||l.scrollIntoView()}else null===(a=eJ.current)||void 0===a||a.scrollTo({top:o})}else null!==(t=eJ.current)&&void 0!==t&&t.scrollTo&&eJ.current.scrollTo(e)}}});var e0=o.useRef(),e1=o.useState(!1),e2=(0,l.Z)(e1,2),e3=e2[0],e4=e2[1],e8=o.useState(!1),e6=(0,l.Z)(e8,2),e5=e6[0],e7=e6[1],e9=o.useState(new Map),te=(0,l.Z)(e9,2),tt=te[0],tn=te[1],to=R(eq).map(function(e){return tt.get(e)}),tr=o.useMemo(function(){return to},[to.join("_")]),ta=(0,o.useMemo)(function(){var e=eq.length,t=function(e,t,n){for(var o=[],r=0,a=e;a!==t;a+=n)o.push(r),eq[a].fixed&&(r+=tr[a]||0);return o},n=t(0,e,1),o=t(e-1,-1,-1).reverse();return"rtl"===y?{left:o,right:n}:{left:n,right:o}},[tr,eq,y]),tl=g&&null!=g.y,tc=g&&null!=eU||!!eR.fixed,ti=tc&&eq.some(function(e){return e.fixed}),td=o.useRef(),ts=(nf=void 0===(nu=(ns="object"===(0,k.Z)(ee)?ee:{}).offsetHeader)?0:nu,nm=void 0===(np=ns.offsetSummary)?0:np,nv=void 0===(nh=ns.offsetScroll)?0:nh,nb=(void 0===(ng=ns.getContainer)?function(){return ey}:ng)()||ey,ny=!!ee,o.useMemo(function(){return{isSticky:ny,stickyClassName:ny?"".concat(s,"-sticky-holder"):"",offsetHeader:nf,offsetSummary:nm,offsetScroll:nv,container:nb}},[ny,nv,nf,nm,s,nb])),tu=ts.isSticky,tf=ts.offsetHeader,tp=ts.offsetSummary,tm=ts.offsetScroll,th=ts.stickyClassName,tv=ts.container,tg=o.useMemo(function(){return null==O?void 0:O(ec)},[O,ec]),tb=(tl||tu)&&o.isValidElement(tg)&&tg.type===H&&tg.props.fixed;tl&&(nw={overflowY:ei?"scroll":"auto",maxHeight:g.y}),tc&&(nx={overflowX:"auto"},tl||(nw={overflowY:"hidden"}),nk={width:!0===eU?"auto":eU,minWidth:"100%"});var ty=o.useCallback(function(e,t){tn(function(n){if(n.get(e)!==t){var o=new Map(n);return o.set(e,t),o}return n})},[]),tx=function(e){var t=(0,o.useRef)(null),n=(0,o.useRef)();function r(){window.clearTimeout(n.current)}return(0,o.useEffect)(function(){return r},[]),[function(e){t.current=e,r(),n.current=window.setTimeout(function(){t.current=null,n.current=void 0},100)},function(){return t.current}]}(0),tw=(0,l.Z)(tx,2),tk=tw[0],tC=tw[1];function tE(e,t){t&&("function"==typeof t?t(e):t.scrollLeft!==e&&(t.scrollLeft=e,t.scrollLeft!==e&&setTimeout(function(){t.scrollLeft=e},0)))}var tS=(0,c.Z)(function(e){var t,n=e.currentTarget,o=e.scrollLeft,r="rtl"===y,a="number"==typeof o?o:n.scrollLeft,l=n||eK;tC()&&tC()!==l||(tk(l),tE(a,e$.current),tE(a,eJ.current),tE(a,e0.current),tE(a,null===(t=td.current)||void 0===t?void 0:t.setScrollLeft));var c=n||e$.current;if(c){var i=es&&J&&"number"==typeof eU?eU:c.scrollWidth,d=c.clientWidth;if(i===d){e4(!1),e7(!1);return}r?(e4(-a0)):(e4(a>0),e7(a1?x-D:0,pointerEvents:"auto"}),j=o.useMemo(function(){return h?M<=1:0===R||0===M||M>1},[M,R,h]);j?L.visibility="hidden":h&&(L.height=null==v?void 0:v(M));var B={};return(0===M||0===R)&&(B.rowSpan=1,B.colSpan=1),o.createElement(T,(0,p.Z)({className:Z()(y,m),ellipsis:r.ellipsis,align:r.align,scope:r.rowScope,component:i,prefixCls:n.prefixCls,key:E,record:s,index:c,renderIndex:d,dataIndex:b,render:j?function(){return null}:g,shouldCellUpdate:r.shouldCellUpdate},S,{appendNode:N,additionalProps:(0,C.Z)((0,C.Z)({},K),{},{style:L},B)}))},eL=["data","index","className","rowKey","style","extra","getHeight"],ej=y(o.forwardRef(function(e,t){var n,r=e.data,a=e.index,l=e.className,c=e.rowKey,i=e.style,d=e.extra,s=e.getHeight,u=(0,j.Z)(e,eL),m=r.record,h=r.indent,v=r.index,g=f(w,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),b=g.scrollX,y=g.flattenColumns,x=g.prefixCls,k=g.fixColumn,S=g.componentWidth,N=f(eM,["getComponent"]).getComponent,K=V(m,c,a,h),O=N(["body","row"],"div"),I=N(["body","cell"],"div"),R=K.rowSupportExpand,P=K.expanded,M=K.rowProps,D=K.expandedRowRender,L=K.expandedRowClassName;if(R&&P){var B=D(m,a,h+1,P),H=G(L,m,a,h),z={};k&&(z={style:(0,E.Z)({},"--virtual-width","".concat(S,"px"))});var A="".concat(x,"-expanded-row-cell");n=o.createElement(O,{className:Z()("".concat(x,"-expanded-row"),"".concat(x,"-expanded-row-level-").concat(h+1),H)},o.createElement(T,{component:I,prefixCls:x,className:Z()(A,(0,E.Z)({},"".concat(A,"-fixed"),k)),additionalProps:z},B))}var W=(0,C.Z)((0,C.Z)({},i),{},{width:b});d&&(W.position="absolute",W.pointerEvents="none");var _=o.createElement(O,(0,p.Z)({},M,u,{"data-row-key":c,ref:R?null:t,className:Z()(l,"".concat(x,"-row"),null==M?void 0:M.className,(0,E.Z)({},"".concat(x,"-row-extra"),d)),style:(0,C.Z)((0,C.Z)({},W),null==M?void 0:M.style)}),y.map(function(e,t){return o.createElement(eD,{key:t,component:I,rowInfo:K,column:e,colIndex:t,indent:h,index:a,renderIndex:v,record:m,inverse:d,getHeight:s})}));return R?o.createElement("div",{ref:t},_,n):_})),eB=y(o.forwardRef(function(e,t){var n=e.data,r=e.onScroll,a=f(w,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","scrollX","direction"]),c=a.flattenColumns,i=a.onColumnResize,d=a.getRowKey,s=a.expandedKeys,u=a.prefixCls,p=a.childrenColumnName,m=a.scrollX,h=a.direction,v=f(eM),g=v.sticky,b=v.scrollY,y=v.listItemHeight,x=v.getComponent,C=v.onScroll,E=o.useRef(),S=q(n,p,s,d),Z=o.useMemo(function(){var e=0;return c.map(function(t){var n=t.width,o=t.minWidth,r=t.key,a=Math.max(n||0,o||0);return e+=a,[r,a,e]})},[c]),N=o.useMemo(function(){return Z.map(function(e){return e[2]})},[Z]);o.useEffect(function(){Z.forEach(function(e){var t=(0,l.Z)(e,2);i(t[0],t[1])})},[Z]),o.useImperativeHandle(t,function(){var e,t={scrollTo:function(e){var t;null===(t=E.current)||void 0===t||t.scrollTo(e)},nativeElement:null===(e=E.current)||void 0===e?void 0:e.nativeElement};return Object.defineProperty(t,"scrollLeft",{get:function(){var e;return(null===(e=E.current)||void 0===e?void 0:e.getScrollInfo().x)||0},set:function(e){var t;null===(t=E.current)||void 0===t||t.scrollTo({left:e})}}),Object.defineProperty(t,"scrollTop",{get:function(){var e;return(null===(e=E.current)||void 0===e?void 0:e.getScrollInfo().y)||0},set:function(e){var t;null===(t=E.current)||void 0===t||t.scrollTo({top:e})}}),t});var K=function(e,t){var n=null===(r=S[t])||void 0===r?void 0:r.record,o=e.onCell;if(o){var r,a,l=o(n,t);return null!==(a=null==l?void 0:l.rowSpan)&&void 0!==a?a:1}return 1},O=o.useMemo(function(){return{columnsOffset:N}},[N]),I="".concat(u,"-tbody"),R=x(["body","wrapper"]),P={};return g&&(P.position="sticky",P.bottom=0,"object"===(0,k.Z)(g)&&g.offsetScroll&&(P.bottom=g.offsetScroll)),o.createElement(eT.Provider,{value:O},o.createElement(eP.Z,{fullHeight:!1,ref:E,prefixCls:"".concat(I,"-virtual"),styles:{horizontalScrollBar:P},className:I,height:b,itemHeight:y||24,data:S,itemKey:function(e){return d(e.record)},component:R,scrollWidth:m,direction:h,onVirtualScroll:function(e){var t,n=e.x;r({currentTarget:null===(t=E.current)||void 0===t?void 0:t.nativeElement,scrollLeft:n})},onScroll:C,extraRender:function(e){var t=e.start,n=e.end,r=e.getSize,a=e.offsetY;if(n<0)return null;for(var l=c.filter(function(e){return 0===K(e,t)}),i=t,s=function(e){if(!(l=l.filter(function(t){return 0===K(t,e)})).length)return i=e,1},u=t;u>=0&&!s(u);u-=1);for(var f=c.filter(function(e){return 1!==K(e,n)}),p=n,m=function(e){if(!(f=f.filter(function(t){return 1!==K(t,e)})).length)return p=Math.max(e-1,n),1},h=n;h1})&&v.push(e)},b=i;b<=p;b+=1)if(g(b))continue;return v.map(function(e){var t=S[e],n=d(t.record,e),l=r(n);return o.createElement(ej,{key:e,data:t,rowKey:n,index:e,style:{top:-a+l.top},extra:!0,getHeight:function(t){var o=e+t-1,a=r(n,d(S[o].record,o));return a.bottom-a.top}})})}},function(e,t,n){var r=d(e.record,t);return o.createElement(ej,{data:e,rowKey:r,index:t,style:n.style})}))})),eH=function(e,t){var n=t.ref,r=t.onScroll;return o.createElement(eB,{ref:n,data:e,onScroll:r})},ez=o.forwardRef(function(e,t){var n=e.data,r=e.columns,l=e.scroll,c=e.sticky,i=e.prefixCls,d=void 0===i?eZ:i,s=e.className,u=e.listItemHeight,f=e.components,m=e.onScroll,h=l||{},v=h.x,g=h.y;"number"!=typeof v&&(v=1),"number"!=typeof g&&(g=500);var b=(0,P.zX)(function(e,t){return(0,K.Z)(f,e)||t}),y=(0,P.zX)(m),x=o.useMemo(function(){return{sticky:c,scrollY:g,listItemHeight:u,getComponent:b,onScroll:y}},[c,g,u,b,y]);return o.createElement(eM.Provider,{value:x},o.createElement(eR,(0,p.Z)({},e,{className:Z()(s,"".concat(d,"-virtual")),scroll:(0,C.Z)((0,C.Z)({},l),{},{x:v}),components:(0,C.Z)((0,C.Z)({},f),{},{body:null!=n&&n.length?eH:void 0}),columns:r,internalHooks:a,tailor:!0,ref:t})))});b(ez,void 0);var eA=n(70464),eW=o.createContext(null),e_=o.createContext({}),eF=o.memo(function(e){for(var t=e.prefixCls,n=e.level,r=e.isStart,a=e.isEnd,l="".concat(t,"-indent-unit"),c=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:null;return n.map(function(d,s){for(var u,f=eX(o?o.pos:"0",s),p=eU(d[a],f),m=0;m1&&void 0!==arguments[1]?arguments[1]:{},f=u.initWrapper,p=u.processEntity,m=u.onProcessFinished,h=u.externalGetKey,v=u.childrenPropName,g=u.fieldNames,b=arguments.length>2?arguments[2]:void 0,y={},x={},w={posEntities:y,keyEntities:x};return f&&(w=f(w)||w),t=function(e){var t=e.node,n=e.index,o=e.pos,r=e.key,a=e.parentPos,l=e.level,c={node:t,nodes:e.nodes,index:n,key:r,pos:o,level:l},i=eU(r,o);y[o]=c,x[i]=c,c.parent=y[a],c.parent&&(c.parent.children=c.parent.children||[],c.parent.children.push(c)),p&&p(c,w)},n={externalGetKey:h||b,childrenPropName:v,fieldNames:g},a=(r=("object"===(0,k.Z)(n)?n:{externalGetKey:n})||{}).childrenPropName,l=r.externalGetKey,i=(c=eG(r.fieldNames)).key,d=c.children,s=a||d,l?"string"==typeof l?o=function(e){return e[l]}:"function"==typeof l&&(o=function(e){return l(e)}):o=function(e,t){return eU(e[i],t)},function n(r,a,l,c){var i=r?r[s]:e,d=r?eX(l.pos,a):"0",u=r?[].concat((0,el.Z)(c),[r]):[];if(r){var f=o(r,d);t({node:r,index:a,pos:d,key:f,parentPos:l.node?l.pos:null,level:l.level+1,nodes:u})}i&&i.forEach(function(e,t){n(e,t,{node:r,pos:d,level:l?l.level+1:-1},u)})}(null),m&&m(w),w}function eQ(e,t){var n=t.expandedKeys,o=t.selectedKeys,r=t.loadedKeys,a=t.loadingKeys,l=t.checkedKeys,c=t.halfCheckedKeys,i=t.dragOverNodeKey,d=t.dropPosition,s=t.keyEntities[e];return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==o.indexOf(e),loaded:-1!==r.indexOf(e),loading:-1!==a.indexOf(e),checked:-1!==l.indexOf(e),halfChecked:-1!==c.indexOf(e),pos:String(s?s.pos:""),dragOver:i===e&&0===d,dragOverGapTop:i===e&&-1===d,dragOverGapBottom:i===e&&1===d}}function e0(e){var t=e.data,n=e.expanded,o=e.selected,r=e.checked,a=e.loaded,l=e.loading,c=e.halfChecked,i=e.dragOver,d=e.dragOverGapTop,s=e.dragOverGapBottom,u=e.pos,f=e.active,p=e.eventKey,m=(0,C.Z)((0,C.Z)({},t),{},{expanded:n,selected:o,checked:r,loaded:a,loading:l,halfChecked:c,dragOver:i,dragOverGapTop:d,dragOverGapBottom:s,pos:u,active:f,key:p});return"props"in m||Object.defineProperty(m,"props",{get:function(){return(0,O.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),m}var e1=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],e2="open",e3="close",e4=function(e){var t,n,r,a=e.eventKey,c=e.className,i=e.style,d=e.dragOver,s=e.dragOverGapTop,u=e.dragOverGapBottom,f=e.isLeaf,m=e.isStart,h=e.isEnd,v=e.expanded,g=e.selected,b=e.checked,y=e.halfChecked,x=e.loading,w=e.domRef,k=e.active,S=e.data,N=e.onMouseMove,K=e.selectable,O=(0,j.Z)(e,e1),I=o.useContext(eW),R=o.useContext(e_),P=o.useRef(null),M=o.useState(!1),T=(0,l.Z)(M,2),D=T[0],L=T[1],B=!!(I.disabled||e.disabled||null!==(t=R.nodeDisabled)&&void 0!==t&&t.call(R,S)),H=o.useMemo(function(){return!!I.checkable&&!1!==e.checkable&&I.checkable},[I.checkable,e.checkable]),z=function(t){B||I.onNodeSelect(t,e0(e))},A=function(t){B||!H||e.disableCheckbox||I.onNodeCheck(t,e0(e),!b)},W=o.useMemo(function(){return"boolean"==typeof K?K:I.selectable},[K,I.selectable]),_=function(t){I.onNodeClick(t,e0(e)),W?z(t):A(t)},q=function(t){I.onNodeDoubleClick(t,e0(e))},V=function(t){I.onNodeMouseEnter(t,e0(e))},X=function(t){I.onNodeMouseLeave(t,e0(e))},U=function(t){I.onNodeContextMenu(t,e0(e))},G=o.useMemo(function(){return!!(I.draggable&&(!I.draggable.nodeDraggable||I.draggable.nodeDraggable(S)))},[I.draggable,S]),Y=function(t){x||I.onNodeExpand(t,e0(e))},$=o.useMemo(function(){return!!((I.keyEntities[a]||{}).children||[]).length},[I.keyEntities,a]),J=o.useMemo(function(){return!1!==f&&(f||!I.loadData&&!$||I.loadData&&e.loaded&&!$)},[f,I.loadData,$,e.loaded]);o.useEffect(function(){!x&&("function"!=typeof I.loadData||!v||J||e.loaded||I.onNodeLoad(e0(e)))},[x,I.loadData,I.onNodeLoad,v,J,e]);var Q=o.useMemo(function(){var e;return null!==(e=I.draggable)&&void 0!==e&&e.icon?o.createElement("span",{className:"".concat(I.prefixCls,"-draggable-icon")},I.draggable.icon):null},[I.draggable]),ee=function(t){var n=e.switcherIcon||I.switcherIcon;return"function"==typeof n?n((0,C.Z)((0,C.Z)({},e),{},{isLeaf:t})):n},et=o.useMemo(function(){if(!H)return null;var t="boolean"!=typeof H?H:null;return o.createElement("span",{className:Z()("".concat(I.prefixCls,"-checkbox"),(0,E.Z)((0,E.Z)((0,E.Z)({},"".concat(I.prefixCls,"-checkbox-checked"),b),"".concat(I.prefixCls,"-checkbox-indeterminate"),!b&&y),"".concat(I.prefixCls,"-checkbox-disabled"),B||e.disableCheckbox)),onClick:A,role:"checkbox","aria-checked":y?"mixed":b,"aria-disabled":B||e.disableCheckbox,"aria-label":"Select ".concat("string"==typeof e.title?e.title:"tree node")},t)},[H,b,y,B,e.disableCheckbox,e.title]),en=o.useMemo(function(){return J?null:v?e2:e3},[J,v]),eo=o.useMemo(function(){return o.createElement("span",{className:Z()("".concat(I.prefixCls,"-iconEle"),"".concat(I.prefixCls,"-icon__").concat(en||"docu"),(0,E.Z)({},"".concat(I.prefixCls,"-icon_loading"),x))})},[I.prefixCls,en,x]),er=o.useMemo(function(){var t=!!I.draggable;return!e.disabled&&t&&I.dragOverNodeKey===a?I.dropIndicatorRender({dropPosition:I.dropPosition,dropLevelOffset:I.dropLevelOffset,indent:I.indent,prefixCls:I.prefixCls,direction:I.direction}):null},[I.dropPosition,I.dropLevelOffset,I.indent,I.prefixCls,I.direction,I.draggable,I.dragOverNodeKey,I.dropIndicatorRender]),ea=o.useMemo(function(){var t,n,r=e.title,a=void 0===r?"---":r,l="".concat(I.prefixCls,"-node-content-wrapper");if(I.showIcon){var c=e.icon||I.icon;t=c?o.createElement("span",{className:Z()("".concat(I.prefixCls,"-iconEle"),"".concat(I.prefixCls,"-icon__customize"))},"function"==typeof c?c(e):c):eo}else I.loadData&&x&&(t=eo);return n="function"==typeof a?a(S):I.titleRender?I.titleRender(S):a,o.createElement("span",{ref:P,title:"string"==typeof a?a:"",className:Z()(l,"".concat(l,"-").concat(en||"normal"),(0,E.Z)({},"".concat(I.prefixCls,"-node-selected"),!B&&(g||D))),onMouseEnter:V,onMouseLeave:X,onContextMenu:U,onClick:_,onDoubleClick:q},t,o.createElement("span",{className:"".concat(I.prefixCls,"-title")},n),er)},[I.prefixCls,I.showIcon,e,I.icon,eo,I.titleRender,S,en,V,X,U,_,q]),el=(0,F.Z)(O,{aria:!0,data:!0}),ec=(I.keyEntities[a]||{}).level,ei=h[h.length-1],ed=!B&&G,es=I.draggingNodeKey===a;return o.createElement("div",(0,p.Z)({ref:w,role:"treeitem","aria-expanded":f?void 0:v,className:Z()(c,"".concat(I.prefixCls,"-treenode"),(r={},(0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)(r,"".concat(I.prefixCls,"-treenode-disabled"),B),"".concat(I.prefixCls,"-treenode-switcher-").concat(v?"open":"close"),!f),"".concat(I.prefixCls,"-treenode-checkbox-checked"),b),"".concat(I.prefixCls,"-treenode-checkbox-indeterminate"),y),"".concat(I.prefixCls,"-treenode-selected"),g),"".concat(I.prefixCls,"-treenode-loading"),x),"".concat(I.prefixCls,"-treenode-active"),k),"".concat(I.prefixCls,"-treenode-leaf-last"),ei),"".concat(I.prefixCls,"-treenode-draggable"),G),"dragging",es),(0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)(r,"drop-target",I.dropTargetKey===a),"drop-container",I.dropContainerKey===a),"drag-over",!B&&d),"drag-over-gap-top",!B&&s),"drag-over-gap-bottom",!B&&u),"filter-node",null===(n=I.filterTreeNode)||void 0===n?void 0:n.call(I,e0(e))),"".concat(I.prefixCls,"-treenode-leaf"),J))),style:i,draggable:ed,onDragStart:ed?function(t){t.stopPropagation(),L(!0),I.onNodeDragStart(t,e);try{t.dataTransfer.setData("text/plain","")}catch(e){}}:void 0,onDragEnter:G?function(t){t.preventDefault(),t.stopPropagation(),I.onNodeDragEnter(t,e)}:void 0,onDragOver:G?function(t){t.preventDefault(),t.stopPropagation(),I.onNodeDragOver(t,e)}:void 0,onDragLeave:G?function(t){t.stopPropagation(),I.onNodeDragLeave(t,e)}:void 0,onDrop:G?function(t){t.preventDefault(),t.stopPropagation(),L(!1),I.onNodeDrop(t,e)}:void 0,onDragEnd:G?function(t){t.stopPropagation(),L(!1),I.onNodeDragEnd(t,e)}:void 0,onMouseMove:N},void 0!==K?{"aria-selected":!!K}:void 0,el),o.createElement(eF,{prefixCls:I.prefixCls,level:ec,isStart:m,isEnd:h}),Q,function(){if(J){var e=ee(!0);return!1!==e?o.createElement("span",{className:Z()("".concat(I.prefixCls,"-switcher"),"".concat(I.prefixCls,"-switcher-noop"))},e):null}var t=ee(!1);return!1!==t?o.createElement("span",{onClick:Y,className:Z()("".concat(I.prefixCls,"-switcher"),"".concat(I.prefixCls,"-switcher_").concat(v?e2:e3))},t):null}(),et,ea)};function e8(e,t){if(!e)return[];var n=e.slice(),o=n.indexOf(t);return o>=0&&n.splice(o,1),n}function e6(e,t){var n=(e||[]).slice();return -1===n.indexOf(t)&&n.push(t),n}function e5(e){return e.split("-")}function e7(e,t,n,o,r,a,l,c,i,d){var s,u,f=e.clientX,p=e.clientY,m=e.target.getBoundingClientRect(),h=m.top,v=m.height,g=(("rtl"===d?-1:1)*(((null==r?void 0:r.x)||0)-f)-12)/o,b=i.filter(function(e){var t;return null===(t=c[e])||void 0===t||null===(t=t.children)||void 0===t?void 0:t.length}),y=c[n.eventKey];if(p-1.5?a({dragNode:N,dropNode:K,dropPosition:1})?E=1:O=!1:a({dragNode:N,dropNode:K,dropPosition:0})?E=0:a({dragNode:N,dropNode:K,dropPosition:1})?E=1:O=!1:a({dragNode:N,dropNode:K,dropPosition:1})?E=1:O=!1,{dropPosition:E,dropLevelOffset:S,dropTargetKey:y.key,dropTargetPos:y.pos,dragOverNodeKey:C,dropContainerKey:0===E?null:(null===(u=y.parent)||void 0===u?void 0:u.key)||null,dropAllowed:O}}function e9(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function te(e){var t;if(!e)return null;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==(0,k.Z)(e))return(0,O.ZP)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function tt(e,t){var n=new Set;return(e||[]).forEach(function(e){!function e(o){if(!n.has(o)){var r=t[o];if(r){n.add(o);var a=r.parent;!r.node.disabled&&a&&e(a.key)}}}(e)}),(0,el.Z)(n)}function tn(e,t){var n=new Set;return e.forEach(function(e){t.has(e)||n.add(e)}),n}function to(e){var t=e||{},n=t.disabled,o=t.disableCheckbox,r=t.checkable;return!!(n||o)||!1===r}function tr(e,t,n,o){var r,a=[];r=o||to;var l=new Set(e.filter(function(e){var t=!!n[e];return t||a.push(e),t})),c=new Map,i=0;return Object.keys(n).forEach(function(e){var t=n[e],o=t.level,r=c.get(o);r||(r=new Set,c.set(o,r)),r.add(t),i=Math.max(i,o)}),(0,O.ZP)(!a.length,"Tree missing follow keys: ".concat(a.slice(0,100).map(function(e){return"'".concat(e,"'")}).join(", "))),!0===t?function(e,t,n,o){for(var r=new Set(e),a=new Set,l=0;l<=n;l+=1)(t.get(l)||new Set).forEach(function(e){var t=e.key,n=e.node,a=e.children,l=void 0===a?[]:a;r.has(t)&&!o(n)&&l.filter(function(e){return!o(e.node)}).forEach(function(e){r.add(e.key)})});for(var c=new Set,i=n;i>=0;i-=1)(t.get(i)||new Set).forEach(function(e){var t=e.parent;if(!(o(e.node)||!e.parent||c.has(e.parent.key))){if(o(e.parent.node)){c.add(t.key);return}var n=!0,l=!1;(t.children||[]).filter(function(e){return!o(e.node)}).forEach(function(e){var t=e.key,o=r.has(t);n&&!o&&(n=!1),!l&&(o||a.has(t))&&(l=!0)}),n&&r.add(t.key),l&&a.add(t.key),c.add(t.key)}});return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(tn(a,r))}}(l,c,i,r):function(e,t,n,o,r){for(var a=new Set(e),l=new Set(t),c=0;c<=o;c+=1)(n.get(c)||new Set).forEach(function(e){var t=e.key,n=e.node,o=e.children,c=void 0===o?[]:o;a.has(t)||l.has(t)||r(n)||c.filter(function(e){return!r(e.node)}).forEach(function(e){a.delete(e.key)})});l=new Set;for(var i=new Set,d=o;d>=0;d-=1)(n.get(d)||new Set).forEach(function(e){var t=e.parent;if(!(r(e.node)||!e.parent||i.has(e.parent.key))){if(r(e.parent.node)){i.add(t.key);return}var n=!0,o=!1;(t.children||[]).filter(function(e){return!r(e.node)}).forEach(function(e){var t=e.key,r=a.has(t);n&&!r&&(n=!1),!o&&(r||l.has(t))&&(o=!0)}),n||a.delete(t.key),o&&l.add(t.key),i.add(t.key)}});return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(tn(l,a))}}(l,t.halfCheckedKeys,c,i,r)}e4.isTreeNode=1;var ta=n(50506);let tl=e=>{let[t,n]=(0,o.useState)(null);return[(0,o.useCallback)((o,r,a)=>{let l=null!=t?t:o,c=Math.max(l||0,o),i=r.slice(Math.min(l||0,o),c+1).map(e),d=i.some(e=>!a.has(e)),s=[];return i.forEach(e=>{d?(a.has(e)||s.push(e),a.add(e)):(a.delete(e),s.push(e))}),n(d?c:null),s},[t]),n]};var tc=n(13613),ti=n(4156),td=n(73705),ts=n(29967);let tu={},tf="SELECT_ALL",tp="SELECT_INVERT",tm="SELECT_NONE",th=[],tv=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(t||[]).forEach(t=>{n.push(t),t&&"object"==typeof t&&e in t&&tv(e,t[e],n)}),n};var tg=(e,t)=>{let{preserveSelectedRowKeys:n,selectedRowKeys:r,defaultSelectedRowKeys:a,getCheckboxProps:l,getTitleCheckboxProps:c,onChange:i,onSelect:d,onSelectAll:s,onSelectInvert:u,onSelectNone:f,onSelectMultiple:p,columnWidth:m,type:h,selections:v,fixed:g,renderCell:b,hideSelectAll:y,checkStrictly:x=!0}=t||{},{prefixCls:w,data:k,pageData:C,getRecordByKey:E,getRowKey:S,expandType:N,childrenColumnName:K,locale:O,getPopupContainer:I}=e,R=(0,tc.ln)("Table"),[P,M]=tl(e=>e),[T,D]=(0,ta.Z)(r||a||th,{value:r}),L=o.useRef(new Map),j=(0,o.useCallback)(e=>{if(n){let t=new Map;e.forEach(e=>{let n=E(e);!n&&L.current.has(e)&&(n=L.current.get(e)),t.set(e,n)}),L.current=t}},[E,n]);o.useEffect(()=>{j(T)},[T]);let B=(0,o.useMemo)(()=>tv(K,C),[K,C]),{keyEntities:H}=(0,o.useMemo)(()=>{if(x)return{keyEntities:null};let e=k;if(n){let t=new Set(B.map((e,t)=>S(e,t))),n=Array.from(L.current).reduce((e,n)=>{let[o,r]=n;return t.has(o)?e:e.concat(r)},[]);e=[].concat((0,el.Z)(e),(0,el.Z)(n))}return eJ(e,{externalGetKey:S,childrenPropName:K})},[k,S,x,K,n,B]),z=(0,o.useMemo)(()=>{let e=new Map;return B.forEach((t,n)=>{let o=S(t,n),r=(l?l(t):null)||{};e.set(o,r)}),e},[B,S,l]),A=(0,o.useCallback)(e=>{let t;let n=S(e);return!!(null==(t=z.has(n)?z.get(S(e)):l?l(e):void 0)?void 0:t.disabled)},[z,S]),[W,_]=(0,o.useMemo)(()=>{if(x)return[T||[],[]];let{checkedKeys:e,halfCheckedKeys:t}=tr(T,!0,H,A);return[e||[],t]},[T,x,H,A]),F=(0,o.useMemo)(()=>new Set("radio"===h?W.slice(0,1):W),[W,h]),q=(0,o.useMemo)(()=>"radio"===h?new Set:new Set(_),[_,h]);o.useEffect(()=>{t||D(th)},[!!t]);let V=(0,o.useCallback)((e,t)=>{let o,r;j(e),n?(o=e,r=e.map(e=>L.current.get(e))):(o=[],r=[],e.forEach(e=>{let t=E(e);void 0!==t&&(o.push(e),r.push(t))})),D(o),null==i||i(o,r,{type:t})},[D,E,i,n]),X=(0,o.useCallback)((e,t,n,o)=>{if(d){let r=n.map(e=>E(e));d(E(e),t,r,o)}V(n,"single")},[d,E,V]),U=(0,o.useMemo)(()=>!v||y?null:(!0===v?[tf,tp,tm]:v).map(e=>e===tf?{key:"all",text:O.selectionAll,onSelect(){V(k.map((e,t)=>S(e,t)).filter(e=>{let t=z.get(e);return!(null==t?void 0:t.disabled)||F.has(e)}),"all")}}:e===tp?{key:"invert",text:O.selectInvert,onSelect(){let e=new Set(F);C.forEach((t,n)=>{let o=S(t,n),r=z.get(o);(null==r?void 0:r.disabled)||(e.has(o)?e.delete(o):e.add(o))});let t=Array.from(e);u&&(R.deprecated(!1,"onSelectInvert","onChange"),u(t)),V(t,"invert")}}:e===tm?{key:"none",text:O.selectNone,onSelect(){null==f||f(),V(Array.from(F).filter(e=>{let t=z.get(e);return null==t?void 0:t.disabled}),"none")}}:e).map(e=>Object.assign(Object.assign({},e),{onSelect:function(){for(var t,n=arguments.length,o=Array(n),r=0;r{var n;let r,a,l;if(!t)return e.filter(e=>e!==tu);let i=(0,el.Z)(e),d=new Set(F),u=B.map(S).filter(e=>!z.get(e).disabled),f=u.every(e=>d.has(e)),k=u.some(e=>d.has(e)),C=()=>{let e=[];f?u.forEach(t=>{d.delete(t),e.push(t)}):u.forEach(t=>{d.has(t)||(d.add(t),e.push(t))});let t=Array.from(d);null==s||s(!f,t.map(e=>E(e)),e.map(e=>E(e))),V(t,"all"),M(null)};if("radio"!==h){let e;if(U){let t={getPopupContainer:I,items:U.map((e,t)=>{let{key:n,text:o,onSelect:r}=e;return{key:null!=n?n:t,onClick:()=>{null==r||r(u)},label:o}})};e=o.createElement("div",{className:"".concat(w,"-selection-extra")},o.createElement(td.Z,{menu:t,getPopupContainer:I},o.createElement("span",null,o.createElement(eA.Z,null))))}let t=B.map((e,t)=>{let n=S(e,t),o=z.get(n)||{};return Object.assign({checked:d.has(n)},o)}).filter(e=>{let{disabled:t}=e;return t}),n=!!t.length&&t.length===B.length,l=n&&t.every(e=>{let{checked:t}=e;return t}),i=n&&t.some(e=>{let{checked:t}=e;return t}),s=(null==c?void 0:c())||{},{onChange:p,disabled:m}=s;a=o.createElement(ti.Z,Object.assign({"aria-label":e?"Custom selection":"Select all"},s,{checked:n?l:!!B.length&&f,indeterminate:n?!l&&i:!f&&k,onChange:e=>{C(),null==p||p(e)},disabled:null!=m?m:0===B.length||n,skipGroup:!0})),r=!y&&o.createElement("div",{className:"".concat(w,"-selection")},a,e)}if(l="radio"===h?(e,t,n)=>{let r=S(t,n),a=d.has(r),l=z.get(r);return{node:o.createElement(ts.ZP,Object.assign({},l,{checked:a,onClick:e=>{var t;e.stopPropagation(),null===(t=null==l?void 0:l.onClick)||void 0===t||t.call(l,e)},onChange:e=>{var t;d.has(r)||X(r,!0,[r],e.nativeEvent),null===(t=null==l?void 0:l.onChange)||void 0===t||t.call(l,e)}})),checked:a}}:(e,t,n)=>{var r;let a;let l=S(t,n),c=d.has(l),i=q.has(l),s=z.get(l);return a="nest"===N?i:null!==(r=null==s?void 0:s.indeterminate)&&void 0!==r?r:i,{node:o.createElement(ti.Z,Object.assign({},s,{indeterminate:a,checked:c,skipGroup:!0,onClick:e=>{var t;e.stopPropagation(),null===(t=null==s?void 0:s.onClick)||void 0===t||t.call(s,e)},onChange:e=>{var t;let{nativeEvent:n}=e,{shiftKey:o}=n,r=u.indexOf(l),a=W.some(e=>u.includes(e));if(o&&x&&a){let e=P(r,u,d),t=Array.from(d);null==p||p(!c,t.map(e=>E(e)),e.map(e=>E(e))),V(t,"multiple")}else if(x){let e=c?e8(W,l):e6(W,l);X(l,!c,e,n)}else{let{checkedKeys:e,halfCheckedKeys:t}=tr([].concat((0,el.Z)(W),[l]),!0,H,A),o=e;if(c){let n=new Set(e);n.delete(l),o=tr(Array.from(n),{checked:!1,halfCheckedKeys:t},H,A).checkedKeys}X(l,!c,o,n)}c?M(null):M(r),null===(t=null==s?void 0:s.onChange)||void 0===t||t.call(s,e)}})),checked:c}},!i.includes(tu)){if(0===i.findIndex(e=>{var t;return(null===(t=e[eo])||void 0===t?void 0:t.columnType)==="EXPAND_COLUMN"})){let[e,...t]=i;i=[e,tu].concat((0,el.Z)(t))}else i=[tu].concat((0,el.Z)(i))}let K=i.indexOf(tu),O=(i=i.filter((e,t)=>e!==tu||t===K))[K-1],R=i[K+1],T=g;void 0===T&&((null==R?void 0:R.fixed)!==void 0?T=R.fixed:(null==O?void 0:O.fixed)!==void 0&&(T=O.fixed)),T&&O&&(null===(n=O[eo])||void 0===n?void 0:n.columnType)==="EXPAND_COLUMN"&&void 0===O.fixed&&(O.fixed=T);let D=Z()("".concat(w,"-selection-col"),{["".concat(w,"-selection-col-with-dropdown")]:v&&"checkbox"===h}),L={fixed:T,width:m,className:"".concat(w,"-selection-column"),title:(null==t?void 0:t.columnTitle)?"function"==typeof t.columnTitle?t.columnTitle(a):t.columnTitle:r,render:(e,t,n)=>{let{node:o,checked:r}=l(e,t,n);return b?b(r,t,n,o):o},onCell:t.onCell,align:t.align,[eo]:{className:D}};return i.map(e=>e===tu?L:e)},[S,B,t,W,F,q,m,U,N,z,p,X,A]),F]};let tb=(e,t)=>(0,o.useImperativeHandle)(e,()=>{let e=t(),{nativeElement:n}=e;return"undefined"!=typeof Proxy?new Proxy(n,{get:(t,n)=>e[n]?e[n]:Reflect.get(t,n)}):(n._antProxy=n._antProxy||{},Object.keys(e).forEach(t=>{if(!(t in n._antProxy)){let o=n[t];n._antProxy[t]=o,n[t]=e[t]}}),n)});function ty(e){return null!=e&&e===e.window}var tx=e=>{var t,n;if("undefined"==typeof window)return 0;let o=0;return ty(e)?o=e.pageYOffset:e instanceof Document?o=e.documentElement.scrollTop:e instanceof HTMLElement?o=e.scrollTop:e&&(o=e.scrollTop),e&&!ty(e)&&"number"!=typeof o&&(o=null===(n=(null!==(t=e.ownerDocument)&&void 0!==t?t:e).documentElement)||void 0===n?void 0:n.scrollTop),o},tw=n(18310),tk=n(71744),tC=n(91086),tE=n(64024),tS=n(33759),tZ=n(28617),tN=n(37381),tK=n(40049),tO=n(10353),tI=n(84951);let tR=(e,t)=>"key"in e&&void 0!==e.key&&null!==e.key?e.key:e.dataIndex?Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex:t;function tP(e,t){return t?"".concat(t,"-").concat(e):"".concat(e)}let tM=(e,t)=>"function"==typeof e?e(t):e,tT=(e,t)=>{let n=tM(e,t);return"[object Object]"===Object.prototype.toString.call(n)?"":n};var tD={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},tL=n(55015),tj=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:tD}))}),tB=n(53253),tH=n(51646);let tz=e=>{let t=o.useRef(e),[,n]=(0,tH.N)();return[()=>t.current,e=>{t.current=e,n()}]};var tA=n(5545),tW=n(85180),t_=n(60985),tF=n(88208),tq=n(76405),tV=n(25049),tX=n(63496),tU=n(41690),tG=n(15900),tY=n(95814);function t$(e){if(null==e)throw TypeError("Cannot destructure "+e)}var tJ=n(66632),tQ=function(e,t){var n=o.useState(!1),r=(0,l.Z)(n,2),a=r[0],c=r[1];(0,i.Z)(function(){if(a)return e(),function(){t()}},[a]),(0,i.Z)(function(){return c(!0),function(){c(!1)}},[])},t0=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],t1=o.forwardRef(function(e,t){var n=e.className,r=e.style,a=e.motion,c=e.motionNodes,d=e.motionType,s=e.onMotionStart,u=e.onMotionEnd,f=e.active,m=e.treeNodeRequiredProps,h=(0,j.Z)(e,t0),v=o.useState(!0),g=(0,l.Z)(v,2),b=g[0],y=g[1],x=o.useContext(eW).prefixCls,w=c&&"hide"!==d;(0,i.Z)(function(){c&&w!==b&&y(w)},[c]);var k=o.useRef(!1),C=function(){c&&!k.current&&(k.current=!0,u())};return(tQ(function(){c&&s()},C),c)?o.createElement(tJ.ZP,(0,p.Z)({ref:t,visible:b},a,{motionAppear:"show"===d,onVisibleChanged:function(e){w===e&&C()}}),function(e,t){var n=e.className,r=e.style;return o.createElement("div",{ref:t,className:Z()("".concat(x,"-treenode-motion"),n),style:r},c.map(function(e){var t=Object.assign({},(t$(e.data),e.data)),n=e.title,r=e.key,a=e.isStart,l=e.isEnd;delete t.children;var c=eQ(r,m);return o.createElement(e4,(0,p.Z)({},t,c,{title:n,active:f,data:e.data,key:r,isStart:a,isEnd:l}))}))}):o.createElement(e4,(0,p.Z)({domRef:t,className:n,style:r},h,{active:f}))});function t2(e,t,n){var o=e.findIndex(function(e){return e.key===n}),r=e[o+1],a=t.findIndex(function(e){return e.key===n});if(r){var l=t.findIndex(function(e){return e.key===r.key});return t.slice(a+1,l)}return t.slice(a+1)}var t3=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],t4={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},t8=function(){},t6="RC_TREE_MOTION_".concat(Math.random()),t5={key:t6},t7={key:t6,level:0,index:0,pos:"0",node:t5,nodes:[t5]},t9={parent:null,children:[],pos:t7.pos,data:t5,title:null,key:t6,isStart:[],isEnd:[]};function ne(e,t,n,o){return!1!==t&&n?e.slice(0,Math.ceil(n/o)+1):e}function nt(e){return eU(e.key,e.pos)}var nn=o.forwardRef(function(e,t){var n=e.prefixCls,r=e.data,a=(e.selectable,e.checkable,e.expandedKeys),c=e.selectedKeys,d=e.checkedKeys,s=e.loadedKeys,u=e.loadingKeys,f=e.halfCheckedKeys,m=e.keyEntities,h=e.disabled,v=e.dragging,g=e.dragOverNodeKey,b=e.dropPosition,y=e.motion,x=e.height,w=e.itemHeight,k=e.virtual,C=e.scrollWidth,E=e.focusable,S=e.activeItem,Z=e.focused,N=e.tabIndex,K=e.onKeyDown,O=e.onFocus,I=e.onBlur,R=e.onActiveChange,P=e.onListChangeStart,M=e.onListChangeEnd,T=(0,j.Z)(e,t3),D=o.useRef(null),L=o.useRef(null);o.useImperativeHandle(t,function(){return{scrollTo:function(e){D.current.scrollTo(e)},getIndentWidth:function(){return L.current.offsetWidth}}});var B=o.useState(a),H=(0,l.Z)(B,2),z=H[0],A=H[1],W=o.useState(r),_=(0,l.Z)(W,2),F=_[0],q=_[1],V=o.useState(r),X=(0,l.Z)(V,2),U=X[0],G=X[1],Y=o.useState([]),$=(0,l.Z)(Y,2),J=$[0],Q=$[1],ee=o.useState(null),et=(0,l.Z)(ee,2),en=et[0],eo=et[1],er=o.useRef(r);function ea(){var e=er.current;q(e),G(e),Q([]),eo(null),M()}er.current=r,(0,i.Z)(function(){A(a);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,o=t.length;if(1!==Math.abs(n-o))return{add:!1,key:null};function r(e,t){var n=new Map;e.forEach(function(e){n.set(e,!0)});var o=t.filter(function(e){return!n.has(e)});return 1===o.length?o[0]:null}return n ").concat(t);return t}(S)),o.createElement("div",null,o.createElement("input",{style:t4,disabled:!1===E||h,tabIndex:!1!==E?N:null,onKeyDown:K,onFocus:O,onBlur:I,value:"",onChange:t8,"aria-label":"for screen reader"})),o.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},o.createElement("div",{className:"".concat(n,"-indent")},o.createElement("div",{ref:L,className:"".concat(n,"-indent-unit")}))),o.createElement(eP.Z,(0,p.Z)({},T,{data:el,itemKey:nt,height:x,fullHeight:!1,virtual:k,itemHeight:w,scrollWidth:C,prefixCls:"".concat(n,"-list"),ref:D,role:"tree",onVisibleChange:function(e){e.every(function(e){return nt(e)!==t6})&&ea()}}),function(e){var t=e.pos,n=Object.assign({},(t$(e.data),e.data)),r=e.title,a=e.key,l=e.isStart,c=e.isEnd,i=eU(a,t);delete n.key,delete n.children;var d=eQ(i,ec);return o.createElement(t1,(0,p.Z)({},n,d,{title:r,active:!!S&&a===S.key,pos:t,data:e.data,isStart:l,isEnd:c,motion:y,motionNodes:a===t6?J:null,motionType:en,onMotionStart:P,onMotionEnd:ea,treeNodeRequiredProps:ec,onMouseMove:function(){R(null)}}))}))}),no=function(e){(0,tU.Z)(n,e);var t=(0,tG.Z)(n);function n(){var e;(0,tq.Z)(this,n);for(var r=arguments.length,a=Array(r),l=0;l0&&void 0!==arguments[0]?arguments[0]:[];t.forEach(function(t){var n=t.key,r=t.children;o.push(n),e(r)})}(l[i].children),o),indent:e.listRef.current.getIndentWidth()}),e.setExpandedKeys(d),window.addEventListener("dragend",e.onWindowDragEnd),null==c||c({event:t,node:e0(n)})}),(0,E.Z)((0,tX.Z)(e),"onNodeDragEnter",function(t,n){var o=e.state,r=o.expandedKeys,a=o.keyEntities,l=o.dragChildrenKeys,c=o.flattenNodes,i=o.indent,d=e.props,s=d.onDragEnter,u=d.onExpand,f=d.allowDrop,p=d.direction,m=n.pos,h=n.eventKey;if(e.currentMouseOverDroppableNodeKey!==h&&(e.currentMouseOverDroppableNodeKey=h),!e.dragNodeProps){e.resetDragState();return}var v=e7(t,e.dragNodeProps,n,i,e.dragStartMousePosition,f,c,a,r,p),g=v.dropPosition,b=v.dropLevelOffset,y=v.dropTargetKey,x=v.dropContainerKey,w=v.dropTargetPos,k=v.dropAllowed,C=v.dragOverNodeKey;if(l.includes(y)||!k||(e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach(function(t){clearTimeout(e.delayedDragEnterLogic[t])}),e.dragNodeProps.eventKey!==n.eventKey&&(t.persist(),e.delayedDragEnterLogic[m]=window.setTimeout(function(){if(null!==e.state.draggingNodeKey){var o=(0,el.Z)(r),l=a[n.eventKey];l&&(l.children||[]).length&&(o=e6(r,n.eventKey)),e.props.hasOwnProperty("expandedKeys")||e.setExpandedKeys(o),null==u||u(o,{node:e0(n),expanded:!0,nativeEvent:t.nativeEvent})}},800)),e.dragNodeProps.eventKey===y&&0===b)){e.resetDragState();return}e.setState({dragOverNodeKey:C,dropPosition:g,dropLevelOffset:b,dropTargetKey:y,dropContainerKey:x,dropTargetPos:w,dropAllowed:k}),null==s||s({event:t,node:e0(n),expandedKeys:r})}),(0,E.Z)((0,tX.Z)(e),"onNodeDragOver",function(t,n){var o=e.state,r=o.dragChildrenKeys,a=o.flattenNodes,l=o.keyEntities,c=o.expandedKeys,i=o.indent,d=e.props,s=d.onDragOver,u=d.allowDrop,f=d.direction;if(e.dragNodeProps){var p=e7(t,e.dragNodeProps,n,i,e.dragStartMousePosition,u,a,l,c,f),m=p.dropPosition,h=p.dropLevelOffset,v=p.dropTargetKey,g=p.dropContainerKey,b=p.dropTargetPos,y=p.dropAllowed,x=p.dragOverNodeKey;!r.includes(v)&&y&&(e.dragNodeProps.eventKey===v&&0===h?null===e.state.dropPosition&&null===e.state.dropLevelOffset&&null===e.state.dropTargetKey&&null===e.state.dropContainerKey&&null===e.state.dropTargetPos&&!1===e.state.dropAllowed&&null===e.state.dragOverNodeKey||e.resetDragState():m===e.state.dropPosition&&h===e.state.dropLevelOffset&&v===e.state.dropTargetKey&&g===e.state.dropContainerKey&&b===e.state.dropTargetPos&&y===e.state.dropAllowed&&x===e.state.dragOverNodeKey||e.setState({dropPosition:m,dropLevelOffset:h,dropTargetKey:v,dropContainerKey:g,dropTargetPos:b,dropAllowed:y,dragOverNodeKey:x}),null==s||s({event:t,node:e0(n)}))}}),(0,E.Z)((0,tX.Z)(e),"onNodeDragLeave",function(t,n){e.currentMouseOverDroppableNodeKey!==n.eventKey||t.currentTarget.contains(t.relatedTarget)||(e.resetDragState(),e.currentMouseOverDroppableNodeKey=null);var o=e.props.onDragLeave;null==o||o({event:t,node:e0(n)})}),(0,E.Z)((0,tX.Z)(e),"onWindowDragEnd",function(t){e.onNodeDragEnd(t,null,!0),window.removeEventListener("dragend",e.onWindowDragEnd)}),(0,E.Z)((0,tX.Z)(e),"onNodeDragEnd",function(t,n){var o=e.props.onDragEnd;e.setState({dragOverNodeKey:null}),e.cleanDragState(),null==o||o({event:t,node:e0(n)}),e.dragNodeProps=null,window.removeEventListener("dragend",e.onWindowDragEnd)}),(0,E.Z)((0,tX.Z)(e),"onNodeDrop",function(t,n){var o,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.state,l=a.dragChildrenKeys,c=a.dropPosition,i=a.dropTargetKey,d=a.dropTargetPos;if(a.dropAllowed){var s=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==i){var u=(0,C.Z)((0,C.Z)({},eQ(i,e.getTreeNodeRequiredProps())),{},{active:(null===(o=e.getActiveItem())||void 0===o?void 0:o.key)===i,data:e.state.keyEntities[i].node}),f=l.includes(i);(0,O.ZP)(!f,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var p=e5(d),m={event:t,node:e0(u),dragNode:e.dragNodeProps?e0(e.dragNodeProps):null,dragNodesKeys:[e.dragNodeProps.eventKey].concat(l),dropToGap:0!==c,dropPosition:c+Number(p[p.length-1])};r||null==s||s(m),e.dragNodeProps=null}}}),(0,E.Z)((0,tX.Z)(e),"cleanDragState",function(){null!==e.state.draggingNodeKey&&e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null,e.currentMouseOverDroppableNodeKey=null}),(0,E.Z)((0,tX.Z)(e),"triggerExpandActionExpand",function(t,n){var o=e.state,r=o.expandedKeys,a=o.flattenNodes,l=n.expanded,c=n.key;if(!n.isLeaf&&!t.shiftKey&&!t.metaKey&&!t.ctrlKey){var i=a.filter(function(e){return e.key===c})[0],d=e0((0,C.Z)((0,C.Z)({},eQ(c,e.getTreeNodeRequiredProps())),{},{data:i.data}));e.setExpandedKeys(l?e8(r,c):e6(r,c)),e.onNodeExpand(t,d)}}),(0,E.Z)((0,tX.Z)(e),"onNodeClick",function(t,n){var o=e.props,r=o.onClick;"click"===o.expandAction&&e.triggerExpandActionExpand(t,n),null==r||r(t,n)}),(0,E.Z)((0,tX.Z)(e),"onNodeDoubleClick",function(t,n){var o=e.props,r=o.onDoubleClick;"doubleClick"===o.expandAction&&e.triggerExpandActionExpand(t,n),null==r||r(t,n)}),(0,E.Z)((0,tX.Z)(e),"onNodeSelect",function(t,n){var o=e.state.selectedKeys,r=e.state,a=r.keyEntities,l=r.fieldNames,c=e.props,i=c.onSelect,d=c.multiple,s=n.selected,u=n[l.key],f=!s,p=(o=f?d?e6(o,u):[u]:e8(o,u)).map(function(e){var t=a[e];return t?t.node:null}).filter(Boolean);e.setUncontrolledState({selectedKeys:o}),null==i||i(o,{event:"select",selected:f,node:n,selectedNodes:p,nativeEvent:t.nativeEvent})}),(0,E.Z)((0,tX.Z)(e),"onNodeCheck",function(t,n,o){var r,a=e.state,l=a.keyEntities,c=a.checkedKeys,i=a.halfCheckedKeys,d=e.props,s=d.checkStrictly,u=d.onCheck,f=n.key,p={event:"check",node:n,checked:o,nativeEvent:t.nativeEvent};if(s){var m=o?e6(c,f):e8(c,f);r={checked:m,halfChecked:e8(i,f)},p.checkedNodes=m.map(function(e){return l[e]}).filter(Boolean).map(function(e){return e.node}),e.setUncontrolledState({checkedKeys:m})}else{var h=tr([].concat((0,el.Z)(c),[f]),!0,l),v=h.checkedKeys,g=h.halfCheckedKeys;if(!o){var b=new Set(v);b.delete(f);var y=tr(Array.from(b),{checked:!1,halfCheckedKeys:g},l);v=y.checkedKeys,g=y.halfCheckedKeys}r=v,p.checkedNodes=[],p.checkedNodesPositions=[],p.halfCheckedKeys=g,v.forEach(function(e){var t=l[e];if(t){var n=t.node,o=t.pos;p.checkedNodes.push(n),p.checkedNodesPositions.push({node:n,pos:o})}}),e.setUncontrolledState({checkedKeys:v},!1,{halfCheckedKeys:g})}null==u||u(r,p)}),(0,E.Z)((0,tX.Z)(e),"onNodeLoad",function(t){var n,o=t.key,r=e.state.keyEntities[o];if(null==r||null===(n=r.children)||void 0===n||!n.length){var a=new Promise(function(n,r){e.setState(function(a){var l=a.loadedKeys,c=a.loadingKeys,i=void 0===c?[]:c,d=e.props,s=d.loadData,u=d.onLoad;return!s||(void 0===l?[]:l).includes(o)||i.includes(o)?null:(s(t).then(function(){var r=e6(e.state.loadedKeys,o);null==u||u(r,{event:"load",node:t}),e.setUncontrolledState({loadedKeys:r}),e.setState(function(e){return{loadingKeys:e8(e.loadingKeys,o)}}),n()}).catch(function(t){if(e.setState(function(e){return{loadingKeys:e8(e.loadingKeys,o)}}),e.loadingRetryTimes[o]=(e.loadingRetryTimes[o]||0)+1,e.loadingRetryTimes[o]>=10){var a=e.state.loadedKeys;(0,O.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),e.setUncontrolledState({loadedKeys:e6(a,o)}),n()}r(t)}),{loadingKeys:e6(i,o)})})});return a.catch(function(){}),a}}),(0,E.Z)((0,tX.Z)(e),"onNodeMouseEnter",function(t,n){var o=e.props.onMouseEnter;null==o||o({event:t,node:n})}),(0,E.Z)((0,tX.Z)(e),"onNodeMouseLeave",function(t,n){var o=e.props.onMouseLeave;null==o||o({event:t,node:n})}),(0,E.Z)((0,tX.Z)(e),"onNodeContextMenu",function(t,n){var o=e.props.onRightClick;o&&(t.preventDefault(),o({event:t,node:n}))}),(0,E.Z)((0,tX.Z)(e),"onFocus",function(){var t=e.props.onFocus;e.setState({focused:!0});for(var n=arguments.length,o=Array(n),r=0;r1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var r=!1,a=!0,l={};Object.keys(t).forEach(function(n){if(e.props.hasOwnProperty(n)){a=!1;return}r=!0,l[n]=t[n]}),r&&(!n||a)&&e.setState((0,C.Z)((0,C.Z)({},l),o))}}),(0,E.Z)((0,tX.Z)(e),"scrollTo",function(t){e.listRef.current.scrollTo(t)}),e}return(0,tV.Z)(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var e=this.props,t=e.activeKey,n=e.itemScrollOffset;void 0!==t&&t!==this.state.activeKey&&(this.setState({activeKey:t}),null!==t&&this.scrollTo({key:t,offset:void 0===n?0:n}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var e,t=this.state,n=t.focused,r=t.flattenNodes,a=t.keyEntities,l=t.draggingNodeKey,c=t.activeKey,i=t.dropLevelOffset,d=t.dropContainerKey,s=t.dropTargetKey,u=t.dropPosition,f=t.dragOverNodeKey,m=t.indent,h=this.props,v=h.prefixCls,g=h.className,b=h.style,y=h.showLine,x=h.focusable,w=h.tabIndex,C=h.selectable,S=h.showIcon,N=h.icon,K=h.switcherIcon,O=h.draggable,I=h.checkable,R=h.checkStrictly,P=h.disabled,M=h.motion,T=h.loadData,D=h.filterTreeNode,L=h.height,j=h.itemHeight,B=h.scrollWidth,H=h.virtual,z=h.titleRender,A=h.dropIndicatorRender,W=h.onContextMenu,_=h.onScroll,q=h.direction,V=h.rootClassName,X=h.rootStyle,U=(0,F.Z)(this.props,{aria:!0,data:!0});O&&(e="object"===(0,k.Z)(O)?O:"function"==typeof O?{nodeDraggable:O}:{});var G={prefixCls:v,selectable:C,showIcon:S,icon:N,switcherIcon:K,draggable:e,draggingNodeKey:l,checkable:I,checkStrictly:R,disabled:P,keyEntities:a,dropLevelOffset:i,dropContainerKey:d,dropTargetKey:s,dropPosition:u,dragOverNodeKey:f,indent:m,direction:q,dropIndicatorRender:A,loadData:T,filterTreeNode:D,titleRender:z,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return o.createElement(eW.Provider,{value:G},o.createElement("div",{className:Z()(v,g,V,(0,E.Z)((0,E.Z)((0,E.Z)({},"".concat(v,"-show-line"),y),"".concat(v,"-focused"),n),"".concat(v,"-active-focused"),null!==c)),style:X},o.createElement(nn,(0,p.Z)({ref:this.listRef,prefixCls:v,style:b,data:r,disabled:P,selectable:C,checkable:!!I,motion:M,dragging:null!==l,height:L,itemHeight:j,virtual:H,focusable:x,focused:n,tabIndex:void 0===w?0:w,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:W,onScroll:_,scrollWidth:B},this.getTreeNodeRequiredProps(),U))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,o,r=t.prevProps,a={prevProps:e};function l(t){return!r&&e.hasOwnProperty(t)||r&&r[t]!==e[t]}var c=t.fieldNames;if(l("fieldNames")&&(c=eG(e.fieldNames),a.fieldNames=c),l("treeData")?n=e.treeData:l("children")&&((0,O.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=eY(e.children)),n){a.treeData=n;var i=eJ(n,{fieldNames:c});a.keyEntities=(0,C.Z)((0,E.Z)({},t6,t7),i.keyEntities)}var d=a.keyEntities||t.keyEntities;if(l("expandedKeys")||r&&l("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!r&&e.defaultExpandParent?tt(e.expandedKeys,d):e.expandedKeys;else if(!r&&e.defaultExpandAll){var s=(0,C.Z)({},d);delete s[t6];var u=[];Object.keys(s).forEach(function(e){var t=s[e];t.children&&t.children.length&&u.push(t.key)}),a.expandedKeys=u}else!r&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?tt(e.defaultExpandedKeys,d):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,n||a.expandedKeys){var f=e$(n||t.treeData,a.expandedKeys||t.expandedKeys,c);a.flattenNodes=f}if(e.selectable&&(l("selectedKeys")?a.selectedKeys=e9(e.selectedKeys,e):!r&&e.defaultSelectedKeys&&(a.selectedKeys=e9(e.defaultSelectedKeys,e))),e.checkable&&(l("checkedKeys")?o=te(e.checkedKeys)||{}:!r&&e.defaultCheckedKeys?o=te(e.defaultCheckedKeys)||{}:n&&(o=te(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),o)){var p=o,m=p.checkedKeys,h=void 0===m?[]:m,v=p.halfCheckedKeys,g=void 0===v?[]:v;if(!e.checkStrictly){var b=tr(h,!0,d);h=b.checkedKeys,g=b.halfCheckedKeys}a.checkedKeys=h,a.halfCheckedKeys=g}return l("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),n}(o.Component);(0,E.Z)(no,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var t=e.dropPosition,n=e.dropLevelOffset,r=e.indent,a={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case -1:a.top=0,a.left=-n*r;break;case 1:a.bottom=0,a.left=-n*r;break;case 0:a.bottom=0,a.left=r}return o.createElement("div",{style:a})},allowDrop:function(){return!0},expandAction:!1}),(0,E.Z)(no,"TreeNode",e4);var nr={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 42h216v494z"}}]},name:"file",theme:"outlined"},na=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nr}))}),nl={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},nc=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nl}))}),ni={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},nd=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:ni}))}),ns={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},nu=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:ns}))}),nf=n(68710),np=n(86586),nm=n(93463),nh=n(23159),nv=n(12918),ng=n(63074),nb=n(71140),ny=n(99320);let nx=e=>{let{treeCls:t,treeNodeCls:n,directoryNodeSelectedBg:o,directoryNodeSelectedColor:r,motionDurationMid:a,borderRadius:l,controlItemBgHover:c}=e;return{["".concat(t).concat(t,"-directory ").concat(n)]:{["".concat(t,"-node-content-wrapper")]:{position:"static",["&:has(".concat(t,"-drop-indicator)")]:{position:"relative"},["> *:not(".concat(t,"-drop-indicator)")]:{position:"relative"},"&:hover":{background:"transparent"},"&:before":{position:"absolute",inset:0,transition:"background-color ".concat(a),content:'""',borderRadius:l},"&:hover:before":{background:c}},["".concat(t,"-switcher, ").concat(t,"-checkbox, ").concat(t,"-draggable-icon")]:{zIndex:1},"&-selected":{background:o,borderRadius:l,["".concat(t,"-switcher, ").concat(t,"-draggable-icon")]:{color:r},["".concat(t,"-node-content-wrapper")]:{color:r,background:"transparent","&, &:hover":{color:r},"&:before, &:hover:before":{background:o}}}}}},nw=new nm.E4("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),nk=(e,t)=>({[".".concat(e,"-switcher-icon")]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:"transform ".concat(t.motionDurationSlow)}}}),nC=(e,t)=>({[".".concat(e,"-drop-indicator")]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:"".concat((0,nm.bf)(t.lineWidthBold)," solid ").concat(t.colorPrimary),borderRadius:"50%",content:'""'}}}),nE=(e,t)=>{let{treeCls:n,treeNodeCls:o,treeNodePadding:r,titleHeight:a,indentSize:l,nodeSelectedBg:c,nodeHoverBg:i,colorTextQuaternary:d,controlItemBgActiveDisabled:s}=t;return{[n]:Object.assign(Object.assign({},(0,nv.Wf)(t)),{"--rc-virtual-list-scrollbar-bg":t.colorSplit,background:t.colorBgContainer,borderRadius:t.borderRadius,transition:"background-color ".concat(t.motionDurationSlow),"&-rtl":{direction:"rtl"},["&".concat(n,"-rtl ").concat(n,"-switcher_close ").concat(n,"-switcher-icon svg")]:{transform:"rotate(90deg)"},["&-focused:not(:hover):not(".concat(n,"-active-focused)")]:(0,nv.oN)(t),["".concat(n,"-list-holder-inner")]:{alignItems:"flex-start"},["&".concat(n,"-block-node")]:{["".concat(n,"-list-holder-inner")]:{alignItems:"stretch",["".concat(n,"-node-content-wrapper")]:{flex:"auto"},["".concat(o,".dragging:after")]:{position:"absolute",inset:0,border:"1px solid ".concat(t.colorPrimary),opacity:0,animationName:nw,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none",borderRadius:t.borderRadius}}},[o]:{display:"flex",alignItems:"flex-start",marginBottom:r,lineHeight:(0,nm.bf)(a),position:"relative","&:before":{content:'""',position:"absolute",zIndex:1,insetInlineStart:0,width:"100%",top:"100%",height:r},["&-disabled ".concat(n,"-node-content-wrapper")]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}},["".concat(n,"-checkbox-disabled + ").concat(n,"-node-selected,&").concat(o,"-disabled").concat(o,"-selected ").concat(n,"-node-content-wrapper")]:{backgroundColor:s},["".concat(n,"-checkbox-disabled")]:{pointerEvents:"unset"},["&:not(".concat(o,"-disabled)")]:{["".concat(n,"-node-content-wrapper")]:{"&:hover":{color:t.nodeHoverColor}}},["&-active ".concat(n,"-node-content-wrapper")]:{background:t.controlItemBgHover},["&:not(".concat(o,"-disabled).filter-node ").concat(n,"-title")]:{color:t.colorPrimary,fontWeight:t.fontWeightStrong},"&-draggable":{cursor:"grab",["".concat(n,"-draggable-icon")]:{flexShrink:0,width:a,textAlign:"center",visibility:"visible",color:d},["&".concat(o,"-disabled ").concat(n,"-draggable-icon")]:{visibility:"hidden"}}},["".concat(n,"-indent")]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:l}},["".concat(n,"-draggable-icon")]:{visibility:"hidden"},["".concat(n,"-switcher, ").concat(n,"-checkbox")]:{marginInlineEnd:t.calc(t.calc(a).sub(t.controlInteractiveSize)).div(2).equal()},["".concat(n,"-switcher")]:Object.assign(Object.assign({},nk(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:a,textAlign:"center",cursor:"pointer",userSelect:"none",transition:"all ".concat(t.motionDurationSlow),"&-noop":{cursor:"unset"},"&:before":{pointerEvents:"none",content:'""',width:a,height:a,position:"absolute",left:{_skip_check_:!0,value:0},top:0,borderRadius:t.borderRadius,transition:"all ".concat(t.motionDurationSlow)},["&:not(".concat(n,"-switcher-noop):hover:before")]:{backgroundColor:t.colorBgTextHover},["&_close ".concat(n,"-switcher-icon svg")]:{transform:"rotate(-90deg)"},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(r).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(a).div(2).equal()).mul(.8).equal(),height:t.calc(a).div(2).equal(),borderBottom:"1px solid ".concat(t.colorBorder),content:'""'}}}),["".concat(n,"-node-content-wrapper")]:Object.assign(Object.assign({position:"relative",minHeight:a,paddingBlock:0,paddingInline:t.paddingXS,background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:"all ".concat(t.motionDurationMid,", border 0s, line-height 0s, box-shadow 0s")},nC(e,t)),{"&:hover":{backgroundColor:i},["&".concat(n,"-node-selected")]:{color:t.nodeSelectedColor,backgroundColor:c},["".concat(n,"-iconEle")]:{display:"inline-block",width:a,height:a,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}}),["".concat(n,"-unselectable ").concat(n,"-node-content-wrapper:hover")]:{backgroundColor:"transparent"},["".concat(o,".drop-container > [draggable]")]:{boxShadow:"0 0 0 2px ".concat(t.colorPrimary)},"&-show-line":{["".concat(n,"-indent-unit")]:{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(r).mul(-1).equal(),borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&-end:before":{display:"none"}},["".concat(n,"-switcher")]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},["".concat(o,"-leaf-last ").concat(n,"-switcher-leaf-line:before")]:{top:"auto !important",bottom:"auto !important",height:"".concat((0,nm.bf)(t.calc(a).div(2).equal())," !important")}})}},nS=function(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],o=".".concat(e),r=t.calc(t.paddingXS).div(2).equal(),a=(0,nb.IX)(t,{treeCls:o,treeNodeCls:"".concat(o,"-treenode"),treeNodePadding:r});return[nE(e,a),n&&nx(a)].filter(Boolean)},nZ=e=>{let{controlHeightSM:t,controlItemBgHover:n,controlItemBgActive:o}=e;return{titleHeight:t,indentSize:t,nodeHoverBg:n,nodeHoverColor:e.colorText,nodeSelectedBg:o,nodeSelectedColor:e.colorText}};var nN=(0,ny.I$)("Tree",(e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:(0,nh.C2)("".concat(n,"-checkbox"),e)},nS(n,e),(0,ng.Z)(e)]},e=>{let{colorTextLightSolid:t,colorPrimary:n}=e;return Object.assign(Object.assign({},nZ(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:n})}),nK=function(e){let{dropPosition:t,dropLevelOffset:n,prefixCls:r,indent:a,direction:l="ltr"}=e,c="ltr"===l?"left":"right",i={[c]:-n*a+4,["ltr"===l?"right":"left"]:0};switch(t){case -1:i.top=-3;break;case 1:i.bottom=-3;break;default:i.bottom=-3,i[c]=a+4}return o.createElement("div",{style:i,className:"".concat(r,"-drop-indicator")})},nO={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},nI=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nO}))}),nR=n(61935),nP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 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:"minus-square",theme:"outlined"},nM=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nP}))}),nT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 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-8H544V328c0-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 8z"}},{tag:"path",attrs:{d:"M880 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:"plus-square",theme:"outlined"},nD=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nT}))}),nL=n(19722),nj=e=>{var t,n;let r;let{prefixCls:a,switcherIcon:l,treeNodeProps:c,showLine:i,switcherLoadingIcon:d}=e,{isLeaf:s,expanded:u,loading:f}=c;if(f)return o.isValidElement(d)?d:o.createElement(nR.Z,{className:"".concat(a,"-switcher-loading-icon")});if(i&&"object"==typeof i&&(r=i.showLeafIcon),s){if(!i)return null;if("boolean"!=typeof r&&r){let e="function"==typeof r?r(c):r;return o.isValidElement(e)?(0,nL.Tm)(e,{className:Z()(null===(t=e.props)||void 0===t?void 0:t.className,"".concat(a,"-switcher-line-custom-icon"))}):e}return r?o.createElement(na,{className:"".concat(a,"-switcher-line-icon")}):o.createElement("span",{className:"".concat(a,"-switcher-leaf-line")})}let p="".concat(a,"-switcher-icon"),m="function"==typeof l?l(c):l;return o.isValidElement(m)?(0,nL.Tm)(m,{className:Z()(null===(n=m.props)||void 0===n?void 0:n.className,p)}):void 0!==m?m:i?u?o.createElement(nM,{className:"".concat(a,"-switcher-line-icon")}):o.createElement(nD,{className:"".concat(a,"-switcher-line-icon")}):o.createElement(nI,{className:p})};let nB=o.forwardRef((e,t)=>{var n;let{getPrefixCls:r,direction:a,virtual:l,tree:c}=o.useContext(tk.E_),{prefixCls:i,className:d,showIcon:s=!1,showLine:u,switcherIcon:f,switcherLoadingIcon:p,blockNode:m=!1,children:h,checkable:v=!1,selectable:g=!0,draggable:b,disabled:y,motion:x,style:w}=e,k=r("tree",i),C=r(),E=o.useContext(np.Z),S=null!=y?y:E,N=null!=x?x:Object.assign(Object.assign({},(0,nf.Z)(C)),{motionAppear:!1}),K=Object.assign(Object.assign({},e),{checkable:v,selectable:g,showIcon:s,motion:N,blockNode:m,disabled:S,showLine:!!u,dropIndicatorRender:nK}),[O,I,R]=nN(k),[,P]=(0,tI.ZP)(),M=P.paddingXS/2+((null===(n=P.Tree)||void 0===n?void 0:n.titleHeight)||P.controlHeightSM),T=o.useMemo(()=>{if(!b)return!1;let e={};switch(typeof b){case"function":e.nodeDraggable=b;break;case"object":e=Object.assign({},b)}return!1!==e.icon&&(e.icon=e.icon||o.createElement(nu,null)),e},[b]);return O(o.createElement(no,Object.assign({itemHeight:M,ref:t,virtual:l},K,{style:Object.assign(Object.assign({},null==c?void 0:c.style),w),prefixCls:k,className:Z()({["".concat(k,"-icon-hide")]:!s,["".concat(k,"-block-node")]:m,["".concat(k,"-unselectable")]:!g,["".concat(k,"-rtl")]:"rtl"===a,["".concat(k,"-disabled")]:S},null==c?void 0:c.className,d,I,R),direction:a,checkable:v?o.createElement("span",{className:"".concat(k,"-checkbox-inner")}):v,selectable:g,switcherIcon:e=>o.createElement(nj,{prefixCls:k,switcherIcon:f,switcherLoadingIcon:p,treeNodeProps:e,showLine:u}),draggable:T}),h))});function nH(e,t,n){let{key:o,children:r}=n;e.forEach(function(e){let a=e[o],l=e[r];!1!==t(a,e)&&nH(l||[],t,n)})}var nz=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};function nA(e){let{isLeaf:t,expanded:n}=e;return t?o.createElement(na,null):n?o.createElement(nc,null):o.createElement(nd,null)}function nW(e){let{treeData:t,children:n}=e;return t||eY(n)}let n_=o.forwardRef((e,t)=>{var{defaultExpandAll:n,defaultExpandParent:r,defaultExpandedKeys:a}=e,l=nz(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);let c=o.useRef(null),i=o.useRef(null),d=()=>{let{keyEntities:e}=eJ(nW(l),{fieldNames:l.fieldNames});return n?Object.keys(e):r?tt(l.expandedKeys||a||[],e):l.expandedKeys||a||[]},[s,u]=o.useState(l.selectedKeys||l.defaultSelectedKeys||[]),[f,p]=o.useState(()=>d());o.useEffect(()=>{"selectedKeys"in l&&u(l.selectedKeys)},[l.selectedKeys]),o.useEffect(()=>{"expandedKeys"in l&&p(l.expandedKeys)},[l.expandedKeys]);let{getPrefixCls:m,direction:h}=o.useContext(tk.E_),{prefixCls:v,className:g,showIcon:b=!0,expandAction:y="click"}=l,x=nz(l,["prefixCls","className","showIcon","expandAction"]),w=m("tree",v),k=Z()("".concat(w,"-directory"),{["".concat(w,"-directory-rtl")]:"rtl"===h},g);return o.createElement(nB,Object.assign({icon:nA,ref:t,blockNode:!0},x,{showIcon:b,expandAction:y,prefixCls:w,className:k,expandedKeys:f,selectedKeys:s,onSelect:(e,t)=>{var n;let o;let{multiple:r,fieldNames:a}=l,{node:d,nativeEvent:s}=t,{key:p=""}=d,m=nW(l),h=Object.assign(Object.assign({},t),{selected:!0}),v=(null==s?void 0:s.ctrlKey)||(null==s?void 0:s.metaKey),g=null==s?void 0:s.shiftKey;r&&v?(o=e,c.current=p,i.current=o):r&&g?o=Array.from(new Set([].concat((0,el.Z)(i.current||[]),(0,el.Z)(function(e){let{treeData:t,expandedKeys:n,startKey:o,endKey:r,fieldNames:a}=e,l=[],c=0;return o&&o===r?[o]:o&&r?(nH(t,e=>{if(2===c)return!1;if(e===o||e===r){if(l.push(e),0===c)c=1;else if(1===c)return c=2,!1}else 1===c&&l.push(e);return n.includes(e)},eG(a)),l):[]}({treeData:m,expandedKeys:f,startKey:p,endKey:c.current,fieldNames:a}))))):(o=[p],c.current=p,i.current=o),h.selectedNodes=function(e,t,n){let o=(0,el.Z)(t),r=[];return nH(e,(e,t)=>{let n=o.indexOf(e);return -1!==n&&(r.push(t),o.splice(n,1)),!!o.length},eG(n)),r}(m,o,a),null===(n=l.onSelect)||void 0===n||n.call(l,o,h),"selectedKeys"in l||u(o)},onExpand:(e,t)=>{var n;return"expandedKeys"in l||p(e),null===(n=l.onExpand)||void 0===n?void 0:n.call(l,e,t)}}))});nB.DirectoryTree=n_,nB.TreeNode=e4;var nF=n(29436),nq=n(39454),nV=e=>{let{value:t,filterSearch:n,tablePrefixCls:r,locale:a,onChange:l}=e;return n?o.createElement("div",{className:"".concat(r,"-filter-dropdown-search")},o.createElement(nq.Z,{prefix:o.createElement(nF.Z,null),placeholder:a.filterSearchPlaceholder,onChange:l,value:t,htmlSize:1,className:"".concat(r,"-filter-dropdown-search-input")})):null};let nX=e=>{let{keyCode:t}=e;t===tY.Z.ENTER&&e.stopPropagation()},nU=o.forwardRef((e,t)=>o.createElement("div",{className:e.className,onClick:e=>e.stopPropagation(),onKeyDown:nX,ref:t},e.children));function nG(e){let t=[];return(e||[]).forEach(e=>{let{value:n,children:o}=e;t.push(n),o&&(t=[].concat((0,el.Z)(t),(0,el.Z)(nG(o))))}),t}function nY(e,t){return("string"==typeof t||"number"==typeof t)&&(null==t?void 0:t.toString().toLowerCase().includes(e.trim().toLowerCase()))}var n$=e=>{var t,n,r,a;let l,c;let{tablePrefixCls:i,prefixCls:s,column:u,dropdownPrefixCls:f,columnKey:p,filterOnClose:m,filterMultiple:h,filterMode:v="menu",filterSearch:g=!1,filterState:b,triggerFilter:y,locale:x,children:w,getPopupContainer:k,rootClassName:C}=e,{filterResetToDefaultFilteredValue:E,defaultFilteredValue:S,filterDropdownProps:N={},filterDropdownOpen:K,filterDropdownVisible:O,onFilterDropdownVisibleChange:I,onFilterDropdownOpenChange:R}=u,[P,M]=o.useState(!1),T=!!(b&&((null===(t=b.filteredKeys)||void 0===t?void 0:t.length)||b.forceFiltered)),D=e=>{var t;M(e),null===(t=N.onOpenChange)||void 0===t||t.call(N,e),null==R||R(e),null==I||I(e)},L=null!==(a=null!==(r=null!==(n=N.open)&&void 0!==n?n:K)&&void 0!==r?r:O)&&void 0!==a?a:P,j=null==b?void 0:b.filteredKeys,[B,H]=tz(j||[]),z=e=>{let{selectedKeys:t}=e;H(t)},A=(e,t)=>{let{node:n,checked:o}=t;h?z({selectedKeys:e}):z({selectedKeys:o&&n.key?[n.key]:[]})};o.useEffect(()=>{P&&z({selectedKeys:j||[]})},[j]);let[W,_]=o.useState([]),F=e=>{_(e)},[q,V]=o.useState(""),X=e=>{let{value:t}=e.target;V(t)};o.useEffect(()=>{P||V("")},[P]);let U=e=>{let t=(null==e?void 0:e.length)?e:null;if(null===t&&(!b||!b.filteredKeys)||(0,d.Z)(t,null==b?void 0:b.filteredKeys,!0))return null;y({column:u,key:p,filteredKeys:t})},G=()=>{D(!1),U(B())},Y=function(){let{confirm:e,closeDropdown:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{confirm:!1,closeDropdown:!1};e&&U([]),t&&D(!1),V(""),E?H((S||[]).map(e=>String(e))):H([])},$=Z()({["".concat(f,"-menu-without-submenu")]:!(u.filters||[]).some(e=>{let{children:t}=e;return t})}),J=e=>{e.target.checked?H(nG(null==u?void 0:u.filters).map(e=>String(e))):H([])},Q=e=>{let{filters:t}=e;return(t||[]).map((e,t)=>{let n=String(e.value),o={title:e.text,key:void 0!==e.value?n:String(t)};return e.children&&(o.children=Q({filters:e.children})),o})},ee=e=>{var t;return Object.assign(Object.assign({},e),{text:e.title,value:e.key,children:(null===(t=e.children)||void 0===t?void 0:t.map(e=>ee(e)))||[]})},{direction:et,renderEmpty:en}=o.useContext(tk.E_);if("function"==typeof u.filterDropdown)l=u.filterDropdown({prefixCls:"".concat(f,"-custom"),setSelectedKeys:e=>z({selectedKeys:e}),selectedKeys:B(),confirm:function(){let{closeDropdown:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{closeDropdown:!0};e&&D(!1),U(B())},clearFilters:Y,filters:u.filters,visible:L,close:()=>{D(!1)}});else if(u.filterDropdown)l=u.filterDropdown;else{let e=B()||[];l=o.createElement(o.Fragment,null,(()=>{var t,n;let r=null!==(t=null==en?void 0:en("Table.filter"))&&void 0!==t?t:o.createElement(tW.Z,{image:tW.Z.PRESENTED_IMAGE_SIMPLE,description:x.filterEmptyText,styles:{image:{height:24}},style:{margin:0,padding:"16px 0"}});if(0===(u.filters||[]).length)return r;if("tree"===v)return o.createElement(o.Fragment,null,o.createElement(nV,{filterSearch:g,value:q,onChange:X,tablePrefixCls:i,locale:x}),o.createElement("div",{className:"".concat(i,"-filter-dropdown-tree")},h?o.createElement(ti.Z,{checked:e.length===nG(u.filters).length,indeterminate:e.length>0&&e.length"function"==typeof g?g(q,ee(e)):nY(q,e.title):void 0})));let a=function e(t){let{filters:n,prefixCls:r,filteredKeys:a,filterMultiple:l,searchValue:c,filterSearch:i}=t;return n.map((t,n)=>{let d=String(t.value);if(t.children)return{key:d||n,label:t.text,popupClassName:"".concat(r,"-dropdown-submenu"),children:e({filters:t.children,prefixCls:r,filteredKeys:a,filterMultiple:l,searchValue:c,filterSearch:i})};let s=l?ti.Z:ts.ZP,u={key:void 0!==t.value?d:n,label:o.createElement(o.Fragment,null,o.createElement(s,{checked:a.includes(d)}),o.createElement("span",null,t.text))};return c.trim()?"function"==typeof i?i(c,t)?u:null:nY(c,t.text)?u:null:u})}({filters:u.filters||[],filterSearch:g,prefixCls:s,filteredKeys:B(),filterMultiple:h,searchValue:q}),l=a.every(e=>null===e);return o.createElement(o.Fragment,null,o.createElement(nV,{filterSearch:g,value:q,onChange:X,tablePrefixCls:i,locale:x}),l?r:o.createElement(t_.Z,{selectable:!0,multiple:h,prefixCls:"".concat(f,"-menu"),className:$,onSelect:z,onDeselect:z,selectedKeys:e,getPopupContainer:k,openKeys:W,onOpenChange:F,items:a}))})(),o.createElement("div",{className:"".concat(s,"-dropdown-btns")},o.createElement(tA.ZP,{type:"link",size:"small",disabled:E?(0,d.Z)((S||[]).map(e=>String(e)),e,!0):0===e.length,onClick:()=>Y()},x.filterReset),o.createElement(tA.ZP,{type:"primary",size:"small",onClick:G},x.filterConfirm)))}u.filterDropdown&&(l=o.createElement(tF.J,{selectable:void 0},l)),l=o.createElement(nU,{className:"".concat(s,"-dropdown")},l);let eo=(0,tB.Z)({trigger:["click"],placement:"rtl"===et?"bottomLeft":"bottomRight",children:(c="function"==typeof u.filterIcon?u.filterIcon(T):u.filterIcon?u.filterIcon:o.createElement(tj,null),o.createElement("span",{role:"button",tabIndex:-1,className:Z()("".concat(s,"-trigger"),{active:T}),onClick:e=>{e.stopPropagation()}},c)),getPopupContainer:k},Object.assign(Object.assign({},N),{rootClassName:Z()(C,N.rootClassName),open:L,onOpenChange:(e,t)=>{"trigger"===t.source&&(e&&void 0!==j&&H(j||[]),D(e),e||u.filterDropdown||!m||G())},popupRender:()=>"function"==typeof(null==N?void 0:N.dropdownRender)?N.dropdownRender(l):l}));return o.createElement("div",{className:"".concat(s,"-column")},o.createElement("span",{className:"".concat(i,"-column-title")},w),o.createElement(td.Z,Object.assign({},eo)))};let nJ=(e,t,n)=>{let o=[];return(e||[]).forEach((e,r)=>{var a;let l=tP(r,n),c=void 0!==e.filterDropdown;if(e.filters||c||"onFilter"in e){if("filteredValue"in e){let t=e.filteredValue;c||(t=null!==(a=null==t?void 0:t.map(String))&&void 0!==a?a:t),o.push({column:e,key:tR(e,l),filteredKeys:t,forceFiltered:e.filtered})}else o.push({column:e,key:tR(e,l),filteredKeys:t&&e.defaultFilteredValue?e.defaultFilteredValue:void 0,forceFiltered:e.filtered})}"children"in e&&(o=[].concat((0,el.Z)(o),(0,el.Z)(nJ(e.children,t,l))))}),o},nQ=e=>{let t={};return e.forEach(e=>{let{key:n,filteredKeys:o,column:r}=e,{filters:a,filterDropdown:l}=r;if(l)t[n]=o||null;else if(Array.isArray(o)){let e=nG(a);t[n]=e.filter(e=>o.includes(String(e)))}else t[n]=null}),t},n0=(e,t,n)=>t.reduce((e,o)=>{let{column:{onFilter:r,filters:a},filteredKeys:l}=o;return r&&l&&l.length?e.map(e=>Object.assign({},e)).filter(e=>l.some(o=>{let l=nG(a),c=l.findIndex(e=>String(e)===String(o)),i=-1!==c?l[c]:o;return e[n]&&(e[n]=n0(e[n],t,n)),r(i,e)})):e},e),n1=e=>e.flatMap(e=>"children"in e?[e].concat((0,el.Z)(n1(e.children||[]))):[e]);var n2=e=>{let{prefixCls:t,dropdownPrefixCls:n,mergedColumns:r,onFilterChange:a,getPopupContainer:l,locale:c,rootClassName:i}=e;(0,tc.ln)("Table");let d=o.useMemo(()=>n1(r||[]),[r]),[s,u]=o.useState(()=>nJ(d,!0)),f=o.useMemo(()=>{let e=nJ(d,!1);if(0===e.length)return e;let t=!0;if(e.forEach(e=>{let{filteredKeys:n}=e;void 0!==n&&(t=!1)}),t){let e=(d||[]).map((e,t)=>tR(e,tP(t)));return s.filter(t=>{let{key:n}=t;return e.includes(n)}).map(t=>{let n=d[e.indexOf(t.key)];return Object.assign(Object.assign({},t),{column:Object.assign(Object.assign({},t.column),n),forceFiltered:n.filtered})})}return e},[d,s]),p=o.useMemo(()=>nQ(f),[f]),m=e=>{let t=f.filter(t=>{let{key:n}=t;return n!==e.key});t.push(e),u(t),a(nQ(t),t)};return[e=>(function e(t,n,r,a,l,c,i,d,s){return r.map((r,u)=>{let f=tP(u,d),{filterOnClose:p=!0,filterMultiple:m=!0,filterMode:h,filterSearch:v}=r,g=r;if(g.filters||g.filterDropdown){let e=tR(g,f),d=a.find(t=>{let{key:n}=t;return e===n});g=Object.assign(Object.assign({},g),{title:a=>o.createElement(n$,{tablePrefixCls:t,prefixCls:"".concat(t,"-filter"),dropdownPrefixCls:n,column:g,columnKey:e,filterState:d,filterOnClose:p,filterMultiple:m,filterMode:h,filterSearch:v,triggerFilter:c,locale:l,getPopupContainer:i,rootClassName:s},tM(r.title,a))})}return"children"in g&&(g=Object.assign(Object.assign({},g),{children:e(t,n,g.children,a,l,c,i,f,s)})),g})})(t,n,e,f,c,m,l,void 0,i),f,p]},n3=(e,t,n)=>{let r=o.useRef({});return[function(o){var a;if(!r.current||r.current.data!==e||r.current.childrenColumnName!==t||r.current.getRowKey!==n){let o=new Map;!function e(r){r.forEach((r,a)=>{let l=n(r,a);o.set(l,r),r&&"object"==typeof r&&t in r&&e(r[t]||[])})}(e),r.current={data:e,childrenColumnName:t,kvMap:o,getRowKey:n}}return null===(a=r.current.kvMap)||void 0===a?void 0:a.get(o)}]},n4=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},n8=function(e,t,n){let r=n&&"object"==typeof n?n:{},{total:a=0}=r,l=n4(r,["total"]),[c,i]=(0,o.useState)(()=>({current:"defaultCurrent"in l?l.defaultCurrent:1,pageSize:"defaultPageSize"in l?l.defaultPageSize:10})),d=(0,tB.Z)(c,l,{total:a>0?a:e}),s=Math.ceil((a||e)/d.pageSize);d.current>s&&(d.current=s||1);let u=(e,t)=>{i({current:null!=e?e:1,pageSize:t||d.pageSize})};return!1===n?[{},()=>{}]:[Object.assign(Object.assign({},d),{onChange:(e,o)=>{var r;n&&(null===(r=n.onChange)||void 0===r||r.call(n,e,o)),u(e,o),t(e,o||(null==d?void 0:d.pageSize))}}),u]},n6={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},n5=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:n6}))}),n7={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},n9=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:n7}))}),oe=n(99981);let ot="ascend",on="descend",oo=e=>"object"==typeof e.sorter&&"number"==typeof e.sorter.multiple&&e.sorter.multiple,or=e=>"function"==typeof e?e:!!e&&"object"==typeof e&&!!e.compare&&e.compare,oa=(e,t)=>t?e[e.indexOf(t)+1]:e[0],ol=(e,t,n)=>{let o=[],r=(e,t)=>{o.push({column:e,key:tR(e,t),multiplePriority:oo(e),sortOrder:e.sortOrder})};return(e||[]).forEach((e,a)=>{let l=tP(a,n);e.children?("sortOrder"in e&&r(e,l),o=[].concat((0,el.Z)(o),(0,el.Z)(ol(e.children,t,l)))):e.sorter&&("sortOrder"in e?r(e,l):t&&e.defaultSortOrder&&o.push({column:e,key:tR(e,l),multiplePriority:oo(e),sortOrder:e.defaultSortOrder}))}),o},oc=(e,t,n,r,a,l,c,i)=>(t||[]).map((t,d)=>{let s=tP(d,i),u=t;if(u.sorter){let i;let d=u.sortDirections||a,f=void 0===u.showSorterTooltip?c:u.showSorterTooltip,p=tR(u,s),m=n.find(e=>{let{key:t}=e;return t===p}),h=m?m.sortOrder:null,v=oa(d,h);if(t.sortIcon)i=t.sortIcon({sortOrder:h});else{let t=d.includes(ot)&&o.createElement(n9,{className:Z()("".concat(e,"-column-sorter-up"),{active:h===ot})}),n=d.includes(on)&&o.createElement(n5,{className:Z()("".concat(e,"-column-sorter-down"),{active:h===on})});i=o.createElement("span",{className:Z()("".concat(e,"-column-sorter"),{["".concat(e,"-column-sorter-full")]:!!(t&&n)})},o.createElement("span",{className:"".concat(e,"-column-sorter-inner"),"aria-hidden":"true"},t,n))}let{cancelSort:g,triggerAsc:b,triggerDesc:y}=l||{},x=g;v===on?x=y:v===ot&&(x=b);let w="object"==typeof f?Object.assign({title:x},f):{title:x};u=Object.assign(Object.assign({},u),{className:Z()(u.className,{["".concat(e,"-column-sort")]:h}),title:n=>{let r="".concat(e,"-column-sorters"),a=o.createElement("span",{className:"".concat(e,"-column-title")},tM(t.title,n)),l=o.createElement("div",{className:r},a,i);return f?"boolean"!=typeof f&&(null==f?void 0:f.target)==="sorter-icon"?o.createElement("div",{className:Z()(r,"".concat(r,"-tooltip-target-sorter"))},a,o.createElement(oe.Z,Object.assign({},w),i)):o.createElement(oe.Z,Object.assign({},w),l):l},onHeaderCell:n=>{var o;let a=(null===(o=t.onHeaderCell)||void 0===o?void 0:o.call(t,n))||{},l=a.onClick,c=a.onKeyDown;a.onClick=e=>{r({column:t,key:p,sortOrder:v,multiplePriority:oo(t)}),null==l||l(e)},a.onKeyDown=e=>{e.keyCode===tY.Z.ENTER&&(r({column:t,key:p,sortOrder:v,multiplePriority:oo(t)}),null==c||c(e))};let i=tT(t.title,{}),d=null==i?void 0:i.toString();return h&&(a["aria-sort"]="ascend"===h?"ascending":"descending"),a["aria-label"]=d||"",a.className=Z()(a.className,"".concat(e,"-column-has-sorters")),a.tabIndex=0,t.ellipsis&&(a.title=(null!=i?i:"").toString()),a}})}return"children"in u&&(u=Object.assign(Object.assign({},u),{children:oc(e,u.children,n,r,a,l,c,s)})),u}),oi=e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n,field:t.dataIndex,columnKey:t.key}},od=e=>{let t=e.filter(e=>{let{sortOrder:t}=e;return t}).map(oi);if(0===t.length&&e.length){let t=e.length-1;return Object.assign(Object.assign({},oi(e[t])),{column:void 0,order:void 0,field:void 0,columnKey:void 0})}return t.length<=1?t[0]||{}:t},os=(e,t,n)=>{let o=t.slice().sort((e,t)=>t.multiplePriority-e.multiplePriority),r=e.slice(),a=o.filter(e=>{let{column:{sorter:t},sortOrder:n}=e;return or(t)&&n});return a.length?r.sort((e,t)=>{for(let n=0;n{let o=e[n];return o?Object.assign(Object.assign({},e),{[n]:os(o,t,n)}):e}):r};var ou=e=>{let{prefixCls:t,mergedColumns:n,sortDirections:r,tableLocale:a,showSorterTooltip:l,onSorterChange:c}=e,[i,d]=o.useState(()=>ol(n,!0)),s=(e,t)=>{let n=[];return e.forEach((e,o)=>{let r=tP(o,t);if(n.push(tR(e,r)),Array.isArray(e.children)){let t=s(e.children,r);n.push.apply(n,(0,el.Z)(t))}}),n},u=o.useMemo(()=>{let e=!0,t=ol(n,!1);if(!t.length){let e=s(n);return i.filter(t=>{let{key:n}=t;return e.includes(n)})}let o=[];function r(t){e?o.push(t):o.push(Object.assign(Object.assign({},t),{sortOrder:null}))}let a=null;return t.forEach(t=>{null===a?(r(t),t.sortOrder&&(!1===t.multiplePriority?e=!1:a=!0)):(a&&!1!==t.multiplePriority||(e=!1),r(t))}),o},[n,i]),f=o.useMemo(()=>{var e,t;let n=u.map(e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n}});return{sortColumns:n,sortColumn:null===(e=n[0])||void 0===e?void 0:e.column,sortOrder:null===(t=n[0])||void 0===t?void 0:t.order}},[u]),p=e=>{let t;d(t=!1!==e.multiplePriority&&u.length&&!1!==u[0].multiplePriority?[].concat((0,el.Z)(u.filter(t=>{let{key:n}=t;return n!==e.key})),[e]):[e]),c(od(t),t)};return[e=>oc(t,e,u,p,r,a,l),u,f,()=>od(u)]};let of=(e,t)=>e.map(e=>{let n=Object.assign({},e);return n.title=tM(e.title,t),"children"in n&&(n.children=of(n.children,t)),n});var op=e=>[o.useCallback(t=>of(t,e),[e])];let om=b(eI,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:o}=t;return n!==o}),oh=b(ez,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:o}=t;return n!==o});var ov=n(54558),og=e=>{let{componentCls:t,lineWidth:n,lineType:o,tableBorderColor:r,tableHeaderBg:a,tablePaddingVertical:l,tablePaddingHorizontal:c,calc:i}=e,d="".concat((0,nm.bf)(n)," ").concat(o," ").concat(r),s=(e,o,r)=>({["&".concat(t,"-").concat(e)]:{["> ".concat(t,"-container")]:{["> ".concat(t,"-content, > ").concat(t,"-body")]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,nm.bf)(i(o).mul(-1).equal()),"\n ").concat((0,nm.bf)(i(i(r).add(n)).mul(-1).equal()))}}}}}});return{["".concat(t,"-wrapper")]:{["".concat(t).concat(t,"-bordered")]:Object.assign(Object.assign(Object.assign({["> ".concat(t,"-title")]:{border:d,borderBottom:0},["> ".concat(t,"-container")]:{borderInlineStart:d,borderTop:d,["\n > ".concat(t,"-content,\n > ").concat(t,"-header,\n > ").concat(t,"-body,\n > ").concat(t,"-summary\n ")]:{"> table":{"\n > thead > tr > th,\n > thead > tr > td,\n > tbody > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:d},"> thead":{"> tr:not(:last-child) > th":{borderBottom:d},"> tr > th::before":{backgroundColor:"transparent !important"}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{["> ".concat(t,"-cell-fix-right-first::after")]:{borderInlineEnd:d}},"\n > tbody > tr > th,\n > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,nm.bf)(i(l).mul(-1).equal())," ").concat((0,nm.bf)(i(i(c).add(n)).mul(-1).equal())),"&::after":{position:"absolute",top:0,insetInlineEnd:n,bottom:0,borderInlineEnd:d,content:'""'}}}}}},["&".concat(t,"-scroll-horizontal")]:{["> ".concat(t,"-container > ").concat(t,"-body")]:{"> table > tbody":{["\n > tr".concat(t,"-expanded-row,\n > tr").concat(t,"-placeholder\n ")]:{"> th, > td":{borderInlineEnd:0}}}}}},s("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),s("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{["> ".concat(t,"-footer")]:{border:d,borderTop:0}}),["".concat(t,"-cell")]:{["".concat(t,"-container:first-child")]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:"0 ".concat((0,nm.bf)(n)," 0 ").concat((0,nm.bf)(n)," ").concat(a)}},["".concat(t,"-bordered ").concat(t,"-cell-scrollbar")]:{borderInlineEnd:d}}}},ob=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-cell-ellipsis")]:Object.assign(Object.assign({},nv.vS),{wordBreak:"keep-all",["\n &".concat(t,"-cell-fix-left-last,\n &").concat(t,"-cell-fix-right-first\n ")]:{overflow:"visible",["".concat(t,"-cell-content")]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},["".concat(t,"-column-title")]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},oy=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody > tr").concat(t,"-placeholder")]:{textAlign:"center",color:e.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:e.colorBgContainer}}}}},ox=e=>{let{componentCls:t,antCls:n,motionDurationSlow:o,lineWidth:r,paddingXS:a,lineType:l,tableBorderColor:c,tableExpandIconBg:i,tableExpandColumnWidth:d,borderRadius:s,tablePaddingVertical:u,tablePaddingHorizontal:f,tableExpandedRowBg:p,paddingXXS:m,expandIconMarginTop:h,expandIconSize:v,expandIconHalfInner:g,expandIconScale:b,calc:y}=e,x="".concat((0,nm.bf)(r)," ").concat(l," ").concat(c),w=y(m).sub(r).equal();return{["".concat(t,"-wrapper")]:{["".concat(t,"-expand-icon-col")]:{width:d},["".concat(t,"-row-expand-icon-cell")]:{textAlign:"center",["".concat(t,"-row-expand-icon")]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},["".concat(t,"-row-indent")]:{height:1,float:"left"},["".concat(t,"-row-expand-icon")]:Object.assign(Object.assign({},(0,nv.Nd)(e)),{position:"relative",float:"left",width:v,height:v,color:"inherit",lineHeight:(0,nm.bf)(v),background:i,border:x,borderRadius:s,transform:"scale(".concat(b,")"),"&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:"transform ".concat(o," ease-out"),content:'""'},"&::before":{top:g,insetInlineEnd:w,insetInlineStart:w,height:r},"&::after":{top:w,bottom:w,insetInlineStart:g,width:r,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}}),["".concat(t,"-row-indent + ").concat(t,"-row-expand-icon")]:{marginTop:h,marginInlineEnd:a},["tr".concat(t,"-expanded-row")]:{"&, &:hover":{"> th, > td":{background:p}},["".concat(n,"-descriptions-view")]:{display:"flex",table:{flex:"auto",width:"100%"}}},["".concat(t,"-expanded-row-fixed")]:{position:"relative",margin:"".concat((0,nm.bf)(y(u).mul(-1).equal())," ").concat((0,nm.bf)(y(f).mul(-1).equal())),padding:"".concat((0,nm.bf)(u)," ").concat((0,nm.bf)(f))}}}},ow=e=>{let{componentCls:t,antCls:n,iconCls:o,tableFilterDropdownWidth:r,tableFilterDropdownSearchWidth:a,paddingXXS:l,paddingXS:c,colorText:i,lineWidth:d,lineType:s,tableBorderColor:u,headerIconColor:f,fontSizeSM:p,tablePaddingHorizontal:m,borderRadius:h,motionDurationSlow:v,colorIcon:g,colorPrimary:b,tableHeaderFilterActiveBg:y,colorTextDisabled:x,tableFilterDropdownBg:w,tableFilterDropdownHeight:k,controlItemBgHover:C,controlItemBgActive:E,boxShadowSecondary:S,filterDropdownMenuBg:Z,calc:N}=e,K="".concat(n,"-dropdown"),O="".concat(t,"-filter-dropdown"),I="".concat(n,"-tree"),R="".concat((0,nm.bf)(d)," ").concat(s," ").concat(u);return[{["".concat(t,"-wrapper")]:{["".concat(t,"-filter-column")]:{display:"flex",justifyContent:"space-between"},["".concat(t,"-filter-trigger")]:{position:"relative",display:"flex",alignItems:"center",marginBlock:N(l).mul(-1).equal(),marginInline:"".concat((0,nm.bf)(l)," ").concat((0,nm.bf)(N(m).div(2).mul(-1).equal())),padding:"0 ".concat((0,nm.bf)(l)),color:f,fontSize:p,borderRadius:h,cursor:"pointer",transition:"all ".concat(v),"&:hover":{color:g,background:y},"&.active":{color:b}}}},{["".concat(n,"-dropdown")]:{[O]:Object.assign(Object.assign({},(0,nv.Wf)(e)),{minWidth:r,backgroundColor:w,borderRadius:h,boxShadow:S,overflow:"hidden",["".concat(K,"-menu")]:{maxHeight:k,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:Z,"&:empty::after":{display:"block",padding:"".concat((0,nm.bf)(c)," 0"),color:x,fontSize:p,textAlign:"center",content:'"Not Found"'}},["".concat(O,"-tree")]:{paddingBlock:"".concat((0,nm.bf)(c)," 0"),paddingInline:c,[I]:{padding:0},["".concat(I,"-treenode ").concat(I,"-node-content-wrapper:hover")]:{backgroundColor:C},["".concat(I,"-treenode-checkbox-checked ").concat(I,"-node-content-wrapper")]:{"&, &:hover":{backgroundColor:E}}},["".concat(O,"-search")]:{padding:c,borderBottom:R,"&-input":{input:{minWidth:a},[o]:{color:x}}},["".concat(O,"-checkall")]:{width:"100%",marginBottom:l,marginInlineStart:l},["".concat(O,"-btns")]:{display:"flex",justifyContent:"space-between",padding:"".concat((0,nm.bf)(N(c).sub(d).equal())," ").concat((0,nm.bf)(c)),overflow:"hidden",borderTop:R}})}},{["".concat(n,"-dropdown ").concat(O,", ").concat(O,"-submenu")]:{["".concat(n,"-checkbox-wrapper + span")]:{paddingInlineStart:c,color:i},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]},ok=e=>{let{componentCls:t,lineWidth:n,colorSplit:o,motionDurationSlow:r,zIndexTableFixed:a,tableBg:l,zIndexTableSticky:c,calc:i}=e;return{["".concat(t,"-wrapper")]:{["\n ".concat(t,"-cell-fix-left,\n ").concat(t,"-cell-fix-right\n ")]:{position:"sticky !important",zIndex:a,background:l},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{position:"absolute",top:0,right:{_skip_check_:!0,value:0},bottom:i(n).mul(-1).equal(),width:30,transform:"translateX(100%)",transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none",willChange:"transform"},["".concat(t,"-cell-fix-left-all::after")]:{display:"none"},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{position:"absolute",top:0,bottom:i(n).mul(-1).equal(),left:{_skip_check_:!0,value:0},width:30,transform:"translateX(-100%)",transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none"},["".concat(t,"-container")]:{position:"relative","&::before, &::after":{position:"absolute",top:0,bottom:0,zIndex:i(c).add(1).equal({unit:!1}),width:30,transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none"},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},["".concat(t,"-ping-left")]:{["&:not(".concat(t,"-has-fix-left) ").concat(t,"-container::before")]:{boxShadow:"inset 10px 0 8px -8px ".concat(o)},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{boxShadow:"inset 10px 0 8px -8px ".concat(o)},["".concat(t,"-cell-fix-left-last::before")]:{backgroundColor:"transparent !important"}},["".concat(t,"-ping-right")]:{["&:not(".concat(t,"-has-fix-right) ").concat(t,"-container::after")]:{boxShadow:"inset -10px 0 8px -8px ".concat(o)},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{boxShadow:"inset -10px 0 8px -8px ".concat(o)}},["".concat(t,"-fixed-column-gapped")]:{["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after,\n ").concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{boxShadow:"none"}}}}},oC=e=>{let{componentCls:t,antCls:n,margin:o}=e;return{["".concat(t,"-wrapper ").concat(t,"-pagination").concat(n,"-pagination")]:{margin:"".concat((0,nm.bf)(o)," 0")}}},oE=e=>{let{componentCls:t,tableRadius:n}=e;return{["".concat(t,"-wrapper")]:{[t]:{["".concat(t,"-title, ").concat(t,"-header")]:{borderRadius:"".concat((0,nm.bf)(n)," ").concat((0,nm.bf)(n)," 0 0")},["".concat(t,"-title + ").concat(t,"-container")]:{borderStartStartRadius:0,borderStartEndRadius:0,["".concat(t,"-header, table")]:{borderRadius:0},"table > thead > tr:first-child":{"th:first-child, th:last-child, td:first-child, td:last-child":{borderRadius:0}}},"&-container":{borderStartStartRadius:n,borderStartEndRadius:n,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:n},"> *:last-child":{borderStartEndRadius:n}}},"&-footer":{borderRadius:"0 0 ".concat((0,nm.bf)(n)," ").concat((0,nm.bf)(n))}}}}},oS=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper-rtl")]:{direction:"rtl",table:{direction:"rtl"},["".concat(t,"-pagination-left")]:{justifyContent:"flex-end"},["".concat(t,"-pagination-right")]:{justifyContent:"flex-start"},["".concat(t,"-row-expand-icon")]:{float:"right","&::after":{transform:"rotate(-90deg)"},"&-collapsed::before":{transform:"rotate(180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"}},["".concat(t,"-container")]:{"&::before":{insetInlineStart:"unset",insetInlineEnd:0},"&::after":{insetInlineStart:0,insetInlineEnd:"unset"},["".concat(t,"-row-indent")]:{float:"right"}}}}},oZ=e=>{let{componentCls:t,antCls:n,iconCls:o,fontSizeIcon:r,padding:a,paddingXS:l,headerIconColor:c,headerIconHoverColor:i,tableSelectionColumnWidth:d,tableSelectedRowBg:s,tableSelectedRowHoverBg:u,tableRowHoverBg:f,tablePaddingHorizontal:p,calc:m}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-selection-col")]:{width:d,["&".concat(t,"-selection-col-with-dropdown")]:{width:m(d).add(r).add(m(a).div(4)).equal()}},["".concat(t,"-bordered ").concat(t,"-selection-col")]:{width:m(d).add(m(l).mul(2)).equal(),["&".concat(t,"-selection-col-with-dropdown")]:{width:m(d).add(r).add(m(a).div(4)).add(m(l).mul(2)).equal()}},["\n table tr th".concat(t,"-selection-column,\n table tr td").concat(t,"-selection-column,\n ").concat(t,"-selection-column\n ")]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:"center",["".concat(n,"-radio-wrapper")]:{marginInlineEnd:0}},["table tr th".concat(t,"-selection-column").concat(t,"-cell-fix-left")]:{zIndex:m(e.zIndexTableFixed).add(1).equal({unit:!1})},["table tr th".concat(t,"-selection-column::after")]:{backgroundColor:"transparent !important"},["".concat(t,"-selection")]:{position:"relative",display:"inline-flex",flexDirection:"column"},["".concat(t,"-selection-extra")]:{position:"absolute",top:0,zIndex:1,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),marginInlineStart:"100%",paddingInlineStart:(0,nm.bf)(m(p).div(4).equal()),[o]:{color:c,fontSize:r,verticalAlign:"baseline","&:hover":{color:i}}},["".concat(t,"-tbody")]:{["".concat(t,"-row")]:{["&".concat(t,"-row-selected")]:{["> ".concat(t,"-cell")]:{background:s,"&-row-hover":{background:u}}},["> ".concat(t,"-cell-row-hover")]:{background:f}}}}}},oN=e=>{let{componentCls:t,tableExpandColumnWidth:n,calc:o}=e,r=(e,r,a,l)=>({["".concat(t).concat(t,"-").concat(e)]:{fontSize:l,["\n ".concat(t,"-title,\n ").concat(t,"-footer,\n ").concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{padding:"".concat((0,nm.bf)(r)," ").concat((0,nm.bf)(a))},["".concat(t,"-filter-trigger")]:{marginInlineEnd:(0,nm.bf)(o(a).div(2).mul(-1).equal())},["".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,nm.bf)(o(r).mul(-1).equal())," ").concat((0,nm.bf)(o(a).mul(-1).equal()))},["".concat(t,"-tbody")]:{["".concat(t,"-wrapper:only-child ").concat(t)]:{marginBlock:(0,nm.bf)(o(r).mul(-1).equal()),marginInline:"".concat((0,nm.bf)(o(n).sub(a).equal())," ").concat((0,nm.bf)(o(a).mul(-1).equal()))}},["".concat(t,"-selection-extra")]:{paddingInlineStart:(0,nm.bf)(o(a).div(4).equal())}}});return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},r("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),r("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},oK=e=>{let{componentCls:t,marginXXS:n,fontSizeIcon:o,headerIconColor:r,headerIconHoverColor:a}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-thead th").concat(t,"-column-has-sorters")]:{outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow,", left 0s"),"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:"transparent !important"}},"&:focus-visible":{color:e.colorPrimary},["\n &".concat(t,"-cell-fix-left:hover,\n &").concat(t,"-cell-fix-right:hover\n ")]:{background:e.tableFixedHeaderSortActiveBg}},["".concat(t,"-thead th").concat(t,"-column-sort")]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},["td".concat(t,"-column-sort")]:{background:e.tableBodySortBg},["".concat(t,"-column-title")]:{position:"relative",zIndex:1,flex:1,minWidth:0},["".concat(t,"-column-sorters")]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},["".concat(t,"-column-sorters-tooltip-target-sorter")]:{"&::after":{content:"none"}},["".concat(t,"-column-sorter")]:{marginInlineStart:n,color:r,fontSize:0,transition:"color ".concat(e.motionDurationSlow),"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:o,"&.active":{color:e.colorPrimary}},["".concat(t,"-column-sorter-up + ").concat(t,"-column-sorter-down")]:{marginTop:"-0.3em"}},["".concat(t,"-column-sorters:hover ").concat(t,"-column-sorter")]:{color:a}}}},oO=e=>{let{componentCls:t,opacityLoading:n,tableScrollThumbBg:o,tableScrollThumbBgHover:r,tableScrollThumbSize:a,tableScrollBg:l,zIndexTableSticky:c,stickyScrollBarBorderRadius:i,lineWidth:d,lineType:s,tableBorderColor:u}=e,f="".concat((0,nm.bf)(d)," ").concat(s," ").concat(u);return{["".concat(t,"-wrapper")]:{["".concat(t,"-sticky")]:{"&-holder":{position:"sticky",zIndex:c,background:e.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:"".concat((0,nm.bf)(a)," !important"),zIndex:c,display:"flex",alignItems:"center",background:l,borderTop:f,opacity:n,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:a,backgroundColor:o,borderRadius:i,transition:"all ".concat(e.motionDurationSlow,", transform 0s"),position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:r}}}}}}},oI=e=>{let{componentCls:t,lineWidth:n,tableBorderColor:o,calc:r}=e,a="".concat((0,nm.bf)(n)," ").concat(e.lineType," ").concat(o);return{["".concat(t,"-wrapper")]:{["".concat(t,"-summary")]:{position:"relative",zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:a}}},["div".concat(t,"-summary")]:{boxShadow:"0 ".concat((0,nm.bf)(r(n).mul(-1).equal())," 0 ").concat(o)}}}},oR=e=>{let{componentCls:t,motionDurationMid:n,lineWidth:o,lineType:r,tableBorderColor:a,calc:l}=e,c="".concat((0,nm.bf)(o)," ").concat(r," ").concat(a),i="".concat(t,"-expanded-row-cell");return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody-virtual")]:{["".concat(t,"-tbody-virtual-holder-inner")]:{["\n & > ".concat(t,"-row, \n & > div:not(").concat(t,"-row) > ").concat(t,"-row\n ")]:{display:"flex",boxSizing:"border-box",width:"100%"}},["".concat(t,"-cell")]:{borderBottom:c,transition:"background ".concat(n)},["".concat(t,"-expanded-row")]:{["".concat(i).concat(i,"-fixed")]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:"calc(var(--virtual-width) - ".concat((0,nm.bf)(o),")"),borderInlineEnd:"none"}}},["".concat(t,"-bordered")]:{["".concat(t,"-tbody-virtual")]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:c,position:"absolute"},["".concat(t,"-cell")]:{borderInlineEnd:c,["&".concat(t,"-cell-fix-right-first:before")]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:l(o).mul(-1).equal(),borderInlineStart:c}}},["&".concat(t,"-virtual")]:{["".concat(t,"-placeholder ").concat(t,"-cell")]:{borderInlineEnd:c,borderBottom:c}}}}}};let oP=e=>{let{componentCls:t,fontWeightStrong:n,tablePaddingVertical:o,tablePaddingHorizontal:r,tableExpandColumnWidth:a,lineWidth:l,lineType:c,tableBorderColor:i,tableFontSize:d,tableBg:s,tableRadius:u,tableHeaderTextColor:f,motionDurationMid:p,tableHeaderBg:m,tableHeaderCellSplitColor:h,tableFooterTextColor:v,tableFooterBg:g,calc:b}=e,y="".concat((0,nm.bf)(l)," ").concat(c," ").concat(i);return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({clear:"both",maxWidth:"100%","--rc-virtual-list-scrollbar-bg":e.tableScrollBg},(0,nv.dF)()),{[t]:Object.assign(Object.assign({},(0,nv.Wf)(e)),{fontSize:d,background:s,borderRadius:"".concat((0,nm.bf)(u)," ").concat((0,nm.bf)(u)," 0 0"),scrollbarColor:"".concat(e.tableScrollThumbBg," ").concat(e.tableScrollBg)}),table:{width:"100%",textAlign:"start",borderRadius:"".concat((0,nm.bf)(u)," ").concat((0,nm.bf)(u)," 0 0"),borderCollapse:"separate",borderSpacing:0},["\n ".concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{position:"relative",padding:"".concat((0,nm.bf)(o)," ").concat((0,nm.bf)(r)),overflowWrap:"break-word"},["".concat(t,"-title")]:{padding:"".concat((0,nm.bf)(o)," ").concat((0,nm.bf)(r))},["".concat(t,"-thead")]:{"\n > tr > th,\n > tr > td\n ":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:m,borderBottom:y,transition:"background ".concat(p," ease"),"&[colspan]:not([colspan='1'])":{textAlign:"center"},["&:not(:last-child):not(".concat(t,"-selection-column):not(").concat(t,"-row-expand-icon-cell):not([colspan])::before")]:{position:"absolute",top:"50%",insetInlineEnd:0,width:1,height:"1.6em",backgroundColor:h,transform:"translateY(-50%)",transition:"background-color ".concat(p),content:'""'}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},["".concat(t,"-tbody")]:{"> tr":{"> th, > td":{transition:"background ".concat(p,", border-color ").concat(p),borderBottom:y,["\n > ".concat(t,"-wrapper:only-child,\n > ").concat(t,"-expanded-row-fixed > ").concat(t,"-wrapper:only-child\n ")]:{[t]:{marginBlock:(0,nm.bf)(b(o).mul(-1).equal()),marginInline:"".concat((0,nm.bf)(b(a).sub(r).equal()),"\n ").concat((0,nm.bf)(b(r).mul(-1).equal())),["".concat(t,"-tbody > tr:last-child > td")]:{borderBottomWidth:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:m,borderBottom:y,transition:"background ".concat(p," ease")},["& > ".concat(t,"-measure-cell")]:{paddingBlock:"0 !important",borderBlock:"0 !important",["".concat(t,"-measure-cell-content")]:{height:0,overflow:"hidden",pointerEvents:"none"}}}},["".concat(t,"-footer")]:{padding:"".concat((0,nm.bf)(o)," ").concat((0,nm.bf)(r)),color:v,background:g}})}};var oM=(0,ny.I$)("Table",e=>{let{colorTextHeading:t,colorSplit:n,colorBgContainer:o,controlInteractiveSize:r,headerBg:a,headerColor:l,headerSortActiveBg:c,headerSortHoverBg:i,bodySortBg:d,rowHoverBg:s,rowSelectedBg:u,rowSelectedHoverBg:f,rowExpandedBg:p,cellPaddingBlock:m,cellPaddingInline:h,cellPaddingBlockMD:v,cellPaddingInlineMD:g,cellPaddingBlockSM:b,cellPaddingInlineSM:y,borderColor:x,footerBg:w,footerColor:k,headerBorderRadius:C,cellFontSize:E,cellFontSizeMD:S,cellFontSizeSM:Z,headerSplitColor:N,fixedHeaderSortActiveBg:K,headerFilterHoverBg:O,filterDropdownBg:I,expandIconBg:R,selectionColumnWidth:P,stickyScrollBarBg:M,calc:T}=e,D=(0,nb.IX)(e,{tableFontSize:E,tableBg:o,tableRadius:C,tablePaddingVertical:m,tablePaddingHorizontal:h,tablePaddingVerticalMiddle:v,tablePaddingHorizontalMiddle:g,tablePaddingVerticalSmall:b,tablePaddingHorizontalSmall:y,tableBorderColor:x,tableHeaderTextColor:l,tableHeaderBg:a,tableFooterTextColor:k,tableFooterBg:w,tableHeaderCellSplitColor:N,tableHeaderSortBg:c,tableHeaderSortHoverBg:i,tableBodySortBg:d,tableFixedHeaderSortActiveBg:K,tableHeaderFilterActiveBg:O,tableFilterDropdownBg:I,tableRowHoverBg:s,tableSelectedRowBg:u,tableSelectedRowHoverBg:f,zIndexTableFixed:2,zIndexTableSticky:T(2).add(1).equal({unit:!1}),tableFontSizeMiddle:S,tableFontSizeSmall:Z,tableSelectionColumnWidth:P,tableExpandIconBg:R,tableExpandColumnWidth:T(r).add(T(e.padding).mul(2)).equal(),tableExpandedRowBg:p,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:M,tableScrollThumbBgHover:t,tableScrollBg:n});return[oP(D),oC(D),oI(D),oK(D),ow(D),og(D),oE(D),ox(D),oI(D),oy(D),oZ(D),ok(D),oO(D),ob(D),oN(D),oS(D),oR(D)]},e=>{let{colorFillAlter:t,colorBgContainer:n,colorTextHeading:o,colorFillSecondary:r,colorFillContent:a,controlItemBgActive:l,controlItemBgActiveHover:c,padding:i,paddingSM:d,paddingXS:s,colorBorderSecondary:u,borderRadiusLG:f,controlHeight:p,colorTextPlaceholder:m,fontSize:h,fontSizeSM:v,lineHeight:g,lineWidth:b,colorIcon:y,colorIconHover:x,opacityLoading:w,controlInteractiveSize:k}=e,C=new ov.t(r).onBackground(n).toHexString(),E=new ov.t(a).onBackground(n).toHexString(),S=new ov.t(t).onBackground(n).toHexString(),Z=new ov.t(y),N=new ov.t(x),K=k/2-b,O=2*K+3*b;return{headerBg:S,headerColor:o,headerSortActiveBg:C,headerSortHoverBg:E,bodySortBg:S,rowHoverBg:S,rowSelectedBg:l,rowSelectedHoverBg:c,rowExpandedBg:t,cellPaddingBlock:i,cellPaddingInline:i,cellPaddingBlockMD:d,cellPaddingInlineMD:s,cellPaddingBlockSM:s,cellPaddingInlineSM:s,borderColor:u,headerBorderRadius:f,footerBg:S,footerColor:o,cellFontSize:h,cellFontSizeMD:h,cellFontSizeSM:h,headerSplitColor:u,fixedHeaderSortActiveBg:C,headerFilterHoverBg:a,filterDropdownMenuBg:n,filterDropdownBg:n,expandIconBg:n,selectionColumnWidth:p,stickyScrollBarBg:m,stickyScrollBarBorderRadius:100,expandIconMarginTop:(h*g-3*b)/2-Math.ceil((1.4*v-3*b)/2),headerIconColor:Z.clone().setA(Z.a*w).toRgbString(),headerIconHoverColor:N.clone().setA(N.a*w).toRgbString(),expandIconHalfInner:K,expandIconSize:O,expandIconScale:k/O}},{unitless:{expandIconScale:!0}});let oT=[];var oD=o.forwardRef((e,t)=>{var n,r;let{prefixCls:l,className:c,rootClassName:i,style:d,size:s,bordered:u,dropdownPrefixCls:f,dataSource:p,pagination:m,rowSelection:h,rowKey:v="key",rowClassName:g,columns:b,children:y,childrenColumnName:x,onChange:w,getPopupContainer:k,loading:C,expandIcon:E,expandable:S,expandedRowRender:N,expandIconColumnIndex:K,indentSize:O,scroll:I,sortDirections:R,locale:P,showSorterTooltip:M={target:"full-header"},virtual:T}=e;(0,tc.ln)("Table");let D=o.useMemo(()=>b||ev(y),[b,y]),L=o.useMemo(()=>D.some(e=>e.responsive),[D]),j=(0,tZ.Z)(L),B=o.useMemo(()=>{let e=new Set(Object.keys(j).filter(e=>j[e]));return D.filter(t=>!t.responsive||t.responsive.some(t=>e.has(t)))},[D,j]),H=(0,eq.Z)(e,["className","style","columns"]),{locale:z=tN.Z,direction:A,table:W,renderEmpty:_,getPrefixCls:F,getPopupContainer:q}=o.useContext(tk.E_),V=(0,tS.Z)(s),X=Object.assign(Object.assign({},z.Table),P),U=p||oT,G=F("table",l),Y=F("dropdown",f),[,$]=(0,tI.ZP)(),J=(0,tE.Z)(G),[Q,ee,et]=oM(G,J),en=Object.assign(Object.assign({childrenColumnName:x,expandIconColumnIndex:K},S),{expandIcon:null!==(n=null==S?void 0:S.expandIcon)&&void 0!==n?n:null===(r=null==W?void 0:W.expandable)||void 0===r?void 0:r.expandIcon}),{childrenColumnName:eo="children"}=en,er=o.useMemo(()=>U.some(e=>null==e?void 0:e[eo])?"nest":N||(null==S?void 0:S.expandedRowRender)?"row":null,[U]),ea={body:o.useRef(null)},el=o.useRef(null),ec=o.useRef(null);tb(t,()=>Object.assign(Object.assign({},ec.current),{nativeElement:el.current}));let ei=o.useMemo(()=>"function"==typeof v?v:e=>null==e?void 0:e[v],[v]),[ed]=n3(U,eo,ei),es={},eu=function(e,t){var n,o,r,a;let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=Object.assign(Object.assign({},es),e);l&&(null===(n=es.resetPagination)||void 0===n||n.call(es),(null===(o=c.pagination)||void 0===o?void 0:o.current)&&(c.pagination.current=1),m&&(null===(r=m.onChange)||void 0===r||r.call(m,1,null===(a=c.pagination)||void 0===a?void 0:a.pageSize))),I&&!1!==I.scrollToFirstRowOnChange&&ea.body.current&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{getContainer:n=()=>window,callback:o,duration:r=450}=t,a=n(),l=tx(a),c=Date.now(),i=()=>{let t=Date.now()-c,n=function(e,t,n,o){let r=n-t;return(e/=o/2)<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t}(t>r?r:t,l,e,r);ty(a)?a.scrollTo(window.pageXOffset,n):a instanceof Document||"HTMLDocument"===a.constructor.name?a.documentElement.scrollTop=n:a.scrollTop=n,tea.body.current}),null==w||w(c.pagination,c.filters,c.sorter,{currentDataSource:n0(os(U,c.sorterStates,eo),c.filterStates,eo),action:t})},[ef,ep,em,eh]=ou({prefixCls:G,mergedColumns:B,onSorterChange:(e,t)=>{eu({sorter:e,sorterStates:t},"sort",!1)},sortDirections:R||["ascend","descend"],tableLocale:X,showSorterTooltip:M}),eg=o.useMemo(()=>os(U,ep,eo),[U,ep]);es.sorter=eh(),es.sorterStates=ep;let[eb,ey,ex]=n2({prefixCls:G,locale:X,dropdownPrefixCls:Y,mergedColumns:B,onFilterChange:(e,t)=>{eu({filters:e,filterStates:t},"filter",!0)},getPopupContainer:k||q,rootClassName:Z()(i,J)}),ew=n0(eg,ey,eo);es.filters=ex,es.filterStates=ey;let[eC]=op(o.useMemo(()=>{let e={};return Object.keys(ex).forEach(t=>{null!==ex[t]&&(e[t]=ex[t])}),Object.assign(Object.assign({},em),{filters:e})},[em,ex])),[eE,eS]=n8(ew.length,(e,t)=>{eu({pagination:Object.assign(Object.assign({},es.pagination),{current:e,pageSize:t})},"paginate")},m);es.pagination=!1===m?{}:function(e,t){let n={current:e.current,pageSize:e.pageSize};return Object.keys(t&&"object"==typeof t?t:{}).forEach(t=>{let o=e[t];"function"!=typeof o&&(n[t]=o)}),n}(eE,m),es.resetPagination=eS;let eZ=o.useMemo(()=>{if(!1===m||!eE.pageSize)return ew;let{current:e=1,total:t,pageSize:n=10}=eE;return ew.lengthn?ew.slice((e-1)*n,e*n):ew:ew.slice((e-1)*n,e*n)},[!!m,ew,null==eE?void 0:eE.current,null==eE?void 0:eE.pageSize,null==eE?void 0:eE.total]),[eN,eK]=tg({prefixCls:G,data:ew,pageData:eZ,getRowKey:ei,getRecordByKey:ed,expandType:er,childrenColumnName:eo,locale:X,getPopupContainer:k||q},h);en.__PARENT_RENDER_ICON__=en.expandIcon,en.expandIcon=en.expandIcon||E||(e=>{let{prefixCls:t,onExpand:n,record:r,expanded:a,expandable:l}=e,c="".concat(t,"-row-expand-icon");return o.createElement("button",{type:"button",onClick:e=>{n(r,e),e.stopPropagation()},className:Z()(c,{["".concat(c,"-spaced")]:!l,["".concat(c,"-expanded")]:l&&a,["".concat(c,"-collapsed")]:l&&!a}),"aria-label":a?X.collapse:X.expand,"aria-expanded":a})}),"nest"===er&&void 0===en.expandIconColumnIndex?en.expandIconColumnIndex=h?1:0:en.expandIconColumnIndex>0&&h&&(en.expandIconColumnIndex-=1),"number"!=typeof en.indentSize&&(en.indentSize="number"==typeof O?O:15);let eO=o.useCallback(e=>eC(eN(eb(ef(e)))),[ef,eb,eN]),eI=o.useMemo(()=>"boolean"==typeof C?{spinning:C}:"object"==typeof C&&null!==C?Object.assign({spinning:!0},C):void 0,[C]),eR=Z()(et,J,"".concat(G,"-wrapper"),null==W?void 0:W.className,{["".concat(G,"-wrapper-rtl")]:"rtl"===A},c,i,ee),eP=Object.assign(Object.assign({},null==W?void 0:W.style),d),eM=o.useMemo(()=>(null==eI?void 0:eI.spinning)&&U===oT?null:void 0!==(null==P?void 0:P.emptyText)?P.emptyText:(null==_?void 0:_("Table"))||o.createElement(tC.Z,{componentName:"Table"}),[null==eI?void 0:eI.spinning,U,null==P?void 0:P.emptyText,_]),eT={},eD=o.useMemo(()=>{let{fontSize:e,lineHeight:t,lineWidth:n,padding:o,paddingXS:r,paddingSM:a}=$,l=Math.floor(e*t);switch(V){case"middle":return 2*a+l+n;case"small":return 2*r+l+n;default:return 2*o+l+n}},[$,V]);T&&(eT.listItemHeight=eD);let{top:eL,bottom:ej}=(()=>{if(!1===m||!(null==eE?void 0:eE.total))return{};let e=()=>eE.size||("small"===V||"middle"===V?"small":void 0),t=t=>o.createElement(tK.Z,Object.assign({},eE,{align:eE.align||("left"===t?"start":"right"===t?"end":t),className:Z()("".concat(G,"-pagination"),eE.className),size:e()})),n="rtl"===A?"left":"right",r=eE.position;if(null===r||!Array.isArray(r))return{bottom:t(n)};let a=r.find(e=>"string"==typeof e&&e.toLowerCase().includes("top")),l=r.find(e=>"string"==typeof e&&e.toLowerCase().includes("bottom")),c=r.every(e=>"none"==="".concat(e)),i=a?a.toLowerCase().replace("top",""):"",d=l?l.toLowerCase().replace("bottom",""):"";return{top:i?t(i):void 0,bottom:d?t(d):a||l||c?void 0:t(n)}})();return Q(o.createElement("div",{ref:el,className:eR,style:eP},o.createElement(tO.Z,Object.assign({spinning:!1},eI),eL,o.createElement(T?oh:om,Object.assign({},eT,H,{ref:ec,columns:B,direction:A,expandable:en,prefixCls:G,className:Z()({["".concat(G,"-middle")]:"middle"===V,["".concat(G,"-small")]:"small"===V,["".concat(G,"-bordered")]:u,["".concat(G,"-empty")]:0===U.length},et,J,ee),data:eZ,rowKey:ei,rowClassName:(e,t,n)=>{let o;return o="function"==typeof g?Z()(g(e,t,n)):Z()(g),Z()({["".concat(G,"-row-selected")]:eK.has(ei(e,t))},o)},emptyText:eM,internalHooks:a,internalRefs:ea,transformColumns:eO,getContainerWidth:(e,t)=>{let n=e.querySelector(".".concat(G,"-container")),o=t;if(n){let e=getComputedStyle(n);o=t-Number.parseInt(e.borderLeftWidth,10)-Number.parseInt(e.borderRightWidth,10)}return o},measureRowRender:e=>o.createElement(tw.ZP,{getPopupContainer:e=>e},e)})),ej)))});let oL=o.forwardRef((e,t)=>{let n=o.useRef(0);return n.current+=1,o.createElement(oD,Object.assign({},e,{ref:t,_renderTimes:n.current}))});oL.SELECTION_COLUMN=tu,oL.EXPAND_COLUMN=r,oL.SELECTION_ALL=tf,oL.SELECTION_INVERT=tp,oL.SELECTION_NONE=tm,oL.Column=e=>null,oL.ColumnGroup=e=>null,oL.Summary=H;var oj=oL}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6609-d93906f43161f066.js b/litellm/proxy/_experimental/out/_next/static/chunks/6609-d93906f43161f066.js deleted file mode 100644 index 8e0a0e5f3b6..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/6609-d93906f43161f066.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6609],{29967:function(e,t,n){n.d(t,{ZP:function(){return B}});var o=n(2265),r=n(36760),a=n.n(r),l=n(92491),c=n(50506),i=n(18242),d=n(71744),s=n(64024),u=n(33759);let f=o.createContext(null),p=f.Provider,m=o.createContext(null),h=m.Provider;var v=n(20873),g=n(28791),b=n(6694),y=n(34709),x=n(66531),w=n(86586),k=n(39109),C=n(93463),E=n(12918),S=n(99320),Z=n(71140);let N=e=>{let{componentCls:t,antCls:n}=e,o="".concat(t,"-group");return{[o]:Object.assign(Object.assign({},(0,E.Wf)(e)),{display:"inline-block",fontSize:0,["&".concat(o,"-rtl")]:{direction:"rtl"},["&".concat(o,"-block")]:{display:"flex"},["".concat(n,"-badge ").concat(n,"-badge-count")]:{zIndex:1},["> ".concat(n,"-badge:not(:first-child) > ").concat(n,"-button-wrapper")]:{borderInlineStart:"none"}})}},K=e=>{let{componentCls:t,wrapperMarginInlineEnd:n,colorPrimary:o,radioSize:r,motionDurationSlow:a,motionDurationMid:l,motionEaseInOutCirc:c,colorBgContainer:i,colorBorder:d,lineWidth:s,colorBgContainerDisabled:u,colorTextDisabled:f,paddingXS:p,dotColorDisabled:m,lineType:h,radioColor:v,radioBgColor:g,calc:b}=e,y="".concat(t,"-inner"),x=b(r).sub(b(4).mul(2)),w=b(1).mul(r).equal({unit:!0});return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},(0,E.Wf)(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer","&:last-child":{marginInlineEnd:0},["&".concat(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"},["".concat(t,"-checked::after")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:"".concat((0,C.bf)(s)," ").concat(h," ").concat(o),borderRadius:"50%",visibility:"hidden",opacity:0,content:'""'},[t]:Object.assign(Object.assign({},(0,E.Wf)(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),["".concat(t,"-wrapper:hover &,\n &:hover ").concat(y)]:{borderColor:o},["".concat(t,"-input:focus-visible + ").concat(y)]:(0,E.oN)(e),["".concat(t,":hover::after, ").concat(t,"-wrapper:hover &::after")]:{visibility:"visible"},["".concat(t,"-inner")]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:w,height:w,marginBlockStart:b(1).mul(r).div(-2).equal({unit:!0}),marginInlineStart:b(1).mul(r).div(-2).equal({unit:!0}),backgroundColor:v,borderBlockStart:0,borderInlineStart:0,borderRadius:w,transform:"scale(0)",opacity:0,transition:"all ".concat(a," ").concat(c),content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:w,height:w,backgroundColor:i,borderColor:d,borderStyle:"solid",borderWidth:s,borderRadius:"50%",transition:"all ".concat(l)},["".concat(t,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},["".concat(t,"-checked")]:{[y]:{borderColor:o,backgroundColor:g,"&::after":{transform:"scale(".concat(e.calc(e.dotSize).div(r).equal(),")"),opacity:1,transition:"all ".concat(a," ").concat(c)}}},["".concat(t,"-disabled")]:{cursor:"not-allowed",[y]:{backgroundColor:u,borderColor:d,cursor:"not-allowed","&::after":{backgroundColor:m}},["".concat(t,"-input")]:{cursor:"not-allowed"},["".concat(t,"-disabled + span")]:{color:f,cursor:"not-allowed"},["&".concat(t,"-checked")]:{[y]:{"&::after":{transform:"scale(".concat(b(x).div(r).equal(),")")}}}},["span".concat(t," + *")]:{paddingInlineStart:p,paddingInlineEnd:p}})}},O=e=>{let{buttonColor:t,controlHeight:n,componentCls:o,lineWidth:r,lineType:a,colorBorder:l,motionDurationMid:c,buttonPaddingInline:i,fontSize:d,buttonBg:s,fontSizeLG:u,controlHeightLG:f,controlHeightSM:p,paddingXS:m,borderRadius:h,borderRadiusSM:v,borderRadiusLG:g,buttonCheckedBg:b,buttonSolidCheckedColor:y,colorTextDisabled:x,colorBgContainerDisabled:w,buttonCheckedBgDisabled:k,buttonCheckedColorDisabled:S,colorPrimary:Z,colorPrimaryHover:N,colorPrimaryActive:K,buttonSolidCheckedBg:O,buttonSolidCheckedHoverBg:I,buttonSolidCheckedActiveBg:R,calc:P}=e;return{["".concat(o,"-button-wrapper")]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:i,paddingBlock:0,color:t,fontSize:d,lineHeight:(0,C.bf)(P(n).sub(P(r).mul(2)).equal()),background:s,border:"".concat((0,C.bf)(r)," ").concat(a," ").concat(l),borderBlockStartWidth:P(r).add(.02).equal(),borderInlineEndWidth:r,cursor:"pointer",transition:["color ".concat(c),"background ".concat(c),"box-shadow ".concat(c)].join(","),a:{color:t},["> ".concat(o,"-button")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:last-child)":{marginInlineEnd:P(r).mul(-1).equal()},"&:first-child":{borderInlineStart:"".concat((0,C.bf)(r)," ").concat(a," ").concat(l),borderStartStartRadius:h,borderEndStartRadius:h},"&:last-child":{borderStartEndRadius:h,borderEndEndRadius:h},"&:first-child:last-child":{borderRadius:h},["".concat(o,"-group-large &")]:{height:f,fontSize:u,lineHeight:(0,C.bf)(P(f).sub(P(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:g,borderEndStartRadius:g},"&:last-child":{borderStartEndRadius:g,borderEndEndRadius:g}},["".concat(o,"-group-small &")]:{height:p,paddingInline:P(m).sub(r).equal(),paddingBlock:0,lineHeight:(0,C.bf)(P(p).sub(P(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},"&:hover":{position:"relative",color:Z},"&:has(:focus-visible)":(0,E.oN)(e),["".concat(o,"-inner, input[type='checkbox'], input[type='radio']")]:{width:0,height:0,opacity:0,pointerEvents:"none"},["&-checked:not(".concat(o,"-button-wrapper-disabled)")]:{zIndex:1,color:Z,background:b,borderColor:Z,"&::before":{backgroundColor:Z},"&:first-child":{borderColor:Z},"&:hover":{color:N,borderColor:N,"&::before":{backgroundColor:N}},"&:active":{color:K,borderColor:K,"&::before":{backgroundColor:K}}},["".concat(o,"-group-solid &-checked:not(").concat(o,"-button-wrapper-disabled)")]:{color:y,background:O,borderColor:O,"&:hover":{color:y,background:I,borderColor:I},"&:active":{color:y,background:R,borderColor:R}},"&-disabled":{color:x,backgroundColor:w,borderColor:l,cursor:"not-allowed","&:first-child, &:hover":{color:x,backgroundColor:w,borderColor:l}},["&-disabled".concat(o,"-button-wrapper-checked")]:{color:S,backgroundColor:k,borderColor:l,boxShadow:"none"},"&-block":{flex:1,textAlign:"center"}}}};var I=(0,S.I$)("Radio",e=>{let{controlOutline:t,controlOutlineWidth:n}=e,o="0 0 0 ".concat((0,C.bf)(n)," ").concat(t),r=(0,Z.IX)(e,{radioFocusShadow:o,radioButtonFocusShadow:o});return[N(r),K(r),O(r)]},e=>{let{wireframe:t,padding:n,marginXS:o,lineWidth:r,fontSizeLG:a,colorText:l,colorBgContainer:c,colorTextDisabled:i,controlItemBgActiveDisabled:d,colorTextLightSolid:s,colorPrimary:u,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:m}=e;return{radioSize:a,dotSize:t?a-8:a-(4+r)*2,dotColorDisabled:i,buttonSolidCheckedColor:s,buttonSolidCheckedBg:u,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:c,buttonCheckedBg:c,buttonColor:l,buttonCheckedBgDisabled:d,buttonCheckedColorDisabled:i,buttonPaddingInline:n-r,wrapperMarginInlineEnd:o,radioColor:t?u:m,radioBgColor:t?c:u}},{unitless:{radioSize:!0,dotSize:!0}}),R=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let P=o.forwardRef((e,t)=>{var n,r;let l=o.useContext(f),c=o.useContext(m),{getPrefixCls:i,direction:u,radio:p}=o.useContext(d.E_),h=o.useRef(null),C=(0,g.sQ)(t,h),{isFormItemInput:E}=o.useContext(k.aM),{prefixCls:S,className:Z,rootClassName:N,children:K,style:O,title:P}=e,M=R(e,["prefixCls","className","rootClassName","children","style","title"]),T=i("radio",S),D="button"===((null==l?void 0:l.optionType)||c),L=D?"".concat(T,"-button"):T,j=(0,s.Z)(T),[B,H,z]=I(T,j),A=Object.assign({},M),W=o.useContext(w.Z);l&&(A.name=l.name,A.onChange=t=>{var n,o;null===(n=e.onChange)||void 0===n||n.call(e,t),null===(o=null==l?void 0:l.onChange)||void 0===o||o.call(l,t)},A.checked=e.value===l.value,A.disabled=null!==(n=A.disabled)&&void 0!==n?n:l.disabled),A.disabled=null!==(r=A.disabled)&&void 0!==r?r:W;let _=a()("".concat(L,"-wrapper"),{["".concat(L,"-wrapper-checked")]:A.checked,["".concat(L,"-wrapper-disabled")]:A.disabled,["".concat(L,"-wrapper-rtl")]:"rtl"===u,["".concat(L,"-wrapper-in-form-item")]:E,["".concat(L,"-wrapper-block")]:!!(null==l?void 0:l.block)},null==p?void 0:p.className,Z,N,H,z,j),[F,q]=(0,x.Z)(A.onClick);return B(o.createElement(b.Z,{component:"Radio",disabled:A.disabled},o.createElement("label",{className:_,style:Object.assign(Object.assign({},null==p?void 0:p.style),O),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:P,onClick:F},o.createElement(v.Z,Object.assign({},A,{className:a()(A.className,{[y.A]:!D}),type:"radio",prefixCls:L,ref:C,onClick:q})),void 0!==K?o.createElement("span",{className:"".concat(L,"-label")},K):null)))});var M=n(29487);let T=o.forwardRef((e,t)=>{let{getPrefixCls:n,direction:r}=o.useContext(d.E_),{name:f}=o.useContext(k.aM),m=(0,l.Z)((0,M.S)(f)),{prefixCls:h,className:v,rootClassName:g,options:b,buttonStyle:y="outline",disabled:x,children:w,size:C,style:E,id:S,optionType:Z,name:N=m,defaultValue:K,value:O,block:R=!1,onChange:T,onMouseEnter:D,onMouseLeave:L,onFocus:j,onBlur:B}=e,[H,z]=(0,c.Z)(K,{value:O}),A=o.useCallback(t=>{let n=t.target.value;"value"in e||z(n),n!==H&&(null==T||T(t))},[H,z,T]),W=n("radio",h),_="".concat(W,"-group"),F=(0,s.Z)(W),[q,V,X]=I(W,F),U=w;b&&b.length>0&&(U=b.map(e=>"string"==typeof e||"number"==typeof e?o.createElement(P,{key:e.toString(),prefixCls:W,disabled:x,value:e,checked:H===e},e):o.createElement(P,{key:"radio-group-value-options-".concat(e.value),prefixCls:W,disabled:e.disabled||x,value:e.value,checked:H===e.value,title:e.title,style:e.style,className:e.className,id:e.id,required:e.required},e.label)));let G=(0,u.Z)(C),Y=a()(_,"".concat(_,"-").concat(y),{["".concat(_,"-").concat(G)]:G,["".concat(_,"-rtl")]:"rtl"===r,["".concat(_,"-block")]:R},v,g,V,X,F),$=o.useMemo(()=>({onChange:A,value:H,disabled:x,name:N,optionType:Z,block:R}),[A,H,x,N,Z,R]);return q(o.createElement("div",Object.assign({},(0,i.Z)(e,{aria:!0,data:!0}),{className:Y,style:E,onMouseEnter:D,onMouseLeave:L,onFocus:j,onBlur:B,id:S,ref:t}),o.createElement(p,{value:$},U)))});var D=o.memo(T),L=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},j=o.forwardRef((e,t)=>{let{getPrefixCls:n}=o.useContext(d.E_),{prefixCls:r}=e,a=L(e,["prefixCls"]),l=n("radio",r);return o.createElement(h,{value:"button"},o.createElement(P,Object.assign({prefixCls:l},a,{type:"radio",ref:t})))});P.Button=j,P.Group=D,P.__ANT_RADIO=!0;var B=P},56609:function(e,t,n){n.d(t,{Z:function(){return oj}});var o=n(2265),r={},a="rc-table-internal-hook",l=n(26365),c=n(58525),i=n(27380),d=n(16671),s=n(54887);function u(e){var t=o.createContext(void 0);return{Context:t,Provider:function(e){var n=e.value,r=e.children,a=o.useRef(n);a.current=n;var c=o.useState(function(){return{getValue:function(){return a.current},listeners:new Set}}),d=(0,l.Z)(c,1)[0];return(0,i.Z)(function(){(0,s.unstable_batchedUpdates)(function(){d.listeners.forEach(function(e){e(n)})})},[n]),o.createElement(t.Provider,{value:d},r)},defaultValue:e}}function f(e,t){var n=(0,c.Z)("function"==typeof t?t:function(e){if(void 0===t)return e;if(!Array.isArray(t))return e[t];var n={};return t.forEach(function(t){n[t]=e[t]}),n}),r=o.useContext(null==e?void 0:e.Context),a=r||{},s=a.listeners,u=a.getValue,f=o.useRef();f.current=n(r?u():null==e?void 0:e.defaultValue);var p=o.useState({}),m=(0,l.Z)(p,2)[1];return(0,i.Z)(function(){if(r)return s.add(e),function(){s.delete(e)};function e(e){var t=n(e);(0,d.Z)(f.current,t,!0)||m({})}},[r]),f.current}var p=n(1119),m=n(28791);function h(){var e=o.createContext(null);function t(){return o.useContext(e)}return{makeImmutable:function(n,r){var a=(0,m.Yr)(n),l=function(l,c){var i=a?{ref:c}:{},d=o.useRef(0),s=o.useRef(l);return null!==t()?o.createElement(n,(0,p.Z)({},l,i)):((!r||r(s.current,l))&&(d.current+=1),s.current=l,o.createElement(e.Provider,{value:d.current},o.createElement(n,(0,p.Z)({},l,i))))};return a?o.forwardRef(l):l},responseImmutable:function(e,n){var r=(0,m.Yr)(e),a=function(n,a){return t(),o.createElement(e,(0,p.Z)({},n,r?{ref:a}:{}))};return r?o.memo(o.forwardRef(a),n):o.memo(a,n)},useImmutableMark:t}}var v=h();v.makeImmutable,v.responseImmutable,v.useImmutableMark;var g=h(),b=g.makeImmutable,y=g.responseImmutable,x=g.useImmutableMark,w=u(),k=n(41154),C=n(31686),E=n(11993),S=n(36760),Z=n.n(S),N=n(6397),K=n(16847),O=n(32559),I=o.createContext({renderWithProps:!1});function R(e){var t=[],n={};return e.forEach(function(e){for(var o=e||{},r=o.key,a=o.dataIndex,l=r||(null==a?[]:Array.isArray(a)?a:[a]).join("-")||"RC_TABLE_KEY";n[l];)l="".concat(l,"_next");n[l]=!0,t.push(l)}),t}var P=n(74126),M=function(e){var t,n=e.ellipsis,r=e.rowType,a=e.children,l=!0===n?{showTitle:!0}:n;return l&&(l.showTitle||"header"===r)&&("string"==typeof a||"number"==typeof a?t=a.toString():o.isValidElement(a)&&"string"==typeof a.props.children&&(t=a.props.children)),t},T=o.memo(function(e){var t,n,r,a,c,i,s,u,m,h,v=e.component,g=e.children,b=e.ellipsis,y=e.scope,S=e.prefixCls,O=e.className,R=e.align,T=e.record,D=e.render,L=e.dataIndex,j=e.renderIndex,B=e.shouldCellUpdate,H=e.index,z=e.rowType,A=e.colSpan,W=e.rowSpan,_=e.fixLeft,F=e.fixRight,q=e.firstFixLeft,V=e.lastFixLeft,X=e.firstFixRight,U=e.lastFixRight,G=e.appendNode,Y=e.additionalProps,$=void 0===Y?{}:Y,J=e.isSticky,Q="".concat(S,"-cell"),ee=f(w,["supportSticky","allColumnsFixedLeft","rowHoverable"]),et=ee.supportSticky,en=ee.allColumnsFixedLeft,eo=ee.rowHoverable,er=(t=o.useContext(I),n=x(),(0,N.Z)(function(){if(null!=g)return[g];var e=null==L||""===L?[]:Array.isArray(L)?L:[L],n=(0,K.Z)(T,e),r=n,a=void 0;if(D){var l=D(n,T,j);!l||"object"!==(0,k.Z)(l)||Array.isArray(l)||o.isValidElement(l)?r=l:(r=l.children,a=l.props,t.renderWithProps=!0)}return[r,a]},[n,T,g,L,D,j],function(e,n){if(B){var o=(0,l.Z)(e,2)[1];return B((0,l.Z)(n,2)[1],o)}return!!t.renderWithProps||!(0,d.Z)(e,n,!0)})),ea=(0,l.Z)(er,2),el=ea[0],ec=ea[1],ei={},ed="number"==typeof _&&et,es="number"==typeof F&&et;ed&&(ei.position="sticky",ei.left=_),es&&(ei.position="sticky",ei.right=F);var eu=null!==(r=null!==(a=null!==(c=null==ec?void 0:ec.colSpan)&&void 0!==c?c:$.colSpan)&&void 0!==a?a:A)&&void 0!==r?r:1,ef=null!==(i=null!==(s=null!==(u=null==ec?void 0:ec.rowSpan)&&void 0!==u?u:$.rowSpan)&&void 0!==s?s:W)&&void 0!==i?i:1,ep=f(w,function(e){var t,n;return[(t=ef||1,n=e.hoverStartRow,H<=e.hoverEndRow&&H+t-1>=n),e.onHover]}),em=(0,l.Z)(ep,2),eh=em[0],ev=em[1],eg=(0,P.zX)(function(e){var t;T&&ev(H,H+ef-1),null==$||null===(t=$.onMouseEnter)||void 0===t||t.call($,e)}),eb=(0,P.zX)(function(e){var t;T&&ev(-1,-1),null==$||null===(t=$.onMouseLeave)||void 0===t||t.call($,e)});if(0===eu||0===ef)return null;var ey=null!==(m=$.title)&&void 0!==m?m:M({rowType:z,ellipsis:b,children:el}),ex=Z()(Q,O,(h={},(0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)(h,"".concat(Q,"-fix-left"),ed&&et),"".concat(Q,"-fix-left-first"),q&&et),"".concat(Q,"-fix-left-last"),V&&et),"".concat(Q,"-fix-left-all"),V&&en&&et),"".concat(Q,"-fix-right"),es&&et),"".concat(Q,"-fix-right-first"),X&&et),"".concat(Q,"-fix-right-last"),U&&et),"".concat(Q,"-ellipsis"),b),"".concat(Q,"-with-append"),G),"".concat(Q,"-fix-sticky"),(ed||es)&&J&&et),(0,E.Z)(h,"".concat(Q,"-row-hover"),!ec&&eh)),$.className,null==ec?void 0:ec.className),ew={};R&&(ew.textAlign=R);var ek=(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)({},null==ec?void 0:ec.style),ei),ew),$.style),eC=el;return"object"!==(0,k.Z)(eC)||Array.isArray(eC)||o.isValidElement(eC)||(eC=null),b&&(V||X)&&(eC=o.createElement("span",{className:"".concat(Q,"-content")},eC)),o.createElement(v,(0,p.Z)({},ec,$,{className:ex,style:ek,title:ey,scope:y,onMouseEnter:eo?eg:void 0,onMouseLeave:eo?eb:void 0,colSpan:1!==eu?eu:null,rowSpan:1!==ef?ef:null}),G,eC)});function D(e,t,n,o,r){var a,l,c=n[e]||{},i=n[t]||{};"left"===c.fixed?a=o.left["rtl"===r?t:e]:"right"===i.fixed&&(l=o.right["rtl"===r?e:t]);var d=!1,s=!1,u=!1,f=!1,p=n[t+1],m=n[e-1],h=p&&!p.fixed||m&&!m.fixed||n.every(function(e){return"left"===e.fixed});return"rtl"===r?void 0!==a?f=!(m&&"left"===m.fixed)&&h:void 0!==l&&(u=!(p&&"right"===p.fixed)&&h):void 0!==a?d=!(p&&"left"===p.fixed)&&h:void 0!==l&&(s=!(m&&"right"===m.fixed)&&h),{fixLeft:a,fixRight:l,lastFixLeft:d,firstFixRight:s,lastFixRight:u,firstFixLeft:f,isSticky:o.isSticky}}var L=o.createContext({}),j=n(6989),B=["children"];function H(e){return e.children}H.Row=function(e){var t=e.children,n=(0,j.Z)(e,B);return o.createElement("tr",n,t)},H.Cell=function(e){var t=e.className,n=e.index,r=e.children,a=e.colSpan,l=void 0===a?1:a,c=e.rowSpan,i=e.align,d=f(w,["prefixCls","direction"]),s=d.prefixCls,u=d.direction,m=o.useContext(L),h=m.scrollColumnIndex,v=m.stickyOffsets,g=m.flattenColumns,b=n+l-1+1===h?l+1:l,y=D(n,n+b-1,g,v,u);return o.createElement(T,(0,p.Z)({className:t,index:n,component:"td",prefixCls:s,record:null,dataIndex:null,align:i,colSpan:b,rowSpan:c,render:function(){return r}},y))};var z=y(function(e){var t=e.children,n=e.stickyOffsets,r=e.flattenColumns,a=f(w,"prefixCls"),l=r.length-1,c=r[l],i=o.useMemo(function(){return{stickyOffsets:n,flattenColumns:r,scrollColumnIndex:null!=c&&c.scrollbar?l:null}},[c,r,l,n]);return o.createElement(L.Provider,{value:i},o.createElement("tfoot",{className:"".concat(a,"-summary")},t))}),A=n(31474),W=n(10281),_=n(3208),F=n(18242);function q(e,t,n,r){return o.useMemo(function(){if(null!=n&&n.size){for(var o=[],a=0;a<(null==e?void 0:e.length);a+=1)!function e(t,n,o,r,a,l,c){var i=l(n,c);t.push({record:n,indent:o,index:c,rowKey:i});var d=null==a?void 0:a.has(i);if(n&&Array.isArray(n[r])&&d)for(var s=0;s1?n-1:0),r=1;r5&&void 0!==arguments[5]?arguments[5]:[],d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=e.record,u=e.prefixCls,f=e.columnsKey,p=e.fixedInfoList,m=e.expandIconColumnIndex,h=e.nestExpandable,v=e.indentSize,g=e.expandIcon,b=e.expanded,y=e.hasNestChildren,x=e.onTriggerExpand,w=e.expandable,k=e.expandedKeys,C=f[n],E=p[n];n===(m||0)&&h&&(c=o.createElement(o.Fragment,null,o.createElement("span",{style:{paddingLeft:"".concat(v*r,"px")},className:"".concat(u,"-row-indent indent-level-").concat(r)}),g({prefixCls:u,expanded:b,expandable:y,record:s,onExpand:x})));var S=(null===(l=t.onCell)||void 0===l?void 0:l.call(t,s,a))||{};if(d){var Z=S.rowSpan,N=void 0===Z?1:Z;if(w&&N&&n=1)),style:(0,C.Z)((0,C.Z)({},r),null==k?void 0:k.style)}),y.map(function(e,t){var n=e.render,r=e.dataIndex,i=e.className,s=Y(g,e,t,u,l,d,null==v?void 0:v.offset),f=s.key,y=s.fixedInfo,x=s.appendCellNode,w=s.additionalCellProps;return o.createElement(T,(0,p.Z)({className:i,ellipsis:e.ellipsis,align:e.align,scope:e.rowScope,component:e.rowScope?h:m,prefixCls:b,key:f,record:a,index:l,renderIndex:c,dataIndex:r,render:n,shouldCellUpdate:e.shouldCellUpdate},y,{appendNode:x,additionalProps:w}))}));if(N&&(K.current||S)){var R=w(a,l,u+1,S);t=o.createElement(X,{expanded:S,className:Z()("".concat(b,"-expanded-row"),"".concat(b,"-expanded-row-level-").concat(u+1),O),prefixCls:b,component:f,cellComponent:m,colSpan:v?v.colSpan:y.length,stickyOffset:null==v?void 0:v.sticky,isEmpty:!1},R)}return o.createElement(o.Fragment,null,I,t)});function J(e){var t=e.columnKey,n=e.onColumnResize,r=e.prefixCls,a=e.title,l=o.useRef();return(0,i.Z)(function(){l.current&&n(t,l.current.offsetWidth)},[]),o.createElement(A.Z,{data:t},o.createElement("th",{ref:l,className:"".concat(r,"-measure-cell")},o.createElement("div",{className:"".concat(r,"-measure-cell-content")},a||"\xa0")))}var Q=n(2857);function ee(e){var t=e.prefixCls,n=e.columnsKey,r=e.onColumnResize,a=e.columns,l=o.useRef(null),c=f(w,["measureRowRender"]).measureRowRender,i=o.createElement("tr",{"aria-hidden":"true",className:"".concat(t,"-measure-row"),ref:l,tabIndex:-1},o.createElement(A.Z.Collection,{onBatchResize:function(e){(0,Q.Z)(l.current)&&e.forEach(function(e){r(e.data,e.size.offsetWidth)})}},n.map(function(e){var n=a.find(function(t){return t.key===e}),l=null==n?void 0:n.title,c=o.isValidElement(l)?o.cloneElement(l,{ref:null}):l;return o.createElement(J,{prefixCls:t,key:e,columnKey:e,onColumnResize:r,title:c})})));return c?c(i):i}var et=y(function(e){var t,n=e.data,r=e.measureColumnWidth,a=f(w,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode","expandedRowOffset","fixedInfoList","colWidths"]),l=a.prefixCls,c=a.getComponent,i=a.onColumnResize,d=a.flattenColumns,s=a.getRowKey,u=a.expandedKeys,p=a.childrenColumnName,m=a.emptyNode,h=a.expandedRowOffset,v=void 0===h?0:h,g=a.colWidths,b=q(n,p,u,s),y=o.useMemo(function(){return b.map(function(e){return e.rowKey})},[b]),x=o.useRef({renderWithProps:!1}),k=o.useMemo(function(){for(var e=d.length-v,t=0,n=0;n=0;d-=1){var s=t[d],u=n&&n[d],m=void 0,h=void 0;if(u&&(m=u[eo],"auto"===a&&(h=u.minWidth)),s||h||m||i){var v=m||{},g=(v.columnType,(0,j.Z)(v,er));l.unshift(o.createElement("col",(0,p.Z)({key:d,style:{width:s,minWidth:h}},g))),i=!0}}return l.length>0?o.createElement("colgroup",null,l):null},el=n(83145),ec=["className","noData","columns","flattenColumns","colWidths","colGroup","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","scrollX","tableLayout","onScroll","children"],ei=o.forwardRef(function(e,t){var n=e.className,r=e.noData,a=e.columns,l=e.flattenColumns,c=e.colWidths,i=e.colGroup,d=e.columCount,s=e.stickyOffsets,u=e.direction,p=e.fixHeader,h=e.stickyTopOffset,v=e.stickyBottomOffset,g=e.stickyClassName,b=e.scrollX,y=e.tableLayout,x=e.onScroll,k=e.children,S=(0,j.Z)(e,ec),N=f(w,["prefixCls","scrollbarSize","isSticky","getComponent"]),K=N.prefixCls,O=N.scrollbarSize,I=N.isSticky,R=(0,N.getComponent)(["header","table"],"table"),P=I&&!p?0:O,M=o.useRef(null),T=o.useCallback(function(e){(0,m.mH)(t,e),(0,m.mH)(M,e)},[]);o.useEffect(function(){function e(e){var t=e.currentTarget,n=e.deltaX;n&&(x({currentTarget:t,scrollLeft:t.scrollLeft+n}),e.preventDefault())}var t=M.current;return null==t||t.addEventListener("wheel",e,{passive:!1}),function(){null==t||t.removeEventListener("wheel",e)}},[]);var D=l[l.length-1],L={fixed:D?D.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(K,"-cell-scrollbar")}}},B=(0,o.useMemo)(function(){return P?[].concat((0,el.Z)(a),[L]):a},[P,a]),H=(0,o.useMemo)(function(){return P?[].concat((0,el.Z)(l),[L]):l},[P,l]),z=(0,o.useMemo)(function(){var e=s.right,t=s.left;return(0,C.Z)((0,C.Z)({},s),{},{left:"rtl"===u?[].concat((0,el.Z)(t.map(function(e){return e+P})),[0]):t,right:"rtl"===u?e:[].concat((0,el.Z)(e.map(function(e){return e+P})),[0]),isSticky:I})},[P,s,I]),A=(0,o.useMemo)(function(){for(var e=[],t=0;t1?"colgroup":"col":null,ellipsis:l.ellipsis,align:l.align,component:c,prefixCls:u,key:h[t]},i,{additionalProps:n,rowType:"header"}))}))},eu=y(function(e){var t=e.stickyOffsets,n=e.columns,r=e.flattenColumns,a=e.onHeaderRow,l=f(w,["prefixCls","getComponent"]),c=l.prefixCls,i=l.getComponent,d=o.useMemo(function(){return function(e){var t=[];!function e(n,o){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t[r]=t[r]||[];var a=o;return n.filter(Boolean).map(function(n){var o={key:n.key,className:n.className||"",children:n.title,column:n,colStart:a},l=1,c=n.children;return c&&c.length>0&&(l=e(c,a,r+1).reduce(function(e,t){return e+t},0),o.hasSubColumns=!0),"colSpan"in n&&(l=n.colSpan),"rowSpan"in n&&(o.rowSpan=n.rowSpan),o.colSpan=l,o.colEnd=o.colStart+l-1,t[r].push(o),a+=l,l})}(e,0);for(var n=t.length,o=function(e){t[e].forEach(function(t){("rowSpan"in t)||t.hasSubColumns||(t.rowSpan=n-e)})},r=0;r1&&void 0!==arguments[1]?arguments[1]:"";return"number"==typeof t?t:t.endsWith("%")?e*parseFloat(t)/100:null}var em=["children"],eh=["fixed"];function ev(e){return(0,ef.Z)(e).filter(function(e){return o.isValidElement(e)}).map(function(e){var t=e.key,n=e.props,o=n.children,r=(0,j.Z)(n,em),a=(0,C.Z)({key:t},r);return o&&(a.children=ev(o)),a})}function eg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key";return e.filter(function(e){return e&&"object"===(0,k.Z)(e)}).reduce(function(e,n,o){var r=n.fixed,a=!0===r?"left":r,l="".concat(t,"-").concat(o),c=n.children;return c&&c.length>0?[].concat((0,el.Z)(e),(0,el.Z)(eg(c,l).map(function(e){var t;return(0,C.Z)((0,C.Z)({},e),{},{fixed:null!==(t=e.fixed)&&void 0!==t?t:a})}))):[].concat((0,el.Z)(e),[(0,C.Z)((0,C.Z)({key:l},n),{},{fixed:a})])},[])}var eb=function(e,t){var n=e.prefixCls,a=e.columns,c=e.children,i=e.expandable,d=e.expandedKeys,s=e.columnTitle,u=e.getRowKey,f=e.onTriggerExpand,p=e.expandIcon,m=e.rowExpandable,h=e.expandIconColumnIndex,v=e.expandedRowOffset,g=void 0===v?0:v,b=e.direction,y=e.expandRowByClick,x=e.columnWidth,w=e.fixed,S=e.scrollWidth,Z=e.clientWidth,N=o.useMemo(function(){return function e(t){return t.filter(function(e){return e&&"object"===(0,k.Z)(e)&&!e.hidden}).map(function(t){var n=t.children;return n&&n.length>0?(0,C.Z)((0,C.Z)({},t),{},{children:e(n)}):t})}((a||ev(c)||[]).slice())},[a,c]),K=o.useMemo(function(){if(i){var e,t=N.slice();if(!t.includes(r)){var a=h||0,l=0===a&&"right"===w?N.length:a;l>=0&&t.splice(l,0,r)}var c=t.indexOf(r);t=t.filter(function(e,t){return e!==r||t===c});var v=N[c];e=w||(v?v.fixed:null);var b=(0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)({},eo,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",s),"fixed",e),"className","".concat(n,"-row-expand-icon-cell")),"width",x),"render",function(e,t,r){var a=u(t,r),l=p({prefixCls:n,expanded:d.has(a),expandable:!m||m(t),record:t,onExpand:f});return y?o.createElement("span",{onClick:function(e){return e.stopPropagation()}},l):l});return t.map(function(e,t){var n=e===r?b:e;return t=0;t-=1){var n=I[t].fixed;if("left"===n||!0===n){e=t;break}}if(e>=0)for(var o=0;o<=e;o+=1){var r=I[o].fixed;if("left"!==r&&!0!==r)return!0}var a=I.findIndex(function(e){return"right"===e.fixed});if(a>=0){for(var l=a;l0){var e=0,t=0;I.forEach(function(n){var o=ep(S,n.width);o?e+=o:t+=1});var n=Math.max(S,Z),o=Math.max(n-e,t),r=t,a=o/t,l=0,c=I.map(function(e){var t=(0,C.Z)({},e),n=ep(S,t.width);if(n)t.width=n;else{var c=Math.floor(a);t.width=1===r?o:c,o-=c,r-=1}return l+=t.width,t});if(l=n-h})})}})},z=function(e){I(function(t){return(0,C.Z)((0,C.Z)({},t),{},{scrollLeft:y?e/y*x:0})})};return(o.useImperativeHandle(t,function(){return{setScrollLeft:z,checkScrollBarVisible:H}}),o.useEffect(function(){var e=ew(document.body,"mouseup",j,!1),t=ew(document.body,"mousemove",B,!1);return H(),function(){e.remove(),t.remove()}},[k,T]),o.useEffect(function(){if(p.current){for(var e=[],t=(0,eC.bn)(p.current);t;)e.push(t),t=t.parentElement;return e.forEach(function(e){return e.addEventListener("scroll",H,!1)}),window.addEventListener("resize",H,!1),window.addEventListener("scroll",H,!1),v.addEventListener("scroll",H,!1),function(){e.forEach(function(e){return e.removeEventListener("scroll",H)}),window.removeEventListener("resize",H),window.removeEventListener("scroll",H),v.removeEventListener("scroll",H)}}},[v]),o.useEffect(function(){O.isHiddenScrollBar||I(function(e){var t=p.current;return t?(0,C.Z)((0,C.Z)({},e),{},{scrollLeft:t.scrollLeft/t.scrollWidth*t.clientWidth}):e})},[O.isHiddenScrollBar]),y<=x||!k||O.isHiddenScrollBar)?null:o.createElement("div",{style:{height:(0,_.Z)(),width:x,bottom:h},className:"".concat(b,"-sticky-scroll")},o.createElement("div",{onMouseDown:function(e){e.persist(),R.current.delta=e.pageX-O.scrollLeft,R.current.x=0,D(!0),e.preventDefault()},ref:S,className:Z()("".concat(b,"-sticky-scroll-bar"),(0,E.Z)({},"".concat(b,"-sticky-scroll-bar-active"),T)),style:{width:"".concat(k,"px"),transform:"translate3d(".concat(O.scrollLeft,"px, 0, 0)")}}))}),eZ="rc-table",eN=[],eK={};function eO(){return"No Data"}var eI=o.forwardRef(function(e,t){var n,r=(0,C.Z)({rowKey:"key",prefixCls:eZ,emptyText:eO},e),s=r.prefixCls,u=r.className,f=r.rowClassName,m=r.style,h=r.data,v=r.rowKey,g=r.scroll,b=r.tableLayout,y=r.direction,x=r.title,S=r.footer,O=r.summary,I=r.caption,P=r.id,M=r.showHeader,T=r.components,L=r.emptyText,B=r.onRow,q=r.onHeaderRow,V=r.measureRowRender,X=r.onScroll,G=r.internalHooks,Y=r.transformColumns,$=r.internalRefs,J=r.tailor,Q=r.getContainerWidth,ee=r.sticky,eo=r.rowHoverable,er=void 0===eo||eo,ec=h||eN,ei=!!ec.length,es=G===a,ef=o.useCallback(function(e,t){return(0,K.Z)(T,e)||t},[T]),ep=o.useMemo(function(){return"function"==typeof v?v:function(e){return e&&e[v]}},[v]),em=ef(["body"]),eh=(tU=o.useState(-1),tY=(tG=(0,l.Z)(tU,2))[0],t$=tG[1],tJ=o.useState(-1),t0=(tQ=(0,l.Z)(tJ,2))[0],t1=tQ[1],[tY,t0,o.useCallback(function(e,t){t$(e),t1(t)},[])]),ev=(0,l.Z)(eh,3),eg=ev[0],ew=ev[1],ek=ev[2],eE=(t8=(t3=r.expandable,t4=(0,j.Z)(r,en),!1===(t2="expandable"in r?(0,C.Z)((0,C.Z)({},t4),t3):t4).showExpandColumn&&(t2.expandIconColumnIndex=-1),t2).expandIcon,t6=t2.expandedRowKeys,t5=t2.defaultExpandedRowKeys,t7=t2.defaultExpandAllRows,t9=t2.expandedRowRender,ne=t2.onExpand,nt=t2.onExpandedRowsChange,nn=t2.childrenColumnName||"children",no=o.useMemo(function(){return t9?"row":!!(r.expandable&&r.internalHooks===a&&r.expandable.__PARENT_RENDER_ICON__||ec.some(function(e){return e&&"object"===(0,k.Z)(e)&&e[nn]}))&&"nest"},[!!t9,ec]),nr=o.useState(function(){if(t5)return t5;if(t7){var e;return e=[],function t(n){(n||[]).forEach(function(n,o){e.push(ep(n,o)),t(n[nn])})}(ec),e}return[]}),nl=(na=(0,l.Z)(nr,2))[0],nc=na[1],ni=o.useMemo(function(){return new Set(t6||nl||[])},[t6,nl]),nd=o.useCallback(function(e){var t,n=ep(e,ec.indexOf(e)),o=ni.has(n);o?(ni.delete(n),t=(0,el.Z)(ni)):t=[].concat((0,el.Z)(ni),[n]),nc(t),ne&&ne(!o,e),nt&&nt(t)},[ep,ni,ec,ne,nt]),[t2,no,ni,t8||U,nn,nd]),eI=(0,l.Z)(eE,6),eR=eI[0],eP=eI[1],eM=eI[2],eT=eI[3],eD=eI[4],eL=eI[5],ej=null==g?void 0:g.x,eB=o.useState(0),eH=(0,l.Z)(eB,2),ez=eH[0],eA=eH[1],eW=eb((0,C.Z)((0,C.Z)((0,C.Z)({},r),eR),{},{expandable:!!eR.expandedRowRender,columnTitle:eR.columnTitle,expandedKeys:eM,getRowKey:ep,onTriggerExpand:eL,expandIcon:eT,expandIconColumnIndex:eR.expandIconColumnIndex,direction:y,scrollWidth:es&&J&&"number"==typeof ej?ej:null,clientWidth:ez}),es?Y:null),e_=(0,l.Z)(eW,4),eF=e_[0],eq=e_[1],eV=e_[2],eX=e_[3],eU=null!=eV?eV:ej,eG=o.useMemo(function(){return{columns:eF,flattenColumns:eq}},[eF,eq]),eY=o.useRef(),e$=o.useRef(),eJ=o.useRef(),eQ=o.useRef();o.useImperativeHandle(t,function(){return{nativeElement:eY.current,scrollTo:function(e){var t;if(eJ.current instanceof HTMLElement){var n=e.index,o=e.top,r=e.key;if("number"!=typeof o||Number.isNaN(o)){var a,l,c=null!=r?r:ep(ec[n]);null===(l=eJ.current.querySelector('[data-row-key="'.concat(c,'"]')))||void 0===l||l.scrollIntoView()}else null===(a=eJ.current)||void 0===a||a.scrollTo({top:o})}else null!==(t=eJ.current)&&void 0!==t&&t.scrollTo&&eJ.current.scrollTo(e)}}});var e0=o.useRef(),e1=o.useState(!1),e2=(0,l.Z)(e1,2),e3=e2[0],e4=e2[1],e8=o.useState(!1),e6=(0,l.Z)(e8,2),e5=e6[0],e7=e6[1],e9=o.useState(new Map),te=(0,l.Z)(e9,2),tt=te[0],tn=te[1],to=R(eq).map(function(e){return tt.get(e)}),tr=o.useMemo(function(){return to},[to.join("_")]),ta=(0,o.useMemo)(function(){var e=eq.length,t=function(e,t,n){for(var o=[],r=0,a=e;a!==t;a+=n)o.push(r),eq[a].fixed&&(r+=tr[a]||0);return o},n=t(0,e,1),o=t(e-1,-1,-1).reverse();return"rtl"===y?{left:o,right:n}:{left:n,right:o}},[tr,eq,y]),tl=g&&null!=g.y,tc=g&&null!=eU||!!eR.fixed,ti=tc&&eq.some(function(e){return e.fixed}),td=o.useRef(),ts=(nf=void 0===(nu=(ns="object"===(0,k.Z)(ee)?ee:{}).offsetHeader)?0:nu,nm=void 0===(np=ns.offsetSummary)?0:np,nv=void 0===(nh=ns.offsetScroll)?0:nh,nb=(void 0===(ng=ns.getContainer)?function(){return ey}:ng)()||ey,ny=!!ee,o.useMemo(function(){return{isSticky:ny,stickyClassName:ny?"".concat(s,"-sticky-holder"):"",offsetHeader:nf,offsetSummary:nm,offsetScroll:nv,container:nb}},[ny,nv,nf,nm,s,nb])),tu=ts.isSticky,tf=ts.offsetHeader,tp=ts.offsetSummary,tm=ts.offsetScroll,th=ts.stickyClassName,tv=ts.container,tg=o.useMemo(function(){return null==O?void 0:O(ec)},[O,ec]),tb=(tl||tu)&&o.isValidElement(tg)&&tg.type===H&&tg.props.fixed;tl&&(nw={overflowY:ei?"scroll":"auto",maxHeight:g.y}),tc&&(nx={overflowX:"auto"},tl||(nw={overflowY:"hidden"}),nk={width:!0===eU?"auto":eU,minWidth:"100%"});var ty=o.useCallback(function(e,t){tn(function(n){if(n.get(e)!==t){var o=new Map(n);return o.set(e,t),o}return n})},[]),tx=function(e){var t=(0,o.useRef)(null),n=(0,o.useRef)();function r(){window.clearTimeout(n.current)}return(0,o.useEffect)(function(){return r},[]),[function(e){t.current=e,r(),n.current=window.setTimeout(function(){t.current=null,n.current=void 0},100)},function(){return t.current}]}(0),tw=(0,l.Z)(tx,2),tk=tw[0],tC=tw[1];function tE(e,t){t&&("function"==typeof t?t(e):t.scrollLeft!==e&&(t.scrollLeft=e,t.scrollLeft!==e&&setTimeout(function(){t.scrollLeft=e},0)))}var tS=(0,c.Z)(function(e){var t,n=e.currentTarget,o=e.scrollLeft,r="rtl"===y,a="number"==typeof o?o:n.scrollLeft,l=n||eK;tC()&&tC()!==l||(tk(l),tE(a,e$.current),tE(a,eJ.current),tE(a,e0.current),tE(a,null===(t=td.current)||void 0===t?void 0:t.setScrollLeft));var c=n||e$.current;if(c){var i=es&&J&&"number"==typeof eU?eU:c.scrollWidth,d=c.clientWidth;if(i===d){e4(!1),e7(!1);return}r?(e4(-a0)):(e4(a>0),e7(a1?x-D:0,pointerEvents:"auto"}),j=o.useMemo(function(){return h?M<=1:0===R||0===M||M>1},[M,R,h]);j?L.visibility="hidden":h&&(L.height=null==v?void 0:v(M));var B={};return(0===M||0===R)&&(B.rowSpan=1,B.colSpan=1),o.createElement(T,(0,p.Z)({className:Z()(y,m),ellipsis:r.ellipsis,align:r.align,scope:r.rowScope,component:i,prefixCls:n.prefixCls,key:E,record:s,index:c,renderIndex:d,dataIndex:b,render:j?function(){return null}:g,shouldCellUpdate:r.shouldCellUpdate},S,{appendNode:N,additionalProps:(0,C.Z)((0,C.Z)({},K),{},{style:L},B)}))},eL=["data","index","className","rowKey","style","extra","getHeight"],ej=y(o.forwardRef(function(e,t){var n,r=e.data,a=e.index,l=e.className,c=e.rowKey,i=e.style,d=e.extra,s=e.getHeight,u=(0,j.Z)(e,eL),m=r.record,h=r.indent,v=r.index,g=f(w,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),b=g.scrollX,y=g.flattenColumns,x=g.prefixCls,k=g.fixColumn,S=g.componentWidth,N=f(eM,["getComponent"]).getComponent,K=V(m,c,a,h),O=N(["body","row"],"div"),I=N(["body","cell"],"div"),R=K.rowSupportExpand,P=K.expanded,M=K.rowProps,D=K.expandedRowRender,L=K.expandedRowClassName;if(R&&P){var B=D(m,a,h+1,P),H=G(L,m,a,h),z={};k&&(z={style:(0,E.Z)({},"--virtual-width","".concat(S,"px"))});var A="".concat(x,"-expanded-row-cell");n=o.createElement(O,{className:Z()("".concat(x,"-expanded-row"),"".concat(x,"-expanded-row-level-").concat(h+1),H)},o.createElement(T,{component:I,prefixCls:x,className:Z()(A,(0,E.Z)({},"".concat(A,"-fixed"),k)),additionalProps:z},B))}var W=(0,C.Z)((0,C.Z)({},i),{},{width:b});d&&(W.position="absolute",W.pointerEvents="none");var _=o.createElement(O,(0,p.Z)({},M,u,{"data-row-key":c,ref:R?null:t,className:Z()(l,"".concat(x,"-row"),null==M?void 0:M.className,(0,E.Z)({},"".concat(x,"-row-extra"),d)),style:(0,C.Z)((0,C.Z)({},W),null==M?void 0:M.style)}),y.map(function(e,t){return o.createElement(eD,{key:t,component:I,rowInfo:K,column:e,colIndex:t,indent:h,index:a,renderIndex:v,record:m,inverse:d,getHeight:s})}));return R?o.createElement("div",{ref:t},_,n):_})),eB=y(o.forwardRef(function(e,t){var n=e.data,r=e.onScroll,a=f(w,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","scrollX","direction"]),c=a.flattenColumns,i=a.onColumnResize,d=a.getRowKey,s=a.expandedKeys,u=a.prefixCls,p=a.childrenColumnName,m=a.scrollX,h=a.direction,v=f(eM),g=v.sticky,b=v.scrollY,y=v.listItemHeight,x=v.getComponent,C=v.onScroll,E=o.useRef(),S=q(n,p,s,d),Z=o.useMemo(function(){var e=0;return c.map(function(t){var n=t.width,o=t.minWidth,r=t.key,a=Math.max(n||0,o||0);return e+=a,[r,a,e]})},[c]),N=o.useMemo(function(){return Z.map(function(e){return e[2]})},[Z]);o.useEffect(function(){Z.forEach(function(e){var t=(0,l.Z)(e,2);i(t[0],t[1])})},[Z]),o.useImperativeHandle(t,function(){var e,t={scrollTo:function(e){var t;null===(t=E.current)||void 0===t||t.scrollTo(e)},nativeElement:null===(e=E.current)||void 0===e?void 0:e.nativeElement};return Object.defineProperty(t,"scrollLeft",{get:function(){var e;return(null===(e=E.current)||void 0===e?void 0:e.getScrollInfo().x)||0},set:function(e){var t;null===(t=E.current)||void 0===t||t.scrollTo({left:e})}}),Object.defineProperty(t,"scrollTop",{get:function(){var e;return(null===(e=E.current)||void 0===e?void 0:e.getScrollInfo().y)||0},set:function(e){var t;null===(t=E.current)||void 0===t||t.scrollTo({top:e})}}),t});var K=function(e,t){var n=null===(r=S[t])||void 0===r?void 0:r.record,o=e.onCell;if(o){var r,a,l=o(n,t);return null!==(a=null==l?void 0:l.rowSpan)&&void 0!==a?a:1}return 1},O=o.useMemo(function(){return{columnsOffset:N}},[N]),I="".concat(u,"-tbody"),R=x(["body","wrapper"]),P={};return g&&(P.position="sticky",P.bottom=0,"object"===(0,k.Z)(g)&&g.offsetScroll&&(P.bottom=g.offsetScroll)),o.createElement(eT.Provider,{value:O},o.createElement(eP.Z,{fullHeight:!1,ref:E,prefixCls:"".concat(I,"-virtual"),styles:{horizontalScrollBar:P},className:I,height:b,itemHeight:y||24,data:S,itemKey:function(e){return d(e.record)},component:R,scrollWidth:m,direction:h,onVirtualScroll:function(e){var t,n=e.x;r({currentTarget:null===(t=E.current)||void 0===t?void 0:t.nativeElement,scrollLeft:n})},onScroll:C,extraRender:function(e){var t=e.start,n=e.end,r=e.getSize,a=e.offsetY;if(n<0)return null;for(var l=c.filter(function(e){return 0===K(e,t)}),i=t,s=function(e){if(!(l=l.filter(function(t){return 0===K(t,e)})).length)return i=e,1},u=t;u>=0&&!s(u);u-=1);for(var f=c.filter(function(e){return 1!==K(e,n)}),p=n,m=function(e){if(!(f=f.filter(function(t){return 1!==K(t,e)})).length)return p=Math.max(e-1,n),1},h=n;h1})&&v.push(e)},b=i;b<=p;b+=1)if(g(b))continue;return v.map(function(e){var t=S[e],n=d(t.record,e),l=r(n);return o.createElement(ej,{key:e,data:t,rowKey:n,index:e,style:{top:-a+l.top},extra:!0,getHeight:function(t){var o=e+t-1,a=r(n,d(S[o].record,o));return a.bottom-a.top}})})}},function(e,t,n){var r=d(e.record,t);return o.createElement(ej,{data:e,rowKey:r,index:t,style:n.style})}))})),eH=function(e,t){var n=t.ref,r=t.onScroll;return o.createElement(eB,{ref:n,data:e,onScroll:r})},ez=o.forwardRef(function(e,t){var n=e.data,r=e.columns,l=e.scroll,c=e.sticky,i=e.prefixCls,d=void 0===i?eZ:i,s=e.className,u=e.listItemHeight,f=e.components,m=e.onScroll,h=l||{},v=h.x,g=h.y;"number"!=typeof v&&(v=1),"number"!=typeof g&&(g=500);var b=(0,P.zX)(function(e,t){return(0,K.Z)(f,e)||t}),y=(0,P.zX)(m),x=o.useMemo(function(){return{sticky:c,scrollY:g,listItemHeight:u,getComponent:b,onScroll:y}},[c,g,u,b,y]);return o.createElement(eM.Provider,{value:x},o.createElement(eR,(0,p.Z)({},e,{className:Z()(s,"".concat(d,"-virtual")),scroll:(0,C.Z)((0,C.Z)({},l),{},{x:v}),components:(0,C.Z)((0,C.Z)({},f),{},{body:null!=n&&n.length?eH:void 0}),columns:r,internalHooks:a,tailor:!0,ref:t})))});b(ez,void 0);var eA=n(70464),eW=o.createContext(null),e_=o.createContext({}),eF=o.memo(function(e){for(var t=e.prefixCls,n=e.level,r=e.isStart,a=e.isEnd,l="".concat(t,"-indent-unit"),c=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:null;return n.map(function(d,s){for(var u,f=eX(o?o.pos:"0",s),p=eU(d[a],f),m=0;m1&&void 0!==arguments[1]?arguments[1]:{},f=u.initWrapper,p=u.processEntity,m=u.onProcessFinished,h=u.externalGetKey,v=u.childrenPropName,g=u.fieldNames,b=arguments.length>2?arguments[2]:void 0,y={},x={},w={posEntities:y,keyEntities:x};return f&&(w=f(w)||w),t=function(e){var t=e.node,n=e.index,o=e.pos,r=e.key,a=e.parentPos,l=e.level,c={node:t,nodes:e.nodes,index:n,key:r,pos:o,level:l},i=eU(r,o);y[o]=c,x[i]=c,c.parent=y[a],c.parent&&(c.parent.children=c.parent.children||[],c.parent.children.push(c)),p&&p(c,w)},n={externalGetKey:h||b,childrenPropName:v,fieldNames:g},a=(r=("object"===(0,k.Z)(n)?n:{externalGetKey:n})||{}).childrenPropName,l=r.externalGetKey,i=(c=eG(r.fieldNames)).key,d=c.children,s=a||d,l?"string"==typeof l?o=function(e){return e[l]}:"function"==typeof l&&(o=function(e){return l(e)}):o=function(e,t){return eU(e[i],t)},function n(r,a,l,c){var i=r?r[s]:e,d=r?eX(l.pos,a):"0",u=r?[].concat((0,el.Z)(c),[r]):[];if(r){var f=o(r,d);t({node:r,index:a,pos:d,key:f,parentPos:l.node?l.pos:null,level:l.level+1,nodes:u})}i&&i.forEach(function(e,t){n(e,t,{node:r,pos:d,level:l?l.level+1:-1},u)})}(null),m&&m(w),w}function eQ(e,t){var n=t.expandedKeys,o=t.selectedKeys,r=t.loadedKeys,a=t.loadingKeys,l=t.checkedKeys,c=t.halfCheckedKeys,i=t.dragOverNodeKey,d=t.dropPosition,s=t.keyEntities[e];return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==o.indexOf(e),loaded:-1!==r.indexOf(e),loading:-1!==a.indexOf(e),checked:-1!==l.indexOf(e),halfChecked:-1!==c.indexOf(e),pos:String(s?s.pos:""),dragOver:i===e&&0===d,dragOverGapTop:i===e&&-1===d,dragOverGapBottom:i===e&&1===d}}function e0(e){var t=e.data,n=e.expanded,o=e.selected,r=e.checked,a=e.loaded,l=e.loading,c=e.halfChecked,i=e.dragOver,d=e.dragOverGapTop,s=e.dragOverGapBottom,u=e.pos,f=e.active,p=e.eventKey,m=(0,C.Z)((0,C.Z)({},t),{},{expanded:n,selected:o,checked:r,loaded:a,loading:l,halfChecked:c,dragOver:i,dragOverGapTop:d,dragOverGapBottom:s,pos:u,active:f,key:p});return"props"in m||Object.defineProperty(m,"props",{get:function(){return(0,O.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),m}var e1=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],e2="open",e3="close",e4=function(e){var t,n,r,a=e.eventKey,c=e.className,i=e.style,d=e.dragOver,s=e.dragOverGapTop,u=e.dragOverGapBottom,f=e.isLeaf,m=e.isStart,h=e.isEnd,v=e.expanded,g=e.selected,b=e.checked,y=e.halfChecked,x=e.loading,w=e.domRef,k=e.active,S=e.data,N=e.onMouseMove,K=e.selectable,O=(0,j.Z)(e,e1),I=o.useContext(eW),R=o.useContext(e_),P=o.useRef(null),M=o.useState(!1),T=(0,l.Z)(M,2),D=T[0],L=T[1],B=!!(I.disabled||e.disabled||null!==(t=R.nodeDisabled)&&void 0!==t&&t.call(R,S)),H=o.useMemo(function(){return!!I.checkable&&!1!==e.checkable&&I.checkable},[I.checkable,e.checkable]),z=function(t){B||I.onNodeSelect(t,e0(e))},A=function(t){B||!H||e.disableCheckbox||I.onNodeCheck(t,e0(e),!b)},W=o.useMemo(function(){return"boolean"==typeof K?K:I.selectable},[K,I.selectable]),_=function(t){I.onNodeClick(t,e0(e)),W?z(t):A(t)},q=function(t){I.onNodeDoubleClick(t,e0(e))},V=function(t){I.onNodeMouseEnter(t,e0(e))},X=function(t){I.onNodeMouseLeave(t,e0(e))},U=function(t){I.onNodeContextMenu(t,e0(e))},G=o.useMemo(function(){return!!(I.draggable&&(!I.draggable.nodeDraggable||I.draggable.nodeDraggable(S)))},[I.draggable,S]),Y=function(t){x||I.onNodeExpand(t,e0(e))},$=o.useMemo(function(){return!!((I.keyEntities[a]||{}).children||[]).length},[I.keyEntities,a]),J=o.useMemo(function(){return!1!==f&&(f||!I.loadData&&!$||I.loadData&&e.loaded&&!$)},[f,I.loadData,$,e.loaded]);o.useEffect(function(){!x&&("function"!=typeof I.loadData||!v||J||e.loaded||I.onNodeLoad(e0(e)))},[x,I.loadData,I.onNodeLoad,v,J,e]);var Q=o.useMemo(function(){var e;return null!==(e=I.draggable)&&void 0!==e&&e.icon?o.createElement("span",{className:"".concat(I.prefixCls,"-draggable-icon")},I.draggable.icon):null},[I.draggable]),ee=function(t){var n=e.switcherIcon||I.switcherIcon;return"function"==typeof n?n((0,C.Z)((0,C.Z)({},e),{},{isLeaf:t})):n},et=o.useMemo(function(){if(!H)return null;var t="boolean"!=typeof H?H:null;return o.createElement("span",{className:Z()("".concat(I.prefixCls,"-checkbox"),(0,E.Z)((0,E.Z)((0,E.Z)({},"".concat(I.prefixCls,"-checkbox-checked"),b),"".concat(I.prefixCls,"-checkbox-indeterminate"),!b&&y),"".concat(I.prefixCls,"-checkbox-disabled"),B||e.disableCheckbox)),onClick:A,role:"checkbox","aria-checked":y?"mixed":b,"aria-disabled":B||e.disableCheckbox,"aria-label":"Select ".concat("string"==typeof e.title?e.title:"tree node")},t)},[H,b,y,B,e.disableCheckbox,e.title]),en=o.useMemo(function(){return J?null:v?e2:e3},[J,v]),eo=o.useMemo(function(){return o.createElement("span",{className:Z()("".concat(I.prefixCls,"-iconEle"),"".concat(I.prefixCls,"-icon__").concat(en||"docu"),(0,E.Z)({},"".concat(I.prefixCls,"-icon_loading"),x))})},[I.prefixCls,en,x]),er=o.useMemo(function(){var t=!!I.draggable;return!e.disabled&&t&&I.dragOverNodeKey===a?I.dropIndicatorRender({dropPosition:I.dropPosition,dropLevelOffset:I.dropLevelOffset,indent:I.indent,prefixCls:I.prefixCls,direction:I.direction}):null},[I.dropPosition,I.dropLevelOffset,I.indent,I.prefixCls,I.direction,I.draggable,I.dragOverNodeKey,I.dropIndicatorRender]),ea=o.useMemo(function(){var t,n,r=e.title,a=void 0===r?"---":r,l="".concat(I.prefixCls,"-node-content-wrapper");if(I.showIcon){var c=e.icon||I.icon;t=c?o.createElement("span",{className:Z()("".concat(I.prefixCls,"-iconEle"),"".concat(I.prefixCls,"-icon__customize"))},"function"==typeof c?c(e):c):eo}else I.loadData&&x&&(t=eo);return n="function"==typeof a?a(S):I.titleRender?I.titleRender(S):a,o.createElement("span",{ref:P,title:"string"==typeof a?a:"",className:Z()(l,"".concat(l,"-").concat(en||"normal"),(0,E.Z)({},"".concat(I.prefixCls,"-node-selected"),!B&&(g||D))),onMouseEnter:V,onMouseLeave:X,onContextMenu:U,onClick:_,onDoubleClick:q},t,o.createElement("span",{className:"".concat(I.prefixCls,"-title")},n),er)},[I.prefixCls,I.showIcon,e,I.icon,eo,I.titleRender,S,en,V,X,U,_,q]),el=(0,F.Z)(O,{aria:!0,data:!0}),ec=(I.keyEntities[a]||{}).level,ei=h[h.length-1],ed=!B&&G,es=I.draggingNodeKey===a;return o.createElement("div",(0,p.Z)({ref:w,role:"treeitem","aria-expanded":f?void 0:v,className:Z()(c,"".concat(I.prefixCls,"-treenode"),(r={},(0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)(r,"".concat(I.prefixCls,"-treenode-disabled"),B),"".concat(I.prefixCls,"-treenode-switcher-").concat(v?"open":"close"),!f),"".concat(I.prefixCls,"-treenode-checkbox-checked"),b),"".concat(I.prefixCls,"-treenode-checkbox-indeterminate"),y),"".concat(I.prefixCls,"-treenode-selected"),g),"".concat(I.prefixCls,"-treenode-loading"),x),"".concat(I.prefixCls,"-treenode-active"),k),"".concat(I.prefixCls,"-treenode-leaf-last"),ei),"".concat(I.prefixCls,"-treenode-draggable"),G),"dragging",es),(0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)(r,"drop-target",I.dropTargetKey===a),"drop-container",I.dropContainerKey===a),"drag-over",!B&&d),"drag-over-gap-top",!B&&s),"drag-over-gap-bottom",!B&&u),"filter-node",null===(n=I.filterTreeNode)||void 0===n?void 0:n.call(I,e0(e))),"".concat(I.prefixCls,"-treenode-leaf"),J))),style:i,draggable:ed,onDragStart:ed?function(t){t.stopPropagation(),L(!0),I.onNodeDragStart(t,e);try{t.dataTransfer.setData("text/plain","")}catch(e){}}:void 0,onDragEnter:G?function(t){t.preventDefault(),t.stopPropagation(),I.onNodeDragEnter(t,e)}:void 0,onDragOver:G?function(t){t.preventDefault(),t.stopPropagation(),I.onNodeDragOver(t,e)}:void 0,onDragLeave:G?function(t){t.stopPropagation(),I.onNodeDragLeave(t,e)}:void 0,onDrop:G?function(t){t.preventDefault(),t.stopPropagation(),L(!1),I.onNodeDrop(t,e)}:void 0,onDragEnd:G?function(t){t.stopPropagation(),L(!1),I.onNodeDragEnd(t,e)}:void 0,onMouseMove:N},void 0!==K?{"aria-selected":!!K}:void 0,el),o.createElement(eF,{prefixCls:I.prefixCls,level:ec,isStart:m,isEnd:h}),Q,function(){if(J){var e=ee(!0);return!1!==e?o.createElement("span",{className:Z()("".concat(I.prefixCls,"-switcher"),"".concat(I.prefixCls,"-switcher-noop"))},e):null}var t=ee(!1);return!1!==t?o.createElement("span",{onClick:Y,className:Z()("".concat(I.prefixCls,"-switcher"),"".concat(I.prefixCls,"-switcher_").concat(v?e2:e3))},t):null}(),et,ea)};function e8(e,t){if(!e)return[];var n=e.slice(),o=n.indexOf(t);return o>=0&&n.splice(o,1),n}function e6(e,t){var n=(e||[]).slice();return -1===n.indexOf(t)&&n.push(t),n}function e5(e){return e.split("-")}function e7(e,t,n,o,r,a,l,c,i,d){var s,u,f=e.clientX,p=e.clientY,m=e.target.getBoundingClientRect(),h=m.top,v=m.height,g=(("rtl"===d?-1:1)*(((null==r?void 0:r.x)||0)-f)-12)/o,b=i.filter(function(e){var t;return null===(t=c[e])||void 0===t||null===(t=t.children)||void 0===t?void 0:t.length}),y=c[n.eventKey];if(p-1.5?a({dragNode:N,dropNode:K,dropPosition:1})?E=1:O=!1:a({dragNode:N,dropNode:K,dropPosition:0})?E=0:a({dragNode:N,dropNode:K,dropPosition:1})?E=1:O=!1:a({dragNode:N,dropNode:K,dropPosition:1})?E=1:O=!1,{dropPosition:E,dropLevelOffset:S,dropTargetKey:y.key,dropTargetPos:y.pos,dragOverNodeKey:C,dropContainerKey:0===E?null:(null===(u=y.parent)||void 0===u?void 0:u.key)||null,dropAllowed:O}}function e9(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function te(e){var t;if(!e)return null;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==(0,k.Z)(e))return(0,O.ZP)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function tt(e,t){var n=new Set;return(e||[]).forEach(function(e){!function e(o){if(!n.has(o)){var r=t[o];if(r){n.add(o);var a=r.parent;!r.node.disabled&&a&&e(a.key)}}}(e)}),(0,el.Z)(n)}function tn(e,t){var n=new Set;return e.forEach(function(e){t.has(e)||n.add(e)}),n}function to(e){var t=e||{},n=t.disabled,o=t.disableCheckbox,r=t.checkable;return!!(n||o)||!1===r}function tr(e,t,n,o){var r,a=[];r=o||to;var l=new Set(e.filter(function(e){var t=!!n[e];return t||a.push(e),t})),c=new Map,i=0;return Object.keys(n).forEach(function(e){var t=n[e],o=t.level,r=c.get(o);r||(r=new Set,c.set(o,r)),r.add(t),i=Math.max(i,o)}),(0,O.ZP)(!a.length,"Tree missing follow keys: ".concat(a.slice(0,100).map(function(e){return"'".concat(e,"'")}).join(", "))),!0===t?function(e,t,n,o){for(var r=new Set(e),a=new Set,l=0;l<=n;l+=1)(t.get(l)||new Set).forEach(function(e){var t=e.key,n=e.node,a=e.children,l=void 0===a?[]:a;r.has(t)&&!o(n)&&l.filter(function(e){return!o(e.node)}).forEach(function(e){r.add(e.key)})});for(var c=new Set,i=n;i>=0;i-=1)(t.get(i)||new Set).forEach(function(e){var t=e.parent;if(!(o(e.node)||!e.parent||c.has(e.parent.key))){if(o(e.parent.node)){c.add(t.key);return}var n=!0,l=!1;(t.children||[]).filter(function(e){return!o(e.node)}).forEach(function(e){var t=e.key,o=r.has(t);n&&!o&&(n=!1),!l&&(o||a.has(t))&&(l=!0)}),n&&r.add(t.key),l&&a.add(t.key),c.add(t.key)}});return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(tn(a,r))}}(l,c,i,r):function(e,t,n,o,r){for(var a=new Set(e),l=new Set(t),c=0;c<=o;c+=1)(n.get(c)||new Set).forEach(function(e){var t=e.key,n=e.node,o=e.children,c=void 0===o?[]:o;a.has(t)||l.has(t)||r(n)||c.filter(function(e){return!r(e.node)}).forEach(function(e){a.delete(e.key)})});l=new Set;for(var i=new Set,d=o;d>=0;d-=1)(n.get(d)||new Set).forEach(function(e){var t=e.parent;if(!(r(e.node)||!e.parent||i.has(e.parent.key))){if(r(e.parent.node)){i.add(t.key);return}var n=!0,o=!1;(t.children||[]).filter(function(e){return!r(e.node)}).forEach(function(e){var t=e.key,r=a.has(t);n&&!r&&(n=!1),!o&&(r||l.has(t))&&(o=!0)}),n||a.delete(t.key),o&&l.add(t.key),i.add(t.key)}});return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(tn(l,a))}}(l,t.halfCheckedKeys,c,i,r)}e4.isTreeNode=1;var ta=n(50506);let tl=e=>{let[t,n]=(0,o.useState)(null);return[(0,o.useCallback)((o,r,a)=>{let l=null!=t?t:o,c=Math.max(l||0,o),i=r.slice(Math.min(l||0,o),c+1).map(e),d=i.some(e=>!a.has(e)),s=[];return i.forEach(e=>{d?(a.has(e)||s.push(e),a.add(e)):(a.delete(e),s.push(e))}),n(d?c:null),s},[t]),n]};var tc=n(13613),ti=n(61994),td=n(73705),ts=n(29967);let tu={},tf="SELECT_ALL",tp="SELECT_INVERT",tm="SELECT_NONE",th=[],tv=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(t||[]).forEach(t=>{n.push(t),t&&"object"==typeof t&&e in t&&tv(e,t[e],n)}),n};var tg=(e,t)=>{let{preserveSelectedRowKeys:n,selectedRowKeys:r,defaultSelectedRowKeys:a,getCheckboxProps:l,getTitleCheckboxProps:c,onChange:i,onSelect:d,onSelectAll:s,onSelectInvert:u,onSelectNone:f,onSelectMultiple:p,columnWidth:m,type:h,selections:v,fixed:g,renderCell:b,hideSelectAll:y,checkStrictly:x=!0}=t||{},{prefixCls:w,data:k,pageData:C,getRecordByKey:E,getRowKey:S,expandType:N,childrenColumnName:K,locale:O,getPopupContainer:I}=e,R=(0,tc.ln)("Table"),[P,M]=tl(e=>e),[T,D]=(0,ta.Z)(r||a||th,{value:r}),L=o.useRef(new Map),j=(0,o.useCallback)(e=>{if(n){let t=new Map;e.forEach(e=>{let n=E(e);!n&&L.current.has(e)&&(n=L.current.get(e)),t.set(e,n)}),L.current=t}},[E,n]);o.useEffect(()=>{j(T)},[T]);let B=(0,o.useMemo)(()=>tv(K,C),[K,C]),{keyEntities:H}=(0,o.useMemo)(()=>{if(x)return{keyEntities:null};let e=k;if(n){let t=new Set(B.map((e,t)=>S(e,t))),n=Array.from(L.current).reduce((e,n)=>{let[o,r]=n;return t.has(o)?e:e.concat(r)},[]);e=[].concat((0,el.Z)(e),(0,el.Z)(n))}return eJ(e,{externalGetKey:S,childrenPropName:K})},[k,S,x,K,n,B]),z=(0,o.useMemo)(()=>{let e=new Map;return B.forEach((t,n)=>{let o=S(t,n),r=(l?l(t):null)||{};e.set(o,r)}),e},[B,S,l]),A=(0,o.useCallback)(e=>{let t;let n=S(e);return!!(null==(t=z.has(n)?z.get(S(e)):l?l(e):void 0)?void 0:t.disabled)},[z,S]),[W,_]=(0,o.useMemo)(()=>{if(x)return[T||[],[]];let{checkedKeys:e,halfCheckedKeys:t}=tr(T,!0,H,A);return[e||[],t]},[T,x,H,A]),F=(0,o.useMemo)(()=>new Set("radio"===h?W.slice(0,1):W),[W,h]),q=(0,o.useMemo)(()=>"radio"===h?new Set:new Set(_),[_,h]);o.useEffect(()=>{t||D(th)},[!!t]);let V=(0,o.useCallback)((e,t)=>{let o,r;j(e),n?(o=e,r=e.map(e=>L.current.get(e))):(o=[],r=[],e.forEach(e=>{let t=E(e);void 0!==t&&(o.push(e),r.push(t))})),D(o),null==i||i(o,r,{type:t})},[D,E,i,n]),X=(0,o.useCallback)((e,t,n,o)=>{if(d){let r=n.map(e=>E(e));d(E(e),t,r,o)}V(n,"single")},[d,E,V]),U=(0,o.useMemo)(()=>!v||y?null:(!0===v?[tf,tp,tm]:v).map(e=>e===tf?{key:"all",text:O.selectionAll,onSelect(){V(k.map((e,t)=>S(e,t)).filter(e=>{let t=z.get(e);return!(null==t?void 0:t.disabled)||F.has(e)}),"all")}}:e===tp?{key:"invert",text:O.selectInvert,onSelect(){let e=new Set(F);C.forEach((t,n)=>{let o=S(t,n),r=z.get(o);(null==r?void 0:r.disabled)||(e.has(o)?e.delete(o):e.add(o))});let t=Array.from(e);u&&(R.deprecated(!1,"onSelectInvert","onChange"),u(t)),V(t,"invert")}}:e===tm?{key:"none",text:O.selectNone,onSelect(){null==f||f(),V(Array.from(F).filter(e=>{let t=z.get(e);return null==t?void 0:t.disabled}),"none")}}:e).map(e=>Object.assign(Object.assign({},e),{onSelect:function(){for(var t,n=arguments.length,o=Array(n),r=0;r{var n;let r,a,l;if(!t)return e.filter(e=>e!==tu);let i=(0,el.Z)(e),d=new Set(F),u=B.map(S).filter(e=>!z.get(e).disabled),f=u.every(e=>d.has(e)),k=u.some(e=>d.has(e)),C=()=>{let e=[];f?u.forEach(t=>{d.delete(t),e.push(t)}):u.forEach(t=>{d.has(t)||(d.add(t),e.push(t))});let t=Array.from(d);null==s||s(!f,t.map(e=>E(e)),e.map(e=>E(e))),V(t,"all"),M(null)};if("radio"!==h){let e;if(U){let t={getPopupContainer:I,items:U.map((e,t)=>{let{key:n,text:o,onSelect:r}=e;return{key:null!=n?n:t,onClick:()=>{null==r||r(u)},label:o}})};e=o.createElement("div",{className:"".concat(w,"-selection-extra")},o.createElement(td.Z,{menu:t,getPopupContainer:I},o.createElement("span",null,o.createElement(eA.Z,null))))}let t=B.map((e,t)=>{let n=S(e,t),o=z.get(n)||{};return Object.assign({checked:d.has(n)},o)}).filter(e=>{let{disabled:t}=e;return t}),n=!!t.length&&t.length===B.length,l=n&&t.every(e=>{let{checked:t}=e;return t}),i=n&&t.some(e=>{let{checked:t}=e;return t}),s=(null==c?void 0:c())||{},{onChange:p,disabled:m}=s;a=o.createElement(ti.Z,Object.assign({"aria-label":e?"Custom selection":"Select all"},s,{checked:n?l:!!B.length&&f,indeterminate:n?!l&&i:!f&&k,onChange:e=>{C(),null==p||p(e)},disabled:null!=m?m:0===B.length||n,skipGroup:!0})),r=!y&&o.createElement("div",{className:"".concat(w,"-selection")},a,e)}if(l="radio"===h?(e,t,n)=>{let r=S(t,n),a=d.has(r),l=z.get(r);return{node:o.createElement(ts.ZP,Object.assign({},l,{checked:a,onClick:e=>{var t;e.stopPropagation(),null===(t=null==l?void 0:l.onClick)||void 0===t||t.call(l,e)},onChange:e=>{var t;d.has(r)||X(r,!0,[r],e.nativeEvent),null===(t=null==l?void 0:l.onChange)||void 0===t||t.call(l,e)}})),checked:a}}:(e,t,n)=>{var r;let a;let l=S(t,n),c=d.has(l),i=q.has(l),s=z.get(l);return a="nest"===N?i:null!==(r=null==s?void 0:s.indeterminate)&&void 0!==r?r:i,{node:o.createElement(ti.Z,Object.assign({},s,{indeterminate:a,checked:c,skipGroup:!0,onClick:e=>{var t;e.stopPropagation(),null===(t=null==s?void 0:s.onClick)||void 0===t||t.call(s,e)},onChange:e=>{var t;let{nativeEvent:n}=e,{shiftKey:o}=n,r=u.indexOf(l),a=W.some(e=>u.includes(e));if(o&&x&&a){let e=P(r,u,d),t=Array.from(d);null==p||p(!c,t.map(e=>E(e)),e.map(e=>E(e))),V(t,"multiple")}else if(x){let e=c?e8(W,l):e6(W,l);X(l,!c,e,n)}else{let{checkedKeys:e,halfCheckedKeys:t}=tr([].concat((0,el.Z)(W),[l]),!0,H,A),o=e;if(c){let n=new Set(e);n.delete(l),o=tr(Array.from(n),{checked:!1,halfCheckedKeys:t},H,A).checkedKeys}X(l,!c,o,n)}c?M(null):M(r),null===(t=null==s?void 0:s.onChange)||void 0===t||t.call(s,e)}})),checked:c}},!i.includes(tu)){if(0===i.findIndex(e=>{var t;return(null===(t=e[eo])||void 0===t?void 0:t.columnType)==="EXPAND_COLUMN"})){let[e,...t]=i;i=[e,tu].concat((0,el.Z)(t))}else i=[tu].concat((0,el.Z)(i))}let K=i.indexOf(tu),O=(i=i.filter((e,t)=>e!==tu||t===K))[K-1],R=i[K+1],T=g;void 0===T&&((null==R?void 0:R.fixed)!==void 0?T=R.fixed:(null==O?void 0:O.fixed)!==void 0&&(T=O.fixed)),T&&O&&(null===(n=O[eo])||void 0===n?void 0:n.columnType)==="EXPAND_COLUMN"&&void 0===O.fixed&&(O.fixed=T);let D=Z()("".concat(w,"-selection-col"),{["".concat(w,"-selection-col-with-dropdown")]:v&&"checkbox"===h}),L={fixed:T,width:m,className:"".concat(w,"-selection-column"),title:(null==t?void 0:t.columnTitle)?"function"==typeof t.columnTitle?t.columnTitle(a):t.columnTitle:r,render:(e,t,n)=>{let{node:o,checked:r}=l(e,t,n);return b?b(r,t,n,o):o},onCell:t.onCell,align:t.align,[eo]:{className:D}};return i.map(e=>e===tu?L:e)},[S,B,t,W,F,q,m,U,N,z,p,X,A]),F]};let tb=(e,t)=>(0,o.useImperativeHandle)(e,()=>{let e=t(),{nativeElement:n}=e;return"undefined"!=typeof Proxy?new Proxy(n,{get:(t,n)=>e[n]?e[n]:Reflect.get(t,n)}):(n._antProxy=n._antProxy||{},Object.keys(e).forEach(t=>{if(!(t in n._antProxy)){let o=n[t];n._antProxy[t]=o,n[t]=e[t]}}),n)});function ty(e){return null!=e&&e===e.window}var tx=e=>{var t,n;if("undefined"==typeof window)return 0;let o=0;return ty(e)?o=e.pageYOffset:e instanceof Document?o=e.documentElement.scrollTop:e instanceof HTMLElement?o=e.scrollTop:e&&(o=e.scrollTop),e&&!ty(e)&&"number"!=typeof o&&(o=null===(n=(null!==(t=e.ownerDocument)&&void 0!==t?t:e).documentElement)||void 0===n?void 0:n.scrollTop),o},tw=n(18310),tk=n(71744),tC=n(91086),tE=n(64024),tS=n(33759),tZ=n(28617),tN=n(37381),tK=n(40049),tO=n(10353),tI=n(84951);let tR=(e,t)=>"key"in e&&void 0!==e.key&&null!==e.key?e.key:e.dataIndex?Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex:t;function tP(e,t){return t?"".concat(t,"-").concat(e):"".concat(e)}let tM=(e,t)=>"function"==typeof e?e(t):e,tT=(e,t)=>{let n=tM(e,t);return"[object Object]"===Object.prototype.toString.call(n)?"":n};var tD={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},tL=n(55015),tj=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:tD}))}),tB=n(53253),tH=n(51646);let tz=e=>{let t=o.useRef(e),[,n]=(0,tH.N)();return[()=>t.current,e=>{t.current=e,n()}]};var tA=n(5545),tW=n(85180),t_=n(60985),tF=n(88208),tq=n(76405),tV=n(25049),tX=n(63496),tU=n(41690),tG=n(15900),tY=n(95814);function t$(e){if(null==e)throw TypeError("Cannot destructure "+e)}var tJ=n(66632),tQ=function(e,t){var n=o.useState(!1),r=(0,l.Z)(n,2),a=r[0],c=r[1];(0,i.Z)(function(){if(a)return e(),function(){t()}},[a]),(0,i.Z)(function(){return c(!0),function(){c(!1)}},[])},t0=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],t1=o.forwardRef(function(e,t){var n=e.className,r=e.style,a=e.motion,c=e.motionNodes,d=e.motionType,s=e.onMotionStart,u=e.onMotionEnd,f=e.active,m=e.treeNodeRequiredProps,h=(0,j.Z)(e,t0),v=o.useState(!0),g=(0,l.Z)(v,2),b=g[0],y=g[1],x=o.useContext(eW).prefixCls,w=c&&"hide"!==d;(0,i.Z)(function(){c&&w!==b&&y(w)},[c]);var k=o.useRef(!1),C=function(){c&&!k.current&&(k.current=!0,u())};return(tQ(function(){c&&s()},C),c)?o.createElement(tJ.ZP,(0,p.Z)({ref:t,visible:b},a,{motionAppear:"show"===d,onVisibleChanged:function(e){w===e&&C()}}),function(e,t){var n=e.className,r=e.style;return o.createElement("div",{ref:t,className:Z()("".concat(x,"-treenode-motion"),n),style:r},c.map(function(e){var t=Object.assign({},(t$(e.data),e.data)),n=e.title,r=e.key,a=e.isStart,l=e.isEnd;delete t.children;var c=eQ(r,m);return o.createElement(e4,(0,p.Z)({},t,c,{title:n,active:f,data:e.data,key:r,isStart:a,isEnd:l}))}))}):o.createElement(e4,(0,p.Z)({domRef:t,className:n,style:r},h,{active:f}))});function t2(e,t,n){var o=e.findIndex(function(e){return e.key===n}),r=e[o+1],a=t.findIndex(function(e){return e.key===n});if(r){var l=t.findIndex(function(e){return e.key===r.key});return t.slice(a+1,l)}return t.slice(a+1)}var t3=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],t4={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},t8=function(){},t6="RC_TREE_MOTION_".concat(Math.random()),t5={key:t6},t7={key:t6,level:0,index:0,pos:"0",node:t5,nodes:[t5]},t9={parent:null,children:[],pos:t7.pos,data:t5,title:null,key:t6,isStart:[],isEnd:[]};function ne(e,t,n,o){return!1!==t&&n?e.slice(0,Math.ceil(n/o)+1):e}function nt(e){return eU(e.key,e.pos)}var nn=o.forwardRef(function(e,t){var n=e.prefixCls,r=e.data,a=(e.selectable,e.checkable,e.expandedKeys),c=e.selectedKeys,d=e.checkedKeys,s=e.loadedKeys,u=e.loadingKeys,f=e.halfCheckedKeys,m=e.keyEntities,h=e.disabled,v=e.dragging,g=e.dragOverNodeKey,b=e.dropPosition,y=e.motion,x=e.height,w=e.itemHeight,k=e.virtual,C=e.scrollWidth,E=e.focusable,S=e.activeItem,Z=e.focused,N=e.tabIndex,K=e.onKeyDown,O=e.onFocus,I=e.onBlur,R=e.onActiveChange,P=e.onListChangeStart,M=e.onListChangeEnd,T=(0,j.Z)(e,t3),D=o.useRef(null),L=o.useRef(null);o.useImperativeHandle(t,function(){return{scrollTo:function(e){D.current.scrollTo(e)},getIndentWidth:function(){return L.current.offsetWidth}}});var B=o.useState(a),H=(0,l.Z)(B,2),z=H[0],A=H[1],W=o.useState(r),_=(0,l.Z)(W,2),F=_[0],q=_[1],V=o.useState(r),X=(0,l.Z)(V,2),U=X[0],G=X[1],Y=o.useState([]),$=(0,l.Z)(Y,2),J=$[0],Q=$[1],ee=o.useState(null),et=(0,l.Z)(ee,2),en=et[0],eo=et[1],er=o.useRef(r);function ea(){var e=er.current;q(e),G(e),Q([]),eo(null),M()}er.current=r,(0,i.Z)(function(){A(a);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,o=t.length;if(1!==Math.abs(n-o))return{add:!1,key:null};function r(e,t){var n=new Map;e.forEach(function(e){n.set(e,!0)});var o=t.filter(function(e){return!n.has(e)});return 1===o.length?o[0]:null}return n ").concat(t);return t}(S)),o.createElement("div",null,o.createElement("input",{style:t4,disabled:!1===E||h,tabIndex:!1!==E?N:null,onKeyDown:K,onFocus:O,onBlur:I,value:"",onChange:t8,"aria-label":"for screen reader"})),o.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},o.createElement("div",{className:"".concat(n,"-indent")},o.createElement("div",{ref:L,className:"".concat(n,"-indent-unit")}))),o.createElement(eP.Z,(0,p.Z)({},T,{data:el,itemKey:nt,height:x,fullHeight:!1,virtual:k,itemHeight:w,scrollWidth:C,prefixCls:"".concat(n,"-list"),ref:D,role:"tree",onVisibleChange:function(e){e.every(function(e){return nt(e)!==t6})&&ea()}}),function(e){var t=e.pos,n=Object.assign({},(t$(e.data),e.data)),r=e.title,a=e.key,l=e.isStart,c=e.isEnd,i=eU(a,t);delete n.key,delete n.children;var d=eQ(i,ec);return o.createElement(t1,(0,p.Z)({},n,d,{title:r,active:!!S&&a===S.key,pos:t,data:e.data,isStart:l,isEnd:c,motion:y,motionNodes:a===t6?J:null,motionType:en,onMotionStart:P,onMotionEnd:ea,treeNodeRequiredProps:ec,onMouseMove:function(){R(null)}}))}))}),no=function(e){(0,tU.Z)(n,e);var t=(0,tG.Z)(n);function n(){var e;(0,tq.Z)(this,n);for(var r=arguments.length,a=Array(r),l=0;l0&&void 0!==arguments[0]?arguments[0]:[];t.forEach(function(t){var n=t.key,r=t.children;o.push(n),e(r)})}(l[i].children),o),indent:e.listRef.current.getIndentWidth()}),e.setExpandedKeys(d),window.addEventListener("dragend",e.onWindowDragEnd),null==c||c({event:t,node:e0(n)})}),(0,E.Z)((0,tX.Z)(e),"onNodeDragEnter",function(t,n){var o=e.state,r=o.expandedKeys,a=o.keyEntities,l=o.dragChildrenKeys,c=o.flattenNodes,i=o.indent,d=e.props,s=d.onDragEnter,u=d.onExpand,f=d.allowDrop,p=d.direction,m=n.pos,h=n.eventKey;if(e.currentMouseOverDroppableNodeKey!==h&&(e.currentMouseOverDroppableNodeKey=h),!e.dragNodeProps){e.resetDragState();return}var v=e7(t,e.dragNodeProps,n,i,e.dragStartMousePosition,f,c,a,r,p),g=v.dropPosition,b=v.dropLevelOffset,y=v.dropTargetKey,x=v.dropContainerKey,w=v.dropTargetPos,k=v.dropAllowed,C=v.dragOverNodeKey;if(l.includes(y)||!k||(e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach(function(t){clearTimeout(e.delayedDragEnterLogic[t])}),e.dragNodeProps.eventKey!==n.eventKey&&(t.persist(),e.delayedDragEnterLogic[m]=window.setTimeout(function(){if(null!==e.state.draggingNodeKey){var o=(0,el.Z)(r),l=a[n.eventKey];l&&(l.children||[]).length&&(o=e6(r,n.eventKey)),e.props.hasOwnProperty("expandedKeys")||e.setExpandedKeys(o),null==u||u(o,{node:e0(n),expanded:!0,nativeEvent:t.nativeEvent})}},800)),e.dragNodeProps.eventKey===y&&0===b)){e.resetDragState();return}e.setState({dragOverNodeKey:C,dropPosition:g,dropLevelOffset:b,dropTargetKey:y,dropContainerKey:x,dropTargetPos:w,dropAllowed:k}),null==s||s({event:t,node:e0(n),expandedKeys:r})}),(0,E.Z)((0,tX.Z)(e),"onNodeDragOver",function(t,n){var o=e.state,r=o.dragChildrenKeys,a=o.flattenNodes,l=o.keyEntities,c=o.expandedKeys,i=o.indent,d=e.props,s=d.onDragOver,u=d.allowDrop,f=d.direction;if(e.dragNodeProps){var p=e7(t,e.dragNodeProps,n,i,e.dragStartMousePosition,u,a,l,c,f),m=p.dropPosition,h=p.dropLevelOffset,v=p.dropTargetKey,g=p.dropContainerKey,b=p.dropTargetPos,y=p.dropAllowed,x=p.dragOverNodeKey;!r.includes(v)&&y&&(e.dragNodeProps.eventKey===v&&0===h?null===e.state.dropPosition&&null===e.state.dropLevelOffset&&null===e.state.dropTargetKey&&null===e.state.dropContainerKey&&null===e.state.dropTargetPos&&!1===e.state.dropAllowed&&null===e.state.dragOverNodeKey||e.resetDragState():m===e.state.dropPosition&&h===e.state.dropLevelOffset&&v===e.state.dropTargetKey&&g===e.state.dropContainerKey&&b===e.state.dropTargetPos&&y===e.state.dropAllowed&&x===e.state.dragOverNodeKey||e.setState({dropPosition:m,dropLevelOffset:h,dropTargetKey:v,dropContainerKey:g,dropTargetPos:b,dropAllowed:y,dragOverNodeKey:x}),null==s||s({event:t,node:e0(n)}))}}),(0,E.Z)((0,tX.Z)(e),"onNodeDragLeave",function(t,n){e.currentMouseOverDroppableNodeKey!==n.eventKey||t.currentTarget.contains(t.relatedTarget)||(e.resetDragState(),e.currentMouseOverDroppableNodeKey=null);var o=e.props.onDragLeave;null==o||o({event:t,node:e0(n)})}),(0,E.Z)((0,tX.Z)(e),"onWindowDragEnd",function(t){e.onNodeDragEnd(t,null,!0),window.removeEventListener("dragend",e.onWindowDragEnd)}),(0,E.Z)((0,tX.Z)(e),"onNodeDragEnd",function(t,n){var o=e.props.onDragEnd;e.setState({dragOverNodeKey:null}),e.cleanDragState(),null==o||o({event:t,node:e0(n)}),e.dragNodeProps=null,window.removeEventListener("dragend",e.onWindowDragEnd)}),(0,E.Z)((0,tX.Z)(e),"onNodeDrop",function(t,n){var o,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.state,l=a.dragChildrenKeys,c=a.dropPosition,i=a.dropTargetKey,d=a.dropTargetPos;if(a.dropAllowed){var s=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==i){var u=(0,C.Z)((0,C.Z)({},eQ(i,e.getTreeNodeRequiredProps())),{},{active:(null===(o=e.getActiveItem())||void 0===o?void 0:o.key)===i,data:e.state.keyEntities[i].node}),f=l.includes(i);(0,O.ZP)(!f,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var p=e5(d),m={event:t,node:e0(u),dragNode:e.dragNodeProps?e0(e.dragNodeProps):null,dragNodesKeys:[e.dragNodeProps.eventKey].concat(l),dropToGap:0!==c,dropPosition:c+Number(p[p.length-1])};r||null==s||s(m),e.dragNodeProps=null}}}),(0,E.Z)((0,tX.Z)(e),"cleanDragState",function(){null!==e.state.draggingNodeKey&&e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null,e.currentMouseOverDroppableNodeKey=null}),(0,E.Z)((0,tX.Z)(e),"triggerExpandActionExpand",function(t,n){var o=e.state,r=o.expandedKeys,a=o.flattenNodes,l=n.expanded,c=n.key;if(!n.isLeaf&&!t.shiftKey&&!t.metaKey&&!t.ctrlKey){var i=a.filter(function(e){return e.key===c})[0],d=e0((0,C.Z)((0,C.Z)({},eQ(c,e.getTreeNodeRequiredProps())),{},{data:i.data}));e.setExpandedKeys(l?e8(r,c):e6(r,c)),e.onNodeExpand(t,d)}}),(0,E.Z)((0,tX.Z)(e),"onNodeClick",function(t,n){var o=e.props,r=o.onClick;"click"===o.expandAction&&e.triggerExpandActionExpand(t,n),null==r||r(t,n)}),(0,E.Z)((0,tX.Z)(e),"onNodeDoubleClick",function(t,n){var o=e.props,r=o.onDoubleClick;"doubleClick"===o.expandAction&&e.triggerExpandActionExpand(t,n),null==r||r(t,n)}),(0,E.Z)((0,tX.Z)(e),"onNodeSelect",function(t,n){var o=e.state.selectedKeys,r=e.state,a=r.keyEntities,l=r.fieldNames,c=e.props,i=c.onSelect,d=c.multiple,s=n.selected,u=n[l.key],f=!s,p=(o=f?d?e6(o,u):[u]:e8(o,u)).map(function(e){var t=a[e];return t?t.node:null}).filter(Boolean);e.setUncontrolledState({selectedKeys:o}),null==i||i(o,{event:"select",selected:f,node:n,selectedNodes:p,nativeEvent:t.nativeEvent})}),(0,E.Z)((0,tX.Z)(e),"onNodeCheck",function(t,n,o){var r,a=e.state,l=a.keyEntities,c=a.checkedKeys,i=a.halfCheckedKeys,d=e.props,s=d.checkStrictly,u=d.onCheck,f=n.key,p={event:"check",node:n,checked:o,nativeEvent:t.nativeEvent};if(s){var m=o?e6(c,f):e8(c,f);r={checked:m,halfChecked:e8(i,f)},p.checkedNodes=m.map(function(e){return l[e]}).filter(Boolean).map(function(e){return e.node}),e.setUncontrolledState({checkedKeys:m})}else{var h=tr([].concat((0,el.Z)(c),[f]),!0,l),v=h.checkedKeys,g=h.halfCheckedKeys;if(!o){var b=new Set(v);b.delete(f);var y=tr(Array.from(b),{checked:!1,halfCheckedKeys:g},l);v=y.checkedKeys,g=y.halfCheckedKeys}r=v,p.checkedNodes=[],p.checkedNodesPositions=[],p.halfCheckedKeys=g,v.forEach(function(e){var t=l[e];if(t){var n=t.node,o=t.pos;p.checkedNodes.push(n),p.checkedNodesPositions.push({node:n,pos:o})}}),e.setUncontrolledState({checkedKeys:v},!1,{halfCheckedKeys:g})}null==u||u(r,p)}),(0,E.Z)((0,tX.Z)(e),"onNodeLoad",function(t){var n,o=t.key,r=e.state.keyEntities[o];if(null==r||null===(n=r.children)||void 0===n||!n.length){var a=new Promise(function(n,r){e.setState(function(a){var l=a.loadedKeys,c=a.loadingKeys,i=void 0===c?[]:c,d=e.props,s=d.loadData,u=d.onLoad;return!s||(void 0===l?[]:l).includes(o)||i.includes(o)?null:(s(t).then(function(){var r=e6(e.state.loadedKeys,o);null==u||u(r,{event:"load",node:t}),e.setUncontrolledState({loadedKeys:r}),e.setState(function(e){return{loadingKeys:e8(e.loadingKeys,o)}}),n()}).catch(function(t){if(e.setState(function(e){return{loadingKeys:e8(e.loadingKeys,o)}}),e.loadingRetryTimes[o]=(e.loadingRetryTimes[o]||0)+1,e.loadingRetryTimes[o]>=10){var a=e.state.loadedKeys;(0,O.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),e.setUncontrolledState({loadedKeys:e6(a,o)}),n()}r(t)}),{loadingKeys:e6(i,o)})})});return a.catch(function(){}),a}}),(0,E.Z)((0,tX.Z)(e),"onNodeMouseEnter",function(t,n){var o=e.props.onMouseEnter;null==o||o({event:t,node:n})}),(0,E.Z)((0,tX.Z)(e),"onNodeMouseLeave",function(t,n){var o=e.props.onMouseLeave;null==o||o({event:t,node:n})}),(0,E.Z)((0,tX.Z)(e),"onNodeContextMenu",function(t,n){var o=e.props.onRightClick;o&&(t.preventDefault(),o({event:t,node:n}))}),(0,E.Z)((0,tX.Z)(e),"onFocus",function(){var t=e.props.onFocus;e.setState({focused:!0});for(var n=arguments.length,o=Array(n),r=0;r1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var r=!1,a=!0,l={};Object.keys(t).forEach(function(n){if(e.props.hasOwnProperty(n)){a=!1;return}r=!0,l[n]=t[n]}),r&&(!n||a)&&e.setState((0,C.Z)((0,C.Z)({},l),o))}}),(0,E.Z)((0,tX.Z)(e),"scrollTo",function(t){e.listRef.current.scrollTo(t)}),e}return(0,tV.Z)(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var e=this.props,t=e.activeKey,n=e.itemScrollOffset;void 0!==t&&t!==this.state.activeKey&&(this.setState({activeKey:t}),null!==t&&this.scrollTo({key:t,offset:void 0===n?0:n}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var e,t=this.state,n=t.focused,r=t.flattenNodes,a=t.keyEntities,l=t.draggingNodeKey,c=t.activeKey,i=t.dropLevelOffset,d=t.dropContainerKey,s=t.dropTargetKey,u=t.dropPosition,f=t.dragOverNodeKey,m=t.indent,h=this.props,v=h.prefixCls,g=h.className,b=h.style,y=h.showLine,x=h.focusable,w=h.tabIndex,C=h.selectable,S=h.showIcon,N=h.icon,K=h.switcherIcon,O=h.draggable,I=h.checkable,R=h.checkStrictly,P=h.disabled,M=h.motion,T=h.loadData,D=h.filterTreeNode,L=h.height,j=h.itemHeight,B=h.scrollWidth,H=h.virtual,z=h.titleRender,A=h.dropIndicatorRender,W=h.onContextMenu,_=h.onScroll,q=h.direction,V=h.rootClassName,X=h.rootStyle,U=(0,F.Z)(this.props,{aria:!0,data:!0});O&&(e="object"===(0,k.Z)(O)?O:"function"==typeof O?{nodeDraggable:O}:{});var G={prefixCls:v,selectable:C,showIcon:S,icon:N,switcherIcon:K,draggable:e,draggingNodeKey:l,checkable:I,checkStrictly:R,disabled:P,keyEntities:a,dropLevelOffset:i,dropContainerKey:d,dropTargetKey:s,dropPosition:u,dragOverNodeKey:f,indent:m,direction:q,dropIndicatorRender:A,loadData:T,filterTreeNode:D,titleRender:z,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return o.createElement(eW.Provider,{value:G},o.createElement("div",{className:Z()(v,g,V,(0,E.Z)((0,E.Z)((0,E.Z)({},"".concat(v,"-show-line"),y),"".concat(v,"-focused"),n),"".concat(v,"-active-focused"),null!==c)),style:X},o.createElement(nn,(0,p.Z)({ref:this.listRef,prefixCls:v,style:b,data:r,disabled:P,selectable:C,checkable:!!I,motion:M,dragging:null!==l,height:L,itemHeight:j,virtual:H,focusable:x,focused:n,tabIndex:void 0===w?0:w,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:W,onScroll:_,scrollWidth:B},this.getTreeNodeRequiredProps(),U))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,o,r=t.prevProps,a={prevProps:e};function l(t){return!r&&e.hasOwnProperty(t)||r&&r[t]!==e[t]}var c=t.fieldNames;if(l("fieldNames")&&(c=eG(e.fieldNames),a.fieldNames=c),l("treeData")?n=e.treeData:l("children")&&((0,O.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=eY(e.children)),n){a.treeData=n;var i=eJ(n,{fieldNames:c});a.keyEntities=(0,C.Z)((0,E.Z)({},t6,t7),i.keyEntities)}var d=a.keyEntities||t.keyEntities;if(l("expandedKeys")||r&&l("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!r&&e.defaultExpandParent?tt(e.expandedKeys,d):e.expandedKeys;else if(!r&&e.defaultExpandAll){var s=(0,C.Z)({},d);delete s[t6];var u=[];Object.keys(s).forEach(function(e){var t=s[e];t.children&&t.children.length&&u.push(t.key)}),a.expandedKeys=u}else!r&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?tt(e.defaultExpandedKeys,d):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,n||a.expandedKeys){var f=e$(n||t.treeData,a.expandedKeys||t.expandedKeys,c);a.flattenNodes=f}if(e.selectable&&(l("selectedKeys")?a.selectedKeys=e9(e.selectedKeys,e):!r&&e.defaultSelectedKeys&&(a.selectedKeys=e9(e.defaultSelectedKeys,e))),e.checkable&&(l("checkedKeys")?o=te(e.checkedKeys)||{}:!r&&e.defaultCheckedKeys?o=te(e.defaultCheckedKeys)||{}:n&&(o=te(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),o)){var p=o,m=p.checkedKeys,h=void 0===m?[]:m,v=p.halfCheckedKeys,g=void 0===v?[]:v;if(!e.checkStrictly){var b=tr(h,!0,d);h=b.checkedKeys,g=b.halfCheckedKeys}a.checkedKeys=h,a.halfCheckedKeys=g}return l("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),n}(o.Component);(0,E.Z)(no,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var t=e.dropPosition,n=e.dropLevelOffset,r=e.indent,a={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case -1:a.top=0,a.left=-n*r;break;case 1:a.bottom=0,a.left=-n*r;break;case 0:a.bottom=0,a.left=r}return o.createElement("div",{style:a})},allowDrop:function(){return!0},expandAction:!1}),(0,E.Z)(no,"TreeNode",e4);var nr={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 42h216v494z"}}]},name:"file",theme:"outlined"},na=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nr}))}),nl={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},nc=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nl}))}),ni={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},nd=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:ni}))}),ns={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},nu=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:ns}))}),nf=n(68710),np=n(86586),nm=n(93463),nh=n(23159),nv=n(12918),ng=n(63074),nb=n(71140),ny=n(99320);let nx=e=>{let{treeCls:t,treeNodeCls:n,directoryNodeSelectedBg:o,directoryNodeSelectedColor:r,motionDurationMid:a,borderRadius:l,controlItemBgHover:c}=e;return{["".concat(t).concat(t,"-directory ").concat(n)]:{["".concat(t,"-node-content-wrapper")]:{position:"static",["&:has(".concat(t,"-drop-indicator)")]:{position:"relative"},["> *:not(".concat(t,"-drop-indicator)")]:{position:"relative"},"&:hover":{background:"transparent"},"&:before":{position:"absolute",inset:0,transition:"background-color ".concat(a),content:'""',borderRadius:l},"&:hover:before":{background:c}},["".concat(t,"-switcher, ").concat(t,"-checkbox, ").concat(t,"-draggable-icon")]:{zIndex:1},"&-selected":{background:o,borderRadius:l,["".concat(t,"-switcher, ").concat(t,"-draggable-icon")]:{color:r},["".concat(t,"-node-content-wrapper")]:{color:r,background:"transparent","&, &:hover":{color:r},"&:before, &:hover:before":{background:o}}}}}},nw=new nm.E4("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),nk=(e,t)=>({[".".concat(e,"-switcher-icon")]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:"transform ".concat(t.motionDurationSlow)}}}),nC=(e,t)=>({[".".concat(e,"-drop-indicator")]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:"".concat((0,nm.bf)(t.lineWidthBold)," solid ").concat(t.colorPrimary),borderRadius:"50%",content:'""'}}}),nE=(e,t)=>{let{treeCls:n,treeNodeCls:o,treeNodePadding:r,titleHeight:a,indentSize:l,nodeSelectedBg:c,nodeHoverBg:i,colorTextQuaternary:d,controlItemBgActiveDisabled:s}=t;return{[n]:Object.assign(Object.assign({},(0,nv.Wf)(t)),{"--rc-virtual-list-scrollbar-bg":t.colorSplit,background:t.colorBgContainer,borderRadius:t.borderRadius,transition:"background-color ".concat(t.motionDurationSlow),"&-rtl":{direction:"rtl"},["&".concat(n,"-rtl ").concat(n,"-switcher_close ").concat(n,"-switcher-icon svg")]:{transform:"rotate(90deg)"},["&-focused:not(:hover):not(".concat(n,"-active-focused)")]:(0,nv.oN)(t),["".concat(n,"-list-holder-inner")]:{alignItems:"flex-start"},["&".concat(n,"-block-node")]:{["".concat(n,"-list-holder-inner")]:{alignItems:"stretch",["".concat(n,"-node-content-wrapper")]:{flex:"auto"},["".concat(o,".dragging:after")]:{position:"absolute",inset:0,border:"1px solid ".concat(t.colorPrimary),opacity:0,animationName:nw,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none",borderRadius:t.borderRadius}}},[o]:{display:"flex",alignItems:"flex-start",marginBottom:r,lineHeight:(0,nm.bf)(a),position:"relative","&:before":{content:'""',position:"absolute",zIndex:1,insetInlineStart:0,width:"100%",top:"100%",height:r},["&-disabled ".concat(n,"-node-content-wrapper")]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}},["".concat(n,"-checkbox-disabled + ").concat(n,"-node-selected,&").concat(o,"-disabled").concat(o,"-selected ").concat(n,"-node-content-wrapper")]:{backgroundColor:s},["".concat(n,"-checkbox-disabled")]:{pointerEvents:"unset"},["&:not(".concat(o,"-disabled)")]:{["".concat(n,"-node-content-wrapper")]:{"&:hover":{color:t.nodeHoverColor}}},["&-active ".concat(n,"-node-content-wrapper")]:{background:t.controlItemBgHover},["&:not(".concat(o,"-disabled).filter-node ").concat(n,"-title")]:{color:t.colorPrimary,fontWeight:t.fontWeightStrong},"&-draggable":{cursor:"grab",["".concat(n,"-draggable-icon")]:{flexShrink:0,width:a,textAlign:"center",visibility:"visible",color:d},["&".concat(o,"-disabled ").concat(n,"-draggable-icon")]:{visibility:"hidden"}}},["".concat(n,"-indent")]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:l}},["".concat(n,"-draggable-icon")]:{visibility:"hidden"},["".concat(n,"-switcher, ").concat(n,"-checkbox")]:{marginInlineEnd:t.calc(t.calc(a).sub(t.controlInteractiveSize)).div(2).equal()},["".concat(n,"-switcher")]:Object.assign(Object.assign({},nk(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:a,textAlign:"center",cursor:"pointer",userSelect:"none",transition:"all ".concat(t.motionDurationSlow),"&-noop":{cursor:"unset"},"&:before":{pointerEvents:"none",content:'""',width:a,height:a,position:"absolute",left:{_skip_check_:!0,value:0},top:0,borderRadius:t.borderRadius,transition:"all ".concat(t.motionDurationSlow)},["&:not(".concat(n,"-switcher-noop):hover:before")]:{backgroundColor:t.colorBgTextHover},["&_close ".concat(n,"-switcher-icon svg")]:{transform:"rotate(-90deg)"},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(r).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(a).div(2).equal()).mul(.8).equal(),height:t.calc(a).div(2).equal(),borderBottom:"1px solid ".concat(t.colorBorder),content:'""'}}}),["".concat(n,"-node-content-wrapper")]:Object.assign(Object.assign({position:"relative",minHeight:a,paddingBlock:0,paddingInline:t.paddingXS,background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:"all ".concat(t.motionDurationMid,", border 0s, line-height 0s, box-shadow 0s")},nC(e,t)),{"&:hover":{backgroundColor:i},["&".concat(n,"-node-selected")]:{color:t.nodeSelectedColor,backgroundColor:c},["".concat(n,"-iconEle")]:{display:"inline-block",width:a,height:a,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}}),["".concat(n,"-unselectable ").concat(n,"-node-content-wrapper:hover")]:{backgroundColor:"transparent"},["".concat(o,".drop-container > [draggable]")]:{boxShadow:"0 0 0 2px ".concat(t.colorPrimary)},"&-show-line":{["".concat(n,"-indent-unit")]:{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(r).mul(-1).equal(),borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&-end:before":{display:"none"}},["".concat(n,"-switcher")]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},["".concat(o,"-leaf-last ").concat(n,"-switcher-leaf-line:before")]:{top:"auto !important",bottom:"auto !important",height:"".concat((0,nm.bf)(t.calc(a).div(2).equal())," !important")}})}},nS=function(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],o=".".concat(e),r=t.calc(t.paddingXS).div(2).equal(),a=(0,nb.IX)(t,{treeCls:o,treeNodeCls:"".concat(o,"-treenode"),treeNodePadding:r});return[nE(e,a),n&&nx(a)].filter(Boolean)},nZ=e=>{let{controlHeightSM:t,controlItemBgHover:n,controlItemBgActive:o}=e;return{titleHeight:t,indentSize:t,nodeHoverBg:n,nodeHoverColor:e.colorText,nodeSelectedBg:o,nodeSelectedColor:e.colorText}};var nN=(0,ny.I$)("Tree",(e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:(0,nh.C2)("".concat(n,"-checkbox"),e)},nS(n,e),(0,ng.Z)(e)]},e=>{let{colorTextLightSolid:t,colorPrimary:n}=e;return Object.assign(Object.assign({},nZ(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:n})}),nK=function(e){let{dropPosition:t,dropLevelOffset:n,prefixCls:r,indent:a,direction:l="ltr"}=e,c="ltr"===l?"left":"right",i={[c]:-n*a+4,["ltr"===l?"right":"left"]:0};switch(t){case -1:i.top=-3;break;case 1:i.bottom=-3;break;default:i.bottom=-3,i[c]=a+4}return o.createElement("div",{style:i,className:"".concat(r,"-drop-indicator")})},nO={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},nI=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nO}))}),nR=n(61935),nP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 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:"minus-square",theme:"outlined"},nM=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nP}))}),nT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 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-8H544V328c0-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 8z"}},{tag:"path",attrs:{d:"M880 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:"plus-square",theme:"outlined"},nD=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nT}))}),nL=n(19722),nj=e=>{var t,n;let r;let{prefixCls:a,switcherIcon:l,treeNodeProps:c,showLine:i,switcherLoadingIcon:d}=e,{isLeaf:s,expanded:u,loading:f}=c;if(f)return o.isValidElement(d)?d:o.createElement(nR.Z,{className:"".concat(a,"-switcher-loading-icon")});if(i&&"object"==typeof i&&(r=i.showLeafIcon),s){if(!i)return null;if("boolean"!=typeof r&&r){let e="function"==typeof r?r(c):r;return o.isValidElement(e)?(0,nL.Tm)(e,{className:Z()(null===(t=e.props)||void 0===t?void 0:t.className,"".concat(a,"-switcher-line-custom-icon"))}):e}return r?o.createElement(na,{className:"".concat(a,"-switcher-line-icon")}):o.createElement("span",{className:"".concat(a,"-switcher-leaf-line")})}let p="".concat(a,"-switcher-icon"),m="function"==typeof l?l(c):l;return o.isValidElement(m)?(0,nL.Tm)(m,{className:Z()(null===(n=m.props)||void 0===n?void 0:n.className,p)}):void 0!==m?m:i?u?o.createElement(nM,{className:"".concat(a,"-switcher-line-icon")}):o.createElement(nD,{className:"".concat(a,"-switcher-line-icon")}):o.createElement(nI,{className:p})};let nB=o.forwardRef((e,t)=>{var n;let{getPrefixCls:r,direction:a,virtual:l,tree:c}=o.useContext(tk.E_),{prefixCls:i,className:d,showIcon:s=!1,showLine:u,switcherIcon:f,switcherLoadingIcon:p,blockNode:m=!1,children:h,checkable:v=!1,selectable:g=!0,draggable:b,disabled:y,motion:x,style:w}=e,k=r("tree",i),C=r(),E=o.useContext(np.Z),S=null!=y?y:E,N=null!=x?x:Object.assign(Object.assign({},(0,nf.Z)(C)),{motionAppear:!1}),K=Object.assign(Object.assign({},e),{checkable:v,selectable:g,showIcon:s,motion:N,blockNode:m,disabled:S,showLine:!!u,dropIndicatorRender:nK}),[O,I,R]=nN(k),[,P]=(0,tI.ZP)(),M=P.paddingXS/2+((null===(n=P.Tree)||void 0===n?void 0:n.titleHeight)||P.controlHeightSM),T=o.useMemo(()=>{if(!b)return!1;let e={};switch(typeof b){case"function":e.nodeDraggable=b;break;case"object":e=Object.assign({},b)}return!1!==e.icon&&(e.icon=e.icon||o.createElement(nu,null)),e},[b]);return O(o.createElement(no,Object.assign({itemHeight:M,ref:t,virtual:l},K,{style:Object.assign(Object.assign({},null==c?void 0:c.style),w),prefixCls:k,className:Z()({["".concat(k,"-icon-hide")]:!s,["".concat(k,"-block-node")]:m,["".concat(k,"-unselectable")]:!g,["".concat(k,"-rtl")]:"rtl"===a,["".concat(k,"-disabled")]:S},null==c?void 0:c.className,d,I,R),direction:a,checkable:v?o.createElement("span",{className:"".concat(k,"-checkbox-inner")}):v,selectable:g,switcherIcon:e=>o.createElement(nj,{prefixCls:k,switcherIcon:f,switcherLoadingIcon:p,treeNodeProps:e,showLine:u}),draggable:T}),h))});function nH(e,t,n){let{key:o,children:r}=n;e.forEach(function(e){let a=e[o],l=e[r];!1!==t(a,e)&&nH(l||[],t,n)})}var nz=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};function nA(e){let{isLeaf:t,expanded:n}=e;return t?o.createElement(na,null):n?o.createElement(nc,null):o.createElement(nd,null)}function nW(e){let{treeData:t,children:n}=e;return t||eY(n)}let n_=o.forwardRef((e,t)=>{var{defaultExpandAll:n,defaultExpandParent:r,defaultExpandedKeys:a}=e,l=nz(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);let c=o.useRef(null),i=o.useRef(null),d=()=>{let{keyEntities:e}=eJ(nW(l),{fieldNames:l.fieldNames});return n?Object.keys(e):r?tt(l.expandedKeys||a||[],e):l.expandedKeys||a||[]},[s,u]=o.useState(l.selectedKeys||l.defaultSelectedKeys||[]),[f,p]=o.useState(()=>d());o.useEffect(()=>{"selectedKeys"in l&&u(l.selectedKeys)},[l.selectedKeys]),o.useEffect(()=>{"expandedKeys"in l&&p(l.expandedKeys)},[l.expandedKeys]);let{getPrefixCls:m,direction:h}=o.useContext(tk.E_),{prefixCls:v,className:g,showIcon:b=!0,expandAction:y="click"}=l,x=nz(l,["prefixCls","className","showIcon","expandAction"]),w=m("tree",v),k=Z()("".concat(w,"-directory"),{["".concat(w,"-directory-rtl")]:"rtl"===h},g);return o.createElement(nB,Object.assign({icon:nA,ref:t,blockNode:!0},x,{showIcon:b,expandAction:y,prefixCls:w,className:k,expandedKeys:f,selectedKeys:s,onSelect:(e,t)=>{var n;let o;let{multiple:r,fieldNames:a}=l,{node:d,nativeEvent:s}=t,{key:p=""}=d,m=nW(l),h=Object.assign(Object.assign({},t),{selected:!0}),v=(null==s?void 0:s.ctrlKey)||(null==s?void 0:s.metaKey),g=null==s?void 0:s.shiftKey;r&&v?(o=e,c.current=p,i.current=o):r&&g?o=Array.from(new Set([].concat((0,el.Z)(i.current||[]),(0,el.Z)(function(e){let{treeData:t,expandedKeys:n,startKey:o,endKey:r,fieldNames:a}=e,l=[],c=0;return o&&o===r?[o]:o&&r?(nH(t,e=>{if(2===c)return!1;if(e===o||e===r){if(l.push(e),0===c)c=1;else if(1===c)return c=2,!1}else 1===c&&l.push(e);return n.includes(e)},eG(a)),l):[]}({treeData:m,expandedKeys:f,startKey:p,endKey:c.current,fieldNames:a}))))):(o=[p],c.current=p,i.current=o),h.selectedNodes=function(e,t,n){let o=(0,el.Z)(t),r=[];return nH(e,(e,t)=>{let n=o.indexOf(e);return -1!==n&&(r.push(t),o.splice(n,1)),!!o.length},eG(n)),r}(m,o,a),null===(n=l.onSelect)||void 0===n||n.call(l,o,h),"selectedKeys"in l||u(o)},onExpand:(e,t)=>{var n;return"expandedKeys"in l||p(e),null===(n=l.onExpand)||void 0===n?void 0:n.call(l,e,t)}}))});nB.DirectoryTree=n_,nB.TreeNode=e4;var nF=n(29436),nq=n(39454),nV=e=>{let{value:t,filterSearch:n,tablePrefixCls:r,locale:a,onChange:l}=e;return n?o.createElement("div",{className:"".concat(r,"-filter-dropdown-search")},o.createElement(nq.Z,{prefix:o.createElement(nF.Z,null),placeholder:a.filterSearchPlaceholder,onChange:l,value:t,htmlSize:1,className:"".concat(r,"-filter-dropdown-search-input")})):null};let nX=e=>{let{keyCode:t}=e;t===tY.Z.ENTER&&e.stopPropagation()},nU=o.forwardRef((e,t)=>o.createElement("div",{className:e.className,onClick:e=>e.stopPropagation(),onKeyDown:nX,ref:t},e.children));function nG(e){let t=[];return(e||[]).forEach(e=>{let{value:n,children:o}=e;t.push(n),o&&(t=[].concat((0,el.Z)(t),(0,el.Z)(nG(o))))}),t}function nY(e,t){return("string"==typeof t||"number"==typeof t)&&(null==t?void 0:t.toString().toLowerCase().includes(e.trim().toLowerCase()))}var n$=e=>{var t,n,r,a;let l,c;let{tablePrefixCls:i,prefixCls:s,column:u,dropdownPrefixCls:f,columnKey:p,filterOnClose:m,filterMultiple:h,filterMode:v="menu",filterSearch:g=!1,filterState:b,triggerFilter:y,locale:x,children:w,getPopupContainer:k,rootClassName:C}=e,{filterResetToDefaultFilteredValue:E,defaultFilteredValue:S,filterDropdownProps:N={},filterDropdownOpen:K,filterDropdownVisible:O,onFilterDropdownVisibleChange:I,onFilterDropdownOpenChange:R}=u,[P,M]=o.useState(!1),T=!!(b&&((null===(t=b.filteredKeys)||void 0===t?void 0:t.length)||b.forceFiltered)),D=e=>{var t;M(e),null===(t=N.onOpenChange)||void 0===t||t.call(N,e),null==R||R(e),null==I||I(e)},L=null!==(a=null!==(r=null!==(n=N.open)&&void 0!==n?n:K)&&void 0!==r?r:O)&&void 0!==a?a:P,j=null==b?void 0:b.filteredKeys,[B,H]=tz(j||[]),z=e=>{let{selectedKeys:t}=e;H(t)},A=(e,t)=>{let{node:n,checked:o}=t;h?z({selectedKeys:e}):z({selectedKeys:o&&n.key?[n.key]:[]})};o.useEffect(()=>{P&&z({selectedKeys:j||[]})},[j]);let[W,_]=o.useState([]),F=e=>{_(e)},[q,V]=o.useState(""),X=e=>{let{value:t}=e.target;V(t)};o.useEffect(()=>{P||V("")},[P]);let U=e=>{let t=(null==e?void 0:e.length)?e:null;if(null===t&&(!b||!b.filteredKeys)||(0,d.Z)(t,null==b?void 0:b.filteredKeys,!0))return null;y({column:u,key:p,filteredKeys:t})},G=()=>{D(!1),U(B())},Y=function(){let{confirm:e,closeDropdown:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{confirm:!1,closeDropdown:!1};e&&U([]),t&&D(!1),V(""),E?H((S||[]).map(e=>String(e))):H([])},$=Z()({["".concat(f,"-menu-without-submenu")]:!(u.filters||[]).some(e=>{let{children:t}=e;return t})}),J=e=>{e.target.checked?H(nG(null==u?void 0:u.filters).map(e=>String(e))):H([])},Q=e=>{let{filters:t}=e;return(t||[]).map((e,t)=>{let n=String(e.value),o={title:e.text,key:void 0!==e.value?n:String(t)};return e.children&&(o.children=Q({filters:e.children})),o})},ee=e=>{var t;return Object.assign(Object.assign({},e),{text:e.title,value:e.key,children:(null===(t=e.children)||void 0===t?void 0:t.map(e=>ee(e)))||[]})},{direction:et,renderEmpty:en}=o.useContext(tk.E_);if("function"==typeof u.filterDropdown)l=u.filterDropdown({prefixCls:"".concat(f,"-custom"),setSelectedKeys:e=>z({selectedKeys:e}),selectedKeys:B(),confirm:function(){let{closeDropdown:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{closeDropdown:!0};e&&D(!1),U(B())},clearFilters:Y,filters:u.filters,visible:L,close:()=>{D(!1)}});else if(u.filterDropdown)l=u.filterDropdown;else{let e=B()||[];l=o.createElement(o.Fragment,null,(()=>{var t,n;let r=null!==(t=null==en?void 0:en("Table.filter"))&&void 0!==t?t:o.createElement(tW.Z,{image:tW.Z.PRESENTED_IMAGE_SIMPLE,description:x.filterEmptyText,styles:{image:{height:24}},style:{margin:0,padding:"16px 0"}});if(0===(u.filters||[]).length)return r;if("tree"===v)return o.createElement(o.Fragment,null,o.createElement(nV,{filterSearch:g,value:q,onChange:X,tablePrefixCls:i,locale:x}),o.createElement("div",{className:"".concat(i,"-filter-dropdown-tree")},h?o.createElement(ti.Z,{checked:e.length===nG(u.filters).length,indeterminate:e.length>0&&e.length"function"==typeof g?g(q,ee(e)):nY(q,e.title):void 0})));let a=function e(t){let{filters:n,prefixCls:r,filteredKeys:a,filterMultiple:l,searchValue:c,filterSearch:i}=t;return n.map((t,n)=>{let d=String(t.value);if(t.children)return{key:d||n,label:t.text,popupClassName:"".concat(r,"-dropdown-submenu"),children:e({filters:t.children,prefixCls:r,filteredKeys:a,filterMultiple:l,searchValue:c,filterSearch:i})};let s=l?ti.Z:ts.ZP,u={key:void 0!==t.value?d:n,label:o.createElement(o.Fragment,null,o.createElement(s,{checked:a.includes(d)}),o.createElement("span",null,t.text))};return c.trim()?"function"==typeof i?i(c,t)?u:null:nY(c,t.text)?u:null:u})}({filters:u.filters||[],filterSearch:g,prefixCls:s,filteredKeys:B(),filterMultiple:h,searchValue:q}),l=a.every(e=>null===e);return o.createElement(o.Fragment,null,o.createElement(nV,{filterSearch:g,value:q,onChange:X,tablePrefixCls:i,locale:x}),l?r:o.createElement(t_.Z,{selectable:!0,multiple:h,prefixCls:"".concat(f,"-menu"),className:$,onSelect:z,onDeselect:z,selectedKeys:e,getPopupContainer:k,openKeys:W,onOpenChange:F,items:a}))})(),o.createElement("div",{className:"".concat(s,"-dropdown-btns")},o.createElement(tA.ZP,{type:"link",size:"small",disabled:E?(0,d.Z)((S||[]).map(e=>String(e)),e,!0):0===e.length,onClick:()=>Y()},x.filterReset),o.createElement(tA.ZP,{type:"primary",size:"small",onClick:G},x.filterConfirm)))}u.filterDropdown&&(l=o.createElement(tF.J,{selectable:void 0},l)),l=o.createElement(nU,{className:"".concat(s,"-dropdown")},l);let eo=(0,tB.Z)({trigger:["click"],placement:"rtl"===et?"bottomLeft":"bottomRight",children:(c="function"==typeof u.filterIcon?u.filterIcon(T):u.filterIcon?u.filterIcon:o.createElement(tj,null),o.createElement("span",{role:"button",tabIndex:-1,className:Z()("".concat(s,"-trigger"),{active:T}),onClick:e=>{e.stopPropagation()}},c)),getPopupContainer:k},Object.assign(Object.assign({},N),{rootClassName:Z()(C,N.rootClassName),open:L,onOpenChange:(e,t)=>{"trigger"===t.source&&(e&&void 0!==j&&H(j||[]),D(e),e||u.filterDropdown||!m||G())},popupRender:()=>"function"==typeof(null==N?void 0:N.dropdownRender)?N.dropdownRender(l):l}));return o.createElement("div",{className:"".concat(s,"-column")},o.createElement("span",{className:"".concat(i,"-column-title")},w),o.createElement(td.Z,Object.assign({},eo)))};let nJ=(e,t,n)=>{let o=[];return(e||[]).forEach((e,r)=>{var a;let l=tP(r,n),c=void 0!==e.filterDropdown;if(e.filters||c||"onFilter"in e){if("filteredValue"in e){let t=e.filteredValue;c||(t=null!==(a=null==t?void 0:t.map(String))&&void 0!==a?a:t),o.push({column:e,key:tR(e,l),filteredKeys:t,forceFiltered:e.filtered})}else o.push({column:e,key:tR(e,l),filteredKeys:t&&e.defaultFilteredValue?e.defaultFilteredValue:void 0,forceFiltered:e.filtered})}"children"in e&&(o=[].concat((0,el.Z)(o),(0,el.Z)(nJ(e.children,t,l))))}),o},nQ=e=>{let t={};return e.forEach(e=>{let{key:n,filteredKeys:o,column:r}=e,{filters:a,filterDropdown:l}=r;if(l)t[n]=o||null;else if(Array.isArray(o)){let e=nG(a);t[n]=e.filter(e=>o.includes(String(e)))}else t[n]=null}),t},n0=(e,t,n)=>t.reduce((e,o)=>{let{column:{onFilter:r,filters:a},filteredKeys:l}=o;return r&&l&&l.length?e.map(e=>Object.assign({},e)).filter(e=>l.some(o=>{let l=nG(a),c=l.findIndex(e=>String(e)===String(o)),i=-1!==c?l[c]:o;return e[n]&&(e[n]=n0(e[n],t,n)),r(i,e)})):e},e),n1=e=>e.flatMap(e=>"children"in e?[e].concat((0,el.Z)(n1(e.children||[]))):[e]);var n2=e=>{let{prefixCls:t,dropdownPrefixCls:n,mergedColumns:r,onFilterChange:a,getPopupContainer:l,locale:c,rootClassName:i}=e;(0,tc.ln)("Table");let d=o.useMemo(()=>n1(r||[]),[r]),[s,u]=o.useState(()=>nJ(d,!0)),f=o.useMemo(()=>{let e=nJ(d,!1);if(0===e.length)return e;let t=!0;if(e.forEach(e=>{let{filteredKeys:n}=e;void 0!==n&&(t=!1)}),t){let e=(d||[]).map((e,t)=>tR(e,tP(t)));return s.filter(t=>{let{key:n}=t;return e.includes(n)}).map(t=>{let n=d[e.indexOf(t.key)];return Object.assign(Object.assign({},t),{column:Object.assign(Object.assign({},t.column),n),forceFiltered:n.filtered})})}return e},[d,s]),p=o.useMemo(()=>nQ(f),[f]),m=e=>{let t=f.filter(t=>{let{key:n}=t;return n!==e.key});t.push(e),u(t),a(nQ(t),t)};return[e=>(function e(t,n,r,a,l,c,i,d,s){return r.map((r,u)=>{let f=tP(u,d),{filterOnClose:p=!0,filterMultiple:m=!0,filterMode:h,filterSearch:v}=r,g=r;if(g.filters||g.filterDropdown){let e=tR(g,f),d=a.find(t=>{let{key:n}=t;return e===n});g=Object.assign(Object.assign({},g),{title:a=>o.createElement(n$,{tablePrefixCls:t,prefixCls:"".concat(t,"-filter"),dropdownPrefixCls:n,column:g,columnKey:e,filterState:d,filterOnClose:p,filterMultiple:m,filterMode:h,filterSearch:v,triggerFilter:c,locale:l,getPopupContainer:i,rootClassName:s},tM(r.title,a))})}return"children"in g&&(g=Object.assign(Object.assign({},g),{children:e(t,n,g.children,a,l,c,i,f,s)})),g})})(t,n,e,f,c,m,l,void 0,i),f,p]},n3=(e,t,n)=>{let r=o.useRef({});return[function(o){var a;if(!r.current||r.current.data!==e||r.current.childrenColumnName!==t||r.current.getRowKey!==n){let o=new Map;!function e(r){r.forEach((r,a)=>{let l=n(r,a);o.set(l,r),r&&"object"==typeof r&&t in r&&e(r[t]||[])})}(e),r.current={data:e,childrenColumnName:t,kvMap:o,getRowKey:n}}return null===(a=r.current.kvMap)||void 0===a?void 0:a.get(o)}]},n4=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},n8=function(e,t,n){let r=n&&"object"==typeof n?n:{},{total:a=0}=r,l=n4(r,["total"]),[c,i]=(0,o.useState)(()=>({current:"defaultCurrent"in l?l.defaultCurrent:1,pageSize:"defaultPageSize"in l?l.defaultPageSize:10})),d=(0,tB.Z)(c,l,{total:a>0?a:e}),s=Math.ceil((a||e)/d.pageSize);d.current>s&&(d.current=s||1);let u=(e,t)=>{i({current:null!=e?e:1,pageSize:t||d.pageSize})};return!1===n?[{},()=>{}]:[Object.assign(Object.assign({},d),{onChange:(e,o)=>{var r;n&&(null===(r=n.onChange)||void 0===r||r.call(n,e,o)),u(e,o),t(e,o||(null==d?void 0:d.pageSize))}}),u]},n6={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},n5=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:n6}))}),n7={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},n9=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:n7}))}),oe=n(99981);let ot="ascend",on="descend",oo=e=>"object"==typeof e.sorter&&"number"==typeof e.sorter.multiple&&e.sorter.multiple,or=e=>"function"==typeof e?e:!!e&&"object"==typeof e&&!!e.compare&&e.compare,oa=(e,t)=>t?e[e.indexOf(t)+1]:e[0],ol=(e,t,n)=>{let o=[],r=(e,t)=>{o.push({column:e,key:tR(e,t),multiplePriority:oo(e),sortOrder:e.sortOrder})};return(e||[]).forEach((e,a)=>{let l=tP(a,n);e.children?("sortOrder"in e&&r(e,l),o=[].concat((0,el.Z)(o),(0,el.Z)(ol(e.children,t,l)))):e.sorter&&("sortOrder"in e?r(e,l):t&&e.defaultSortOrder&&o.push({column:e,key:tR(e,l),multiplePriority:oo(e),sortOrder:e.defaultSortOrder}))}),o},oc=(e,t,n,r,a,l,c,i)=>(t||[]).map((t,d)=>{let s=tP(d,i),u=t;if(u.sorter){let i;let d=u.sortDirections||a,f=void 0===u.showSorterTooltip?c:u.showSorterTooltip,p=tR(u,s),m=n.find(e=>{let{key:t}=e;return t===p}),h=m?m.sortOrder:null,v=oa(d,h);if(t.sortIcon)i=t.sortIcon({sortOrder:h});else{let t=d.includes(ot)&&o.createElement(n9,{className:Z()("".concat(e,"-column-sorter-up"),{active:h===ot})}),n=d.includes(on)&&o.createElement(n5,{className:Z()("".concat(e,"-column-sorter-down"),{active:h===on})});i=o.createElement("span",{className:Z()("".concat(e,"-column-sorter"),{["".concat(e,"-column-sorter-full")]:!!(t&&n)})},o.createElement("span",{className:"".concat(e,"-column-sorter-inner"),"aria-hidden":"true"},t,n))}let{cancelSort:g,triggerAsc:b,triggerDesc:y}=l||{},x=g;v===on?x=y:v===ot&&(x=b);let w="object"==typeof f?Object.assign({title:x},f):{title:x};u=Object.assign(Object.assign({},u),{className:Z()(u.className,{["".concat(e,"-column-sort")]:h}),title:n=>{let r="".concat(e,"-column-sorters"),a=o.createElement("span",{className:"".concat(e,"-column-title")},tM(t.title,n)),l=o.createElement("div",{className:r},a,i);return f?"boolean"!=typeof f&&(null==f?void 0:f.target)==="sorter-icon"?o.createElement("div",{className:Z()(r,"".concat(r,"-tooltip-target-sorter"))},a,o.createElement(oe.Z,Object.assign({},w),i)):o.createElement(oe.Z,Object.assign({},w),l):l},onHeaderCell:n=>{var o;let a=(null===(o=t.onHeaderCell)||void 0===o?void 0:o.call(t,n))||{},l=a.onClick,c=a.onKeyDown;a.onClick=e=>{r({column:t,key:p,sortOrder:v,multiplePriority:oo(t)}),null==l||l(e)},a.onKeyDown=e=>{e.keyCode===tY.Z.ENTER&&(r({column:t,key:p,sortOrder:v,multiplePriority:oo(t)}),null==c||c(e))};let i=tT(t.title,{}),d=null==i?void 0:i.toString();return h&&(a["aria-sort"]="ascend"===h?"ascending":"descending"),a["aria-label"]=d||"",a.className=Z()(a.className,"".concat(e,"-column-has-sorters")),a.tabIndex=0,t.ellipsis&&(a.title=(null!=i?i:"").toString()),a}})}return"children"in u&&(u=Object.assign(Object.assign({},u),{children:oc(e,u.children,n,r,a,l,c,s)})),u}),oi=e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n,field:t.dataIndex,columnKey:t.key}},od=e=>{let t=e.filter(e=>{let{sortOrder:t}=e;return t}).map(oi);if(0===t.length&&e.length){let t=e.length-1;return Object.assign(Object.assign({},oi(e[t])),{column:void 0,order:void 0,field:void 0,columnKey:void 0})}return t.length<=1?t[0]||{}:t},os=(e,t,n)=>{let o=t.slice().sort((e,t)=>t.multiplePriority-e.multiplePriority),r=e.slice(),a=o.filter(e=>{let{column:{sorter:t},sortOrder:n}=e;return or(t)&&n});return a.length?r.sort((e,t)=>{for(let n=0;n{let o=e[n];return o?Object.assign(Object.assign({},e),{[n]:os(o,t,n)}):e}):r};var ou=e=>{let{prefixCls:t,mergedColumns:n,sortDirections:r,tableLocale:a,showSorterTooltip:l,onSorterChange:c}=e,[i,d]=o.useState(()=>ol(n,!0)),s=(e,t)=>{let n=[];return e.forEach((e,o)=>{let r=tP(o,t);if(n.push(tR(e,r)),Array.isArray(e.children)){let t=s(e.children,r);n.push.apply(n,(0,el.Z)(t))}}),n},u=o.useMemo(()=>{let e=!0,t=ol(n,!1);if(!t.length){let e=s(n);return i.filter(t=>{let{key:n}=t;return e.includes(n)})}let o=[];function r(t){e?o.push(t):o.push(Object.assign(Object.assign({},t),{sortOrder:null}))}let a=null;return t.forEach(t=>{null===a?(r(t),t.sortOrder&&(!1===t.multiplePriority?e=!1:a=!0)):(a&&!1!==t.multiplePriority||(e=!1),r(t))}),o},[n,i]),f=o.useMemo(()=>{var e,t;let n=u.map(e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n}});return{sortColumns:n,sortColumn:null===(e=n[0])||void 0===e?void 0:e.column,sortOrder:null===(t=n[0])||void 0===t?void 0:t.order}},[u]),p=e=>{let t;d(t=!1!==e.multiplePriority&&u.length&&!1!==u[0].multiplePriority?[].concat((0,el.Z)(u.filter(t=>{let{key:n}=t;return n!==e.key})),[e]):[e]),c(od(t),t)};return[e=>oc(t,e,u,p,r,a,l),u,f,()=>od(u)]};let of=(e,t)=>e.map(e=>{let n=Object.assign({},e);return n.title=tM(e.title,t),"children"in n&&(n.children=of(n.children,t)),n});var op=e=>[o.useCallback(t=>of(t,e),[e])];let om=b(eI,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:o}=t;return n!==o}),oh=b(ez,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:o}=t;return n!==o});var ov=n(54558),og=e=>{let{componentCls:t,lineWidth:n,lineType:o,tableBorderColor:r,tableHeaderBg:a,tablePaddingVertical:l,tablePaddingHorizontal:c,calc:i}=e,d="".concat((0,nm.bf)(n)," ").concat(o," ").concat(r),s=(e,o,r)=>({["&".concat(t,"-").concat(e)]:{["> ".concat(t,"-container")]:{["> ".concat(t,"-content, > ").concat(t,"-body")]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,nm.bf)(i(o).mul(-1).equal()),"\n ").concat((0,nm.bf)(i(i(r).add(n)).mul(-1).equal()))}}}}}});return{["".concat(t,"-wrapper")]:{["".concat(t).concat(t,"-bordered")]:Object.assign(Object.assign(Object.assign({["> ".concat(t,"-title")]:{border:d,borderBottom:0},["> ".concat(t,"-container")]:{borderInlineStart:d,borderTop:d,["\n > ".concat(t,"-content,\n > ").concat(t,"-header,\n > ").concat(t,"-body,\n > ").concat(t,"-summary\n ")]:{"> table":{"\n > thead > tr > th,\n > thead > tr > td,\n > tbody > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:d},"> thead":{"> tr:not(:last-child) > th":{borderBottom:d},"> tr > th::before":{backgroundColor:"transparent !important"}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{["> ".concat(t,"-cell-fix-right-first::after")]:{borderInlineEnd:d}},"\n > tbody > tr > th,\n > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,nm.bf)(i(l).mul(-1).equal())," ").concat((0,nm.bf)(i(i(c).add(n)).mul(-1).equal())),"&::after":{position:"absolute",top:0,insetInlineEnd:n,bottom:0,borderInlineEnd:d,content:'""'}}}}}},["&".concat(t,"-scroll-horizontal")]:{["> ".concat(t,"-container > ").concat(t,"-body")]:{"> table > tbody":{["\n > tr".concat(t,"-expanded-row,\n > tr").concat(t,"-placeholder\n ")]:{"> th, > td":{borderInlineEnd:0}}}}}},s("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),s("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{["> ".concat(t,"-footer")]:{border:d,borderTop:0}}),["".concat(t,"-cell")]:{["".concat(t,"-container:first-child")]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:"0 ".concat((0,nm.bf)(n)," 0 ").concat((0,nm.bf)(n)," ").concat(a)}},["".concat(t,"-bordered ").concat(t,"-cell-scrollbar")]:{borderInlineEnd:d}}}},ob=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-cell-ellipsis")]:Object.assign(Object.assign({},nv.vS),{wordBreak:"keep-all",["\n &".concat(t,"-cell-fix-left-last,\n &").concat(t,"-cell-fix-right-first\n ")]:{overflow:"visible",["".concat(t,"-cell-content")]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},["".concat(t,"-column-title")]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},oy=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody > tr").concat(t,"-placeholder")]:{textAlign:"center",color:e.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:e.colorBgContainer}}}}},ox=e=>{let{componentCls:t,antCls:n,motionDurationSlow:o,lineWidth:r,paddingXS:a,lineType:l,tableBorderColor:c,tableExpandIconBg:i,tableExpandColumnWidth:d,borderRadius:s,tablePaddingVertical:u,tablePaddingHorizontal:f,tableExpandedRowBg:p,paddingXXS:m,expandIconMarginTop:h,expandIconSize:v,expandIconHalfInner:g,expandIconScale:b,calc:y}=e,x="".concat((0,nm.bf)(r)," ").concat(l," ").concat(c),w=y(m).sub(r).equal();return{["".concat(t,"-wrapper")]:{["".concat(t,"-expand-icon-col")]:{width:d},["".concat(t,"-row-expand-icon-cell")]:{textAlign:"center",["".concat(t,"-row-expand-icon")]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},["".concat(t,"-row-indent")]:{height:1,float:"left"},["".concat(t,"-row-expand-icon")]:Object.assign(Object.assign({},(0,nv.Nd)(e)),{position:"relative",float:"left",width:v,height:v,color:"inherit",lineHeight:(0,nm.bf)(v),background:i,border:x,borderRadius:s,transform:"scale(".concat(b,")"),"&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:"transform ".concat(o," ease-out"),content:'""'},"&::before":{top:g,insetInlineEnd:w,insetInlineStart:w,height:r},"&::after":{top:w,bottom:w,insetInlineStart:g,width:r,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}}),["".concat(t,"-row-indent + ").concat(t,"-row-expand-icon")]:{marginTop:h,marginInlineEnd:a},["tr".concat(t,"-expanded-row")]:{"&, &:hover":{"> th, > td":{background:p}},["".concat(n,"-descriptions-view")]:{display:"flex",table:{flex:"auto",width:"100%"}}},["".concat(t,"-expanded-row-fixed")]:{position:"relative",margin:"".concat((0,nm.bf)(y(u).mul(-1).equal())," ").concat((0,nm.bf)(y(f).mul(-1).equal())),padding:"".concat((0,nm.bf)(u)," ").concat((0,nm.bf)(f))}}}},ow=e=>{let{componentCls:t,antCls:n,iconCls:o,tableFilterDropdownWidth:r,tableFilterDropdownSearchWidth:a,paddingXXS:l,paddingXS:c,colorText:i,lineWidth:d,lineType:s,tableBorderColor:u,headerIconColor:f,fontSizeSM:p,tablePaddingHorizontal:m,borderRadius:h,motionDurationSlow:v,colorIcon:g,colorPrimary:b,tableHeaderFilterActiveBg:y,colorTextDisabled:x,tableFilterDropdownBg:w,tableFilterDropdownHeight:k,controlItemBgHover:C,controlItemBgActive:E,boxShadowSecondary:S,filterDropdownMenuBg:Z,calc:N}=e,K="".concat(n,"-dropdown"),O="".concat(t,"-filter-dropdown"),I="".concat(n,"-tree"),R="".concat((0,nm.bf)(d)," ").concat(s," ").concat(u);return[{["".concat(t,"-wrapper")]:{["".concat(t,"-filter-column")]:{display:"flex",justifyContent:"space-between"},["".concat(t,"-filter-trigger")]:{position:"relative",display:"flex",alignItems:"center",marginBlock:N(l).mul(-1).equal(),marginInline:"".concat((0,nm.bf)(l)," ").concat((0,nm.bf)(N(m).div(2).mul(-1).equal())),padding:"0 ".concat((0,nm.bf)(l)),color:f,fontSize:p,borderRadius:h,cursor:"pointer",transition:"all ".concat(v),"&:hover":{color:g,background:y},"&.active":{color:b}}}},{["".concat(n,"-dropdown")]:{[O]:Object.assign(Object.assign({},(0,nv.Wf)(e)),{minWidth:r,backgroundColor:w,borderRadius:h,boxShadow:S,overflow:"hidden",["".concat(K,"-menu")]:{maxHeight:k,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:Z,"&:empty::after":{display:"block",padding:"".concat((0,nm.bf)(c)," 0"),color:x,fontSize:p,textAlign:"center",content:'"Not Found"'}},["".concat(O,"-tree")]:{paddingBlock:"".concat((0,nm.bf)(c)," 0"),paddingInline:c,[I]:{padding:0},["".concat(I,"-treenode ").concat(I,"-node-content-wrapper:hover")]:{backgroundColor:C},["".concat(I,"-treenode-checkbox-checked ").concat(I,"-node-content-wrapper")]:{"&, &:hover":{backgroundColor:E}}},["".concat(O,"-search")]:{padding:c,borderBottom:R,"&-input":{input:{minWidth:a},[o]:{color:x}}},["".concat(O,"-checkall")]:{width:"100%",marginBottom:l,marginInlineStart:l},["".concat(O,"-btns")]:{display:"flex",justifyContent:"space-between",padding:"".concat((0,nm.bf)(N(c).sub(d).equal())," ").concat((0,nm.bf)(c)),overflow:"hidden",borderTop:R}})}},{["".concat(n,"-dropdown ").concat(O,", ").concat(O,"-submenu")]:{["".concat(n,"-checkbox-wrapper + span")]:{paddingInlineStart:c,color:i},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]},ok=e=>{let{componentCls:t,lineWidth:n,colorSplit:o,motionDurationSlow:r,zIndexTableFixed:a,tableBg:l,zIndexTableSticky:c,calc:i}=e;return{["".concat(t,"-wrapper")]:{["\n ".concat(t,"-cell-fix-left,\n ").concat(t,"-cell-fix-right\n ")]:{position:"sticky !important",zIndex:a,background:l},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{position:"absolute",top:0,right:{_skip_check_:!0,value:0},bottom:i(n).mul(-1).equal(),width:30,transform:"translateX(100%)",transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none",willChange:"transform"},["".concat(t,"-cell-fix-left-all::after")]:{display:"none"},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{position:"absolute",top:0,bottom:i(n).mul(-1).equal(),left:{_skip_check_:!0,value:0},width:30,transform:"translateX(-100%)",transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none"},["".concat(t,"-container")]:{position:"relative","&::before, &::after":{position:"absolute",top:0,bottom:0,zIndex:i(c).add(1).equal({unit:!1}),width:30,transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none"},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},["".concat(t,"-ping-left")]:{["&:not(".concat(t,"-has-fix-left) ").concat(t,"-container::before")]:{boxShadow:"inset 10px 0 8px -8px ".concat(o)},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{boxShadow:"inset 10px 0 8px -8px ".concat(o)},["".concat(t,"-cell-fix-left-last::before")]:{backgroundColor:"transparent !important"}},["".concat(t,"-ping-right")]:{["&:not(".concat(t,"-has-fix-right) ").concat(t,"-container::after")]:{boxShadow:"inset -10px 0 8px -8px ".concat(o)},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{boxShadow:"inset -10px 0 8px -8px ".concat(o)}},["".concat(t,"-fixed-column-gapped")]:{["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after,\n ").concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{boxShadow:"none"}}}}},oC=e=>{let{componentCls:t,antCls:n,margin:o}=e;return{["".concat(t,"-wrapper ").concat(t,"-pagination").concat(n,"-pagination")]:{margin:"".concat((0,nm.bf)(o)," 0")}}},oE=e=>{let{componentCls:t,tableRadius:n}=e;return{["".concat(t,"-wrapper")]:{[t]:{["".concat(t,"-title, ").concat(t,"-header")]:{borderRadius:"".concat((0,nm.bf)(n)," ").concat((0,nm.bf)(n)," 0 0")},["".concat(t,"-title + ").concat(t,"-container")]:{borderStartStartRadius:0,borderStartEndRadius:0,["".concat(t,"-header, table")]:{borderRadius:0},"table > thead > tr:first-child":{"th:first-child, th:last-child, td:first-child, td:last-child":{borderRadius:0}}},"&-container":{borderStartStartRadius:n,borderStartEndRadius:n,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:n},"> *:last-child":{borderStartEndRadius:n}}},"&-footer":{borderRadius:"0 0 ".concat((0,nm.bf)(n)," ").concat((0,nm.bf)(n))}}}}},oS=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper-rtl")]:{direction:"rtl",table:{direction:"rtl"},["".concat(t,"-pagination-left")]:{justifyContent:"flex-end"},["".concat(t,"-pagination-right")]:{justifyContent:"flex-start"},["".concat(t,"-row-expand-icon")]:{float:"right","&::after":{transform:"rotate(-90deg)"},"&-collapsed::before":{transform:"rotate(180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"}},["".concat(t,"-container")]:{"&::before":{insetInlineStart:"unset",insetInlineEnd:0},"&::after":{insetInlineStart:0,insetInlineEnd:"unset"},["".concat(t,"-row-indent")]:{float:"right"}}}}},oZ=e=>{let{componentCls:t,antCls:n,iconCls:o,fontSizeIcon:r,padding:a,paddingXS:l,headerIconColor:c,headerIconHoverColor:i,tableSelectionColumnWidth:d,tableSelectedRowBg:s,tableSelectedRowHoverBg:u,tableRowHoverBg:f,tablePaddingHorizontal:p,calc:m}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-selection-col")]:{width:d,["&".concat(t,"-selection-col-with-dropdown")]:{width:m(d).add(r).add(m(a).div(4)).equal()}},["".concat(t,"-bordered ").concat(t,"-selection-col")]:{width:m(d).add(m(l).mul(2)).equal(),["&".concat(t,"-selection-col-with-dropdown")]:{width:m(d).add(r).add(m(a).div(4)).add(m(l).mul(2)).equal()}},["\n table tr th".concat(t,"-selection-column,\n table tr td").concat(t,"-selection-column,\n ").concat(t,"-selection-column\n ")]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:"center",["".concat(n,"-radio-wrapper")]:{marginInlineEnd:0}},["table tr th".concat(t,"-selection-column").concat(t,"-cell-fix-left")]:{zIndex:m(e.zIndexTableFixed).add(1).equal({unit:!1})},["table tr th".concat(t,"-selection-column::after")]:{backgroundColor:"transparent !important"},["".concat(t,"-selection")]:{position:"relative",display:"inline-flex",flexDirection:"column"},["".concat(t,"-selection-extra")]:{position:"absolute",top:0,zIndex:1,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),marginInlineStart:"100%",paddingInlineStart:(0,nm.bf)(m(p).div(4).equal()),[o]:{color:c,fontSize:r,verticalAlign:"baseline","&:hover":{color:i}}},["".concat(t,"-tbody")]:{["".concat(t,"-row")]:{["&".concat(t,"-row-selected")]:{["> ".concat(t,"-cell")]:{background:s,"&-row-hover":{background:u}}},["> ".concat(t,"-cell-row-hover")]:{background:f}}}}}},oN=e=>{let{componentCls:t,tableExpandColumnWidth:n,calc:o}=e,r=(e,r,a,l)=>({["".concat(t).concat(t,"-").concat(e)]:{fontSize:l,["\n ".concat(t,"-title,\n ").concat(t,"-footer,\n ").concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{padding:"".concat((0,nm.bf)(r)," ").concat((0,nm.bf)(a))},["".concat(t,"-filter-trigger")]:{marginInlineEnd:(0,nm.bf)(o(a).div(2).mul(-1).equal())},["".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,nm.bf)(o(r).mul(-1).equal())," ").concat((0,nm.bf)(o(a).mul(-1).equal()))},["".concat(t,"-tbody")]:{["".concat(t,"-wrapper:only-child ").concat(t)]:{marginBlock:(0,nm.bf)(o(r).mul(-1).equal()),marginInline:"".concat((0,nm.bf)(o(n).sub(a).equal())," ").concat((0,nm.bf)(o(a).mul(-1).equal()))}},["".concat(t,"-selection-extra")]:{paddingInlineStart:(0,nm.bf)(o(a).div(4).equal())}}});return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},r("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),r("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},oK=e=>{let{componentCls:t,marginXXS:n,fontSizeIcon:o,headerIconColor:r,headerIconHoverColor:a}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-thead th").concat(t,"-column-has-sorters")]:{outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow,", left 0s"),"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:"transparent !important"}},"&:focus-visible":{color:e.colorPrimary},["\n &".concat(t,"-cell-fix-left:hover,\n &").concat(t,"-cell-fix-right:hover\n ")]:{background:e.tableFixedHeaderSortActiveBg}},["".concat(t,"-thead th").concat(t,"-column-sort")]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},["td".concat(t,"-column-sort")]:{background:e.tableBodySortBg},["".concat(t,"-column-title")]:{position:"relative",zIndex:1,flex:1,minWidth:0},["".concat(t,"-column-sorters")]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},["".concat(t,"-column-sorters-tooltip-target-sorter")]:{"&::after":{content:"none"}},["".concat(t,"-column-sorter")]:{marginInlineStart:n,color:r,fontSize:0,transition:"color ".concat(e.motionDurationSlow),"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:o,"&.active":{color:e.colorPrimary}},["".concat(t,"-column-sorter-up + ").concat(t,"-column-sorter-down")]:{marginTop:"-0.3em"}},["".concat(t,"-column-sorters:hover ").concat(t,"-column-sorter")]:{color:a}}}},oO=e=>{let{componentCls:t,opacityLoading:n,tableScrollThumbBg:o,tableScrollThumbBgHover:r,tableScrollThumbSize:a,tableScrollBg:l,zIndexTableSticky:c,stickyScrollBarBorderRadius:i,lineWidth:d,lineType:s,tableBorderColor:u}=e,f="".concat((0,nm.bf)(d)," ").concat(s," ").concat(u);return{["".concat(t,"-wrapper")]:{["".concat(t,"-sticky")]:{"&-holder":{position:"sticky",zIndex:c,background:e.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:"".concat((0,nm.bf)(a)," !important"),zIndex:c,display:"flex",alignItems:"center",background:l,borderTop:f,opacity:n,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:a,backgroundColor:o,borderRadius:i,transition:"all ".concat(e.motionDurationSlow,", transform 0s"),position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:r}}}}}}},oI=e=>{let{componentCls:t,lineWidth:n,tableBorderColor:o,calc:r}=e,a="".concat((0,nm.bf)(n)," ").concat(e.lineType," ").concat(o);return{["".concat(t,"-wrapper")]:{["".concat(t,"-summary")]:{position:"relative",zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:a}}},["div".concat(t,"-summary")]:{boxShadow:"0 ".concat((0,nm.bf)(r(n).mul(-1).equal())," 0 ").concat(o)}}}},oR=e=>{let{componentCls:t,motionDurationMid:n,lineWidth:o,lineType:r,tableBorderColor:a,calc:l}=e,c="".concat((0,nm.bf)(o)," ").concat(r," ").concat(a),i="".concat(t,"-expanded-row-cell");return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody-virtual")]:{["".concat(t,"-tbody-virtual-holder-inner")]:{["\n & > ".concat(t,"-row, \n & > div:not(").concat(t,"-row) > ").concat(t,"-row\n ")]:{display:"flex",boxSizing:"border-box",width:"100%"}},["".concat(t,"-cell")]:{borderBottom:c,transition:"background ".concat(n)},["".concat(t,"-expanded-row")]:{["".concat(i).concat(i,"-fixed")]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:"calc(var(--virtual-width) - ".concat((0,nm.bf)(o),")"),borderInlineEnd:"none"}}},["".concat(t,"-bordered")]:{["".concat(t,"-tbody-virtual")]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:c,position:"absolute"},["".concat(t,"-cell")]:{borderInlineEnd:c,["&".concat(t,"-cell-fix-right-first:before")]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:l(o).mul(-1).equal(),borderInlineStart:c}}},["&".concat(t,"-virtual")]:{["".concat(t,"-placeholder ").concat(t,"-cell")]:{borderInlineEnd:c,borderBottom:c}}}}}};let oP=e=>{let{componentCls:t,fontWeightStrong:n,tablePaddingVertical:o,tablePaddingHorizontal:r,tableExpandColumnWidth:a,lineWidth:l,lineType:c,tableBorderColor:i,tableFontSize:d,tableBg:s,tableRadius:u,tableHeaderTextColor:f,motionDurationMid:p,tableHeaderBg:m,tableHeaderCellSplitColor:h,tableFooterTextColor:v,tableFooterBg:g,calc:b}=e,y="".concat((0,nm.bf)(l)," ").concat(c," ").concat(i);return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({clear:"both",maxWidth:"100%","--rc-virtual-list-scrollbar-bg":e.tableScrollBg},(0,nv.dF)()),{[t]:Object.assign(Object.assign({},(0,nv.Wf)(e)),{fontSize:d,background:s,borderRadius:"".concat((0,nm.bf)(u)," ").concat((0,nm.bf)(u)," 0 0"),scrollbarColor:"".concat(e.tableScrollThumbBg," ").concat(e.tableScrollBg)}),table:{width:"100%",textAlign:"start",borderRadius:"".concat((0,nm.bf)(u)," ").concat((0,nm.bf)(u)," 0 0"),borderCollapse:"separate",borderSpacing:0},["\n ".concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{position:"relative",padding:"".concat((0,nm.bf)(o)," ").concat((0,nm.bf)(r)),overflowWrap:"break-word"},["".concat(t,"-title")]:{padding:"".concat((0,nm.bf)(o)," ").concat((0,nm.bf)(r))},["".concat(t,"-thead")]:{"\n > tr > th,\n > tr > td\n ":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:m,borderBottom:y,transition:"background ".concat(p," ease"),"&[colspan]:not([colspan='1'])":{textAlign:"center"},["&:not(:last-child):not(".concat(t,"-selection-column):not(").concat(t,"-row-expand-icon-cell):not([colspan])::before")]:{position:"absolute",top:"50%",insetInlineEnd:0,width:1,height:"1.6em",backgroundColor:h,transform:"translateY(-50%)",transition:"background-color ".concat(p),content:'""'}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},["".concat(t,"-tbody")]:{"> tr":{"> th, > td":{transition:"background ".concat(p,", border-color ").concat(p),borderBottom:y,["\n > ".concat(t,"-wrapper:only-child,\n > ").concat(t,"-expanded-row-fixed > ").concat(t,"-wrapper:only-child\n ")]:{[t]:{marginBlock:(0,nm.bf)(b(o).mul(-1).equal()),marginInline:"".concat((0,nm.bf)(b(a).sub(r).equal()),"\n ").concat((0,nm.bf)(b(r).mul(-1).equal())),["".concat(t,"-tbody > tr:last-child > td")]:{borderBottomWidth:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:m,borderBottom:y,transition:"background ".concat(p," ease")},["& > ".concat(t,"-measure-cell")]:{paddingBlock:"0 !important",borderBlock:"0 !important",["".concat(t,"-measure-cell-content")]:{height:0,overflow:"hidden",pointerEvents:"none"}}}},["".concat(t,"-footer")]:{padding:"".concat((0,nm.bf)(o)," ").concat((0,nm.bf)(r)),color:v,background:g}})}};var oM=(0,ny.I$)("Table",e=>{let{colorTextHeading:t,colorSplit:n,colorBgContainer:o,controlInteractiveSize:r,headerBg:a,headerColor:l,headerSortActiveBg:c,headerSortHoverBg:i,bodySortBg:d,rowHoverBg:s,rowSelectedBg:u,rowSelectedHoverBg:f,rowExpandedBg:p,cellPaddingBlock:m,cellPaddingInline:h,cellPaddingBlockMD:v,cellPaddingInlineMD:g,cellPaddingBlockSM:b,cellPaddingInlineSM:y,borderColor:x,footerBg:w,footerColor:k,headerBorderRadius:C,cellFontSize:E,cellFontSizeMD:S,cellFontSizeSM:Z,headerSplitColor:N,fixedHeaderSortActiveBg:K,headerFilterHoverBg:O,filterDropdownBg:I,expandIconBg:R,selectionColumnWidth:P,stickyScrollBarBg:M,calc:T}=e,D=(0,nb.IX)(e,{tableFontSize:E,tableBg:o,tableRadius:C,tablePaddingVertical:m,tablePaddingHorizontal:h,tablePaddingVerticalMiddle:v,tablePaddingHorizontalMiddle:g,tablePaddingVerticalSmall:b,tablePaddingHorizontalSmall:y,tableBorderColor:x,tableHeaderTextColor:l,tableHeaderBg:a,tableFooterTextColor:k,tableFooterBg:w,tableHeaderCellSplitColor:N,tableHeaderSortBg:c,tableHeaderSortHoverBg:i,tableBodySortBg:d,tableFixedHeaderSortActiveBg:K,tableHeaderFilterActiveBg:O,tableFilterDropdownBg:I,tableRowHoverBg:s,tableSelectedRowBg:u,tableSelectedRowHoverBg:f,zIndexTableFixed:2,zIndexTableSticky:T(2).add(1).equal({unit:!1}),tableFontSizeMiddle:S,tableFontSizeSmall:Z,tableSelectionColumnWidth:P,tableExpandIconBg:R,tableExpandColumnWidth:T(r).add(T(e.padding).mul(2)).equal(),tableExpandedRowBg:p,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:M,tableScrollThumbBgHover:t,tableScrollBg:n});return[oP(D),oC(D),oI(D),oK(D),ow(D),og(D),oE(D),ox(D),oI(D),oy(D),oZ(D),ok(D),oO(D),ob(D),oN(D),oS(D),oR(D)]},e=>{let{colorFillAlter:t,colorBgContainer:n,colorTextHeading:o,colorFillSecondary:r,colorFillContent:a,controlItemBgActive:l,controlItemBgActiveHover:c,padding:i,paddingSM:d,paddingXS:s,colorBorderSecondary:u,borderRadiusLG:f,controlHeight:p,colorTextPlaceholder:m,fontSize:h,fontSizeSM:v,lineHeight:g,lineWidth:b,colorIcon:y,colorIconHover:x,opacityLoading:w,controlInteractiveSize:k}=e,C=new ov.t(r).onBackground(n).toHexString(),E=new ov.t(a).onBackground(n).toHexString(),S=new ov.t(t).onBackground(n).toHexString(),Z=new ov.t(y),N=new ov.t(x),K=k/2-b,O=2*K+3*b;return{headerBg:S,headerColor:o,headerSortActiveBg:C,headerSortHoverBg:E,bodySortBg:S,rowHoverBg:S,rowSelectedBg:l,rowSelectedHoverBg:c,rowExpandedBg:t,cellPaddingBlock:i,cellPaddingInline:i,cellPaddingBlockMD:d,cellPaddingInlineMD:s,cellPaddingBlockSM:s,cellPaddingInlineSM:s,borderColor:u,headerBorderRadius:f,footerBg:S,footerColor:o,cellFontSize:h,cellFontSizeMD:h,cellFontSizeSM:h,headerSplitColor:u,fixedHeaderSortActiveBg:C,headerFilterHoverBg:a,filterDropdownMenuBg:n,filterDropdownBg:n,expandIconBg:n,selectionColumnWidth:p,stickyScrollBarBg:m,stickyScrollBarBorderRadius:100,expandIconMarginTop:(h*g-3*b)/2-Math.ceil((1.4*v-3*b)/2),headerIconColor:Z.clone().setA(Z.a*w).toRgbString(),headerIconHoverColor:N.clone().setA(N.a*w).toRgbString(),expandIconHalfInner:K,expandIconSize:O,expandIconScale:k/O}},{unitless:{expandIconScale:!0}});let oT=[];var oD=o.forwardRef((e,t)=>{var n,r;let{prefixCls:l,className:c,rootClassName:i,style:d,size:s,bordered:u,dropdownPrefixCls:f,dataSource:p,pagination:m,rowSelection:h,rowKey:v="key",rowClassName:g,columns:b,children:y,childrenColumnName:x,onChange:w,getPopupContainer:k,loading:C,expandIcon:E,expandable:S,expandedRowRender:N,expandIconColumnIndex:K,indentSize:O,scroll:I,sortDirections:R,locale:P,showSorterTooltip:M={target:"full-header"},virtual:T}=e;(0,tc.ln)("Table");let D=o.useMemo(()=>b||ev(y),[b,y]),L=o.useMemo(()=>D.some(e=>e.responsive),[D]),j=(0,tZ.Z)(L),B=o.useMemo(()=>{let e=new Set(Object.keys(j).filter(e=>j[e]));return D.filter(t=>!t.responsive||t.responsive.some(t=>e.has(t)))},[D,j]),H=(0,eq.Z)(e,["className","style","columns"]),{locale:z=tN.Z,direction:A,table:W,renderEmpty:_,getPrefixCls:F,getPopupContainer:q}=o.useContext(tk.E_),V=(0,tS.Z)(s),X=Object.assign(Object.assign({},z.Table),P),U=p||oT,G=F("table",l),Y=F("dropdown",f),[,$]=(0,tI.ZP)(),J=(0,tE.Z)(G),[Q,ee,et]=oM(G,J),en=Object.assign(Object.assign({childrenColumnName:x,expandIconColumnIndex:K},S),{expandIcon:null!==(n=null==S?void 0:S.expandIcon)&&void 0!==n?n:null===(r=null==W?void 0:W.expandable)||void 0===r?void 0:r.expandIcon}),{childrenColumnName:eo="children"}=en,er=o.useMemo(()=>U.some(e=>null==e?void 0:e[eo])?"nest":N||(null==S?void 0:S.expandedRowRender)?"row":null,[U]),ea={body:o.useRef(null)},el=o.useRef(null),ec=o.useRef(null);tb(t,()=>Object.assign(Object.assign({},ec.current),{nativeElement:el.current}));let ei=o.useMemo(()=>"function"==typeof v?v:e=>null==e?void 0:e[v],[v]),[ed]=n3(U,eo,ei),es={},eu=function(e,t){var n,o,r,a;let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=Object.assign(Object.assign({},es),e);l&&(null===(n=es.resetPagination)||void 0===n||n.call(es),(null===(o=c.pagination)||void 0===o?void 0:o.current)&&(c.pagination.current=1),m&&(null===(r=m.onChange)||void 0===r||r.call(m,1,null===(a=c.pagination)||void 0===a?void 0:a.pageSize))),I&&!1!==I.scrollToFirstRowOnChange&&ea.body.current&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{getContainer:n=()=>window,callback:o,duration:r=450}=t,a=n(),l=tx(a),c=Date.now(),i=()=>{let t=Date.now()-c,n=function(e,t,n,o){let r=n-t;return(e/=o/2)<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t}(t>r?r:t,l,e,r);ty(a)?a.scrollTo(window.pageXOffset,n):a instanceof Document||"HTMLDocument"===a.constructor.name?a.documentElement.scrollTop=n:a.scrollTop=n,tea.body.current}),null==w||w(c.pagination,c.filters,c.sorter,{currentDataSource:n0(os(U,c.sorterStates,eo),c.filterStates,eo),action:t})},[ef,ep,em,eh]=ou({prefixCls:G,mergedColumns:B,onSorterChange:(e,t)=>{eu({sorter:e,sorterStates:t},"sort",!1)},sortDirections:R||["ascend","descend"],tableLocale:X,showSorterTooltip:M}),eg=o.useMemo(()=>os(U,ep,eo),[U,ep]);es.sorter=eh(),es.sorterStates=ep;let[eb,ey,ex]=n2({prefixCls:G,locale:X,dropdownPrefixCls:Y,mergedColumns:B,onFilterChange:(e,t)=>{eu({filters:e,filterStates:t},"filter",!0)},getPopupContainer:k||q,rootClassName:Z()(i,J)}),ew=n0(eg,ey,eo);es.filters=ex,es.filterStates=ey;let[eC]=op(o.useMemo(()=>{let e={};return Object.keys(ex).forEach(t=>{null!==ex[t]&&(e[t]=ex[t])}),Object.assign(Object.assign({},em),{filters:e})},[em,ex])),[eE,eS]=n8(ew.length,(e,t)=>{eu({pagination:Object.assign(Object.assign({},es.pagination),{current:e,pageSize:t})},"paginate")},m);es.pagination=!1===m?{}:function(e,t){let n={current:e.current,pageSize:e.pageSize};return Object.keys(t&&"object"==typeof t?t:{}).forEach(t=>{let o=e[t];"function"!=typeof o&&(n[t]=o)}),n}(eE,m),es.resetPagination=eS;let eZ=o.useMemo(()=>{if(!1===m||!eE.pageSize)return ew;let{current:e=1,total:t,pageSize:n=10}=eE;return ew.lengthn?ew.slice((e-1)*n,e*n):ew:ew.slice((e-1)*n,e*n)},[!!m,ew,null==eE?void 0:eE.current,null==eE?void 0:eE.pageSize,null==eE?void 0:eE.total]),[eN,eK]=tg({prefixCls:G,data:ew,pageData:eZ,getRowKey:ei,getRecordByKey:ed,expandType:er,childrenColumnName:eo,locale:X,getPopupContainer:k||q},h);en.__PARENT_RENDER_ICON__=en.expandIcon,en.expandIcon=en.expandIcon||E||(e=>{let{prefixCls:t,onExpand:n,record:r,expanded:a,expandable:l}=e,c="".concat(t,"-row-expand-icon");return o.createElement("button",{type:"button",onClick:e=>{n(r,e),e.stopPropagation()},className:Z()(c,{["".concat(c,"-spaced")]:!l,["".concat(c,"-expanded")]:l&&a,["".concat(c,"-collapsed")]:l&&!a}),"aria-label":a?X.collapse:X.expand,"aria-expanded":a})}),"nest"===er&&void 0===en.expandIconColumnIndex?en.expandIconColumnIndex=h?1:0:en.expandIconColumnIndex>0&&h&&(en.expandIconColumnIndex-=1),"number"!=typeof en.indentSize&&(en.indentSize="number"==typeof O?O:15);let eO=o.useCallback(e=>eC(eN(eb(ef(e)))),[ef,eb,eN]),eI=o.useMemo(()=>"boolean"==typeof C?{spinning:C}:"object"==typeof C&&null!==C?Object.assign({spinning:!0},C):void 0,[C]),eR=Z()(et,J,"".concat(G,"-wrapper"),null==W?void 0:W.className,{["".concat(G,"-wrapper-rtl")]:"rtl"===A},c,i,ee),eP=Object.assign(Object.assign({},null==W?void 0:W.style),d),eM=o.useMemo(()=>(null==eI?void 0:eI.spinning)&&U===oT?null:void 0!==(null==P?void 0:P.emptyText)?P.emptyText:(null==_?void 0:_("Table"))||o.createElement(tC.Z,{componentName:"Table"}),[null==eI?void 0:eI.spinning,U,null==P?void 0:P.emptyText,_]),eT={},eD=o.useMemo(()=>{let{fontSize:e,lineHeight:t,lineWidth:n,padding:o,paddingXS:r,paddingSM:a}=$,l=Math.floor(e*t);switch(V){case"middle":return 2*a+l+n;case"small":return 2*r+l+n;default:return 2*o+l+n}},[$,V]);T&&(eT.listItemHeight=eD);let{top:eL,bottom:ej}=(()=>{if(!1===m||!(null==eE?void 0:eE.total))return{};let e=()=>eE.size||("small"===V||"middle"===V?"small":void 0),t=t=>o.createElement(tK.Z,Object.assign({},eE,{align:eE.align||("left"===t?"start":"right"===t?"end":t),className:Z()("".concat(G,"-pagination"),eE.className),size:e()})),n="rtl"===A?"left":"right",r=eE.position;if(null===r||!Array.isArray(r))return{bottom:t(n)};let a=r.find(e=>"string"==typeof e&&e.toLowerCase().includes("top")),l=r.find(e=>"string"==typeof e&&e.toLowerCase().includes("bottom")),c=r.every(e=>"none"==="".concat(e)),i=a?a.toLowerCase().replace("top",""):"",d=l?l.toLowerCase().replace("bottom",""):"";return{top:i?t(i):void 0,bottom:d?t(d):a||l||c?void 0:t(n)}})();return Q(o.createElement("div",{ref:el,className:eR,style:eP},o.createElement(tO.Z,Object.assign({spinning:!1},eI),eL,o.createElement(T?oh:om,Object.assign({},eT,H,{ref:ec,columns:B,direction:A,expandable:en,prefixCls:G,className:Z()({["".concat(G,"-middle")]:"middle"===V,["".concat(G,"-small")]:"small"===V,["".concat(G,"-bordered")]:u,["".concat(G,"-empty")]:0===U.length},et,J,ee),data:eZ,rowKey:ei,rowClassName:(e,t,n)=>{let o;return o="function"==typeof g?Z()(g(e,t,n)):Z()(g),Z()({["".concat(G,"-row-selected")]:eK.has(ei(e,t))},o)},emptyText:eM,internalHooks:a,internalRefs:ea,transformColumns:eO,getContainerWidth:(e,t)=>{let n=e.querySelector(".".concat(G,"-container")),o=t;if(n){let e=getComputedStyle(n);o=t-Number.parseInt(e.borderLeftWidth,10)-Number.parseInt(e.borderRightWidth,10)}return o},measureRowRender:e=>o.createElement(tw.ZP,{getPopupContainer:e=>e},e)})),ej)))});let oL=o.forwardRef((e,t)=>{let n=o.useRef(0);return n.current+=1,o.createElement(oD,Object.assign({},e,{ref:t,_renderTimes:n.current}))});oL.SELECTION_COLUMN=tu,oL.EXPAND_COLUMN=r,oL.SELECTION_ALL=tf,oL.SELECTION_INVERT=tp,oL.SELECTION_NONE=tm,oL.Column=e=>null,oL.ColumnGroup=e=>null,oL.Summary=H;var oj=oL}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6640-500d8b4d4ec506a1.js b/litellm/proxy/_experimental/out/_next/static/chunks/6640-500d8b4d4ec506a1.js new file mode 100644 index 00000000000..b7f7324df32 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/6640-500d8b4d4ec506a1.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6640,1623],{34310:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1119),i=r(2265),s={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"},a=r(55015),o=i.forwardRef(function(e,t){return i.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:s}))})},3632:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1119),i=r(2265),s={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"},a=r(55015),o=i.forwardRef(function(e,t){return i.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:s}))})},35291:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1119),i=r(2265),s={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"},a=r(55015),o=i.forwardRef(function(e,t){return i.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:s}))})},59341:function(e,t,r){"use strict";r.d(t,{Z:function(){return T}});var n=r(5853),i=r(71049),s=r(11323),a=r(2265),o=r(66797),u=r(40099),l=r(74275),c=r(59456),h=r(93980),d=r(65573),f=r(67561),p=r(87550),m=r(628),g=r(80281),y=r(31370),b=r(20131),v=r(38929),_=r(52307),k=r(52724),w=r(7935);let C=(0,a.createContext)(null);C.displayName="GroupContext";let E=a.Fragment,O=Object.assign((0,v.yV)(function(e,t){var r;let n=(0,a.useId)(),E=(0,g.Q)(),O=(0,p.B)(),{id:x=E||"headlessui-switch-".concat(n),disabled:S=O||!1,checked:R,defaultChecked:P,onChange:q,name:D,value:T,form:F,autoFocus:j=!1,...A}=e,M=(0,a.useContext)(C),[I,N]=(0,a.useState)(null),L=(0,a.useRef)(null),Q=(0,f.T)(L,t,null===M?null:M.setSwitch,N),z=(0,l.L)(P),[V,K]=(0,u.q)(R,q,null!=z&&z),B=(0,c.G)(),[H,Z]=(0,a.useState)(!1),U=(0,h.z)(()=>{Z(!0),null==K||K(!V),B.nextFrame(()=>{Z(!1)})}),G=(0,h.z)(e=>{if((0,y.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),U()}),W=(0,h.z)(e=>{e.key===k.R.Space?(e.preventDefault(),U()):e.key===k.R.Enter&&(0,b.g)(e.currentTarget)}),J=(0,h.z)(e=>e.preventDefault()),X=(0,w.wp)(),$=(0,_.zH)(),{isFocusVisible:Y,focusProps:ee}=(0,i.F)({autoFocus:j}),{isHovered:et,hoverProps:er}=(0,s.X)({isDisabled:S}),{pressed:en,pressProps:ei}=(0,o.x)({disabled:S}),es=(0,a.useMemo)(()=>({checked:V,disabled:S,hover:et,focus:Y,active:en,autofocus:j,changing:H}),[V,et,Y,en,S,H,j]),ea=(0,v.dG)({id:x,ref:Q,role:"switch",type:(0,d.f)(e,I),tabIndex:-1===e.tabIndex?0:null!=(r=e.tabIndex)?r:0,"aria-checked":V,"aria-labelledby":X,"aria-describedby":$,disabled:S||void 0,autoFocus:j,onClick:G,onKeyUp:W,onKeyPress:J},ee,er,ei),eo=(0,a.useCallback)(()=>{if(void 0!==z)return null==K?void 0:K(z)},[K,z]),eu=(0,v.L6)();return a.createElement(a.Fragment,null,null!=D&&a.createElement(m.Mt,{disabled:S,data:{[D]:T||"on"},overrides:{type:"checkbox",checked:V},form:F,onReset:eo}),eu({ourProps:ea,theirProps:A,slot:es,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var t;let[r,n]=(0,a.useState)(null),[i,s]=(0,w.bE)(),[o,u]=(0,_.fw)(),l=(0,a.useMemo)(()=>({switch:r,setSwitch:n}),[r,n]),c=(0,v.L6)();return a.createElement(u,{name:"Switch.Description",value:o},a.createElement(s,{name:"Switch.Label",value:i,props:{htmlFor:null==(t=l.switch)?void 0:t.id,onClick(e){r&&(e.currentTarget instanceof HTMLLabelElement&&e.preventDefault(),r.click(),r.focus({preventScroll:!0}))}}},a.createElement(C.Provider,{value:l},c({ourProps:{},theirProps:e,slot:{},defaultTag:E,name:"Switch.Group"}))))},Label:w.__,Description:_.dk});var x=r(44140),S=r(26898),R=r(13241),P=r(1153),q=r(47187);let D=(0,P.fn)("Switch"),T=a.forwardRef((e,t)=>{let{checked:r,defaultChecked:i=!1,onChange:s,color:o,name:u,error:l,errorMessage:c,disabled:h,required:d,tooltip:f,id:p}=e,m=(0,n._T)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),g={bgColor:o?(0,P.bM)(o,S.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:o?(0,P.bM)(o,S.K.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[y,b]=(0,x.Z)(i,r),[v,_]=(0,a.useState)(!1),{tooltipProps:k,getReferenceProps:w}=(0,q.l)(300);return a.createElement("div",{className:"flex flex-row items-center justify-start"},a.createElement(q.Z,Object.assign({text:f},k)),a.createElement("div",Object.assign({ref:(0,P.lq)([t,k.refs.setReference]),className:(0,R.q)(D("root"),"flex flex-row relative h-5")},m,w),a.createElement("input",{type:"checkbox",className:(0,R.q)(D("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:u,required:d,checked:y,onChange:e=>{e.preventDefault()}}),a.createElement(O,{checked:y,onChange:e=>{b(e),null==s||s(e)},disabled:h,className:(0,R.q)(D("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",h?"cursor-not-allowed":""),onFocus:()=>_(!0),onBlur:()=>_(!1),id:p},a.createElement("span",{className:(0,R.q)(D("sr-only"),"sr-only")},"Switch ",y?"on":"off"),a.createElement("span",{"aria-hidden":"true",className:(0,R.q)(D("background"),y?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")}),a.createElement("span",{"aria-hidden":"true",className:(0,R.q)(D("round"),y?(0,R.q)(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",v?(0,R.q)("ring-2",g.ringColor):"")}))),l&&c?a.createElement("p",{className:(0,R.q)(D("errorMessage"),"text-sm text-red-500 mt-1 ")},c):null)});T.displayName="Switch"},35829:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(5853),i=r(26898),s=r(13241),a=r(1153),o=r(2265);let u=o.forwardRef((e,t)=>{let{color:r,children:u,className:l}=e,c=(0,n._T)(e,["color","children","className"]);return o.createElement("p",Object.assign({ref:t,className:(0,s.q)("font-semibold text-tremor-metric",r?(0,a.bM)(r,i.K.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",l)},c),u)});u.displayName="Metric"},30401:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},15452:function(e,t){var r,n,i;n=[],void 0!==(i="function"==typeof(r=function e(){var t,r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r?r:{},n=!r.document&&!!r.postMessage,i=r.IS_PAPA_WORKER||!1,s={},a=0,o={};function u(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 f(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,i)r.postMessage({results:s,workerId:o.WORKER_ID,finished:n});else if(k(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||!n||!k(this._config.complete)||s&&s.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),n||s&&s.meta.paused||this._nextChunk(),s}this._halted=!0},this._sendError=function(e){k(this._config.error)?this._config.error(e):i&&this._config.error&&r.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function l(e){var t;(e=e||{}).chunkSize||(e.chunkSize=o.RemoteChunkSize),u.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=_(this._chunkLoaded,this),t.onerror=_(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e,r,i=this._config.downloadRequestHeaders;for(r in i)t.setRequestHeader(r,i[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 c(e){(e=e||{}).chunkSize||(e.chunkSize=o.LocalChunkSize),u.call(this,e);var t,r,n="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,r=e.slice||e.webkitSlice||e.mozSlice,n?((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 h(e){var t;u.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 d(e){u.call(this,e=e||{});var t=[],r=!0,n=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.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=_(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(),n=!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,n,i,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)))$/,u=this,l=0,c=0,h=!1,d=!1,f=[],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&&(w("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)})),_()){if(g){if(Array.isArray(g.data[0])){for(var t,r=0;_()&&r=f.length?"__parsed_extra":f[i]:o,l=u=e.transform?e.transform(u,o):u,(e.dynamicTypingFunction&&void 0===e.dynamicTyping[r]&&(e.dynamicTyping[r]=e.dynamicTypingFunction(r)),!0===(e.dynamicTyping[r]||e.dynamicTyping))?"true"===l||"TRUE"===l||"false"!==l&&"FALSE"!==l&&((e=>{if(s.test(e)&&-9007199254740992<(e=parseFloat(e))&&e<9007199254740992)return 1})(l)?parseFloat(l):a.test(l)?new Date(l):""===l?null:l):l);"__parsed_extra"===o?(n[o]=n[o]||[],n[o].push(u)):n[o]=u}return e.header&&(i>f.length?w("FieldMismatch","TooManyFields","Too many fields: expected "+f.length+" fields but parsed "+i,c+r):ie.preview?r.abort():(g.data=g.data[0],i(g,u))))}),this.parse=function(i,s,a){var u=e.quoteChar||'"',u=(e.newline||(e.newline=this.guessLineEndings(i,u)),n=!1,e.delimiter?k(e.delimiter)&&(e.delimiter=e.delimiter(i),g.meta.delimiter=e.delimiter):((u=((t,r,n,i,s)=>{var a,u,l,c;s=s||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var h=0;h=r.length/2?"\r\n":"\r"}}function p(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){var t=(e=e||{}).delimiter,r=e.newline,n=e.comments,i=e.step,s=e.preview,a=e.fastMode,u=null,l=!1,c=null==e.quoteChar?'"':e.quoteChar,h=c;if(void 0!==e.escapeChar&&(h=e.escapeChar),("string"!=typeof t||-1=s)return N(!0);break}E.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:C.length,index:d}),T++}}else if(n&&0===O.length&&o.substring(d,d+_)===n){if(-1===q)return N();d=q+v,q=o.indexOf(r,d),P=o.indexOf(t,d)}else if(-1!==P&&(P=s)return N(!0)}return M();function j(e){C.push(e),x=d}function A(e){return -1!==e&&(e=o.substring(T+1,e))&&""===e.trim()?e.length:0}function M(e){return g||(void 0===e&&(e=o.substring(d)),O.push(e),d=y,j(O),w&&L()),N()}function I(e){d=e,j(O),O=[],q=o.indexOf(r,d)}function N(n){if(e.header&&!m&&C.length&&!l){var i=C[0],s=Object.create(null),a=new Set(i);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||(i=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||(l=t.skipEmptyLines),"string"==typeof t.newline&&(s=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");c=t.columns}void 0!==t.escapeChar&&(u=t.escapeChar+a),t.escapeFormulae instanceof RegExp?h=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(h=/^[=+\-@\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,l);if("object"==typeof e[0])return f(c||Object.keys(e[0]),e,l)}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||[],l);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=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,a),n=i.default.Children.only(t);return i.default.cloneElement(n,l(l({},r),{},{onClick:this.onClick}))}}],function(e,t){for(var r=0;r"boolean"==typeof e||e instanceof Boolean,s=e=>"number"==typeof e||e instanceof Number,a=e=>"bigint"==typeof e||e instanceof BigInt,o=e=>!!e&&e instanceof Date,u=e=>"string"==typeof e||e instanceof String,l=e=>Array.isArray(e),c=e=>"object"==typeof e&&null!==e,h=e=>!!e&&e instanceof Object&&"function"==typeof e;function d(e,t){return void 0===t&&(t=!1),!e||t?`"${e}"`:e}function f(e){let{field:t,value:r,data:i,lastElement:s,openBracket:a,closeBracket:o,level:u,style:l,shouldExpandNode:c,clickToExpandNode:h,outerRef:f,beforeExpandChange:p}=e,m=(0,n.useRef)(!1),[g,b]=(0,n.useState)(()=>c(u,r,t)),v=(0,n.useRef)(null);(0,n.useEffect)(()=>{m.current?b(c(u,r,t)):m.current=!0},[c]);let _=(0,n.useId)();if(0===i.length)return function(e){let{field:t,openBracket:r,closeBracket:i,lastElement:s,style:a}=e;return(0,n.createElement)("div",{className:a.basicChildStyle,role:"treeitem","aria-selected":void 0},(t||""===t)&&(0,n.createElement)("span",{className:a.label},d(t,a.quotesForFieldNames),":"),(0,n.createElement)("span",{className:a.punctuation},r),(0,n.createElement)("span",{className:a.punctuation},i),!s&&(0,n.createElement)("span",{className:a.punctuation},","))}({field:t,openBracket:a,closeBracket:o,lastElement:s,style:l});let k=g?l.collapseIcon:l.expandIcon,w=g?l.ariaLables.collapseJson:l.ariaLables.expandJson,C=u+1,E=i.length-1,O=e=>{g!==e&&(!p||p({level:u,value:r,field:t,newExpandValue:e}))&&b(e)},x=e=>{if("ArrowRight"===e.key||"ArrowLeft"===e.key)e.preventDefault(),O("ArrowRight"===e.key);else if("ArrowUp"===e.key||"ArrowDown"===e.key){e.preventDefault();let t="ArrowUp"===e.key?-1:1;if(!f.current)return;let r=f.current.querySelectorAll("[role=button]"),n=-1;for(let e=0;e{var e;O(!g);let t=v.current;if(!t)return;let r=null===(e=f.current)||void 0===e?void 0:e.querySelector('[role=button][tabindex="0"]');r&&(r.tabIndex=-1),t.tabIndex=0,t.focus()};return(0,n.createElement)("div",{className:l.basicChildStyle,role:"treeitem","aria-expanded":g,"aria-selected":void 0},(0,n.createElement)("span",{className:k,onClick:S,onKeyDown:x,role:"button","aria-label":w,"aria-expanded":g,"aria-controls":g?_:void 0,ref:v,tabIndex:0===u?0:-1}),(t||""===t)&&(h?(0,n.createElement)("span",{className:l.clickableLabel,onClick:S,onKeyDown:x},d(t,l.quotesForFieldNames),":"):(0,n.createElement)("span",{className:l.label},d(t,l.quotesForFieldNames),":")),(0,n.createElement)("span",{className:l.punctuation},a),g?(0,n.createElement)("ul",{id:_,role:"group",className:l.childFieldsContainer},i.map((e,t)=>(0,n.createElement)(y,{key:e[0]||t,field:e[0],value:e[1],style:l,lastElement:t===E,level:C,shouldExpandNode:c,clickToExpandNode:h,beforeExpandChange:p,outerRef:f}))):(0,n.createElement)("span",{className:l.collapsedContent,onClick:S,onKeyDown:x}),(0,n.createElement)("span",{className:l.punctuation},o),!s&&(0,n.createElement)("span",{className:l.punctuation},","))}function p(e){let{field:t,value:r,style:n,lastElement:i,shouldExpandNode:s,clickToExpandNode:a,level:o,outerRef:u,beforeExpandChange:l}=e;return f({field:t,value:r,lastElement:i||!1,level:o,openBracket:"{",closeBracket:"}",style:n,shouldExpandNode:s,clickToExpandNode:a,data:Object.keys(r).map(e=>[e,r[e]]),outerRef:u,beforeExpandChange:l})}function m(e){let{field:t,value:r,style:n,lastElement:i,level:s,shouldExpandNode:a,clickToExpandNode:o,outerRef:u,beforeExpandChange:l}=e;return f({field:t,value:r,lastElement:i||!1,level:s,openBracket:"[",closeBracket:"]",style:n,shouldExpandNode:a,clickToExpandNode:o,data:r.map(e=>[void 0,e]),outerRef:u,beforeExpandChange:l})}function g(e){let t,{field:r,value:l,style:c,lastElement:f}=e,p=c.otherValue;if(null===l)t="null",p=c.nullValue;else if(void 0===l)t="undefined",p=c.undefinedValue;else if(u(l)){var m;m=!c.noQuotesForStringValues,t=c.stringifyStringValues?JSON.stringify(l):m?`"${l}"`:l,p=c.stringValue}else i(l)?(t=l?"true":"false",p=c.booleanValue):s(l)?(t=l.toString(),p=c.numberValue):a(l)?(t=`${l.toString()}n`,p=c.numberValue):t=o(l)?l.toISOString():h(l)?"function() { }":l.toString();return(0,n.createElement)("div",{className:c.basicChildStyle,role:"treeitem","aria-selected":void 0},(r||""===r)&&(0,n.createElement)("span",{className:c.label},d(r,c.quotesForFieldNames),":"),(0,n.createElement)("span",{className:p},t),!f&&(0,n.createElement)("span",{className:c.punctuation},","))}function y(e){let t=e.value;return l(t)?(0,n.createElement)(m,Object.assign({},e)):!c(t)||o(t)||h(t)?(0,n.createElement)(g,Object.assign({},e)):(0,n.createElement)(p,Object.assign({},e))}let b={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},v=()=>!0,_=e=>{let{data:t,style:r=b,shouldExpandNode:i=v,clickToExpandNode:s=!1,beforeExpandChange:a,compactTopLevel:o,...u}=e,l=(0,n.useRef)(null);return(0,n.createElement)("div",Object.assign({"aria-label":"JSON view"},u,{className:r.container,ref:l,role:"tree"}),o&&c(t)?Object.entries(t).map(e=>{let[t,o]=e;return(0,n.createElement)(y,{key:t,field:t,value:o,style:{...b,...r},lastElement:!0,level:1,shouldExpandNode:i,clickToExpandNode:s,beforeExpandChange:a,outerRef:l})}):(0,n.createElement)(y,{value:t,style:{...b,...r},lastElement:!0,level:0,shouldExpandNode:i,clickToExpandNode:s,outerRef:l,beforeExpandChange:a}))}},52621:function(){},44643:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=i},88532:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=i},2356:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=i},71157:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=i},2894:function(e,t,r){"use strict";r.d(t,{R:function(){return o},m:function(){return a}});var n=r(18238),i=r(7989),s=r(11255),a=class extends i.F{#e;#t;#r;#n;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||o(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,s.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});let n="pending"===this.state.status,i=!this.#n.canStart();try{if(n)t();else{this.#i({type:"pending",variables:e,isPaused:i}),await this.#r.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:i})}let s=await this.#n.start();return await this.#r.config.onSuccess?.(s,e,this.state.context,this,r),await this.options.onSuccess?.(s,e,this.state.context,r),await this.#r.config.onSettled?.(s,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(s,null,e,this.state.context,r),this.#i({type:"success",data:s}),s}catch(t){try{throw await this.#r.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#r.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#i({type:"error",error:t})}}finally{this.#r.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.Vr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21623:function(e,t,r){"use strict";r.d(t,{S:function(){return m}});var n=r(45345),i=r(21733),s=r(18238),a=r(24112),o=class extends a.l{constructor(e={}){super(),this.config=e,this.#s=new Map}#s;build(e,t,r){let s=t.queryKey,a=t.queryHash??(0,n.Rm)(s,t),o=this.get(a);return o||(o=new i.A({client:e,queryKey:s,queryHash:a,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){this.#s.has(e.queryHash)||(this.#s.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#s.get(e.queryHash);t&&(e.destroy(),t===e&&this.#s.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){s.Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#s.get(e)}getAll(){return[...this.#s.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n._x)(e,t)):t}notify(e){s.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){s.Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){s.Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},u=r(2894),l=class extends a.l{constructor(e={}){super(),this.config=e,this.#a=new Set,this.#o=new Map,this.#u=0}#a;#o;#u;build(e,t,r){let n=new u.m({client:e,mutationCache:this,mutationId:++this.#u,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#a.add(e);let t=c(e);if("string"==typeof t){let r=this.#o.get(t);r?r.push(e):this.#o.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#a.delete(e)){let t=c(e);if("string"==typeof t){let r=this.#o.get(t);if(r){if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#o.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=c(e);if("string"!=typeof t)return!0;{let r=this.#o.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=c(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#o.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){s.Vr.batch(()=>{this.#a.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#a.clear(),this.#o.clear()})}getAll(){return Array.from(this.#a)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.X7)(e,t))}notify(e){s.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return s.Vr.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.ZT))))}};function c(e){return e.options.scope?.id}var h=r(87045),d=r(57853);function f(e){return{onFetch:(t,r)=>{let i=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],u={pages:[],pageParams:[]},l=0,c=async()=>{let r=!1,c=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)})},h=(0,n.cG)(t.options,t.fetchOptions),d=async(e,i,s)=>{if(r)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:i,direction:s?"backward":"forward",meta:t.options.meta};return c(e),e})(),o=await h(a),{maxPages:u}=t.options,l=s?n.Ht:n.VX;return{pages:l(e.pages,o,u),pageParams:l(e.pageParams,i,u)}};if(s&&a.length){let e="backward"===s,t={pages:a,pageParams:o},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:p)(i,t);u=await d(t,r,e)}else{let t=e??a.length;do{let e=0===l?o[0]??i.initialPageParam:p(i,u);if(l>0&&null==e)break;u=await d(u,e),l++}while(lt.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=c}}}function p(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var m=class{#l;#r;#c;#h;#d;#f;#p;#m;constructor(e={}){this.#l=e.queryCache||new o,this.#r=e.mutationCache||new l,this.#c=e.defaultOptions||{},this.#h=new Map,this.#d=new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#p=h.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#l.onFocus())}),this.#m=d.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#l.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#p?.(),this.#p=void 0,this.#m?.(),this.#m=void 0)}isFetching(e){return this.#l.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#r.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#l.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#l.build(this,t),i=r.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,n.KC)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#l.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let i=this.defaultQueryOptions({queryKey:e}),s=this.#l.get(i.queryHash),a=s?.state.data,o=(0,n.SE)(t,a);if(void 0!==o)return this.#l.build(this,i).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return s.Vr.batch(()=>this.#l.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#l.get(t.queryHash)?.state}removeQueries(e){let t=this.#l;s.Vr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#l;return s.Vr.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(s.Vr.batch(()=>this.#l.findAll(e).map(e=>e.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e,t={}){return s.Vr.batch(()=>(this.#l.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(s.Vr.batch(()=>this.#l.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(n.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#l.build(this,t);return r.isStaleByTime((0,n.KC)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.ZT).catch(n.ZT)}fetchInfiniteQuery(e){return e.behavior=f(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(e){return e.behavior=f(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return d.N.isOnline()?this.#r.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#l}getMutationCache(){return this.#r}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#h.set((0,n.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#h.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#d.set((0,n.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#d.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#l.clear(),this.#r.clear()}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6653-f346a32ad9e689af.js b/litellm/proxy/_experimental/out/_next/static/chunks/6653-f346a32ad9e689af.js new file mode 100644 index 00000000000..d26487ba996 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/6653-f346a32ad9e689af.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6653],{88913:function(e,s,l){l.d(s,{Dx:function(){return d.Z},Zb:function(){return a.Z},iz:function(){return r.Z},oi:function(){return n.Z},xv:function(){return i.Z},zx:function(){return t.Z}});var t=l(78489),a=l(12514),r=l(67982),i=l(84264),n=l(49566),d=l(96761)},58643:function(e,s,l){l.d(s,{OK:function(){return t.Z},nP:function(){return n.Z},td:function(){return r.Z},v0:function(){return a.Z},x4:function(){return i.Z}});var t=l(12485),a=l(18135),r=l(35242),i=l(29706),n=l(77991)},86653:function(e,s,l){l.d(s,{Z:function(){return eS}});var t=l(57437),a=l(58643),r=l(2265),i=l(16312),n=l(57840),d=l(42264),o=l(22116),c=l(4156),u=l(56609),m=l(23496),x=l(5945),h=l(58760),g=l(37592),v=l(19015),j=l(19250),p=l(10032),f=l(99981),y=l(24199),b=l(57365),_=l(49566),N=l(16853),S=l(46468),w=l(20347),Z=l(15424),k=l(65925);function C(e){let{userData:s,onCancel:l,onSubmit:a,teams:n,accessToken:d,userID:o,userRole:c,userModels:u,possibleUIRoles:m,isBulkEdit:x=!1}=e,[h]=p.Z.useForm();return r.useEffect(()=>{var e,l,t,a,r,i,n;h.setFieldsValue({user_id:s.user_id,user_email:null===(e=s.user_info)||void 0===e?void 0:e.user_email,user_alias:null===(l=s.user_info)||void 0===l?void 0:l.user_alias,user_role:null===(t=s.user_info)||void 0===t?void 0:t.user_role,models:(null===(a=s.user_info)||void 0===a?void 0:a.models)||[],max_budget:null===(r=s.user_info)||void 0===r?void 0:r.max_budget,budget_duration:null===(i=s.user_info)||void 0===i?void 0:i.budget_duration,metadata:(null===(n=s.user_info)||void 0===n?void 0:n.metadata)?JSON.stringify(s.user_info.metadata,null,2):void 0})},[s,h]),(0,t.jsxs)(p.Z,{form:h,onFinish:e=>{if(e.metadata&&"string"==typeof e.metadata)try{e.metadata=JSON.parse(e.metadata)}catch(e){console.error("Error parsing metadata JSON:",e);return}a(e)},layout:"vertical",children:[!x&&(0,t.jsx)(p.Z.Item,{label:"User ID",name:"user_id",children:(0,t.jsx)(_.Z,{disabled:!0})}),!x&&(0,t.jsx)(p.Z.Item,{label:"Email",name:"user_email",children:(0,t.jsx)(_.Z,{})}),(0,t.jsx)(p.Z.Item,{label:"User Alias",name:"user_alias",children:(0,t.jsx)(_.Z,{})}),(0,t.jsx)(p.Z.Item,{label:(0,t.jsxs)("span",{children:["Global Proxy Role"," ",(0,t.jsx)(f.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,t.jsx)(Z.Z,{})})]}),name:"user_role",children:(0,t.jsx)(g.default,{children:m&&Object.entries(m).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(b.Z,{value:s,title:l,children:(0,t.jsxs)("div",{className:"flex",children:[l," ",(0,t.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:a})]})},s)})})}),(0,t.jsx)(p.Z.Item,{label:(0,t.jsxs)("span",{children:["Personal Models"," ",(0,t.jsx)(f.Z,{title:"Select which models this user can access outside of team-scope. Choose 'All Proxy Models' to grant access to all models available on the proxy.",children:(0,t.jsx)(Z.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,t.jsxs)(g.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:!w.ZL.includes(c||""),children:[(0,t.jsx)(g.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),(0,t.jsx)(g.default.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"),u.map(e=>(0,t.jsx)(g.default.Option,{value:e,children:(0,S.W0)(e)},e))]})}),(0,t.jsx)(p.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(y.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(p.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsx)(k.Z,{})}),(0,t.jsx)(p.Z.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(N.Z,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,t.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,t.jsx)(i.z,{variant:"secondary",type:"button",onClick:l,children:"Cancel"}),(0,t.jsx)(i.z,{type:"submit",children:"Save Changes"})]})]})}var U=l(9114);let{Text:I,Title:D}=n.default;var z=e=>{let{visible:s,onCancel:l,selectedUsers:a,possibleUIRoles:i,accessToken:n,onSuccess:p,teams:f,userRole:y,userModels:b,allowAllUsers:_=!1}=e,[N,S]=(0,r.useState)(!1),[w,Z]=(0,r.useState)([]),[k,z]=(0,r.useState)(null),[A,B]=(0,r.useState)(!1),[L,E]=(0,r.useState)(!1),T=()=>{Z([]),z(null),B(!1),E(!1),l()},O=r.useMemo(()=>({user_id:"bulk_edit",user_info:{user_email:"",user_role:"",teams:[],models:[],max_budget:null,spend:0,metadata:{},created_at:null,updated_at:null},keys:[],teams:f||[]}),[f,s]),F=async e=>{if(console.log("formValues",e),!n){U.Z.fromBackend("Access token not found");return}S(!0);try{let s=a.map(e=>e.user_id),t={};e.user_role&&""!==e.user_role&&(t.user_role=e.user_role),null!==e.max_budget&&void 0!==e.max_budget&&(t.max_budget=e.max_budget),e.models&&e.models.length>0&&(t.models=e.models),e.budget_duration&&""!==e.budget_duration&&(t.budget_duration=e.budget_duration),e.metadata&&Object.keys(e.metadata).length>0&&(t.metadata=e.metadata);let r=Object.keys(t).length>0,i=A&&w.length>0;if(!r&&!i){U.Z.fromBackend("Please modify at least one field or select teams to add users to");return}let o=[];if(r){if(L){let e=await (0,j.userBulkUpdateUserCall)(n,t,void 0,!0);o.push("Updated all users (".concat(e.total_requested," total)"))}else await (0,j.userBulkUpdateUserCall)(n,t,s),o.push("Updated ".concat(s.length," user(s)"))}if(i){let e=[];for(let s of w)try{let l=null;L?l=null:a.map(e=>({user_id:e.user_id,role:"user",user_email:e.user_email||null}));let t=await (0,j.teamBulkMemberAddCall)(n,s,l||null,k||void 0,L);console.log("result",t),e.push({teamId:s,success:!0,successfulAdditions:t.successful_additions,failedAdditions:t.failed_additions})}catch(l){console.error("Failed to add users to team ".concat(s,":"),l),e.push({teamId:s,success:!1,error:l})}let s=e.filter(e=>e.success),l=e.filter(e=>!e.success);if(s.length>0){let e=s.reduce((e,s)=>e+s.successfulAdditions,0);o.push("Added users to ".concat(s.length," team(s) (").concat(e," total additions)"))}l.length>0&&d.ZP.warning("Failed to add users to ".concat(l.length," team(s)"))}o.length>0&&U.Z.success(o.join(". ")),Z([]),z(null),B(!1),E(!1),p(),l()}catch(e){console.error("Bulk operation failed:",e),U.Z.fromBackend("Failed to perform bulk operations")}finally{S(!1)}};return(0,t.jsxs)(o.Z,{visible:s,onCancel:T,footer:null,title:L?"Bulk Edit All Users":"Bulk Edit ".concat(a.length," User(s)"),width:800,children:[_&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(c.Z,{checked:L,onChange:e=>E(e.target.checked),children:(0,t.jsx)(I,{strong:!0,children:"Update ALL users in the system"})}),L&&(0,t.jsx)("div",{style:{marginTop:8},children:(0,t.jsx)(I,{type:"warning",style:{fontSize:"12px"},children:"⚠️ This will apply changes to ALL users in the system, not just the selected ones."})})]}),!L&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)(D,{level:5,children:["Selected Users (",a.length,"):"]}),(0,t.jsx)(u.Z,{size:"small",bordered:!0,dataSource:a,pagination:!1,scroll:{y:200},rowKey:"user_id",columns:[{title:"User ID",dataIndex:"user_id",key:"user_id",width:"30%",render:e=>(0,t.jsx)(I,{strong:!0,style:{fontSize:"12px"},children:e.length>20?"".concat(e.slice(0,20),"..."):e})},{title:"Email",dataIndex:"user_email",key:"user_email",width:"25%",render:e=>(0,t.jsx)(I,{type:"secondary",style:{fontSize:"12px"},children:e||"No email"})},{title:"Current Role",dataIndex:"user_role",key:"user_role",width:"25%",render:e=>{var s;return(0,t.jsx)(I,{style:{fontSize:"12px"},children:(null==i?void 0:null===(s=i[e])||void 0===s?void 0:s.ui_label)||e})}},{title:"Budget",dataIndex:"max_budget",key:"max_budget",width:"20%",render:e=>(0,t.jsx)(I,{style:{fontSize:"12px"},children:null!==e?"$".concat(e):"Unlimited"})}]})]}),(0,t.jsx)(m.Z,{}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsxs)(I,{children:[(0,t.jsx)("strong",{children:"Instructions:"})," Fill in the fields below with the values you want to apply to all selected users. You can bulk edit: role, budget, models, and metadata. You can also add users to teams."]})}),(0,t.jsx)(x.Z,{title:"Team Management",size:"small",className:"mb-4",style:{backgroundColor:"#fafafa"},children:(0,t.jsxs)(h.Z,{direction:"vertical",style:{width:"100%"},children:[(0,t.jsx)(c.Z,{checked:A,onChange:e=>B(e.target.checked),children:"Add selected users to teams"}),A&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(I,{strong:!0,children:"Select Teams:"}),(0,t.jsx)(g.default,{mode:"multiple",placeholder:"Select teams to add users to",value:w,onChange:Z,style:{width:"100%",marginTop:8},options:(null==f?void 0:f.map(e=>({label:e.team_alias||e.team_id,value:e.team_id})))||[]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(I,{strong:!0,children:"Team Budget (Optional):"}),(0,t.jsx)(v.Z,{placeholder:"Max budget per user in team",value:k,onChange:e=>z(e),style:{width:"100%",marginTop:8},min:0,step:.01,precision:2}),(0,t.jsx)(I,{type:"secondary",style:{fontSize:"12px"},children:"Leave empty for unlimited budget within team limits"})]}),(0,t.jsx)(I,{type:"secondary",style:{fontSize:"12px"},children:'Users will be added with "user" role by default. All users will be added to each selected team.'})]})]})}),(0,t.jsx)(C,{userData:O,onCancel:T,onSubmit:F,teams:f,accessToken:n,userID:"bulk_edit",userRole:y,userModels:b,possibleUIRoles:i,isBulkEdit:!0}),N&&(0,t.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,t.jsxs)(I,{children:["Updating ",L?"all users":a.length," user(s)..."]})})]})},A=l(7765),B=l(5545),L=e=>{let{visible:s,possibleUIRoles:l,onCancel:a,user:i,onSubmit:n}=e,[d,c]=(0,r.useState)(i),[u]=p.Z.useForm();(0,r.useEffect)(()=>{u.resetFields()},[i]);let m=async()=>{u.resetFields(),a()},x=async e=>{n(e),u.resetFields(),a()};return i?(0,t.jsx)(o.Z,{visible:s,onCancel:m,footer:null,title:"Edit User "+i.user_id,width:1e3,children:(0,t.jsx)(p.Z,{form:u,onFinish:x,initialValues:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z.Item,{className:"mt-8",label:"User Email",tooltip:"Email of the User",name:"user_email",children:(0,t.jsx)(_.Z,{})}),(0,t.jsx)(p.Z.Item,{label:"user_id",name:"user_id",hidden:!0,children:(0,t.jsx)(_.Z,{})}),(0,t.jsx)(p.Z.Item,{label:"User Role",name:"user_role",children:(0,t.jsx)(g.default,{children:l&&Object.entries(l).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(b.Z,{value:s,title:l,children:(0,t.jsxs)("div",{className:"flex",children:[l," ",(0,t.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:a})]})},s)})})}),(0,t.jsx)(p.Z.Item,{label:"Spend (USD)",name:"spend",tooltip:"(float) - Spend of all LLM calls completed by this user",help:"Across all keys (including keys with team_id).",children:(0,t.jsx)(v.Z,{min:0,step:.01})}),(0,t.jsx)(p.Z.Item,{label:"User Budget (USD)",name:"max_budget",tooltip:"(float) - Maximum budget of this user",help:"Maximum budget of this user.",children:(0,t.jsx)(y.Z,{min:0,step:.01})}),(0,t.jsx)(p.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsx)(k.Z,{})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(B.ZP,{htmlType:"submit",children:"Save"})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(B.ZP,{htmlType:"submit",children:"Save"})})]})})}):null},E=l(98187),T=l(59872),O=l(19616),F=l(29827),M=l(11713),R=l(21609),P=l(88913),K=l(63709),V=l(10353),q=l(26349),G=l(96473),J=e=>{var s;let{accessToken:l,possibleUIRoles:a,userID:i,userRole:d}=e,[o,c]=(0,r.useState)(!0),[u,m]=(0,r.useState)(null),[x,h]=(0,r.useState)(!1),[p,f]=(0,r.useState)({}),[y,b]=(0,r.useState)(!1),[_,N]=(0,r.useState)([]),{Paragraph:w}=n.default,{Option:Z}=g.default;(0,r.useEffect)(()=>{(async()=>{if(!l){c(!1);return}try{let e=await (0,j.getInternalUserSettings)(l);if(m(e),f(e.values||{}),l)try{let e=await (0,j.modelAvailableCall)(l,i,d);if(e&&e.data){let s=e.data.map(e=>e.id);N(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching SSO settings:",e),U.Z.fromBackend("Failed to fetch SSO settings")}finally{c(!1)}})()},[l]);let C=async()=>{if(l){b(!0);try{let e=Object.entries(p).reduce((e,s)=>{let[l,t]=s;return e[l]=""===t?null:t,e},{}),s=await (0,j.updateInternalUserSettings)(l,e);m({...u,values:s.settings}),h(!1)}catch(e){console.error("Error updating SSO settings:",e),U.Z.fromBackend("Failed to update settings: "+e)}finally{b(!1)}}},I=(e,s)=>{f(l=>({...l,[e]:s}))},D=e=>e&&Array.isArray(e)?e.map(e=>"string"==typeof e?{team_id:e,user_role:"user"}:"object"==typeof e&&e.team_id?{team_id:e.team_id,max_budget_in_team:e.max_budget_in_team,user_role:e.user_role||"user"}:{team_id:"",user_role:"user"}):[],z=e=>{let s=D(e),l=(e,l,t)=>{let a=[...s];a[e]={...a[e],[l]:t},I("teams",a)},a=e=>{I("teams",s.filter((s,l)=>l!==e))};return(0,t.jsxs)("div",{className:"space-y-3",children:[s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg p-4 bg-gray-50",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsxs)(P.xv,{className:"font-medium",children:["Team ",s+1]}),(0,t.jsx)(P.zx,{size:"sm",variant:"secondary",icon:q.Z,onClick:()=>a(s),className:"text-red-500 hover:text-red-700",children:"Remove"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(P.xv,{className:"text-sm font-medium mb-1",children:"Team ID"}),(0,t.jsx)(P.oi,{value:e.team_id,onChange:e=>l(s,"team_id",e.target.value),placeholder:"Enter team ID"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(P.xv,{className:"text-sm font-medium mb-1",children:"Max Budget in Team"}),(0,t.jsx)(v.Z,{style:{width:"100%"},value:e.max_budget_in_team,onChange:e=>l(s,"max_budget_in_team",e),placeholder:"Optional",min:0,step:.01,precision:2})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(P.xv,{className:"text-sm font-medium mb-1",children:"User Role"}),(0,t.jsxs)(g.default,{style:{width:"100%"},value:e.user_role,onChange:e=>l(s,"user_role",e),children:[(0,t.jsx)(Z,{value:"user",children:"User"}),(0,t.jsx)(Z,{value:"admin",children:"Admin"})]})]})]})]},s)),(0,t.jsx)(P.zx,{variant:"secondary",icon:G.Z,onClick:()=>{I("teams",[...s,{team_id:"",user_role:"user"}])},className:"w-full",children:"Add Team"})]})},A=(e,s,l)=>{var r;let i=s.type;if("teams"===e)return(0,t.jsx)("div",{className:"mt-2",children:z(p[e]||[])});if("user_role"===e&&a)return(0,t.jsx)(g.default,{style:{width:"100%"},value:p[e]||"",onChange:s=>I(e,s),className:"mt-2",children:Object.entries(a).filter(e=>{let[s]=e;return s.includes("internal_user")}).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(Z,{value:s,children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{children:l}),(0,t.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:a})]})},s)})});if("budget_duration"===e)return(0,t.jsx)(k.Z,{value:p[e]||null,onChange:s=>I(e,s),className:"mt-2"});if("boolean"===i)return(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(K.Z,{checked:!!p[e],onChange:s=>I(e,s)})});if("array"===i&&(null===(r=s.items)||void 0===r?void 0:r.enum))return(0,t.jsx)(g.default,{mode:"multiple",style:{width:"100%"},value:p[e]||[],onChange:s=>I(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,t.jsx)(Z,{value:e,children:e},e))});if("models"===e)return(0,t.jsxs)(g.default,{mode:"multiple",style:{width:"100%"},value:p[e]||[],onChange:s=>I(e,s),className:"mt-2",children:[(0,t.jsx)(Z,{value:"no-default-models",children:"No Default Models"},"no-default-models"),(0,t.jsx)(Z,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),_.map(e=>(0,t.jsx)(Z,{value:e,children:(0,S.W0)(e)},e))]});if("string"===i&&s.enum)return(0,t.jsx)(g.default,{style:{width:"100%"},value:p[e]||"",onChange:s=>I(e,s),className:"mt-2",children:s.enum.map(e=>(0,t.jsx)(Z,{value:e,children:e},e))});else return(0,t.jsx)(P.oi,{value:void 0!==p[e]?String(p[e]):"",onChange:s=>I(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},B=(e,s)=>{if(null==s)return(0,t.jsx)("span",{className:"text-gray-400",children:"Not set"});if("teams"===e&&Array.isArray(s)){if(0===s.length)return(0,t.jsx)("span",{className:"text-gray-400",children:"No teams assigned"});let e=D(s);return(0,t.jsx)("div",{className:"space-y-2 mt-1",children:e.map((e,s)=>(0,t.jsx)("div",{className:"border rounded-lg p-3 bg-white",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Team ID:"}),(0,t.jsx)("p",{className:"text-gray-900",children:e.team_id||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Max Budget:"}),(0,t.jsx)("p",{className:"text-gray-900",children:void 0!==e.max_budget_in_team?"$".concat((0,T.pw)(e.max_budget_in_team,4)):"No limit"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Role:"}),(0,t.jsx)("p",{className:"text-gray-900 capitalize",children:e.user_role})]})]})},s))})}if("user_role"===e&&a&&a[s]){let{ui_label:e,description:l}=a[s];return(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium",children:e}),l&&(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:l})]})}return"budget_duration"===e?(0,t.jsx)("span",{children:(0,k.m)(s)}):"boolean"==typeof s?(0,t.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,t.jsx)("span",{className:"text-gray-400",children:"None"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,S.W0)(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,t.jsx)("span",{className:"text-gray-400",children:"None"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,t.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,t.jsx)("span",{children:String(s)})};return o?(0,t.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,t.jsx)(V.Z,{size:"large"})}):u?(0,t.jsxs)(P.Zb,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(P.Dx,{children:"Default User Settings"}),!o&&u&&(x?(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(P.zx,{variant:"secondary",onClick:()=>{h(!1),f(u.values||{})},disabled:y,children:"Cancel"}),(0,t.jsx)(P.zx,{onClick:C,loading:y,children:"Save Changes"})]}):(0,t.jsx)(P.zx,{onClick:()=>h(!0),children:"Edit Settings"}))]}),(null==u?void 0:null===(s=u.field_schema)||void 0===s?void 0:s.description)&&(0,t.jsx)(w,{className:"mb-4",children:u.field_schema.description}),(0,t.jsx)(P.iz,{}),(0,t.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=u;return s&&s.properties?Object.entries(s.properties).map(s=>{let[l,a]=s,r=e[l],i=l.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,t.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,t.jsx)(P.xv,{className:"font-medium text-lg",children:i}),(0,t.jsx)(w,{className:"text-sm text-gray-500 mt-1",children:a.description||"No description available"}),x?(0,t.jsx)("div",{className:"mt-2",children:A(l,a,r)}):(0,t.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:B(l,r)})]},l)}):(0,t.jsx)(P.xv,{children:"No schema information available"})})()})]}):(0,t.jsx)(P.Zb,{children:(0,t.jsx)(P.xv,{children:"No settings available or you do not have permission to view them."})})},W=l(41649),Q=l(67101),$=l(47323),H=l(15731),Y=l(53410),X=l(74998),ee=l(23628);let es=(e,s,l,a,r,i)=>{let n=[{header:"User ID",accessorKey:"user_id",enableSorting:!0,cell:e=>{let{row:s}=e;return(0,t.jsx)(f.Z,{title:s.original.user_id,children:(0,t.jsx)("span",{className:"text-xs",children:s.original.user_id?"".concat(s.original.user_id.slice(0,7),"..."):"-"})})}},{header:"Email",accessorKey:"user_email",enableSorting:!0,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.user_email||"-"})}},{header:"Global Proxy Role",accessorKey:"user_role",enableSorting:!0,cell:s=>{var l;let{row:a}=s;return(0,t.jsx)("span",{className:"text-xs",children:(null==e?void 0:null===(l=e[a.original.user_role])||void 0===l?void 0:l.ui_label)||"-"})}},{header:"User Alias",accessorKey:"user_alias",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.user_alias||"-"})}},{header:"Spend (USD)",accessorKey:"spend",enableSorting:!0,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.spend?(0,T.pw)(s.original.spend,4):"-"})}},{header:"Budget (USD)",accessorKey:"max_budget",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:null!==s.original.max_budget?s.original.max_budget:"Unlimited"})}},{header:()=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{children:"SSO ID"}),(0,t.jsx)(f.Z,{title:"SSO ID is the ID of the user in the SSO provider. If the user is not using SSO, this will be null.",children:(0,t.jsx)(H.Z,{className:"w-4 h-4"})})]}),accessorKey:"sso_user_id",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:null!==s.original.sso_user_id?s.original.sso_user_id:"-"})}},{header:"Virtual Keys",accessorKey:"key_count",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)(Q.Z,{numItems:2,children:s.original.key_count>0?(0,t.jsxs)(W.Z,{size:"xs",color:"indigo",children:[s.original.key_count," ",1===s.original.key_count?"Key":"Keys"]}):(0,t.jsx)(W.Z,{size:"xs",color:"gray",children:"No Keys"})})}},{header:"Created At",accessorKey:"created_at",enableSorting:!0,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.created_at?new Date(s.original.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.updated_at?new Date(s.original.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"Actions",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(f.Z,{title:"Edit user details",children:(0,t.jsx)($.Z,{icon:Y.Z,size:"sm",onClick:()=>r(s.original.user_id,!0),className:"cursor-pointer hover:text-blue-600"})}),(0,t.jsx)(f.Z,{title:"Delete user",children:(0,t.jsx)($.Z,{icon:X.Z,size:"sm",onClick:()=>l(s.original),className:"cursor-pointer hover:text-red-600"})}),(0,t.jsx)(f.Z,{title:"Reset Password",children:(0,t.jsx)($.Z,{icon:ee.Z,size:"sm",onClick:()=>a(s.original.user_id),className:"cursor-pointer hover:text-green-600"})})]})}}];if(i){let{onSelectUser:e,onSelectAll:s,isUserSelected:l,isAllSelected:a,isIndeterminate:r}=i;return[{id:"select",enableSorting:!1,header:()=>(0,t.jsx)(c.Z,{indeterminate:r,checked:a,onChange:e=>s(e.target.checked),onClick:e=>e.stopPropagation()}),cell:s=>{let{row:a}=s;return(0,t.jsx)(c.Z,{checked:l(a.original),onChange:s=>e(a.original,s.target.checked),onClick:e=>e.stopPropagation()})}},...n]}return n};var el=l(71594),et=l(24525),ea=l(27281),er=l(21626),ei=l(97214),en=l(28241),ed=l(58834),eo=l(69552),ec=l(71876),eu=l(44633),em=l(86462),ex=l(49084),eh=l(50337),eg=l(84717),ev=l(10900),ej=l(30401),ep=l(78867);function ef(e){var s,l,a,i,n,d,o,c,u,m,x,h,g,v,p,f,y,b,_,N,S,Z,I,D,z,A,L,O,F,M,P,K,V,q,G,J,W,Q,$,H,Y,es,el,et,ea;let{userId:er,onClose:ei,accessToken:en,userRole:ed,onDelete:eo,possibleUIRoles:ec,initialTab:eu=0,startInEditMode:em=!1}=e,[ex,eh]=(0,r.useState)(null),[ef,ey]=(0,r.useState)(!1),[eb,e_]=(0,r.useState)(!1),[eN,eS]=(0,r.useState)(!0),[ew,eZ]=(0,r.useState)(em),[ek,eC]=(0,r.useState)([]),[eU,eI]=(0,r.useState)(!1),[eD,ez]=(0,r.useState)(null),[eA,eB]=(0,r.useState)(null),[eL,eE]=(0,r.useState)(eu),[eT,eO]=(0,r.useState)({}),[eF,eM]=(0,r.useState)(!1);r.useEffect(()=>{eB((0,j.getProxyBaseUrl)())},[]),r.useEffect(()=>{console.log("userId: ".concat(er,", userRole: ").concat(ed,", accessToken: ").concat(en)),(async()=>{try{if(!en)return;let e=await (0,j.userInfoCall)(en,er,ed||"",!1,null,null,!0);eh(e);let s=(await (0,j.modelAvailableCall)(en,er,ed||"")).data.map(e=>e.id);eC(s)}catch(e){console.error("Error fetching user data:",e),U.Z.fromBackend("Failed to fetch user data")}finally{eS(!1)}})()},[en,er,ed]);let eR=async()=>{if(!en){U.Z.fromBackend("Access token not found");return}try{U.Z.success("Generating password reset link...");let e=await (0,j.invitationCreateCall)(en,er);ez(e),eI(!0)}catch(e){U.Z.fromBackend("Failed to generate password reset link")}},eP=async()=>{try{if(!en)return;e_(!0),await (0,j.userDeleteCall)(en,[er]),U.Z.success("User deleted successfully"),eo&&eo(),ei()}catch(e){console.error("Error deleting user:",e),U.Z.fromBackend("Failed to delete user")}finally{ey(!1),e_(!1)}},eK=async e=>{try{if(!en||!ex)return;await (0,j.userUpdateUserCall)(en,e,null),eh({...ex,user_info:{...ex.user_info,user_email:e.user_email,user_alias:e.user_alias,models:e.models,max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:e.metadata}}),U.Z.success("User updated successfully"),eZ(!1)}catch(e){console.error("Error updating user:",e),U.Z.fromBackend("Failed to update user")}};if(eN)return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)(eg.zx,{icon:ev.Z,variant:"light",onClick:ei,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(eg.xv,{children:"Loading user data..."})]});if(!ex)return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)(eg.zx,{icon:ev.Z,variant:"light",onClick:ei,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(eg.xv,{children:"User not found"})]});let eV=async(e,s)=>{await (0,T.vQ)(e)&&(eO(e=>({...e,[s]:!0})),setTimeout(()=>{eO(e=>({...e,[s]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.zx,{icon:ev.Z,variant:"light",onClick:ei,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(eg.Dx,{children:(null===(s=ex.user_info)||void 0===s?void 0:s.user_email)||"User"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(eg.xv,{className:"text-gray-500 font-mono",children:ex.user_id}),(0,t.jsx)(B.ZP,{type:"text",size:"small",icon:eT["user-id"]?(0,t.jsx)(ej.Z,{size:12}):(0,t.jsx)(ep.Z,{size:12}),onClick:()=>eV(ex.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eT["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),ed&&w.LQ.includes(ed)&&(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(eg.zx,{icon:ee.Z,variant:"secondary",onClick:eR,className:"flex items-center",children:"Reset Password"}),(0,t.jsx)(eg.zx,{icon:X.Z,variant:"secondary",onClick:()=>ey(!0),className:"flex items-center text-red-500 border-red-500 hover:text-red-600 hover:border-red-600",children:"Delete User"})]})]}),(0,t.jsx)(R.Z,{isOpen:ef,title:"Delete User?",message:"Are you sure you want to delete this user? This action cannot be undone.",resourceInformationTitle:"User Information",resourceInformation:[{label:"Email",value:null===(l=ex.user_info)||void 0===l?void 0:l.user_email},{label:"User ID",value:ex.user_id,code:!0},{label:"Global Proxy Role",value:(null===(a=ex.user_info)||void 0===a?void 0:a.user_role)&&(null==ec?void 0:null===(i=ec[ex.user_info.user_role])||void 0===i?void 0:i.ui_label)||(null===(n=ex.user_info)||void 0===n?void 0:n.user_role)||"-"},{label:"Total Spend (USD)",value:(null===(d=ex.user_info)||void 0===d?void 0:d.spend)!==null&&(null===(o=ex.user_info)||void 0===o?void 0:o.spend)!==void 0?ex.user_info.spend.toFixed(2):void 0}],onCancel:()=>{ey(!1)},onOk:eP,confirmLoading:eb}),(0,t.jsxs)(eg.v0,{defaultIndex:eL,onIndexChange:eE,children:[(0,t.jsxs)(eg.td,{className:"mb-4",children:[(0,t.jsx)(eg.OK,{children:"Overview"}),(0,t.jsx)(eg.OK,{children:"Details"})]}),(0,t.jsxs)(eg.nP,{children:[(0,t.jsx)(eg.x4,{children:(0,t.jsxs)(eg.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(eg.Zb,{children:[(0,t.jsx)(eg.xv,{children:"Spend"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(eg.Dx,{children:["$",(0,T.pw)((null===(c=ex.user_info)||void 0===c?void 0:c.spend)||0,4)]}),(0,t.jsxs)(eg.xv,{children:["of"," ",(null===(u=ex.user_info)||void 0===u?void 0:u.max_budget)!==null?"$".concat((0,T.pw)(ex.user_info.max_budget,4)):"Unlimited"]})]})]}),(0,t.jsxs)(eg.Zb,{children:[(0,t.jsx)(eg.xv,{children:"Teams"}),(0,t.jsx)("div",{className:"mt-2",children:(null===(m=ex.teams)||void 0===m?void 0:m.length)&&(null===(x=ex.teams)||void 0===x?void 0:x.length)>0?(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[null===(h=ex.teams)||void 0===h?void 0:h.slice(0,eF?ex.teams.length:20).map((e,s)=>(0,t.jsx)(eg.Ct,{color:"blue",title:e.team_alias,children:e.team_alias},s)),!eF&&(null===(g=ex.teams)||void 0===g?void 0:g.length)>20&&(0,t.jsxs)(eg.Ct,{color:"gray",className:"cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eM(!0),children:["+",ex.teams.length-20," more"]}),eF&&(null===(v=ex.teams)||void 0===v?void 0:v.length)>20&&(0,t.jsx)(eg.Ct,{color:"gray",className:"cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eM(!1),children:"Show Less"})]}):(0,t.jsx)(eg.xv,{children:"No teams"})})]}),(0,t.jsxs)(eg.Zb,{children:[(0,t.jsx)(eg.xv,{children:"Virtual Keys"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsxs)(eg.xv,{children:[(null===(p=ex.keys)||void 0===p?void 0:p.length)||0," ",(null===(f=ex.keys)||void 0===f?void 0:f.length)===1?"Key":"Keys"]})})]}),(0,t.jsxs)(eg.Zb,{children:[(0,t.jsx)(eg.xv,{children:"Personal Models"}),(0,t.jsx)("div",{className:"mt-2",children:(null===(b=ex.user_info)||void 0===b?void 0:null===(y=b.models)||void 0===y?void 0:y.length)&&(null===(N=ex.user_info)||void 0===N?void 0:null===(_=N.models)||void 0===_?void 0:_.length)>0?null===(Z=ex.user_info)||void 0===Z?void 0:null===(S=Z.models)||void 0===S?void 0:S.map((e,s)=>(0,t.jsx)(eg.xv,{children:e},s)):(0,t.jsx)(eg.xv,{children:"All proxy models"})})]})]})}),(0,t.jsx)(eg.x4,{children:(0,t.jsxs)(eg.Zb,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(eg.Dx,{children:"User Settings"}),!ew&&ed&&w.LQ.includes(ed)&&(0,t.jsx)(eg.zx,{onClick:()=>eZ(!0),children:"Edit Settings"})]}),ew&&ex?(0,t.jsx)(C,{userData:ex,onCancel:()=>eZ(!1),onSubmit:eK,teams:ex.teams,accessToken:en,userID:er,userRole:ed,userModels:ek,possibleUIRoles:ec}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"User ID"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(eg.xv,{className:"font-mono",children:ex.user_id}),(0,t.jsx)(B.ZP,{type:"text",size:"small",icon:eT["user-id"]?(0,t.jsx)(ej.Z,{size:12}):(0,t.jsx)(ep.Z,{size:12}),onClick:()=>eV(ex.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eT["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Email"}),(0,t.jsx)(eg.xv,{children:(null===(I=ex.user_info)||void 0===I?void 0:I.user_email)||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"User Alias"}),(0,t.jsx)(eg.xv,{children:(null===(D=ex.user_info)||void 0===D?void 0:D.user_alias)||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Global Proxy Role"}),(0,t.jsx)(eg.xv,{children:(null===(z=ex.user_info)||void 0===z?void 0:z.user_role)||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Created"}),(0,t.jsx)(eg.xv,{children:(null===(A=ex.user_info)||void 0===A?void 0:A.created_at)?new Date(ex.user_info.created_at).toLocaleString():"Unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Last Updated"}),(0,t.jsx)(eg.xv,{children:(null===(L=ex.user_info)||void 0===L?void 0:L.updated_at)?new Date(ex.user_info.updated_at).toLocaleString():"Unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Teams"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(O=ex.teams)||void 0===O?void 0:O.length)&&(null===(F=ex.teams)||void 0===F?void 0:F.length)>0?(0,t.jsxs)(t.Fragment,{children:[null===(M=ex.teams)||void 0===M?void 0:M.slice(0,eF?ex.teams.length:20).map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",title:e.team_alias||e.team_id,children:e.team_alias||e.team_id},s)),!eF&&(null===(P=ex.teams)||void 0===P?void 0:P.length)>20&&(0,t.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded text-xs cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eM(!0),children:["+",ex.teams.length-20," more"]}),eF&&(null===(K=ex.teams)||void 0===K?void 0:K.length)>20&&(0,t.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded text-xs cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eM(!1),children:"Show Less"})]}):(0,t.jsx)(eg.xv,{children:"No teams"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Personal Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(q=ex.user_info)||void 0===q?void 0:null===(V=q.models)||void 0===V?void 0:V.length)&&(null===(J=ex.user_info)||void 0===J?void 0:null===(G=J.models)||void 0===G?void 0:G.length)>0?null===(Q=ex.user_info)||void 0===Q?void 0:null===(W=Q.models)||void 0===W?void 0:W.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,t.jsx)(eg.xv,{children:"All proxy models"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Virtual Keys"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===($=ex.keys)||void 0===$?void 0:$.length)&&(null===(H=ex.keys)||void 0===H?void 0:H.length)>0?ex.keys.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-green-100 rounded text-xs",children:e.key_alias||e.token},s)):(0,t.jsx)(eg.xv,{children:"No Virtual Keys"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Max Budget"}),(0,t.jsx)(eg.xv,{children:(null===(Y=ex.user_info)||void 0===Y?void 0:Y.max_budget)!==null&&(null===(es=ex.user_info)||void 0===es?void 0:es.max_budget)!==void 0?"$".concat((0,T.pw)(ex.user_info.max_budget,4)):"Unlimited"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Budget Reset"}),(0,t.jsx)(eg.xv,{children:(0,k.m)(null!==(ea=null===(el=ex.user_info)||void 0===el?void 0:el.budget_duration)&&void 0!==ea?ea:null)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Metadata"}),(0,t.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify((null===(et=ex.user_info)||void 0===et?void 0:et.metadata)||{},null,2)})]})]})]})})]})]}),(0,t.jsx)(E.Z,{isInvitationLinkModalVisible:eU,setIsInvitationLinkModalVisible:eI,baseUrl:eA||"",invitationLinkData:eD,modalType:"resetPassword"})]})}function ey(e){let{data:s=[],columns:l,isLoading:a=!1,onSortChange:i,currentSort:n,accessToken:d,userRole:o,possibleUIRoles:c,handleEdit:u,handleDelete:m,handleResetPassword:x,selectedUsers:h=[],onSelectionChange:g,enableSelection:v=!1,filters:j,updateFilters:p,initialFilters:f,teams:y,userListResponse:_,currentPage:N,handlePageChange:S}=e,[w,Z]=r.useState([{id:(null==n?void 0:n.sortBy)||"created_at",desc:(null==n?void 0:n.sortOrder)==="desc"}]),[k,C]=r.useState(null),[U,I]=r.useState(!1),[D,z]=r.useState(!1),A=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];C(e),I(s)},B=(e,s)=>{g&&(s?g([...h,e]):g(h.filter(s=>s.user_id!==e.user_id)))},L=e=>{g&&(e?g(s):g([]))},E=e=>h.some(s=>s.user_id===e.user_id),T=s.length>0&&h.length===s.length,O=h.length>0&&h.lengthc?es(c,u,m,x,A,v?{selectedUsers:h,onSelectUser:B,onSelectAll:L,isUserSelected:E,isAllSelected:T,isIndeterminate:O}:void 0):l,[c,u,m,x,A,l,v,h,T,O]),M=(0,el.b7)({data:s,columns:F,state:{sorting:w},onSortingChange:e=>{let s="function"==typeof e?e(w):e;if(Z(s),s&&Array.isArray(s)&&s.length>0&&s[0]){let e=s[0];if(e.id){let s=e.id,l=e.desc?"desc":"asc";null==i||i(s,l)}}else null==i||i("created_at","desc")},getCoreRowModel:(0,et.sC)(),manualSorting:!0,enableSorting:!0});return(r.useEffect(()=>{n&&Z([{id:n.sortBy,desc:"desc"===n.sortOrder}])},[n]),k)?(0,t.jsx)(ef,{userId:k,onClose:()=>{C(null),I(!1)},accessToken:d,userRole:o,possibleUIRoles:c,initialTab:U?1:0,startInEditMode:U}):(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsx)("div",{className:"border-b px-6 py-4",children:(0,t.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsxs)("div",{className:"relative w-64",children:[(0,t.jsx)("input",{type:"text",placeholder:"Search by email...",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:j.email,onChange:e=>p({email: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)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(D?"bg-gray-100":""),onClick:()=>z(!D),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:"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"})}),"Filters",(j.user_id||j.user_role||j.team)&&(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,t.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{p(f)},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:"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"})}),"Reset Filters"]})]}),D&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,t.jsxs)("div",{className:"relative w-64",children:[(0,t.jsx)("input",{type:"text",placeholder:"Filter by User 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:j.user_id,onChange:e=>p({user_id: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:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,t.jsx)("div",{className:"w-64",children:(0,t.jsx)(ea.Z,{value:j.user_role,onValueChange:e=>p({user_role:e}),placeholder:"Select Role",children:c&&Object.entries(c).map(e=>{let[s,l]=e;return(0,t.jsx)(b.Z,{value:s,children:l.ui_label},s)})})}),(0,t.jsx)("div",{className:"w-64",children:(0,t.jsx)(ea.Z,{value:j.team,onValueChange:e=>p({team:e}),placeholder:"Select Team",children:null==y?void 0:y.map(e=>(0,t.jsx)(b.Z,{value:e.team_id,children:e.team_alias||e.team_id},e.team_id))})}),(0,t.jsx)("div",{className:"relative w-64",children:(0,t.jsx)("input",{type:"text",placeholder:"Filter by SSO 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:j.sso_user_id,onChange:e=>p({sso_user_id:e.target.value})})})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[a?(0,t.jsx)(eh.Z.Input,{active:!0,style:{width:192,height:20}}):(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",_&&_.users&&_.users.length>0?(_.page-1)*_.page_size+1:0," ","-"," ",_&&_.users?Math.min(_.page*_.page_size,_.total):0," ","of ",_?_.total:0," results"]}),(0,t.jsx)("div",{className:"flex space-x-2",children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eh.Z.Button,{active:!0,size:"small",style:{width:80,height:30}}),(0,t.jsx)(eh.Z.Button,{active:!0,size:"small",style:{width:60,height:30}})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>S(N-1),disabled:1===N,className:"px-3 py-1 text-sm border rounded-md ".concat(1===N?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,t.jsx)("button",{onClick:()=>S(N+1),disabled:!_||N>=_.total_pages,className:"px-3 py-1 text-sm border rounded-md ".concat(!_||N>=_.total_pages?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})})]})]})}),(0,t.jsx)("div",{className:"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)(er.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(ed.Z,{children:M.getHeaderGroups().map(e=>(0,t.jsx)(ec.Z,{children:e.headers.map(e=>(0,t.jsx)(eo.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""," ").concat(e.column.getCanSort()?"cursor-pointer hover:bg-gray-50":""),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,el.ie)(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)(eu.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(em.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(ex.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,t.jsx)(ei.Z,{children:a?(0,t.jsx)(ec.Z,{children:(0,t.jsx)(en.Z,{colSpan:F.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"\uD83D\uDE85 Loading users..."})})})}):s.length>0?M.getRowModel().rows.map(e=>(0,t.jsx)(ec.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(en.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:()=>{"user_id"===e.column.id&&A(e.getValue(),!1)},style:{cursor:"user_id"===e.column.id?"pointer":"default",color:"user_id"===e.column.id?"#3b82f6":"inherit"},children:(0,el.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(ec.Z,{children:(0,t.jsx)(en.Z,{colSpan:F.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No users found"})})})})})]})})})})]})}let{Text:eb,Title:e_}=n.default,eN={email:"",user_id:"",user_role:"",sso_user_id:"",team:"",model:"",min_spend:null,max_spend:null,sort_by:"created_at",sort_order:"desc"};var eS=e=>{var s,l,n;let{accessToken:d,token:o,userRole:c,userID:u,teams:m}=e,x=(0,F.NL)(),[h,g]=(0,r.useState)(1),[v,p]=(0,r.useState)(!1),[f,y]=(0,r.useState)(null),[b,_]=(0,r.useState)(!1),[N,S]=(0,r.useState)(!1),[Z,k]=(0,r.useState)(null),[C,I]=(0,r.useState)("users"),[D,B]=(0,r.useState)(eN),[P,K,V]=(0,O.G)(D,{wait:300}),[q,G]=(0,r.useState)(!1),[W,Q]=(0,r.useState)(null),[$,H]=(0,r.useState)(null),[Y,X]=(0,r.useState)([]),[ee,el]=(0,r.useState)(!1),[et,ea]=(0,r.useState)(!1),[er,ei]=(0,r.useState)([]),en=e=>{k(e),_(!0)};(0,r.useEffect)(()=>()=>{V.cancel()},[V]),(0,r.useEffect)(()=>{H((0,j.getProxyBaseUrl)())},[]),(0,r.useEffect)(()=>{(async()=>{try{if(!u||!c||!d)return;let e=(await (0,j.modelAvailableCall)(d,u,c)).data.map(e=>e.id);console.log("available_model_names:",e),ei(e)}catch(e){console.error("Error fetching user models:",e)}})()},[d,u,c]);let ed=e=>{B(s=>{let l={...s,...e};return K(l),l})},eo=async e=>{if(!d){U.Z.fromBackend("Access token not found");return}try{U.Z.success("Generating password reset link...");let s=await (0,j.invitationCreateCall)(d,e);Q(s),G(!0)}catch(e){U.Z.fromBackend("Failed to generate password reset link")}},ec=async()=>{if(Z&&d)try{S(!0),await (0,j.userDeleteCall)(d,[Z.user_id]),x.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let s=e.users.filter(e=>e.user_id!==Z.user_id);return{...e,users:s}}),U.Z.success("User deleted successfully")}catch(e){console.error("Error deleting user:",e),U.Z.fromBackend("Failed to delete user")}finally{_(!1),k(null),S(!1)}},eu=async()=>{y(null),p(!1)},em=async e=>{if(console.log("inside handleEditSubmit:",e),d&&o&&c&&u){try{let s=await (0,j.userUpdateUserCall)(d,e,null);x.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let l=e.users.map(e=>e.user_id===s.data.user_id?(0,T.nl)(e,s.data):e);return{...e,users:l}}),U.Z.success("User ".concat(e.user_id," updated successfully"))}catch(e){console.error("There was an error updating the user",e)}y(null),p(!1)}},ex=async e=>{g(e)},eg=(0,M.a)({queryKey:["userList",{debouncedFilter:P,currentPage:h}],queryFn:async()=>{if(!d)throw Error("Access token required");return await (0,j.userListCall)(d,P.user_id?[P.user_id]:null,h,25,P.email||null,P.user_role||null,P.team||null,P.sso_user_id||null,P.sort_by,P.sort_order)},enabled:!!(d&&o&&c&&u),placeholderData:e=>e}),ev=eg.data,ej=(0,M.a)({queryKey:["userRoles"],initialData:()=>({}),queryFn:async()=>{if(!d)throw Error("Access token required");return await (0,j.getPossibleUserRoles)(d)},enabled:!!(d&&o&&c&&u)}).data,ep=es(ej,e=>{y(e),p(!0)},en,eo,()=>{});return(0,t.jsxs)("div",{className:"w-full p-8 overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,t.jsx)("div",{className:"flex space-x-3",children:eg.isLoading?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eh.Z.Button,{active:!0,size:"default",shape:"default",style:{width:110,height:36}}),(0,t.jsx)(eh.Z.Button,{active:!0,size:"default",shape:"default",style:{width:145,height:36}}),(0,t.jsx)(eh.Z.Button,{active:!0,size:"default",shape:"default",style:{width:110,height:36}})]}):u&&d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A.Z,{userID:u,accessToken:d,teams:m,possibleUIRoles:ej}),(0,t.jsx)(i.z,{onClick:()=>{ea(!et),X([])},variant:et?"primary":"secondary",className:"flex items-center",children:et?"Cancel Selection":"Select Users"}),et&&(0,t.jsxs)(i.z,{onClick:()=>{if(0===Y.length){U.Z.fromBackend("Please select users to edit");return}el(!0)},disabled:0===Y.length,className:"flex items-center",children:["Bulk Edit (",Y.length," selected)"]})]}):null})}),(0,t.jsxs)(a.v0,{defaultIndex:0,onIndexChange:e=>I(0===e?"users":"settings"),children:[(0,t.jsxs)(a.td,{className:"mb-4",children:[(0,t.jsx)(a.OK,{children:"Users"}),(0,t.jsx)(a.OK,{children:"Default User Settings"})]}),(0,t.jsxs)(a.nP,{children:[(0,t.jsx)(a.x4,{children:(0,t.jsx)(ey,{data:(null===(s=eg.data)||void 0===s?void 0:s.users)||[],columns:ep,isLoading:eg.isLoading,accessToken:d,userRole:c,onSortChange:(e,s)=>{ed({sort_by:e,sort_order:s})},currentSort:{sortBy:D.sort_by,sortOrder:D.sort_order},possibleUIRoles:ej,handleEdit:e=>{y(e),p(!0)},handleDelete:en,handleResetPassword:eo,enableSelection:et,selectedUsers:Y,onSelectionChange:e=>{X(e)},filters:D,updateFilters:ed,initialFilters:eN,teams:m,userListResponse:ev,currentPage:h,handlePageChange:ex})}),(0,t.jsx)(a.x4,{children:u&&c&&d?(0,t.jsx)(J,{accessToken:d,possibleUIRoles:ej,userID:u,userRole:c}):(0,t.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,t.jsx)(eh.Z,{active:!0,paragraph:{rows:4}})})})]})]}),(0,t.jsx)(L,{visible:v,possibleUIRoles:ej,onCancel:eu,user:f,onSubmit:em}),(0,t.jsx)(R.Z,{isOpen:b,title:"Delete User?",message:"Are you sure you want to delete this user? This action cannot be undone.",resourceInformationTitle:"User Information",resourceInformation:[{label:"Email",value:null==Z?void 0:Z.user_email},{label:"User ID",value:null==Z?void 0:Z.user_id,code:!0},{label:"Global Proxy Role",value:Z&&(null==ej?void 0:null===(l=ej[Z.user_role])||void 0===l?void 0:l.ui_label)||(null==Z?void 0:Z.user_role)||"-"},{label:"Total Spend (USD)",value:null==Z?void 0:null===(n=Z.spend)||void 0===n?void 0:n.toFixed(2)}],onCancel:()=>{_(!1),k(null)},onOk:ec,confirmLoading:N}),(0,t.jsx)(E.Z,{isInvitationLinkModalVisible:q,setIsInvitationLinkModalVisible:G,baseUrl:$||"",invitationLinkData:W,modalType:"resetPassword"}),(0,t.jsx)(z,{visible:ee,onCancel:()=>el(!1),selectedUsers:Y,possibleUIRoles:ej,accessToken:d,onSuccess:()=>{x.invalidateQueries({queryKey:["userList"]}),X([]),ea(!1)},teams:m,userRole:c,userModels:er,allowAllUsers:!!c&&(0,w.tY)(c)})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/667-cbb542e4dc0d37bb.js b/litellm/proxy/_experimental/out/_next/static/chunks/667-cbb542e4dc0d37bb.js new file mode 100644 index 00000000000..2a08e17f359 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/667-cbb542e4dc0d37bb.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[667],{12660:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(1119),o=r(2265),i={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"},a=r(55015),s=o.forwardRef(function(e,t){return o.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:i}))})},5540:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(1119),o=r(2265),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:"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"},a=r(55015),s=o.forwardRef(function(e,t){return o.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:i}))})},3632:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(1119),o=r(2265),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"},a=r(55015),s=o.forwardRef(function(e,t){return o.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:i}))})},35291:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(1119),o=r(2265),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"},a=r(55015),s=o.forwardRef(function(e,t){return o.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:i}))})},59341:function(e,t,r){"use strict";r.d(t,{Z:function(){return F}});var n=r(5853),o=r(71049),i=r(11323),a=r(2265),s=r(66797),l=r(40099),c=r(74275),u=r(59456),d=r(93980),f=r(65573),h=r(67561),p=r(87550),m=r(628),g=r(80281),v=r(31370),b=r(20131),y=r(38929),w=r(52307),S=r(52724),_=r(7935);let k=(0,a.createContext)(null);k.displayName="GroupContext";let C=a.Fragment,x=Object.assign((0,y.yV)(function(e,t){var r;let n=(0,a.useId)(),C=(0,g.Q)(),x=(0,p.B)(),{id:O=C||"headlessui-switch-".concat(n),disabled:j=x||!1,checked:E,defaultChecked:R,onChange:z,name:N,value:F,form:P,autoFocus:Z=!1,...L}=e,T=(0,a.useContext)(k),[I,M]=(0,a.useState)(null),B=(0,a.useRef)(null),A=(0,h.T)(B,t,null===T?null:T.setSwitch,M),q=(0,c.L)(R),[W,D]=(0,l.q)(E,z,null!=q&&q),V=(0,u.G)(),[H,G]=(0,a.useState)(!1),K=(0,d.z)(()=>{G(!0),null==D||D(!W),V.nextFrame(()=>{G(!1)})}),U=(0,d.z)(e=>{if((0,v.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),K()}),X=(0,d.z)(e=>{e.key===S.R.Space?(e.preventDefault(),K()):e.key===S.R.Enter&&(0,b.g)(e.currentTarget)}),$=(0,d.z)(e=>e.preventDefault()),Q=(0,_.wp)(),Y=(0,w.zH)(),{isFocusVisible:J,focusProps:ee}=(0,o.F)({autoFocus:Z}),{isHovered:et,hoverProps:er}=(0,i.X)({isDisabled:j}),{pressed:en,pressProps:eo}=(0,s.x)({disabled:j}),ei=(0,a.useMemo)(()=>({checked:W,disabled:j,hover:et,focus:J,active:en,autofocus:Z,changing:H}),[W,et,J,en,j,H,Z]),ea=(0,y.dG)({id:O,ref:A,role:"switch",type:(0,f.f)(e,I),tabIndex:-1===e.tabIndex?0:null!=(r=e.tabIndex)?r:0,"aria-checked":W,"aria-labelledby":Q,"aria-describedby":Y,disabled:j||void 0,autoFocus:Z,onClick:U,onKeyUp:X,onKeyPress:$},ee,er,eo),es=(0,a.useCallback)(()=>{if(void 0!==q)return null==D?void 0:D(q)},[D,q]),el=(0,y.L6)();return a.createElement(a.Fragment,null,null!=N&&a.createElement(m.Mt,{disabled:j,data:{[N]:F||"on"},overrides:{type:"checkbox",checked:W},form:P,onReset:es}),el({ourProps:ea,theirProps:L,slot:ei,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var t;let[r,n]=(0,a.useState)(null),[o,i]=(0,_.bE)(),[s,l]=(0,w.fw)(),c=(0,a.useMemo)(()=>({switch:r,setSwitch:n}),[r,n]),u=(0,y.L6)();return a.createElement(l,{name:"Switch.Description",value:s},a.createElement(i,{name:"Switch.Label",value:o,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}))}}},a.createElement(k.Provider,{value:c},u({ourProps:{},theirProps:e,slot:{},defaultTag:C,name:"Switch.Group"}))))},Label:_.__,Description:w.dk});var O=r(44140),j=r(26898),E=r(13241),R=r(1153),z=r(47187);let N=(0,R.fn)("Switch"),F=a.forwardRef((e,t)=>{let{checked:r,defaultChecked:o=!1,onChange:i,color:s,name:l,error:c,errorMessage:u,disabled:d,required:f,tooltip:h,id:p}=e,m=(0,n._T)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),g={bgColor:s?(0,R.bM)(s,j.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:s?(0,R.bM)(s,j.K.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[v,b]=(0,O.Z)(o,r),[y,w]=(0,a.useState)(!1),{tooltipProps:S,getReferenceProps:_}=(0,z.l)(300);return a.createElement("div",{className:"flex flex-row items-center justify-start"},a.createElement(z.Z,Object.assign({text:h},S)),a.createElement("div",Object.assign({ref:(0,R.lq)([t,S.refs.setReference]),className:(0,E.q)(N("root"),"flex flex-row relative h-5")},m,_),a.createElement("input",{type:"checkbox",className:(0,E.q)(N("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:l,required:f,checked:v,onChange:e=>{e.preventDefault()}}),a.createElement(x,{checked:v,onChange:e=>{b(e),null==i||i(e)},disabled:d,className:(0,E.q)(N("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:()=>w(!0),onBlur:()=>w(!1),id:p},a.createElement("span",{className:(0,E.q)(N("sr-only"),"sr-only")},"Switch ",v?"on":"off"),a.createElement("span",{"aria-hidden":"true",className:(0,E.q)(N("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")}),a.createElement("span",{"aria-hidden":"true",className:(0,E.q)(N("round"),v?(0,E.q)(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,E.q)("ring-2",g.ringColor):"")}))),c&&u?a.createElement("p",{className:(0,E.q)(N("errorMessage"),"text-sm text-red-500 mt-1 ")},u):null)});F.displayName="Switch"},92570:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=e=>e?"function"==typeof e?e():e:null},20435:function(e,t,r){"use strict";r.d(t,{aV:function(){return d}});var n=r(2265),o=r(36760),i=r.n(o),a=r(5769),s=r(92570),l=r(71744),c=r(72262),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 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 d=e=>{let{title:t,content:r,prefixCls:o}=e;return t||r?n.createElement(n.Fragment,null,t&&n.createElement("div",{className:"".concat(o,"-title")},t),r&&n.createElement("div",{className:"".concat(o,"-inner-content")},r)):null},f=e=>{let{hashId:t,prefixCls:r,className:o,style:l,placement:c="top",title:u,content:f,children:h}=e,p=(0,s.Z)(u),m=(0,s.Z)(f),g=i()(t,r,"".concat(r,"-pure"),"".concat(r,"-placement-").concat(c),o);return n.createElement("div",{className:g,style:l},n.createElement("div",{className:"".concat(r,"-arrow")}),n.createElement(a.G,Object.assign({},e,{className:t,prefixCls:r}),h||n.createElement(d,{prefixCls:r,title:p,content:m})))};t.ZP=e=>{let{prefixCls:t,className:r}=e,o=u(e,["prefixCls","className"]),{getPrefixCls:a}=n.useContext(l.E_),s=a("popover",t),[d,h,p]=(0,c.Z)(s);return d(n.createElement(f,Object.assign({},o,{prefixCls:s,hashId:h,className:i()(r,p)})))}},79326:function(e,t,r){"use strict";var n=r(2265),o=r(36760),i=r.n(o),a=r(50506),s=r(95814),l=r(92570),c=r(68710),u=r(19722),d=r(71744),f=r(99981),h=r(20435),p=r(72262),m=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 g=n.forwardRef((e,t)=>{var r,o;let{prefixCls:g,title:v,content:b,overlayClassName:y,placement:w="top",trigger:S="hover",children:_,mouseEnterDelay:k=.1,mouseLeaveDelay:C=.1,onOpenChange:x,overlayStyle:O={},styles:j,classNames:E}=e,R=m(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:z,className:N,style:F,classNames:P,styles:Z}=(0,d.dj)("popover"),L=z("popover",g),[T,I,M]=(0,p.Z)(L),B=z(),A=i()(y,I,M,N,P.root,null==E?void 0:E.root),q=i()(P.body,null==E?void 0:E.body),[W,D]=(0,a.Z)(!1,{value:null!==(r=e.open)&&void 0!==r?r:e.visible,defaultValue:null!==(o=e.defaultOpen)&&void 0!==o?o:e.defaultVisible}),V=(e,t)=>{D(e,!0),null==x||x(e,t)},H=e=>{e.keyCode===s.Z.ESC&&V(!1,e)},G=(0,l.Z)(v),K=(0,l.Z)(b);return T(n.createElement(f.Z,Object.assign({placement:w,trigger:S,mouseEnterDelay:k,mouseLeaveDelay:C},R,{prefixCls:L,classNames:{root:A,body:q},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},Z.root),F),O),null==j?void 0:j.root),body:Object.assign(Object.assign({},Z.body),null==j?void 0:j.body)},ref:t,open:W,onOpenChange:e=>{V(e)},overlay:G||K?n.createElement(h.aV,{prefixCls:L,title:G,content:K}):null,transitionName:(0,c.m)(B,"zoom-big",R.transitionName),"data-popover-inject":!0}),(0,u.Tm)(_,{onKeyDown:e=>{var t,r;(0,n.isValidElement)(_)&&(null===(r=null==_?void 0:(t=_.props).onKeyDown)||void 0===r||r.call(t,e)),H(e)}})))});g._InternalPanelDoNotUseOrYouWillBeFired=h.ZP,t.Z=g},72262:function(e,t,r){"use strict";var n=r(12918),o=r(691),i=r(88260),a=r(34442),s=r(53454),l=r(99320),c=r(71140);let u=e=>{let{componentCls:t,popoverColor:r,titleMinWidth:o,fontWeightStrong:a,innerPadding:s,boxShadowSecondary:l,colorTextHeading:c,borderRadiusLG:u,zIndexPopup:d,titleMarginBottom:f,colorBgElevated:h,popoverBg:p,titleBorderBottom:m,innerContentPadding:g,titlePadding:v}=e;return[{[t]:Object.assign(Object.assign({},(0,n.Wf)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:d,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":h,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},["".concat(t,"-content")]:{position:"relative"},["".concat(t,"-inner")]:{backgroundColor:p,backgroundClip:"padding-box",borderRadius:u,boxShadow:l,padding:s},["".concat(t,"-title")]:{minWidth:o,marginBottom:f,color:c,fontWeight:a,borderBottom:m,padding:v},["".concat(t,"-inner-content")]:{color:r,padding:g}})},(0,i.ZP)(e,"var(--antd-arrow-background-color)"),{["".concat(t,"-pure")]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",["".concat(t,"-content")]:{display:"inline-block"}}}]},d=e=>{let{componentCls:t}=e;return{[t]:s.i.map(r=>{let n=e["".concat(r,"6")];return{["&".concat(t,"-").concat(r)]:{"--antd-arrow-background-color":n,["".concat(t,"-inner")]:{backgroundColor:n},["".concat(t,"-arrow")]:{background:"transparent"}}}})}};t.Z=(0,l.I$)("Popover",e=>{let{colorBgElevated:t,colorText:r}=e,n=(0,c.IX)(e,{popoverBg:t,popoverColor:r});return[u(n),d(n),(0,o._y)(n,"zoom-big")]},e=>{let{lineWidth:t,controlHeight:r,fontHeight:n,padding:o,wireframe:s,zIndexPopupBase:l,borderRadiusLG:c,marginXS:u,lineType:d,colorSplit:f,paddingSM:h}=e,p=r-n;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:l+30},(0,a.w)(e)),(0,i.wZ)({contentRadius:c,limitVerticalRadius:!0})),{innerPadding:s?0:12,titleMarginBottom:s?0:u,titlePadding:s?"".concat(p/2,"px ").concat(o,"px ").concat(p/2-t,"px"):0,titleBorderBottom:s?"".concat(t,"px ").concat(d," ").concat(f):"none",innerContentPadding:s?"".concat(h,"px ").concat(o,"px"):0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]})},3810:function(e,t,r){"use strict";r.d(t,{Z:function(){return z}});var n=r(2265),o=r(36760),i=r.n(o),a=r(18694),s=r(93350),l=r(53445),c=r(19722),u=r(6694),d=r(71744),f=r(93463),h=r(54558),p=r(12918),m=r(71140),g=r(99320);let v=e=>{let{paddingXXS:t,lineWidth:r,tagPaddingHorizontal:n,componentCls:o,calc:i}=e,a=i(n).sub(r).equal(),s=i(t).sub(r).equal();return{[o]:Object.assign(Object.assign({},(0,p.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:a,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:"".concat((0,f.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusSM,opacity:1,transition:"all ".concat(e.motionDurationMid),textAlign:"start",position:"relative",["&".concat(o,"-rtl")]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},["".concat(o,"-close-icon")]:{marginInlineStart:s,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:"all ".concat(e.motionDurationMid),"&:hover":{color:e.colorTextHeading}},["&".concat(o,"-has-color")]:{borderColor:"transparent",["&, a, a:hover, ".concat(e.iconCls,"-close, ").concat(e.iconCls,"-close:hover")]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",["&:not(".concat(o,"-checkable-checked):hover")]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},["> ".concat(e.iconCls," + span, > span + ").concat(e.iconCls)]:{marginInlineStart:a}}),["".concat(o,"-borderless")]:{borderColor:"transparent",background:e.tagBorderlessBg}}},b=e=>{let{lineWidth:t,fontSizeIcon:r,calc:n}=e,o=e.fontSizeSM;return(0,m.IX)(e,{tagFontSize:o,tagLineHeight:(0,f.bf)(n(e.lineHeightSM).mul(o).equal()),tagIconSize:n(r).sub(n(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},y=e=>({defaultBg:new h.t(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var w=(0,g.I$)("Tag",e=>v(b(e)),y),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 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 _=n.forwardRef((e,t)=>{let{prefixCls:r,style:o,className:a,checked:s,children:l,icon:c,onChange:u,onClick:f}=e,h=S(e,["prefixCls","style","className","checked","children","icon","onChange","onClick"]),{getPrefixCls:p,tag:m}=n.useContext(d.E_),g=p("tag",r),[v,b,y]=w(g),_=i()(g,"".concat(g,"-checkable"),{["".concat(g,"-checkable-checked")]:s},null==m?void 0:m.className,a,b,y);return v(n.createElement("span",Object.assign({},h,{ref:t,style:Object.assign(Object.assign({},o),null==m?void 0:m.style),className:_,onClick:e=>{null==u||u(!s),null==f||f(e)}}),c,n.createElement("span",null,l)))});var k=r(18536);let C=e=>(0,k.Z)(e,(t,r)=>{let{textColor:n,lightBorderColor:o,lightColor:i,darkColor:a}=r;return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:n,background:i,borderColor:o,"&-inverse":{color:e.colorTextLightSolid,background:a,borderColor:a},["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}});var x=(0,g.bk)(["Tag","preset"],e=>C(b(e)),y);let O=(e,t,r)=>{let n="string"!=typeof r?r:r.charAt(0).toUpperCase()+r.slice(1);return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:e["color".concat(r)],background:e["color".concat(n,"Bg")],borderColor:e["color".concat(n,"Border")],["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}};var j=(0,g.bk)(["Tag","status"],e=>{let t=b(e);return[O(t,"success","Success"),O(t,"processing","Info"),O(t,"error","Error"),O(t,"warning","Warning")]},y),E=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 R=n.forwardRef((e,t)=>{let{prefixCls:r,className:o,rootClassName:f,style:h,children:p,icon:m,color:g,onClose:v,bordered:b=!0,visible:y}=e,S=E(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:_,direction:k,tag:C}=n.useContext(d.E_),[O,R]=n.useState(!0),z=(0,a.Z)(S,["closeIcon","closable"]);n.useEffect(()=>{void 0!==y&&R(y)},[y]);let N=(0,s.o2)(g),F=(0,s.yT)(g),P=N||F,Z=Object.assign(Object.assign({backgroundColor:g&&!P?g:void 0},null==C?void 0:C.style),h),L=_("tag",r),[T,I,M]=w(L),B=i()(L,null==C?void 0:C.className,{["".concat(L,"-").concat(g)]:P,["".concat(L,"-has-color")]:g&&!P,["".concat(L,"-hidden")]:!O,["".concat(L,"-rtl")]:"rtl"===k,["".concat(L,"-borderless")]:!b},o,f,I,M),A=e=>{e.stopPropagation(),null==v||v(e),e.defaultPrevented||R(!1)},[,q]=(0,l.b)((0,l.w)(e),(0,l.w)(C),{closable:!1,closeIconRender:e=>{let t=n.createElement("span",{className:"".concat(L,"-close-icon"),onClick:A},e);return(0,c.wm)(e,t,e=>({onClick:t=>{var r;null===(r=null==e?void 0:e.onClick)||void 0===r||r.call(e,t),A(t)},className:i()(null==e?void 0:e.className,"".concat(L,"-close-icon"))}))}}),W="function"==typeof S.onClick||p&&"a"===p.type,D=m||null,V=D?n.createElement(n.Fragment,null,D,p&&n.createElement("span",null,p)):p,H=n.createElement("span",Object.assign({},z,{ref:t,className:B,style:Z}),V,q,N&&n.createElement(x,{key:"preset",prefixCls:L}),F&&n.createElement(j,{key:"status",prefixCls:L}));return T(W?n.createElement(u.Z,{component:"Tag"},H):H)});R.CheckableTag=_;var z=R},79205:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(2265);let o=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),i=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()),a=e=>{let t=i(e);return t.charAt(0).toUpperCase()+t.slice(1)},s=function(){for(var e=arguments.length,t=Array(e),r=0;r!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()},l=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var c={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 u=(0,n.forwardRef)((e,t)=>{let{color:r="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:u="",children:d,iconNode:f,...h}=e;return(0,n.createElement)("svg",{ref:t,...c,width:o,height:o,stroke:r,strokeWidth:a?24*Number(i)/Number(o):i,className:s("lucide",u),...!d&&!l(h)&&{"aria-hidden":"true"},...h},[...f.map(e=>{let[t,r]=e;return(0,n.createElement)(t,r)}),...Array.isArray(d)?d:[d]])}),d=(e,t)=>{let r=(0,n.forwardRef)((r,i)=>{let{className:l,...c}=r;return(0,n.createElement)(u,{ref:i,iconNode:t,className:s("lucide-".concat(o(a(e))),"lucide-".concat(e),l),...c})});return r.displayName=a(e),r}},30401:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},78867:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},24601:function(){},18975:function(e,t,r){"use strict";var n=r(40257);r(24601);var o=r(2265),i=o&&"object"==typeof o&&"default"in o?o:{default:o},a=void 0!==n&&n.env&&!0,s=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,r=t.name,n=void 0===r?"stylesheet":r,o=t.optimizeForSpeed,i=void 0===o?a:o;c(s(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof i,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=i,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t=e.prototype;return t.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()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(a||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}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t>>0},d={};function f(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 h(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var r=e+t;return d[r]||(d[r]=t.replace(/__jsx-style-dynamic-selector/g,e)),d[r]}var p=function(){function e(e){var t=void 0===e?{}:e,r=t.styleSheet,n=void 0===r?null:r,o=t.optimizeForSpeed,i=void 0!==o&&o;this._sheet=n||new l({name:"styled-jsx",optimizeForSpeed:i}),this._sheet.inject(),n&&"boolean"==typeof i&&(this._sheet.setOptimizeForSpeed(i),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==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 i=o.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=i,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 i.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=f(n,r);return{styleId:o,rules:Array.isArray(t)?t.map(function(e){return h(o,e)}):[h(o,t)]}}return{styleId:f(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}(),m=o.createContext(null);m.displayName="StyleSheetContext";var g=i.default.useInsertionEffect||i.default.useLayoutEffect,v="undefined"!=typeof window?new p:void 0;function b(e){var t=v||o.useContext(m);return t&&("undefined"==typeof window?t.add(e):g(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}b.dynamic=function(e){return e.map(function(e){return f(e[0],e[1])}).join(" ")},t.style=b},29:function(e,t,r){"use strict";e.exports=r(18975).style},86462:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"}))});t.Z=o},2356:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.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),n.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"}))});t.Z=o},49084:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.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),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=o}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7155-036c6fcc23f65f77.js b/litellm/proxy/_experimental/out/_next/static/chunks/7155-036c6fcc23f65f77.js deleted file mode 100644 index 3192fe34a1f..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/7155-036c6fcc23f65f77.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7155],{88913:function(e,s,l){l.d(s,{Dx:function(){return d.Z},Zb:function(){return a.Z},iz:function(){return r.Z},oi:function(){return n.Z},xv:function(){return i.Z},zx:function(){return t.Z}});var t=l(78489),a=l(12514),r=l(67982),i=l(84264),n=l(49566),d=l(96761)},58643:function(e,s,l){l.d(s,{OK:function(){return t.Z},nP:function(){return n.Z},td:function(){return r.Z},v0:function(){return a.Z},x4:function(){return i.Z}});var t=l(12485),a=l(18135),r=l(35242),i=l(29706),n=l(77991)},77155:function(e,s,l){l.d(s,{Z:function(){return ew}});var t=l(57437),a=l(58643),r=l(2265),i=l(16312),n=l(57840),d=l(42264),o=l(22116),c=l(61994),u=l(56609),m=l(23496),x=l(5945),h=l(58760),g=l(37592),v=l(19015),j=l(19250),p=l(10032),f=l(99981),y=l(24199),b=l(57365),_=l(49566),N=l(16853),w=l(46468),S=l(20347),Z=l(15424),k=l(65925);function C(e){let{userData:s,onCancel:l,onSubmit:a,teams:n,accessToken:d,userID:o,userRole:c,userModels:u,possibleUIRoles:m,isBulkEdit:x=!1}=e,[h]=p.Z.useForm();return r.useEffect(()=>{var e,l,t,a,r,i,n;h.setFieldsValue({user_id:s.user_id,user_email:null===(e=s.user_info)||void 0===e?void 0:e.user_email,user_alias:null===(l=s.user_info)||void 0===l?void 0:l.user_alias,user_role:null===(t=s.user_info)||void 0===t?void 0:t.user_role,models:(null===(a=s.user_info)||void 0===a?void 0:a.models)||[],max_budget:null===(r=s.user_info)||void 0===r?void 0:r.max_budget,budget_duration:null===(i=s.user_info)||void 0===i?void 0:i.budget_duration,metadata:(null===(n=s.user_info)||void 0===n?void 0:n.metadata)?JSON.stringify(s.user_info.metadata,null,2):void 0})},[s,h]),(0,t.jsxs)(p.Z,{form:h,onFinish:e=>{if(e.metadata&&"string"==typeof e.metadata)try{e.metadata=JSON.parse(e.metadata)}catch(e){console.error("Error parsing metadata JSON:",e);return}a(e)},layout:"vertical",children:[!x&&(0,t.jsx)(p.Z.Item,{label:"User ID",name:"user_id",children:(0,t.jsx)(_.Z,{disabled:!0})}),!x&&(0,t.jsx)(p.Z.Item,{label:"Email",name:"user_email",children:(0,t.jsx)(_.Z,{})}),(0,t.jsx)(p.Z.Item,{label:"User Alias",name:"user_alias",children:(0,t.jsx)(_.Z,{})}),(0,t.jsx)(p.Z.Item,{label:(0,t.jsxs)("span",{children:["Global Proxy Role"," ",(0,t.jsx)(f.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,t.jsx)(Z.Z,{})})]}),name:"user_role",children:(0,t.jsx)(g.default,{children:m&&Object.entries(m).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(b.Z,{value:s,title:l,children:(0,t.jsxs)("div",{className:"flex",children:[l," ",(0,t.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:a})]})},s)})})}),(0,t.jsx)(p.Z.Item,{label:(0,t.jsxs)("span",{children:["Personal Models"," ",(0,t.jsx)(f.Z,{title:"Select which models this user can access outside of team-scope. Choose 'All Proxy Models' to grant access to all models available on the proxy.",children:(0,t.jsx)(Z.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,t.jsxs)(g.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:!S.ZL.includes(c||""),children:[(0,t.jsx)(g.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),(0,t.jsx)(g.default.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"),u.map(e=>(0,t.jsx)(g.default.Option,{value:e,children:(0,w.W0)(e)},e))]})}),(0,t.jsx)(p.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(y.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(p.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsx)(k.Z,{})}),(0,t.jsx)(p.Z.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(N.Z,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,t.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,t.jsx)(i.z,{variant:"secondary",type:"button",onClick:l,children:"Cancel"}),(0,t.jsx)(i.z,{type:"submit",children:"Save Changes"})]})]})}var U=l(9114);let{Text:I,Title:D}=n.default;var z=e=>{let{visible:s,onCancel:l,selectedUsers:a,possibleUIRoles:i,accessToken:n,onSuccess:p,teams:f,userRole:y,userModels:b,allowAllUsers:_=!1}=e,[N,w]=(0,r.useState)(!1),[S,Z]=(0,r.useState)([]),[k,z]=(0,r.useState)(null),[A,B]=(0,r.useState)(!1),[L,E]=(0,r.useState)(!1),T=()=>{Z([]),z(null),B(!1),E(!1),l()},O=r.useMemo(()=>({user_id:"bulk_edit",user_info:{user_email:"",user_role:"",teams:[],models:[],max_budget:null,spend:0,metadata:{},created_at:null,updated_at:null},keys:[],teams:f||[]}),[f,s]),F=async e=>{if(console.log("formValues",e),!n){U.Z.fromBackend("Access token not found");return}w(!0);try{let s=a.map(e=>e.user_id),t={};e.user_role&&""!==e.user_role&&(t.user_role=e.user_role),null!==e.max_budget&&void 0!==e.max_budget&&(t.max_budget=e.max_budget),e.models&&e.models.length>0&&(t.models=e.models),e.budget_duration&&""!==e.budget_duration&&(t.budget_duration=e.budget_duration),e.metadata&&Object.keys(e.metadata).length>0&&(t.metadata=e.metadata);let r=Object.keys(t).length>0,i=A&&S.length>0;if(!r&&!i){U.Z.fromBackend("Please modify at least one field or select teams to add users to");return}let o=[];if(r){if(L){let e=await (0,j.userBulkUpdateUserCall)(n,t,void 0,!0);o.push("Updated all users (".concat(e.total_requested," total)"))}else await (0,j.userBulkUpdateUserCall)(n,t,s),o.push("Updated ".concat(s.length," user(s)"))}if(i){let e=[];for(let s of S)try{let l=null;L?l=null:a.map(e=>({user_id:e.user_id,role:"user",user_email:e.user_email||null}));let t=await (0,j.teamBulkMemberAddCall)(n,s,l||null,k||void 0,L);console.log("result",t),e.push({teamId:s,success:!0,successfulAdditions:t.successful_additions,failedAdditions:t.failed_additions})}catch(l){console.error("Failed to add users to team ".concat(s,":"),l),e.push({teamId:s,success:!1,error:l})}let s=e.filter(e=>e.success),l=e.filter(e=>!e.success);if(s.length>0){let e=s.reduce((e,s)=>e+s.successfulAdditions,0);o.push("Added users to ".concat(s.length," team(s) (").concat(e," total additions)"))}l.length>0&&d.ZP.warning("Failed to add users to ".concat(l.length," team(s)"))}o.length>0&&U.Z.success(o.join(". ")),Z([]),z(null),B(!1),E(!1),p(),l()}catch(e){console.error("Bulk operation failed:",e),U.Z.fromBackend("Failed to perform bulk operations")}finally{w(!1)}};return(0,t.jsxs)(o.Z,{visible:s,onCancel:T,footer:null,title:L?"Bulk Edit All Users":"Bulk Edit ".concat(a.length," User(s)"),width:800,children:[_&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(c.Z,{checked:L,onChange:e=>E(e.target.checked),children:(0,t.jsx)(I,{strong:!0,children:"Update ALL users in the system"})}),L&&(0,t.jsx)("div",{style:{marginTop:8},children:(0,t.jsx)(I,{type:"warning",style:{fontSize:"12px"},children:"⚠️ This will apply changes to ALL users in the system, not just the selected ones."})})]}),!L&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)(D,{level:5,children:["Selected Users (",a.length,"):"]}),(0,t.jsx)(u.Z,{size:"small",bordered:!0,dataSource:a,pagination:!1,scroll:{y:200},rowKey:"user_id",columns:[{title:"User ID",dataIndex:"user_id",key:"user_id",width:"30%",render:e=>(0,t.jsx)(I,{strong:!0,style:{fontSize:"12px"},children:e.length>20?"".concat(e.slice(0,20),"..."):e})},{title:"Email",dataIndex:"user_email",key:"user_email",width:"25%",render:e=>(0,t.jsx)(I,{type:"secondary",style:{fontSize:"12px"},children:e||"No email"})},{title:"Current Role",dataIndex:"user_role",key:"user_role",width:"25%",render:e=>{var s;return(0,t.jsx)(I,{style:{fontSize:"12px"},children:(null==i?void 0:null===(s=i[e])||void 0===s?void 0:s.ui_label)||e})}},{title:"Budget",dataIndex:"max_budget",key:"max_budget",width:"20%",render:e=>(0,t.jsx)(I,{style:{fontSize:"12px"},children:null!==e?"$".concat(e):"Unlimited"})}]})]}),(0,t.jsx)(m.Z,{}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsxs)(I,{children:[(0,t.jsx)("strong",{children:"Instructions:"})," Fill in the fields below with the values you want to apply to all selected users. You can bulk edit: role, budget, models, and metadata. You can also add users to teams."]})}),(0,t.jsx)(x.Z,{title:"Team Management",size:"small",className:"mb-4",style:{backgroundColor:"#fafafa"},children:(0,t.jsxs)(h.Z,{direction:"vertical",style:{width:"100%"},children:[(0,t.jsx)(c.Z,{checked:A,onChange:e=>B(e.target.checked),children:"Add selected users to teams"}),A&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(I,{strong:!0,children:"Select Teams:"}),(0,t.jsx)(g.default,{mode:"multiple",placeholder:"Select teams to add users to",value:S,onChange:Z,style:{width:"100%",marginTop:8},options:(null==f?void 0:f.map(e=>({label:e.team_alias||e.team_id,value:e.team_id})))||[]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(I,{strong:!0,children:"Team Budget (Optional):"}),(0,t.jsx)(v.Z,{placeholder:"Max budget per user in team",value:k,onChange:e=>z(e),style:{width:"100%",marginTop:8},min:0,step:.01,precision:2}),(0,t.jsx)(I,{type:"secondary",style:{fontSize:"12px"},children:"Leave empty for unlimited budget within team limits"})]}),(0,t.jsx)(I,{type:"secondary",style:{fontSize:"12px"},children:'Users will be added with "user" role by default. All users will be added to each selected team.'})]})]})}),(0,t.jsx)(C,{userData:O,onCancel:T,onSubmit:F,teams:f,accessToken:n,userID:"bulk_edit",userRole:y,userModels:b,possibleUIRoles:i,isBulkEdit:!0}),N&&(0,t.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,t.jsxs)(I,{children:["Updating ",L?"all users":a.length," user(s)..."]})})]})},A=l(7765),B=l(5545),L=e=>{let{visible:s,possibleUIRoles:l,onCancel:a,user:i,onSubmit:n}=e,[d,c]=(0,r.useState)(i),[u]=p.Z.useForm();(0,r.useEffect)(()=>{u.resetFields()},[i]);let m=async()=>{u.resetFields(),a()},x=async e=>{n(e),u.resetFields(),a()};return i?(0,t.jsx)(o.Z,{visible:s,onCancel:m,footer:null,title:"Edit User "+i.user_id,width:1e3,children:(0,t.jsx)(p.Z,{form:u,onFinish:x,initialValues:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z.Item,{className:"mt-8",label:"User Email",tooltip:"Email of the User",name:"user_email",children:(0,t.jsx)(_.Z,{})}),(0,t.jsx)(p.Z.Item,{label:"user_id",name:"user_id",hidden:!0,children:(0,t.jsx)(_.Z,{})}),(0,t.jsx)(p.Z.Item,{label:"User Role",name:"user_role",children:(0,t.jsx)(g.default,{children:l&&Object.entries(l).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(b.Z,{value:s,title:l,children:(0,t.jsxs)("div",{className:"flex",children:[l," ",(0,t.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:a})]})},s)})})}),(0,t.jsx)(p.Z.Item,{label:"Spend (USD)",name:"spend",tooltip:"(float) - Spend of all LLM calls completed by this user",help:"Across all keys (including keys with team_id).",children:(0,t.jsx)(v.Z,{min:0,step:.01})}),(0,t.jsx)(p.Z.Item,{label:"User Budget (USD)",name:"max_budget",tooltip:"(float) - Maximum budget of this user",help:"Maximum budget of this user.",children:(0,t.jsx)(y.Z,{min:0,step:.01})}),(0,t.jsx)(p.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsx)(k.Z,{})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(B.ZP,{htmlType:"submit",children:"Save"})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(B.ZP,{htmlType:"submit",children:"Save"})})]})})}):null},E=l(98187),T=l(59872),O=l(19616),F=l(29827),M=l(11713),R=l(21609),P=l(88913),K=l(63709),V=l(10353),q=l(26349),G=l(96473),J=e=>{var s;let{accessToken:l,possibleUIRoles:a,userID:i,userRole:d}=e,[o,c]=(0,r.useState)(!0),[u,m]=(0,r.useState)(null),[x,h]=(0,r.useState)(!1),[p,f]=(0,r.useState)({}),[y,b]=(0,r.useState)(!1),[_,N]=(0,r.useState)([]),{Paragraph:S}=n.default,{Option:Z}=g.default;(0,r.useEffect)(()=>{(async()=>{if(!l){c(!1);return}try{let e=await (0,j.getInternalUserSettings)(l);if(m(e),f(e.values||{}),l)try{let e=await (0,j.modelAvailableCall)(l,i,d);if(e&&e.data){let s=e.data.map(e=>e.id);N(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching SSO settings:",e),U.Z.fromBackend("Failed to fetch SSO settings")}finally{c(!1)}})()},[l]);let C=async()=>{if(l){b(!0);try{let e=Object.entries(p).reduce((e,s)=>{let[l,t]=s;return e[l]=""===t?null:t,e},{}),s=await (0,j.updateInternalUserSettings)(l,e);m({...u,values:s.settings}),h(!1)}catch(e){console.error("Error updating SSO settings:",e),U.Z.fromBackend("Failed to update settings: "+e)}finally{b(!1)}}},I=(e,s)=>{f(l=>({...l,[e]:s}))},D=e=>e&&Array.isArray(e)?e.map(e=>"string"==typeof e?{team_id:e,user_role:"user"}:"object"==typeof e&&e.team_id?{team_id:e.team_id,max_budget_in_team:e.max_budget_in_team,user_role:e.user_role||"user"}:{team_id:"",user_role:"user"}):[],z=e=>{let s=D(e),l=(e,l,t)=>{let a=[...s];a[e]={...a[e],[l]:t},I("teams",a)},a=e=>{I("teams",s.filter((s,l)=>l!==e))};return(0,t.jsxs)("div",{className:"space-y-3",children:[s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg p-4 bg-gray-50",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsxs)(P.xv,{className:"font-medium",children:["Team ",s+1]}),(0,t.jsx)(P.zx,{size:"sm",variant:"secondary",icon:q.Z,onClick:()=>a(s),className:"text-red-500 hover:text-red-700",children:"Remove"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(P.xv,{className:"text-sm font-medium mb-1",children:"Team ID"}),(0,t.jsx)(P.oi,{value:e.team_id,onChange:e=>l(s,"team_id",e.target.value),placeholder:"Enter team ID"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(P.xv,{className:"text-sm font-medium mb-1",children:"Max Budget in Team"}),(0,t.jsx)(v.Z,{style:{width:"100%"},value:e.max_budget_in_team,onChange:e=>l(s,"max_budget_in_team",e),placeholder:"Optional",min:0,step:.01,precision:2})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(P.xv,{className:"text-sm font-medium mb-1",children:"User Role"}),(0,t.jsxs)(g.default,{style:{width:"100%"},value:e.user_role,onChange:e=>l(s,"user_role",e),children:[(0,t.jsx)(Z,{value:"user",children:"User"}),(0,t.jsx)(Z,{value:"admin",children:"Admin"})]})]})]})]},s)),(0,t.jsx)(P.zx,{variant:"secondary",icon:G.Z,onClick:()=>{I("teams",[...s,{team_id:"",user_role:"user"}])},className:"w-full",children:"Add Team"})]})},A=(e,s,l)=>{var r;let i=s.type;if("teams"===e)return(0,t.jsx)("div",{className:"mt-2",children:z(p[e]||[])});if("user_role"===e&&a)return(0,t.jsx)(g.default,{style:{width:"100%"},value:p[e]||"",onChange:s=>I(e,s),className:"mt-2",children:Object.entries(a).filter(e=>{let[s]=e;return s.includes("internal_user")}).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(Z,{value:s,children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{children:l}),(0,t.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:a})]})},s)})});if("budget_duration"===e)return(0,t.jsx)(k.Z,{value:p[e]||null,onChange:s=>I(e,s),className:"mt-2"});if("boolean"===i)return(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(K.Z,{checked:!!p[e],onChange:s=>I(e,s)})});if("array"===i&&(null===(r=s.items)||void 0===r?void 0:r.enum))return(0,t.jsx)(g.default,{mode:"multiple",style:{width:"100%"},value:p[e]||[],onChange:s=>I(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,t.jsx)(Z,{value:e,children:e},e))});if("models"===e)return(0,t.jsxs)(g.default,{mode:"multiple",style:{width:"100%"},value:p[e]||[],onChange:s=>I(e,s),className:"mt-2",children:[(0,t.jsx)(Z,{value:"no-default-models",children:"No Default Models"},"no-default-models"),_.map(e=>(0,t.jsx)(Z,{value:e,children:(0,w.W0)(e)},e))]});if("string"===i&&s.enum)return(0,t.jsx)(g.default,{style:{width:"100%"},value:p[e]||"",onChange:s=>I(e,s),className:"mt-2",children:s.enum.map(e=>(0,t.jsx)(Z,{value:e,children:e},e))});else return(0,t.jsx)(P.oi,{value:void 0!==p[e]?String(p[e]):"",onChange:s=>I(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},B=(e,s)=>{if(null==s)return(0,t.jsx)("span",{className:"text-gray-400",children:"Not set"});if("teams"===e&&Array.isArray(s)){if(0===s.length)return(0,t.jsx)("span",{className:"text-gray-400",children:"No teams assigned"});let e=D(s);return(0,t.jsx)("div",{className:"space-y-2 mt-1",children:e.map((e,s)=>(0,t.jsx)("div",{className:"border rounded-lg p-3 bg-white",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Team ID:"}),(0,t.jsx)("p",{className:"text-gray-900",children:e.team_id||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Max Budget:"}),(0,t.jsx)("p",{className:"text-gray-900",children:void 0!==e.max_budget_in_team?"$".concat((0,T.pw)(e.max_budget_in_team,4)):"No limit"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Role:"}),(0,t.jsx)("p",{className:"text-gray-900 capitalize",children:e.user_role})]})]})},s))})}if("user_role"===e&&a&&a[s]){let{ui_label:e,description:l}=a[s];return(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium",children:e}),l&&(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:l})]})}return"budget_duration"===e?(0,t.jsx)("span",{children:(0,k.m)(s)}):"boolean"==typeof s?(0,t.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,t.jsx)("span",{className:"text-gray-400",children:"None"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,w.W0)(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,t.jsx)("span",{className:"text-gray-400",children:"None"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,t.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,t.jsx)("span",{children:String(s)})};return o?(0,t.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,t.jsx)(V.Z,{size:"large"})}):u?(0,t.jsxs)(P.Zb,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(P.Dx,{children:"Default User Settings"}),!o&&u&&(x?(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(P.zx,{variant:"secondary",onClick:()=>{h(!1),f(u.values||{})},disabled:y,children:"Cancel"}),(0,t.jsx)(P.zx,{onClick:C,loading:y,children:"Save Changes"})]}):(0,t.jsx)(P.zx,{onClick:()=>h(!0),children:"Edit Settings"}))]}),(null==u?void 0:null===(s=u.field_schema)||void 0===s?void 0:s.description)&&(0,t.jsx)(S,{className:"mb-4",children:u.field_schema.description}),(0,t.jsx)(P.iz,{}),(0,t.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=u;return s&&s.properties?Object.entries(s.properties).map(s=>{let[l,a]=s,r=e[l],i=l.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,t.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,t.jsx)(P.xv,{className:"font-medium text-lg",children:i}),(0,t.jsx)(S,{className:"text-sm text-gray-500 mt-1",children:a.description||"No description available"}),x?(0,t.jsx)("div",{className:"mt-2",children:A(l,a,r)}):(0,t.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:B(l,r)})]},l)}):(0,t.jsx)(P.xv,{children:"No schema information available"})})()})]}):(0,t.jsx)(P.Zb,{children:(0,t.jsx)(P.xv,{children:"No settings available or you do not have permission to view them."})})},W=l(41649),Q=l(67101),$=l(47323),H=l(15731),Y=l(53410),X=l(74998),ee=l(23628);let es=(e,s,l,a,r,i)=>{let n=[{header:"User ID",accessorKey:"user_id",enableSorting:!0,cell:e=>{let{row:s}=e;return(0,t.jsx)(f.Z,{title:s.original.user_id,children:(0,t.jsx)("span",{className:"text-xs",children:s.original.user_id?"".concat(s.original.user_id.slice(0,7),"..."):"-"})})}},{header:"Email",accessorKey:"user_email",enableSorting:!0,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.user_email||"-"})}},{header:"Global Proxy Role",accessorKey:"user_role",enableSorting:!0,cell:s=>{var l;let{row:a}=s;return(0,t.jsx)("span",{className:"text-xs",children:(null==e?void 0:null===(l=e[a.original.user_role])||void 0===l?void 0:l.ui_label)||"-"})}},{header:"User Alias",accessorKey:"user_alias",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.user_alias||"-"})}},{header:"Spend (USD)",accessorKey:"spend",enableSorting:!0,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.spend?(0,T.pw)(s.original.spend,4):"-"})}},{header:"Budget (USD)",accessorKey:"max_budget",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:null!==s.original.max_budget?s.original.max_budget:"Unlimited"})}},{header:()=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{children:"SSO ID"}),(0,t.jsx)(f.Z,{title:"SSO ID is the ID of the user in the SSO provider. If the user is not using SSO, this will be null.",children:(0,t.jsx)(H.Z,{className:"w-4 h-4"})})]}),accessorKey:"sso_user_id",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:null!==s.original.sso_user_id?s.original.sso_user_id:"-"})}},{header:"Virtual Keys",accessorKey:"key_count",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)(Q.Z,{numItems:2,children:s.original.key_count>0?(0,t.jsxs)(W.Z,{size:"xs",color:"indigo",children:[s.original.key_count," ",1===s.original.key_count?"Key":"Keys"]}):(0,t.jsx)(W.Z,{size:"xs",color:"gray",children:"No Keys"})})}},{header:"Created At",accessorKey:"created_at",enableSorting:!0,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.created_at?new Date(s.original.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.updated_at?new Date(s.original.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"Actions",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(f.Z,{title:"Edit user details",children:(0,t.jsx)($.Z,{icon:Y.Z,size:"sm",onClick:()=>r(s.original.user_id,!0),className:"cursor-pointer hover:text-blue-600"})}),(0,t.jsx)(f.Z,{title:"Delete user",children:(0,t.jsx)($.Z,{icon:X.Z,size:"sm",onClick:()=>l(s.original),className:"cursor-pointer hover:text-red-600"})}),(0,t.jsx)(f.Z,{title:"Reset Password",children:(0,t.jsx)($.Z,{icon:ee.Z,size:"sm",onClick:()=>a(s.original.user_id),className:"cursor-pointer hover:text-green-600"})})]})}}];if(i){let{onSelectUser:e,onSelectAll:s,isUserSelected:l,isAllSelected:a,isIndeterminate:r}=i;return[{id:"select",enableSorting:!1,header:()=>(0,t.jsx)(c.Z,{indeterminate:r,checked:a,onChange:e=>s(e.target.checked),onClick:e=>e.stopPropagation()}),cell:s=>{let{row:a}=s;return(0,t.jsx)(c.Z,{checked:l(a.original),onChange:s=>e(a.original,s.target.checked),onClick:e=>e.stopPropagation()})}},...n]}return n};var el=l(71594),et=l(24525),ea=l(27281),er=l(21626),ei=l(97214),en=l(28241),ed=l(58834),eo=l(69552),ec=l(71876),eu=l(44633),em=l(86462),ex=l(49084),eh=l(50337),eg=l(84717),ev=l(10900),ej=l(30401),ep=l(78867);function ef(e){var s,l,a,i,n,d,o,c,u,m,x,h,g,v,p,f,y,b,_,N,w,Z,I,D,z,A,L,O,F,M,R,P,K,V,q,G,J,W,Q;let{userId:$,onClose:H,accessToken:Y,userRole:es,onDelete:el,possibleUIRoles:et,initialTab:ea=0,startInEditMode:er=!1}=e,[ei,en]=(0,r.useState)(null),[ed,eo]=(0,r.useState)(!1),[ec,eu]=(0,r.useState)(!0),[em,ex]=(0,r.useState)(er),[eh,ef]=(0,r.useState)([]),[ey,eb]=(0,r.useState)(!1),[e_,eN]=(0,r.useState)(null),[ew,eS]=(0,r.useState)(null),[eZ,ek]=(0,r.useState)(ea),[eC,eU]=(0,r.useState)({}),[eI,eD]=(0,r.useState)(!1);r.useEffect(()=>{eS((0,j.getProxyBaseUrl)())},[]),r.useEffect(()=>{console.log("userId: ".concat($,", userRole: ").concat(es,", accessToken: ").concat(Y)),(async()=>{try{if(!Y)return;let e=await (0,j.userInfoCall)(Y,$,es||"",!1,null,null,!0);en(e);let s=(await (0,j.modelAvailableCall)(Y,$,es||"")).data.map(e=>e.id);ef(s)}catch(e){console.error("Error fetching user data:",e),U.Z.fromBackend("Failed to fetch user data")}finally{eu(!1)}})()},[Y,$,es]);let ez=async()=>{if(!Y){U.Z.fromBackend("Access token not found");return}try{U.Z.success("Generating password reset link...");let e=await (0,j.invitationCreateCall)(Y,$);eN(e),eb(!0)}catch(e){U.Z.fromBackend("Failed to generate password reset link")}},eA=async()=>{try{if(!Y)return;await (0,j.userDeleteCall)(Y,[$]),U.Z.success("User deleted successfully"),el&&el(),H()}catch(e){console.error("Error deleting user:",e),U.Z.fromBackend("Failed to delete user")}},eB=async e=>{try{if(!Y||!ei)return;await (0,j.userUpdateUserCall)(Y,e,null),en({...ei,user_info:{...ei.user_info,user_email:e.user_email,user_alias:e.user_alias,models:e.models,max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:e.metadata}}),U.Z.success("User updated successfully"),ex(!1)}catch(e){console.error("Error updating user:",e),U.Z.fromBackend("Failed to update user")}};if(ec)return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)(eg.zx,{icon:ev.Z,variant:"light",onClick:H,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(eg.xv,{children:"Loading user data..."})]});if(!ei)return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)(eg.zx,{icon:ev.Z,variant:"light",onClick:H,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(eg.xv,{children:"User not found"})]});let eL=async(e,s)=>{await (0,T.vQ)(e)&&(eU(e=>({...e,[s]:!0})),setTimeout(()=>{eU(e=>({...e,[s]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.zx,{icon:ev.Z,variant:"light",onClick:H,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(eg.Dx,{children:(null===(s=ei.user_info)||void 0===s?void 0:s.user_email)||"User"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(eg.xv,{className:"text-gray-500 font-mono",children:ei.user_id}),(0,t.jsx)(B.ZP,{type:"text",size:"small",icon:eC["user-id"]?(0,t.jsx)(ej.Z,{size:12}):(0,t.jsx)(ep.Z,{size:12}),onClick:()=>eL(ei.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eC["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),es&&S.LQ.includes(es)&&(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(eg.zx,{icon:ee.Z,variant:"secondary",onClick:ez,className:"flex items-center",children:"Reset Password"}),(0,t.jsx)(eg.zx,{icon:X.Z,variant:"secondary",onClick:()=>eo(!0),className:"flex items-center",children:"Delete User"})]})]}),ed&&(0,t.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,t.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,t.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,t.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,t.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,t.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,t.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,t.jsx)("div",{className:"sm:flex sm:items-start",children:(0,t.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,t.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete User"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this user?"})})]})})}),(0,t.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,t.jsx)(eg.zx,{onClick:eA,color:"red",className:"ml-2",children:"Delete"}),(0,t.jsx)(eg.zx,{onClick:()=>eo(!1),children:"Cancel"})]})]})]})}),(0,t.jsxs)(eg.v0,{defaultIndex:eZ,onIndexChange:ek,children:[(0,t.jsxs)(eg.td,{className:"mb-4",children:[(0,t.jsx)(eg.OK,{children:"Overview"}),(0,t.jsx)(eg.OK,{children:"Details"})]}),(0,t.jsxs)(eg.nP,{children:[(0,t.jsx)(eg.x4,{children:(0,t.jsxs)(eg.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(eg.Zb,{children:[(0,t.jsx)(eg.xv,{children:"Spend"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(eg.Dx,{children:["$",(0,T.pw)((null===(l=ei.user_info)||void 0===l?void 0:l.spend)||0,4)]}),(0,t.jsxs)(eg.xv,{children:["of"," ",(null===(a=ei.user_info)||void 0===a?void 0:a.max_budget)!==null?"$".concat((0,T.pw)(ei.user_info.max_budget,4)):"Unlimited"]})]})]}),(0,t.jsxs)(eg.Zb,{children:[(0,t.jsx)(eg.xv,{children:"Teams"}),(0,t.jsx)("div",{className:"mt-2",children:(null===(i=ei.teams)||void 0===i?void 0:i.length)&&(null===(n=ei.teams)||void 0===n?void 0:n.length)>0?(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[null===(d=ei.teams)||void 0===d?void 0:d.slice(0,eI?ei.teams.length:20).map((e,s)=>(0,t.jsx)(eg.Ct,{color:"blue",title:e.team_alias,children:e.team_alias},s)),!eI&&(null===(o=ei.teams)||void 0===o?void 0:o.length)>20&&(0,t.jsxs)(eg.Ct,{color:"gray",className:"cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eD(!0),children:["+",ei.teams.length-20," more"]}),eI&&(null===(c=ei.teams)||void 0===c?void 0:c.length)>20&&(0,t.jsx)(eg.Ct,{color:"gray",className:"cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eD(!1),children:"Show Less"})]}):(0,t.jsx)(eg.xv,{children:"No teams"})})]}),(0,t.jsxs)(eg.Zb,{children:[(0,t.jsx)(eg.xv,{children:"Virtual Keys"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsxs)(eg.xv,{children:[(null===(u=ei.keys)||void 0===u?void 0:u.length)||0," ",(null===(m=ei.keys)||void 0===m?void 0:m.length)===1?"Key":"Keys"]})})]}),(0,t.jsxs)(eg.Zb,{children:[(0,t.jsx)(eg.xv,{children:"Personal Models"}),(0,t.jsx)("div",{className:"mt-2",children:(null===(h=ei.user_info)||void 0===h?void 0:null===(x=h.models)||void 0===x?void 0:x.length)&&(null===(v=ei.user_info)||void 0===v?void 0:null===(g=v.models)||void 0===g?void 0:g.length)>0?null===(f=ei.user_info)||void 0===f?void 0:null===(p=f.models)||void 0===p?void 0:p.map((e,s)=>(0,t.jsx)(eg.xv,{children:e},s)):(0,t.jsx)(eg.xv,{children:"All proxy models"})})]})]})}),(0,t.jsx)(eg.x4,{children:(0,t.jsxs)(eg.Zb,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(eg.Dx,{children:"User Settings"}),!em&&es&&S.LQ.includes(es)&&(0,t.jsx)(eg.zx,{onClick:()=>ex(!0),children:"Edit Settings"})]}),em&&ei?(0,t.jsx)(C,{userData:ei,onCancel:()=>ex(!1),onSubmit:eB,teams:ei.teams,accessToken:Y,userID:$,userRole:es,userModels:eh,possibleUIRoles:et}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"User ID"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(eg.xv,{className:"font-mono",children:ei.user_id}),(0,t.jsx)(B.ZP,{type:"text",size:"small",icon:eC["user-id"]?(0,t.jsx)(ej.Z,{size:12}):(0,t.jsx)(ep.Z,{size:12}),onClick:()=>eL(ei.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eC["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Email"}),(0,t.jsx)(eg.xv,{children:(null===(y=ei.user_info)||void 0===y?void 0:y.user_email)||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"User Alias"}),(0,t.jsx)(eg.xv,{children:(null===(b=ei.user_info)||void 0===b?void 0:b.user_alias)||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Global Proxy Role"}),(0,t.jsx)(eg.xv,{children:(null===(_=ei.user_info)||void 0===_?void 0:_.user_role)||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Created"}),(0,t.jsx)(eg.xv,{children:(null===(N=ei.user_info)||void 0===N?void 0:N.created_at)?new Date(ei.user_info.created_at).toLocaleString():"Unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Last Updated"}),(0,t.jsx)(eg.xv,{children:(null===(w=ei.user_info)||void 0===w?void 0:w.updated_at)?new Date(ei.user_info.updated_at).toLocaleString():"Unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Teams"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(Z=ei.teams)||void 0===Z?void 0:Z.length)&&(null===(I=ei.teams)||void 0===I?void 0:I.length)>0?(0,t.jsxs)(t.Fragment,{children:[null===(D=ei.teams)||void 0===D?void 0:D.slice(0,eI?ei.teams.length:20).map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",title:e.team_alias||e.team_id,children:e.team_alias||e.team_id},s)),!eI&&(null===(z=ei.teams)||void 0===z?void 0:z.length)>20&&(0,t.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded text-xs cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eD(!0),children:["+",ei.teams.length-20," more"]}),eI&&(null===(A=ei.teams)||void 0===A?void 0:A.length)>20&&(0,t.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded text-xs cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eD(!1),children:"Show Less"})]}):(0,t.jsx)(eg.xv,{children:"No teams"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Personal Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(O=ei.user_info)||void 0===O?void 0:null===(L=O.models)||void 0===L?void 0:L.length)&&(null===(M=ei.user_info)||void 0===M?void 0:null===(F=M.models)||void 0===F?void 0:F.length)>0?null===(P=ei.user_info)||void 0===P?void 0:null===(R=P.models)||void 0===R?void 0:R.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,t.jsx)(eg.xv,{children:"All proxy models"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Virtual Keys"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(K=ei.keys)||void 0===K?void 0:K.length)&&(null===(V=ei.keys)||void 0===V?void 0:V.length)>0?ei.keys.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-green-100 rounded text-xs",children:e.key_alias||e.token},s)):(0,t.jsx)(eg.xv,{children:"No Virtual Keys"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Max Budget"}),(0,t.jsx)(eg.xv,{children:(null===(q=ei.user_info)||void 0===q?void 0:q.max_budget)!==null&&(null===(G=ei.user_info)||void 0===G?void 0:G.max_budget)!==void 0?"$".concat((0,T.pw)(ei.user_info.max_budget,4)):"Unlimited"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Budget Reset"}),(0,t.jsx)(eg.xv,{children:(0,k.m)(null!==(Q=null===(J=ei.user_info)||void 0===J?void 0:J.budget_duration)&&void 0!==Q?Q:null)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Metadata"}),(0,t.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify((null===(W=ei.user_info)||void 0===W?void 0:W.metadata)||{},null,2)})]})]})]})})]})]}),(0,t.jsx)(E.Z,{isInvitationLinkModalVisible:ey,setIsInvitationLinkModalVisible:eb,baseUrl:ew||"",invitationLinkData:e_,modalType:"resetPassword"})]})}function ey(e){let{data:s=[],columns:l,isLoading:a=!1,onSortChange:i,currentSort:n,accessToken:d,userRole:o,possibleUIRoles:c,handleEdit:u,handleDelete:m,handleResetPassword:x,selectedUsers:h=[],onSelectionChange:g,enableSelection:v=!1,filters:j,updateFilters:p,initialFilters:f,teams:y,userListResponse:_,currentPage:N,handlePageChange:w}=e,[S,Z]=r.useState([{id:(null==n?void 0:n.sortBy)||"created_at",desc:(null==n?void 0:n.sortOrder)==="desc"}]),[k,C]=r.useState(null),[U,I]=r.useState(!1),[D,z]=r.useState(!1),A=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];C(e),I(s)},B=(e,s)=>{g&&(s?g([...h,e]):g(h.filter(s=>s.user_id!==e.user_id)))},L=e=>{g&&(e?g(s):g([]))},E=e=>h.some(s=>s.user_id===e.user_id),T=s.length>0&&h.length===s.length,O=h.length>0&&h.lengthc?es(c,u,m,x,A,v?{selectedUsers:h,onSelectUser:B,onSelectAll:L,isUserSelected:E,isAllSelected:T,isIndeterminate:O}:void 0):l,[c,u,m,x,A,l,v,h,T,O]),M=(0,el.b7)({data:s,columns:F,state:{sorting:S},onSortingChange:e=>{let s="function"==typeof e?e(S):e;if(Z(s),s&&Array.isArray(s)&&s.length>0&&s[0]){let e=s[0];if(e.id){let s=e.id,l=e.desc?"desc":"asc";null==i||i(s,l)}}else null==i||i("created_at","desc")},getCoreRowModel:(0,et.sC)(),manualSorting:!0,enableSorting:!0});return(r.useEffect(()=>{n&&Z([{id:n.sortBy,desc:"desc"===n.sortOrder}])},[n]),k)?(0,t.jsx)(ef,{userId:k,onClose:()=>{C(null),I(!1)},accessToken:d,userRole:o,possibleUIRoles:c,initialTab:U?1:0,startInEditMode:U}):(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsx)("div",{className:"border-b px-6 py-4",children:(0,t.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsxs)("div",{className:"relative w-64",children:[(0,t.jsx)("input",{type:"text",placeholder:"Search by email...",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:j.email,onChange:e=>p({email: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)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(D?"bg-gray-100":""),onClick:()=>z(!D),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:"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"})}),"Filters",(j.user_id||j.user_role||j.team)&&(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,t.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{p(f)},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:"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"})}),"Reset Filters"]})]}),D&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,t.jsxs)("div",{className:"relative w-64",children:[(0,t.jsx)("input",{type:"text",placeholder:"Filter by User 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:j.user_id,onChange:e=>p({user_id: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:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,t.jsx)("div",{className:"w-64",children:(0,t.jsx)(ea.Z,{value:j.user_role,onValueChange:e=>p({user_role:e}),placeholder:"Select Role",children:c&&Object.entries(c).map(e=>{let[s,l]=e;return(0,t.jsx)(b.Z,{value:s,children:l.ui_label},s)})})}),(0,t.jsx)("div",{className:"w-64",children:(0,t.jsx)(ea.Z,{value:j.team,onValueChange:e=>p({team:e}),placeholder:"Select Team",children:null==y?void 0:y.map(e=>(0,t.jsx)(b.Z,{value:e.team_id,children:e.team_alias||e.team_id},e.team_id))})}),(0,t.jsx)("div",{className:"relative w-64",children:(0,t.jsx)("input",{type:"text",placeholder:"Filter by SSO 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:j.sso_user_id,onChange:e=>p({sso_user_id:e.target.value})})})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[a?(0,t.jsx)(eh.Z.Input,{active:!0,style:{width:192,height:20}}):(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",_&&_.users&&_.users.length>0?(_.page-1)*_.page_size+1:0," ","-"," ",_&&_.users?Math.min(_.page*_.page_size,_.total):0," ","of ",_?_.total:0," results"]}),(0,t.jsx)("div",{className:"flex space-x-2",children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eh.Z.Button,{active:!0,size:"small",style:{width:80,height:30}}),(0,t.jsx)(eh.Z.Button,{active:!0,size:"small",style:{width:60,height:30}})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>w(N-1),disabled:1===N,className:"px-3 py-1 text-sm border rounded-md ".concat(1===N?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,t.jsx)("button",{onClick:()=>w(N+1),disabled:!_||N>=_.total_pages,className:"px-3 py-1 text-sm border rounded-md ".concat(!_||N>=_.total_pages?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})})]})]})}),(0,t.jsx)("div",{className:"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)(er.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(ed.Z,{children:M.getHeaderGroups().map(e=>(0,t.jsx)(ec.Z,{children:e.headers.map(e=>(0,t.jsx)(eo.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""," ").concat(e.column.getCanSort()?"cursor-pointer hover:bg-gray-50":""),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,el.ie)(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)(eu.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(em.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(ex.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,t.jsx)(ei.Z,{children:a?(0,t.jsx)(ec.Z,{children:(0,t.jsx)(en.Z,{colSpan:F.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"\uD83D\uDE85 Loading users..."})})})}):s.length>0?M.getRowModel().rows.map(e=>(0,t.jsx)(ec.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(en.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:()=>{"user_id"===e.column.id&&A(e.getValue(),!1)},style:{cursor:"user_id"===e.column.id?"pointer":"default",color:"user_id"===e.column.id?"#3b82f6":"inherit"},children:(0,el.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(ec.Z,{children:(0,t.jsx)(en.Z,{colSpan:F.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No users found"})})})})})]})})})})]})}let{Text:eb,Title:e_}=n.default,eN={email:"",user_id:"",user_role:"",sso_user_id:"",team:"",model:"",min_spend:null,max_spend:null,sort_by:"created_at",sort_order:"desc"};var ew=e=>{var s,l,n;let{accessToken:d,token:o,userRole:c,userID:u,teams:m}=e,x=(0,F.NL)(),[h,g]=(0,r.useState)(1),[v,p]=(0,r.useState)(!1),[f,y]=(0,r.useState)(null),[b,_]=(0,r.useState)(!1),[N,w]=(0,r.useState)(!1),[Z,k]=(0,r.useState)(null),[C,I]=(0,r.useState)("users"),[D,B]=(0,r.useState)(eN),[P,K,V]=(0,O.G)(D,{wait:300}),[q,G]=(0,r.useState)(!1),[W,Q]=(0,r.useState)(null),[$,H]=(0,r.useState)(null),[Y,X]=(0,r.useState)([]),[ee,el]=(0,r.useState)(!1),[et,ea]=(0,r.useState)(!1),[er,ei]=(0,r.useState)([]),en=e=>{k(e),_(!0)};(0,r.useEffect)(()=>()=>{V.cancel()},[V]),(0,r.useEffect)(()=>{H((0,j.getProxyBaseUrl)())},[]),(0,r.useEffect)(()=>{(async()=>{try{if(!u||!c||!d)return;let e=(await (0,j.modelAvailableCall)(d,u,c)).data.map(e=>e.id);console.log("available_model_names:",e),ei(e)}catch(e){console.error("Error fetching user models:",e)}})()},[d,u,c]);let ed=e=>{B(s=>{let l={...s,...e};return K(l),l})},eo=async e=>{if(!d){U.Z.fromBackend("Access token not found");return}try{U.Z.success("Generating password reset link...");let s=await (0,j.invitationCreateCall)(d,e);Q(s),G(!0)}catch(e){U.Z.fromBackend("Failed to generate password reset link")}},ec=async()=>{if(Z&&d)try{w(!0),await (0,j.userDeleteCall)(d,[Z.user_id]),x.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let s=e.users.filter(e=>e.user_id!==Z.user_id);return{...e,users:s}}),U.Z.success("User deleted successfully")}catch(e){console.error("Error deleting user:",e),U.Z.fromBackend("Failed to delete user")}finally{_(!1),k(null),w(!1)}},eu=async()=>{y(null),p(!1)},em=async e=>{if(console.log("inside handleEditSubmit:",e),d&&o&&c&&u){try{let s=await (0,j.userUpdateUserCall)(d,e,null);x.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let l=e.users.map(e=>e.user_id===s.data.user_id?(0,T.nl)(e,s.data):e);return{...e,users:l}}),U.Z.success("User ".concat(e.user_id," updated successfully"))}catch(e){console.error("There was an error updating the user",e)}y(null),p(!1)}},ex=async e=>{g(e)},eg=(0,M.a)({queryKey:["userList",{debouncedFilter:P,currentPage:h}],queryFn:async()=>{if(!d)throw Error("Access token required");return await (0,j.userListCall)(d,P.user_id?[P.user_id]:null,h,25,P.email||null,P.user_role||null,P.team||null,P.sso_user_id||null,P.sort_by,P.sort_order)},enabled:!!(d&&o&&c&&u),placeholderData:e=>e}),ev=eg.data,ej=(0,M.a)({queryKey:["userRoles"],initialData:()=>({}),queryFn:async()=>{if(!d)throw Error("Access token required");return await (0,j.getPossibleUserRoles)(d)},enabled:!!(d&&o&&c&&u)}).data,ep=es(ej,e=>{y(e),p(!0)},en,eo,()=>{});return(0,t.jsxs)("div",{className:"w-full p-8 overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,t.jsx)("div",{className:"flex space-x-3",children:eg.isLoading?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eh.Z.Button,{active:!0,size:"default",shape:"default",style:{width:110,height:36}}),(0,t.jsx)(eh.Z.Button,{active:!0,size:"default",shape:"default",style:{width:145,height:36}}),(0,t.jsx)(eh.Z.Button,{active:!0,size:"default",shape:"default",style:{width:110,height:36}})]}):u&&d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A.Z,{userID:u,accessToken:d,teams:m,possibleUIRoles:ej}),(0,t.jsx)(i.z,{onClick:()=>{ea(!et),X([])},variant:et?"primary":"secondary",className:"flex items-center",children:et?"Cancel Selection":"Select Users"}),et&&(0,t.jsxs)(i.z,{onClick:()=>{if(0===Y.length){U.Z.fromBackend("Please select users to edit");return}el(!0)},disabled:0===Y.length,className:"flex items-center",children:["Bulk Edit (",Y.length," selected)"]})]}):null})}),(0,t.jsxs)(a.v0,{defaultIndex:0,onIndexChange:e=>I(0===e?"users":"settings"),children:[(0,t.jsxs)(a.td,{className:"mb-4",children:[(0,t.jsx)(a.OK,{children:"Users"}),(0,t.jsx)(a.OK,{children:"Default User Settings"})]}),(0,t.jsxs)(a.nP,{children:[(0,t.jsx)(a.x4,{children:(0,t.jsx)(ey,{data:(null===(s=eg.data)||void 0===s?void 0:s.users)||[],columns:ep,isLoading:eg.isLoading,accessToken:d,userRole:c,onSortChange:(e,s)=>{ed({sort_by:e,sort_order:s})},currentSort:{sortBy:D.sort_by,sortOrder:D.sort_order},possibleUIRoles:ej,handleEdit:e=>{y(e),p(!0)},handleDelete:en,handleResetPassword:eo,enableSelection:et,selectedUsers:Y,onSelectionChange:e=>{X(e)},filters:D,updateFilters:ed,initialFilters:eN,teams:m,userListResponse:ev,currentPage:h,handlePageChange:ex})}),(0,t.jsx)(a.x4,{children:u&&c&&d?(0,t.jsx)(J,{accessToken:d,possibleUIRoles:ej,userID:u,userRole:c}):(0,t.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,t.jsx)(eh.Z,{active:!0,paragraph:{rows:4}})})})]})]}),(0,t.jsx)(L,{visible:v,possibleUIRoles:ej,onCancel:eu,user:f,onSubmit:em}),(0,t.jsx)(R.Z,{isOpen:b,title:"Delete User?",message:"Are you sure you want to delete this user? This action cannot be undone.",resourceInformationTitle:"User Information",resourceInformation:[{label:"Email",value:null==Z?void 0:Z.user_email},{label:"User ID",value:null==Z?void 0:Z.user_id,code:!0},{label:"Global Proxy Role",value:Z&&(null==ej?void 0:null===(l=ej[Z.user_role])||void 0===l?void 0:l.ui_label)||(null==Z?void 0:Z.user_role)||"-"},{label:"Total Spend (USD)",value:null==Z?void 0:null===(n=Z.spend)||void 0===n?void 0:n.toFixed(2)}],onCancel:()=>{_(!1),k(null)},onOk:ec,confirmLoading:N}),(0,t.jsx)(E.Z,{isInvitationLinkModalVisible:q,setIsInvitationLinkModalVisible:G,baseUrl:$||"",invitationLinkData:W,modalType:"resetPassword"}),(0,t.jsx)(z,{visible:ee,onCancel:()=>el(!1),selectedUsers:Y,possibleUIRoles:ej,accessToken:d,onSuccess:()=>{x.invalidateQueries({queryKey:["userList"]}),X([]),ea(!1)},teams:m,userRole:c,userModels:er,allowAllUsers:!!c&&(0,S.tY)(c)})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7448-90fa7495684d6da9.js b/litellm/proxy/_experimental/out/_next/static/chunks/7448-90fa7495684d6da9.js new file mode 100644 index 00000000000..59d227f6d62 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/7448-90fa7495684d6da9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7448],{29271:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(1119),a=r(2265),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 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},i=r(55015),l=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:o}))})},92403:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(1119),a=r(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"},i=r(55015),l=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:o}))})},62272:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(1119),a=r(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},i=r(55015),l=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:o}))})},34419:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(1119),a=r(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},i=r(55015),l=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:o}))})},58747:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(5853),a=r(2265);let o=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}},4537:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(5853),a=r(2265);let o=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.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"}))}},27281:function(e,t,r){r.d(t,{Z:function(){return f}});var n=r(5853),a=r(58747),o=r(2265),i=r(4537),l=r(13241),s=r(1153),c=r(96398),u=r(51975),d=r(85238),m=r(44140);let p=(0,s.fn)("Select"),f=o.forwardRef((e,t)=>{let{defaultValue:r="",value:s,onValueChange:f,placeholder:h="Select...",disabled:b=!1,icon:v,enableClear:y=!1,required:g,children:w,name:x,error:E=!1,errorMessage:O,className:C,id:N}=e,k=(0,n._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),S=(0,o.useRef)(null),j=o.Children.toArray(w),[R,M]=(0,m.Z)(r,s),T=(0,o.useMemo)(()=>{let e=o.Children.toArray(w).filter(o.isValidElement);return(0,c.sl)(e)},[w]);return o.createElement("div",{className:(0,l.q)("w-full min-w-[10rem] text-tremor-default",C)},o.createElement("div",{className:"relative"},o.createElement("select",{title:"select-hidden",required:g,className:(0,l.q)("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:R,onChange:e=>{e.preventDefault()},name:x,disabled:b,id:N,onFocus:()=>{let e=S.current;e&&e.focus()}},o.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},h),j.map(e=>{let t=e.props.value,r=e.props.children;return o.createElement("option",{className:"hidden",key:t,value:t},r)})),o.createElement(u.Ri,Object.assign({as:"div",ref:t,defaultValue:R,value:R,onChange:e=>{null==f||f(e),M(e)},disabled:b,id:N},k),e=>{var t;let{value:r}=e;return o.createElement(o.Fragment,null,o.createElement(u.Y4,{ref:S,className:(0,l.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",v?"pl-10":"pl-3",(0,c.um)((0,c.Uh)(r),b,E))},v&&o.createElement("span",{className:(0,l.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(v,{className:(0,l.q)(p("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("span",{className:"w-[90%] block truncate"},r&&null!==(t=T.get(r))&&void 0!==t?t:h),o.createElement("span",{className:(0,l.q)("absolute inset-y-0 right-0 flex items-center mr-3")},o.createElement(a.Z,{className:(0,l.q)(p("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),y&&R?o.createElement("button",{type:"button",className:(0,l.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),M(""),null==f||f("")}},o.createElement(i.Z,{className:(0,l.q)(p("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(d.u,{enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(u.O_,{anchor:"bottom start",className:(0,l.q)("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")},w)))})),E&&O?o.createElement("p",{className:(0,l.q)("errorMessage","text-sm text-rose-500 mt-1")},O):null)});f.displayName="Select"},67982:function(e,t,r){r.d(t,{Z:function(){return s}});var n=r(5853),a=r(13241),o=r(1153),i=r(2265);let l=(0,o.fn)("Divider"),s=i.forwardRef((e,t)=>{let{className:r,children:o}=e,s=(0,n._T)(e,["className","children"]);return i.createElement("div",Object.assign({ref:t,className:(0,a.q)(l("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",r)},s),o?i.createElement(i.Fragment,null,i.createElement("div",{className:(0,a.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),i.createElement("div",{className:(0,a.q)("text-inherit whitespace-nowrap")},o),i.createElement("div",{className:(0,a.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):i.createElement("div",{className:(0,a.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});s.displayName="Divider"},21626:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(5853),a=r(2265),o=r(13241);let i=(0,r(1153).fn)("Table"),l=a.forwardRef((e,t)=>{let{children:r,className:l}=e,s=(0,n._T)(e,["children","className"]);return a.createElement("div",{className:(0,o.q)(i("root"),"overflow-auto",l)},a.createElement("table",Object.assign({ref:t,className:(0,o.q)(i("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},s),r))});l.displayName="Table"},97214:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(5853),a=r(2265),o=r(13241);let i=(0,r(1153).fn)("TableBody"),l=a.forwardRef((e,t)=>{let{children:r,className:l}=e,s=(0,n._T)(e,["children","className"]);return a.createElement(a.Fragment,null,a.createElement("tbody",Object.assign({ref:t,className:(0,o.q)(i("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",l)},s),r))});l.displayName="TableBody"},28241:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(5853),a=r(2265),o=r(13241);let i=(0,r(1153).fn)("TableCell"),l=a.forwardRef((e,t)=>{let{children:r,className:l}=e,s=(0,n._T)(e,["children","className"]);return a.createElement(a.Fragment,null,a.createElement("td",Object.assign({ref:t,className:(0,o.q)(i("root"),"align-middle whitespace-nowrap text-left p-4",l)},s),r))});l.displayName="TableCell"},58834:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(5853),a=r(2265),o=r(13241);let i=(0,r(1153).fn)("TableHead"),l=a.forwardRef((e,t)=>{let{children:r,className:l}=e,s=(0,n._T)(e,["children","className"]);return a.createElement(a.Fragment,null,a.createElement("thead",Object.assign({ref:t,className:(0,o.q)(i("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",l)},s),r))});l.displayName="TableHead"},69552:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(5853),a=r(2265),o=r(13241);let i=(0,r(1153).fn)("TableHeaderCell"),l=a.forwardRef((e,t)=>{let{children:r,className:l}=e,s=(0,n._T)(e,["children","className"]);return a.createElement(a.Fragment,null,a.createElement("th",Object.assign({ref:t,className:(0,o.q)(i("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content-strong","dark:text-dark-tremor-content-strong",l)},s),r))});l.displayName="TableHeaderCell"},71876:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(5853),a=r(2265),o=r(13241);let i=(0,r(1153).fn)("TableRow"),l=a.forwardRef((e,t)=>{let{children:r,className:l}=e,s=(0,n._T)(e,["children","className"]);return a.createElement(a.Fragment,null,a.createElement("tr",Object.assign({ref:t,className:(0,o.q)(i("row"),l)},s),r))});l.displayName="TableRow"},94789:function(e,t,r){r.d(t,{Z:function(){return c}});var n=r(5853),a=r(2265),o=r(26898),i=r(13241),l=r(1153);let s=(0,l.fn)("Callout"),c=a.forwardRef((e,t)=>{let{title:r,icon:c,color:u,className:d,children:m}=e,p=(0,n._T)(e,["title","icon","color","className","children"]);return a.createElement("div",Object.assign({ref:t,className:(0,i.q)(s("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",u?(0,i.q)((0,l.bM)(u,o.K.background).bgColor,(0,l.bM)(u,o.K.darkBorder).borderColor,(0,l.bM)(u,o.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,i.q)("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)},p),a.createElement("div",{className:(0,i.q)(s("header"),"flex items-start")},c?a.createElement(c,{className:(0,i.q)(s("icon"),"flex-none h-5 w-5 mr-1.5")}):null,a.createElement("h4",{className:(0,i.q)(s("title"),"font-semibold")},r)),a.createElement("p",{className:(0,i.q)(s("body"),"overflow-y-auto",m?"mt-2":"")},m))});c.displayName="Callout"},96761:function(e,t,r){r.d(t,{Z:function(){return s}});var n=r(5853),a=r(26898),o=r(13241),i=r(1153),l=r(2265);let s=l.forwardRef((e,t)=>{let{color:r,children:s,className:c}=e,u=(0,n._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:t,className:(0,o.q)("font-medium text-tremor-title",r?(0,i.bM)(r,a.K.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",c)},u),s)});s.displayName="Title"},44140:function(e,t,r){r.d(t,{Z:function(){return a}});var n=r(2265);let a=(e,t)=>{let r=void 0!==t,[a,o]=(0,n.useState)(e);return[r?t:a,e=>{r||o(e)}]}},51653:function(e,t,r){r.d(t,{Z:function(){return L}});var n=r(2265),a=r(8900),o=r(39725),i=r(49638),l=r(54537),s=r(55726),c=r(36760),u=r.n(c),d=r(66632),m=r(18242),p=r(28791),f=r(19722),h=r(71744),b=r(93463),v=r(12918),y=r(99320);let g=(e,t,r,n,a)=>({background:e,border:"".concat((0,b.bf)(n.lineWidth)," ").concat(n.lineType," ").concat(t),["".concat(a,"-icon")]:{color:r}}),w=e=>{let{componentCls:t,motionDurationSlow:r,marginXS:n,marginSM:a,fontSize:o,fontSizeLG:i,lineHeight:l,borderRadiusLG:s,motionEaseInOutCirc:c,withDescriptionIconSize:u,colorText:d,colorTextHeading:m,withDescriptionPadding:p,defaultPadding:f}=e;return{[t]:Object.assign(Object.assign({},(0,v.Wf)(e)),{position:"relative",display:"flex",alignItems:"center",padding:f,wordWrap:"break-word",borderRadius:s,["&".concat(t,"-rtl")]:{direction:"rtl"},["".concat(t,"-content")]:{flex:1,minWidth:0},["".concat(t,"-icon")]:{marginInlineEnd:n,lineHeight:0},"&-description":{display:"none",fontSize:o,lineHeight:l},"&-message":{color:m},["&".concat(t,"-motion-leave")]:{overflow:"hidden",opacity:1,transition:"max-height ".concat(r," ").concat(c,", opacity ").concat(r," ").concat(c,",\n padding-top ").concat(r," ").concat(c,", padding-bottom ").concat(r," ").concat(c,",\n margin-bottom ").concat(r," ").concat(c)},["&".concat(t,"-motion-leave-active")]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),["".concat(t,"-with-description")]:{alignItems:"flex-start",padding:p,["".concat(t,"-icon")]:{marginInlineEnd:a,fontSize:u,lineHeight:0},["".concat(t,"-message")]:{display:"block",marginBottom:n,color:m,fontSize:i},["".concat(t,"-description")]:{display:"block",color:d}},["".concat(t,"-banner")]:{marginBottom:0,border:"0 !important",borderRadius:0}}},x=e=>{let{componentCls:t,colorSuccess:r,colorSuccessBorder:n,colorSuccessBg:a,colorWarning:o,colorWarningBorder:i,colorWarningBg:l,colorError:s,colorErrorBorder:c,colorErrorBg:u,colorInfo:d,colorInfoBorder:m,colorInfoBg:p}=e;return{[t]:{"&-success":g(a,n,r,e,t),"&-info":g(p,m,d,e,t),"&-warning":g(l,i,o,e,t),"&-error":Object.assign(Object.assign({},g(u,c,s,e,t)),{["".concat(t,"-description > pre")]:{margin:0,padding:0}})}}},E=e=>{let{componentCls:t,iconCls:r,motionDurationMid:n,marginXS:a,fontSizeIcon:o,colorIcon:i,colorIconHover:l}=e;return{[t]:{"&-action":{marginInlineStart:a},["".concat(t,"-close-icon")]:{marginInlineStart:a,padding:0,overflow:"hidden",fontSize:o,lineHeight:(0,b.bf)(o),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",["".concat(r,"-close")]:{color:i,transition:"color ".concat(n),"&:hover":{color:l}}},"&-close-text":{color:i,transition:"color ".concat(n),"&:hover":{color:l}}}}};var O=(0,y.I$)("Alert",e=>[w(e),x(e),E(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:"".concat(e.paddingContentVerticalSM,"px ").concat(12,"px"),withDescriptionPadding:"".concat(e.paddingMD,"px ").concat(e.paddingContentHorizontalLG,"px")})),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 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 N={success:a.Z,info:s.Z,error:o.Z,warning:l.Z},k=e=>{let{icon:t,prefixCls:r,type:a}=e,o=N[a]||null;return t?(0,f.wm)(t,n.createElement("span",{className:"".concat(r,"-icon")},t),()=>({className:u()("".concat(r,"-icon"),t.props.className)})):n.createElement(o,{className:"".concat(r,"-icon")})},S=e=>{let{isClosable:t,prefixCls:r,closeIcon:a,handleClose:o,ariaProps:l}=e,s=!0===a||void 0===a?n.createElement(i.Z,null):a;return t?n.createElement("button",Object.assign({type:"button",onClick:o,className:"".concat(r,"-close-icon"),tabIndex:0},l),s):null},j=n.forwardRef((e,t)=>{let{description:r,prefixCls:a,message:o,banner:i,className:l,rootClassName:s,style:c,onMouseEnter:f,onMouseLeave:b,onClick:v,afterClose:y,showIcon:g,closable:w,closeText:x,closeIcon:E,action:N,id:j}=e,R=C(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[M,T]=n.useState(!1),P=n.useRef(null);n.useImperativeHandle(t,()=>({nativeElement:P.current}));let{getPrefixCls:Z,direction:z,closable:I,closeIcon:L,className:q,style:_}=(0,h.dj)("alert"),G=Z("alert",a),[F,D,H]=O(G),A=t=>{var r;T(!0),null===(r=e.onClose)||void 0===r||r.call(e,t)},V=n.useMemo(()=>void 0!==e.type?e.type:i?"warning":"info",[e.type,i]),B=n.useMemo(()=>"object"==typeof w&&!!w.closeIcon||!!x||("boolean"==typeof w?w:!1!==E&&null!=E||!!I),[x,E,w,I]),K=!!i&&void 0===g||g,U=u()(G,"".concat(G,"-").concat(V),{["".concat(G,"-with-description")]:!!r,["".concat(G,"-no-icon")]:!K,["".concat(G,"-banner")]:!!i,["".concat(G,"-rtl")]:"rtl"===z},q,l,s,H,D),W=(0,m.Z)(R,{aria:!0,data:!0}),X=n.useMemo(()=>"object"==typeof w&&w.closeIcon?w.closeIcon:x||(void 0!==E?E:"object"==typeof I&&I.closeIcon?I.closeIcon:L),[E,w,I,x,L]),Y=n.useMemo(()=>{let e=null!=w?w:I;if("object"==typeof e){let{closeIcon:t}=e;return C(e,["closeIcon"])}return{}},[w,I]);return F(n.createElement(d.ZP,{visible:!M,motionName:"".concat(G,"-motion"),motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:y},(t,a)=>{let{className:i,style:l}=t;return n.createElement("div",Object.assign({id:j,ref:(0,p.sQ)(P,a),"data-show":!M,className:u()(U,i),style:Object.assign(Object.assign(Object.assign({},_),c),l),onMouseEnter:f,onMouseLeave:b,onClick:v,role:"alert"},W),K?n.createElement(k,{description:r,icon:e.icon,prefixCls:G,type:V}):null,n.createElement("div",{className:"".concat(G,"-content")},o?n.createElement("div",{className:"".concat(G,"-message")},o):null,r?n.createElement("div",{className:"".concat(G,"-description")},r):null),N?n.createElement("div",{className:"".concat(G,"-action")},N):null,n.createElement(S,{isClosable:B,prefixCls:G,closeIcon:X,handleClose:A,ariaProps:Y}))}))});var R=r(76405),M=r(25049),T=r(24995),P=r(63929),Z=r(37977),z=r(41690);let I=function(e){function t(){var e,r,n;return(0,R.Z)(this,t),r=t,n=arguments,r=(0,T.Z)(r),(e=(0,Z.Z)(this,(0,P.Z)()?Reflect.construct(r,n||[],(0,T.Z)(this).constructor):r.apply(this,n))).state={error:void 0,info:{componentStack:""}},e}return(0,z.Z)(t,e),(0,M.Z)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,description:t,id:r,children:a}=this.props,{error:o,info:i}=this.state,l=(null==i?void 0:i.componentStack)||null,s=void 0===e?(o||"").toString():e;return o?n.createElement(j,{id:r,type:"error",message:s,description:n.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},void 0===t?l:t)}):a}}])}(n.Component);j.ErrorBoundary=I;var L=j},58760:function(e,t,r){r.d(t,{Z:function(){return k}});var n=r(2265),a=r(36760),o=r.n(a),i=r(45287);function l(e){return["small","middle","large"].includes(e)}function s(e){return!!e&&"number"==typeof e&&!Number.isNaN(e)}var c=r(71744),u=r(77685),d=r(17691),m=r(99320);let p=e=>{let{componentCls:t,borderRadius:r,paddingSM:n,colorBorder:a,paddingXS:o,fontSizeLG:i,fontSizeSM:l,borderRadiusLG:s,borderRadiusSM:c,colorBgContainerDisabled:u,lineWidth:m}=e;return{[t]:[{display:"inline-flex",alignItems:"center",gap:0,paddingInline:n,margin:0,background:u,borderWidth:m,borderStyle:"solid",borderColor:a,borderRadius:r,"&-large":{fontSize:i,borderRadius:s},"&-small":{paddingInline:o,borderRadius:c,fontSize:l},"&-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,d.c)(e,{focus:!1})]}};var f=(0,m.I$)(["Space","Addon"],e=>[p(e)]),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 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 b=n.forwardRef((e,t)=>{let{className:r,children:a,style:i,prefixCls:l}=e,s=h(e,["className","children","style","prefixCls"]),{getPrefixCls:d,direction:m}=n.useContext(c.E_),p=d("space-addon",l),[b,v,y]=f(p),{compactItemClassnames:g,compactSize:w}=(0,u.ri)(p,m),x=o()(p,v,g,y,{["".concat(p,"-").concat(w)]:w},r);return b(n.createElement("div",Object.assign({ref:t,className:x,style:i},s),a))}),v=n.createContext({latestIndex:0}),y=v.Provider;var g=e=>{let{className:t,index:r,children:a,split:o,style:i}=e,{latestIndex:l}=n.useContext(v);return null==a?null:n.createElement(n.Fragment,null,n.createElement("div",{className:t,style:i},a),r{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"}},["".concat(t,"-item:empty")]:{display:"none"},["".concat(t,"-item > ").concat(r,"-badge-not-a-wrapper:only-child")]:{display:"block"}}}},E=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}}}};var O=(0,m.I$)("Space",e=>{let t=(0,w.IX)(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[x(t),E(t)]},()=>({}),{resetStyle:!1}),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 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 N=n.forwardRef((e,t)=>{var r;let{getPrefixCls:a,direction:u,size:d,className:m,style:p,classNames:f,styles:h}=(0,c.dj)("space"),{size:b=null!=d?d:"small",align:v,className:w,rootClassName:x,children:E,direction:N="horizontal",prefixCls:k,split:S,style:j,wrap:R=!1,classNames:M,styles:T}=e,P=C(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[Z,z]=Array.isArray(b)?b:[b,b],I=l(z),L=l(Z),q=s(z),_=s(Z),G=(0,i.Z)(E,{keepEmpty:!0}),F=void 0===v&&"horizontal"===N?"center":v,D=a("space",k),[H,A,V]=O(D),B=o()(D,m,A,"".concat(D,"-").concat(N),{["".concat(D,"-rtl")]:"rtl"===u,["".concat(D,"-align-").concat(F)]:F,["".concat(D,"-gap-row-").concat(z)]:I,["".concat(D,"-gap-col-").concat(Z)]:L},w,x,V),K=o()("".concat(D,"-item"),null!==(r=null==M?void 0:M.item)&&void 0!==r?r:f.item),U=Object.assign(Object.assign({},h.item),null==T?void 0:T.item),W=G.map((e,t)=>{let r=(null==e?void 0:e.key)||"".concat(K,"-").concat(t);return n.createElement(g,{className:K,key:r,index:t,split:S,style:U},e)}),X=n.useMemo(()=>({latestIndex:G.reduce((e,t,r)=>null!=t?r:e,0)}),[G]);if(0===G.length)return null;let Y={};return R&&(Y.flexWrap="wrap"),!L&&_&&(Y.columnGap=Z),!I&&q&&(Y.rowGap=z),H(n.createElement("div",Object.assign({ref:t,className:B,style:Object.assign(Object.assign(Object.assign({},Y),p),j)},P),n.createElement(y,{value:X},W)))});N.Compact=u.ZP,N.Addon=b;var k=N},6337:function(e,t,r){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(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var a=l(r(2265)),o=l(r(49211)),i=["text","onCopy","options","children"];function l(e){return e&&e.__esModule?e:{default:e}}function s(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||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,i),n=a.default.Children.only(t);return a.default.cloneElement(n,c(c({},r),{},{onClick:this.onClick}))}}],function(e,t){for(var r=0;rt!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#a({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,o.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#a({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#a({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});let n="pending"===this.state.status,a=!this.#n.canStart();try{if(n)t();else{this.#a({type:"pending",variables:e,isPaused:a}),await this.#r.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:a})}let o=await this.#n.start();return await this.#r.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#r.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#a({type:"success",data:o}),o}catch(t){try{throw await this.#r.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#r.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#a({type:"error",error:t})}}finally{this.#r.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.Vr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function l(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21770:function(e,t,r){r.d(t,{D:function(){return u}});var n=r(2265),a=r(2894),o=r(18238),i=r(24112),l=r(45345),s=class extends i.l{#e;#o=void 0;#i;#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,l.VS)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#i,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,l.Ym)(t.mutationKey)!==(0,l.Ym)(this.options.mutationKey)?this.reset():this.#i?.state.status==="pending"&&this.#i.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#i?.removeObserver(this)}onMutationUpdate(e){this.#s(),this.#c(e)}getCurrentResult(){return this.#o}reset(){this.#i?.removeObserver(this),this.#i=void 0,this.#s(),this.#c()}mutate(e,t){return this.#l=t,this.#i?.removeObserver(this),this.#i=this.#e.getMutationCache().build(this.#e,this.options),this.#i.addObserver(this),this.#i.execute(e)}#s(){let e=this.#i?.state??(0,a.R)();this.#o={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#c(e){o.Vr.batch(()=>{if(this.#l&&this.hasListeners()){let t=this.#o.variables,r=this.#o.context,n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#l.onSuccess?.(e.data,t,r,n),this.#l.onSettled?.(e.data,null,t,r,n)):e?.type==="error"&&(this.#l.onError?.(e.error,t,r,n),this.#l.onSettled?.(void 0,e.error,t,r,n))}this.listeners.forEach(e=>{e(this.#o)})})}},c=r(29827);function u(e,t){let r=(0,c.NL)(t),[a]=n.useState(()=>new s(r,e));n.useEffect(()=>{a.setOptions(e)},[a,e]);let i=n.useSyncExternalStore(n.useCallback(e=>a.subscribe(o.Vr.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),u=n.useCallback((e,t)=>{a.mutate(e,t).catch(l.ZT)},[a]);if(i.error&&(0,l.L3)(a.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}},85238:function(e,t,r){let n;r.d(t,{u:function(){return j}});var a=r(2265),o=r(59456),i=r(93980),l=r(25289),s=r(73389),c=r(43507),u=r(180),d=r(67561),m=r(98218),p=r(28294),f=r(95504),h=r(72468),b=r(38929);function v(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||(null!=(t=e.as)?t:O)!==a.Fragment||1===a.Children.count(e.children)}let y=(0,a.createContext)(null);y.displayName="TransitionContext";var g=((n=g||{}).Visible="visible",n.Hidden="hidden",n);let w=(0,a.createContext)(null);function x(e){return"children"in e?x(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function E(e,t){let r=(0,c.E)(e),n=(0,a.useRef)([]),s=(0,l.t)(),u=(0,o.G)(),d=(0,i.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.l4.Hidden,a=n.current.findIndex(t=>{let{el:r}=t;return r===e});-1!==a&&((0,h.E)(t,{[b.l4.Unmount](){n.current.splice(a,1)},[b.l4.Hidden](){n.current[a].state="hidden"}}),u.microTask(()=>{var e;!x(n)&&s.current&&(null==(e=r.current)||e.call(r))}))}),m=(0,i.z)(e=>{let t=n.current.find(t=>{let{el:r}=t;return r===e});return t?"visible"!==t.state&&(t.state="visible"):n.current.push({el:e,state:"visible"}),()=>d(e,b.l4.Unmount)}),p=(0,a.useRef)([]),f=(0,a.useRef)(Promise.resolve()),v=(0,a.useRef)({enter:[],leave:[]}),y=(0,i.z)((e,r,n)=>{p.current.splice(0),t&&(t.chains.current[r]=t.chains.current[r].filter(t=>{let[r]=t;return r!==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=>{let[t,r]=e;return r})).then(()=>e())})]),"enter"===r?f.current=f.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),g=(0,i.z)((e,t,r)=>{Promise.all(v.current[t].splice(0).map(e=>{let[t,r]=e;return r})).then(()=>{var e;null==(e=p.current.shift())||e()}).then(()=>r(t))});return(0,a.useMemo)(()=>({children:n,register:m,unregister:d,onStart:y,onStop:g,wait:f,chains:v}),[m,d,n,y,g,v,f])}w.displayName="NestingContext";let O=a.Fragment,C=b.VN.RenderStrategy,N=(0,b.yV)(function(e,t){let{show:r,appear:n=!1,unmount:o=!0,...l}=e,c=(0,a.useRef)(null),m=v(e),f=(0,d.T)(...m?[c,t]:null===t?[]:[t]);(0,u.H)();let h=(0,p.oJ)();if(void 0===r&&null!==h&&(r=(h&p.ZM.Open)===p.ZM.Open),void 0===r)throw Error("A is used but it is missing a `show={true | false}` prop.");let[g,O]=(0,a.useState)(r?"visible":"hidden"),N=E(()=>{r||O("hidden")}),[S,j]=(0,a.useState)(!0),R=(0,a.useRef)([r]);(0,s.e)(()=>{!1!==S&&R.current[R.current.length-1]!==r&&(R.current.push(r),j(!1))},[R,r]);let M=(0,a.useMemo)(()=>({show:r,appear:n,initial:S}),[r,n,S]);(0,s.e)(()=>{r?O("visible"):x(N)||null===c.current||O("hidden")},[r,N]);let T={unmount:o},P=(0,i.z)(()=>{var t;S&&j(!1),null==(t=e.beforeEnter)||t.call(e)}),Z=(0,i.z)(()=>{var t;S&&j(!1),null==(t=e.beforeLeave)||t.call(e)}),z=(0,b.L6)();return a.createElement(w.Provider,{value:N},a.createElement(y.Provider,{value:M},z({ourProps:{...T,as:a.Fragment,children:a.createElement(k,{ref:f,...T,...l,beforeEnter:P,beforeLeave:Z})},theirProps:{},defaultTag:a.Fragment,features:C,visible:"visible"===g,name:"Transition"})))}),k=(0,b.yV)(function(e,t){var r,n;let{transition:o=!0,beforeEnter:l,afterEnter:c,beforeLeave:g,afterLeave:N,enter:k,enterFrom:S,enterTo:j,entered:R,leave:M,leaveFrom:T,leaveTo:P,...Z}=e,[z,I]=(0,a.useState)(null),L=(0,a.useRef)(null),q=v(e),_=(0,d.T)(...q?[L,t,I]:null===t?[]:[t]),G=null==(r=Z.unmount)||r?b.l4.Unmount:b.l4.Hidden,{show:F,appear:D,initial:H}=function(){let e=(0,a.useContext)(y);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),[A,V]=(0,a.useState)(F?"visible":"hidden"),B=function(){let e=(0,a.useContext)(w);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),{register:K,unregister:U}=B;(0,s.e)(()=>K(L),[K,L]),(0,s.e)(()=>{if(G===b.l4.Hidden&&L.current){if(F&&"visible"!==A){V("visible");return}return(0,h.E)(A,{hidden:()=>U(L),visible:()=>K(L)})}},[A,L,K,U,F,G]);let W=(0,u.H)();(0,s.e)(()=>{if(q&&W&&"visible"===A&&null===L.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[L,A,W,q]);let X=H&&!D,Y=D&&F&&H,$=(0,a.useRef)(!1),J=E(()=>{$.current||(V("hidden"),U(L))},B),Q=(0,i.z)(e=>{$.current=!0,J.onStart(L,e?"enter":"leave",e=>{"enter"===e?null==l||l():"leave"===e&&(null==g||g())})}),ee=(0,i.z)(e=>{let t=e?"enter":"leave";$.current=!1,J.onStop(L,t,e=>{"enter"===e?null==c||c():"leave"===e&&(null==N||N())}),"leave"!==t||x(J)||(V("hidden"),U(L))});(0,a.useEffect)(()=>{q&&o||(Q(F),ee(F))},[F,q,o]);let et=!(!o||!q||!W||X),[,er]=(0,m.Y)(et,z,F,{start:Q,end:ee}),en=(0,b.oA)({ref:_,className:(null==(n=(0,f.A)(Z.className,Y&&k,Y&&S,er.enter&&k,er.enter&&er.closed&&S,er.enter&&!er.closed&&j,er.leave&&M,er.leave&&!er.closed&&T,er.leave&&er.closed&&P,!er.transition&&F&&R))?void 0:n.trim())||void 0,...(0,m.X)(er)}),ea=0;"visible"===A&&(ea|=p.ZM.Open),"hidden"===A&&(ea|=p.ZM.Closed),er.enter&&(ea|=p.ZM.Opening),er.leave&&(ea|=p.ZM.Closing);let eo=(0,b.L6)();return a.createElement(w.Provider,{value:J},a.createElement(p.up,{value:ea},eo({ourProps:en,theirProps:Z,defaultTag:O,features:C,visible:"visible"===A,name:"Transition.Child"})))}),S=(0,b.yV)(function(e,t){let r=null!==(0,a.useContext)(y),n=null!==(0,p.oJ)();return a.createElement(a.Fragment,null,!r&&n?a.createElement(N,{ref:t,...e}):a.createElement(k,{ref:t,...e}))}),j=Object.assign(N,{Child:S,Root:N})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7526-2f08bc80c8f88b21.js b/litellm/proxy/_experimental/out/_next/static/chunks/7526-2f08bc80c8f88b21.js new file mode 100644 index 00000000000..4ca4283d6e4 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/7526-2f08bc80c8f88b21.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7526],{19130:function(e,t,n){n.d(t,{RM:function(){return a.Z},SC:function(){return o.Z},iA:function(){return s.Z},pj:function(){return r.Z},ss:function(){return l.Z},xs:function(){return i.Z}});var s=n(21626),a=n(97214),r=n(28241),l=n(58834),i=n(69552),o=n(71876)},8048:function(e,t,n){n.d(t,{C:function(){return m}});var s=n(57437),a=n(71594),r=n(24525),l=n(2265),i=n(19130),o=n(44633),c=n(86462),d=n(49084);function m(e){let{data:t=[],columns:n,isLoading:m=!1,table:p,defaultSorting:u=[]}=e,[g,x]=l.useState(u),[h]=l.useState("onChange"),[f,_]=l.useState({}),[b,j]=l.useState({}),v=(0,a.b7)({data:t,columns:n,state:{sorting:g,columnSizing:f,columnVisibility:b},columnResizeMode:h,onSortingChange:x,onColumnSizingChange:_,onColumnVisibilityChange:j,getCoreRowModel:(0,r.sC)(),getSortedRowModel:(0,r.tj)(),enableSorting:!0,enableColumnResizing:!0,defaultColumn:{minSize:40,maxSize:500}});return l.useEffect(()=>{p&&(p.current=v)},[v,p]),(0,s.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsx)("div",{className:"relative min-w-full",children:(0,s.jsxs)(i.iA,{className:"[&_td]:py-2 [&_th]:py-2 w-full",children:[(0,s.jsx)(i.ss,{children:v.getHeaderGroups().map(e=>(0,s.jsx)(i.SC,{children:e.headers.map(e=>{var t;return(0,s.jsxs)(i.xs,{className:"py-1 h-8 relative ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.id?120:e.getSize(),position:"actions"===e.id?"sticky":"relative",right:"actions"===e.id?0:"auto"},onClick:e.column.getCanSort()?e.column.getToggleSortingHandler():void 0,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,a.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,s.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,s.jsx)(o.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,s.jsx)(c.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,s.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"})})]}),e.column.getCanResize()&&(0,s.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"absolute right-0 top-0 h-full w-2 cursor-col-resize select-none touch-none ".concat(e.column.getIsResizing()?"bg-blue-500":"hover:bg-blue-200")})]},e.id)})},e.id))}),(0,s.jsx)(i.RM,{children:m?(0,s.jsx)(i.SC,{children:(0,s.jsx)(i.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:"\uD83D\uDE85 Loading models..."})})})}):v.getRowModel().rows.length>0?v.getRowModel().rows.map(e=>(0,s.jsx)(i.SC,{children:e.getVisibleCells().map(e=>{var t;return(0,s.jsx)(i.pj,{className:"py-0.5 ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.column.id?120:e.column.getSize(),position:"actions"===e.column.id?"sticky":"relative",right:"actions"===e.column.id?0:"auto"},children:(0,a.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)):(0,s.jsx)(i.SC,{children:(0,s.jsx)(i.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:"No models found"})})})})})]})})})})}},67325:function(e,t,n){var s=n(57437),a=n(27648),r=n(2265),l=n(99981),i=n(73705),o=n(19250),c=n(15883),d=n(46346),m=n(57400),p=n(91870),u=n(40428),g=n(83884),x=n(45524),h=n(3914),f=n(91624),_=n(69734);t.Z=e=>{let{userID:t,userEmail:n,userRole:b,premiumUser:j,proxySettings:v,setProxySettings:y,accessToken:N,isPublicPage:w=!1,sidebarCollapsed:A=!1,onToggleSidebar:S}=e,C=(0,o.getProxyBaseUrl)(),[I,k]=(0,r.useState)(""),[Z,E]=(0,r.useState)(""),{logoUrl:M}=(0,_.F)(),O=M||"".concat(C,"/get_image");(0,r.useEffect)(()=>{(async()=>{try{let e=await fetch("".concat(C,"/health/readiness")),t=await e.json();t.litellm_version&&E(t.litellm_version)}catch(e){console.error("Failed to fetch version:",e)}})()},[C]),(0,r.useEffect)(()=>{(async()=>{if(N){let e=await (0,f.C)(N);console.log("response from fetchProxySettings",e),e&&y(e)}})()},[N]),(0,r.useEffect)(()=>{k((null==v?void 0:v.PROXY_LOGOUT_URL)||"")},[v]);let P=[{key:"user-info",onClick:e=>{var t;return null===(t=e.domEvent)||void 0===t?void 0:t.stopPropagation()},label:(0,s.jsxs)("div",{className:"px-3 py-3 border-b border-gray-100",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(c.Z,{className:"mr-2 text-gray-700"}),(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:t})]}),j?(0,s.jsx)(l.Z,{title:"Premium User",placement:"left",children:(0,s.jsxs)("div",{className:"flex items-center bg-gradient-to-r from-amber-500 to-yellow-500 text-white px-2 py-0.5 rounded-full cursor-help",children:[(0,s.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,s.jsx)("span",{className:"text-xs font-medium",children:"Premium"})]})}):(0,s.jsx)(l.Z,{title:"Upgrade to Premium for advanced features",placement:"left",children:(0,s.jsxs)("div",{className:"flex items-center bg-gray-100 text-gray-500 px-2 py-0.5 rounded-full cursor-help",children:[(0,s.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,s.jsx)("span",{className:"text-xs font-medium",children:"Standard"})]})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center text-sm",children:[(0,s.jsx)(m.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,s.jsx)("span",{className:"text-gray-500 text-xs",children:"Role"}),(0,s.jsx)("span",{className:"ml-auto text-gray-700 font-medium",children:b})]}),(0,s.jsxs)("div",{className:"flex items-center text-sm",children:[(0,s.jsx)(p.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,s.jsx)("span",{className:"text-gray-500 text-xs",children:"Email"}),(0,s.jsx)("span",{className:"ml-auto text-gray-700 font-medium truncate max-w-[150px]",title:n||"Unknown",children:n||"Unknown"})]})]})]})},{key:"logout",label:(0,s.jsxs)("div",{className:"flex items-center py-2 px-3 hover:bg-gray-50 rounded-md mx-1 my-1",onClick:()=>{(0,h.b)(),window.location.href=I},children:[(0,s.jsx)(u.Z,{className:"mr-3 text-gray-600"}),(0,s.jsx)("span",{className:"text-gray-800",children:"Logout"})]})}];return(0,s.jsx)("nav",{className:"bg-white border-b border-gray-200 sticky top-0 z-10",children:(0,s.jsx)("div",{className:"w-full",children:(0,s.jsxs)("div",{className:"flex items-center h-14 px-4",children:[" ",(0,s.jsxs)("div",{className:"flex items-center flex-shrink-0",children:[S&&(0,s.jsx)("button",{onClick:S,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:A?"Expand sidebar":"Collapse sidebar",children:(0,s.jsx)("span",{className:"text-lg",children:A?(0,s.jsx)(g.Z,{}):(0,s.jsx)(x.Z,{})})}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(a.default,{href:"/",className:"flex items-center",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("img",{src:O,alt:"LiteLLM Brand",className:"h-10 w-auto"}),(0,s.jsx)("span",{className:"absolute -top-1 -right-2 text-lg animate-bounce",style:{animationDuration:"2s"},title:"Happy Holidays!",children:"\uD83C\uDF84"})]})}),Z&&(0,s.jsxs)("a",{href:"https://docs.litellm.ai/release_notes",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-gray-500 border border-gray-200 rounded-lg px-2 py-0.5 bg-gray-50 font-medium -ml-2 hover:bg-gray-100 transition-colors cursor-pointer z-10",children:["v",Z]})]})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-5 ml-auto",children:[(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-gray-600 hover:text-gray-900 transition-colors",children:"Docs"}),!w&&(0,s.jsx)(i.Z,{menu:{items:P,className:"min-w-[200px]",style:{padding:"8px",marginTop:"8px",borderRadius:"12px",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.08)"}},overlayStyle:{minWidth:"200px"},children:(0,s.jsxs)("button",{className:"inline-flex items-center text-sm text-gray-600 hover:text-gray-900 transition-colors",children:["User",(0,s.jsx)("svg",{className:"ml-1 w-5 h-5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 9l-7 7-7-7"})})]})})]})]})})})}},82971:function(e,t,n){n.d(t,{L:function(){return a}});var s=n(8443);let a=e=>{let t;let{apiKeySource:n,accessToken:a,apiKey:r,inputMessage:l,chatHistory:i,selectedTags:o,selectedVectorStores:c,selectedGuardrails:d,selectedMCPTools:m,selectedVoice:p,endpointType:u,selectedModel:g,selectedSdk:x,proxySettings:h}=e,f="session"===n?a:r,_=window.location.origin,b=null==h?void 0:h.LITELLM_UI_API_DOC_BASE_URL;b&&b.trim()?_=b:(null==h?void 0:h.PROXY_BASE_URL)&&(_=h.PROXY_BASE_URL);let j=l||"Your prompt here",v=j.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),y=i.filter(e=>!e.isImage).map(e=>{let{role:t,content:n}=e;return{role:t,content:n}}),N={};o.length>0&&(N.tags=o),c.length>0&&(N.vector_stores=c),d.length>0&&(N.guardrails=d);let w=g||"your-model-name",A="azure"===x?'import openai\n\nclient = openai.AzureOpenAI(\n api_key="'.concat(f||"YOUR_LITELLM_API_KEY",'",\n azure_endpoint="').concat(_,'",\n api_version="2024-02-01"\n)'):'import openai\n\nclient = openai.OpenAI(\n api_key="'.concat(f||"YOUR_LITELLM_API_KEY",'",\n base_url="').concat(_,'"\n)');switch(u){case s.KP.CHAT:{let e=Object.keys(N).length>0,n="";if(e){let e=JSON.stringify({metadata:N},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();n=",\n extra_body=".concat(e)}let s=y.length>0?y:[{role:"user",content:j}];t='\nimport base64\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# Example with text only\nresponse = client.chat.completions.create(\n model="'.concat(w,'",\n messages=').concat(JSON.stringify(s,null,4)).concat(n,'\n)\n\nprint(response)\n\n# Example with image or PDF (uncomment and provide file path to use)\n# base64_file = encode_image("path/to/your/file.jpg") # or .pdf\n# response_with_file = client.chat.completions.create(\n# model="').concat(w,'",\n# messages=[\n# {\n# "role": "user",\n# "content": [\n# {\n# "type": "text",\n# "text": "').concat(v,'"\n# },\n# {\n# "type": "image_url",\n# "image_url": {\n# "url": f"data:image/jpeg;base64,{base64_file}" # or data:application/pdf;base64,{base64_file}\n# }\n# }\n# ]\n# }\n# ]').concat(n,"\n# )\n# print(response_with_file)\n");break}case s.KP.RESPONSES:{let e=Object.keys(N).length>0,n="";if(e){let e=JSON.stringify({metadata:N},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();n=",\n extra_body=".concat(e)}let s=y.length>0?y:[{role:"user",content:j}];t='\nimport base64\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# Example with text only\nresponse = client.responses.create(\n model="'.concat(w,'",\n input=').concat(JSON.stringify(s,null,4)).concat(n,'\n)\n\nprint(response.output_text)\n\n# Example with image or PDF (uncomment and provide file path to use)\n# base64_file = encode_image("path/to/your/file.jpg") # or .pdf\n# response_with_file = client.responses.create(\n# model="').concat(w,'",\n# input=[\n# {\n# "role": "user",\n# "content": [\n# {"type": "input_text", "text": "').concat(v,'"},\n# {\n# "type": "input_image",\n# "image_url": f"data:image/jpeg;base64,{base64_file}", # or data:application/pdf;base64,{base64_file}\n# },\n# ],\n# }\n# ]').concat(n,"\n# )\n# print(response_with_file.output_text)\n");break}case s.KP.IMAGE:t="azure"===x?"\n# NOTE: The Azure SDK does not have a direct equivalent to the multi-modal 'responses.create' method shown for OpenAI.\n# This snippet uses 'client.images.generate' and will create a new image based on your prompt.\n# It does not use the uploaded image, as 'client.images.generate' does not support image inputs in this context.\nimport os\nimport requests\nimport json\nimport time\nfrom PIL import Image\n\nresult = client.images.generate(\n model=\"".concat(w,'",\n prompt="').concat(l,'",\n n=1\n)\n\njson_response = json.loads(result.model_dump_json())\n\n# Set the directory for the stored image\nimage_dir = os.path.join(os.curdir, \'images\')\n\n# If the directory doesn\'t exist, create it\nif not os.path.isdir(image_dir):\n os.mkdir(image_dir)\n\n# Initialize the image path\nimage_filename = f"generated_image_{int(time.time())}.png"\nimage_path = os.path.join(image_dir, image_filename)\n\ntry:\n # Retrieve the generated image\n if json_response.get("data") && len(json_response["data"]) > 0 && json_response["data"][0].get("url"):\n image_url = json_response["data"][0]["url"]\n generated_image = requests.get(image_url).content\n with open(image_path, "wb") as image_file:\n image_file.write(generated_image)\n\n print(f"Image saved to {image_path}")\n # Display the image\n image = Image.open(image_path)\n image.show()\n else:\n print("Could not find image URL in response.")\n print("Full response:", json_response)\nexcept Exception as e:\n print(f"An error occurred: {e}")\n print("Full response:", json_response)\n'):"\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(v,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(w,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;case s.KP.IMAGE_EDITS:t="azure"===x?'\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# The prompt entered by the user\nprompt = "'.concat(v,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(w,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n'):"\nimport base64\nimport os\nimport time\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(v,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(w,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;case s.KP.EMBEDDINGS:t='\nresponse = client.embeddings.create(\n input="'.concat(l||"Your string here",'",\n model="').concat(w,'",\n encoding_format="base64" # or "float"\n)\n\nprint(response.data[0].embedding)\n');break;case s.KP.TRANSCRIPTION:t='\n# Open the audio file\naudio_file = open("path/to/your/audio/file.mp3", "rb")\n\n# Make the transcription request\nresponse = client.audio.transcriptions.create(\n model="'.concat(w,'",\n file=audio_file').concat(l?',\n prompt="'.concat(l.replace(/"/g,'\\"'),'"'):"","\n)\n\nprint(response.text)\n");break;case s.KP.SPEECH:t='\n# Make the text-to-speech request\nresponse = client.audio.speech.create(\n model="'.concat(w,'",\n input="').concat(l||"Your text to convert to speech here",'",\n voice="').concat(p,'" # Options: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer\n)\n\n# Save the audio to a file\noutput_filename = "output_speech.mp3"\nresponse.stream_to_file(output_filename)\nprint(f"Audio saved to {output_filename}")\n\n# Optional: Customize response format and speed\n# response = client.audio.speech.create(\n# model="').concat(w,'",\n# input="').concat(l||"Your text to convert to speech here",'",\n# voice="alloy",\n# response_format="mp3", # Options: mp3, opus, aac, flac, wav, pcm\n# speed=1.0 # Range: 0.25 to 4.0\n# )\n# response.stream_to_file("output_speech.mp3")\n');break;default:t="\n# Code generation for this endpoint is not implemented yet."}return"".concat(A,"\n").concat(t)}},8443:function(e,t,n){var s,a,r,l;n.d(t,{KP:function(){return a},vf:function(){return o}}),(r=s||(s={})).AUDIO_SPEECH="audio_speech",r.AUDIO_TRANSCRIPTION="audio_transcription",r.IMAGE_GENERATION="image_generation",r.VIDEO_GENERATION="video_generation",r.CHAT="chat",r.RESPONSES="responses",r.IMAGE_EDITS="image_edits",r.ANTHROPIC_MESSAGES="anthropic_messages",r.EMBEDDING="embedding",(l=a||(a={})).IMAGE="image",l.VIDEO="video",l.CHAT="chat",l.RESPONSES="responses",l.IMAGE_EDITS="image_edits",l.ANTHROPIC_MESSAGES="anthropic_messages",l.EMBEDDINGS="embeddings",l.SPEECH="speech",l.TRANSCRIPTION="transcription",l.A2A_AGENTS="a2a_agents";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"},o=e=>{if(console.log("getEndpointType:",e),Object.values(s).includes(e)){let t=i[e];return console.log("endpointType:",t),t}return"chat"}},42673:function(e,t,n){var s,a;n.d(t,{Cl:function(){return s},bK:function(){return d},cd:function(){return i},dr:function(){return o},fK:function(){return r},ph:function(){return c}}),(a=s||(s={})).A2A_Agent="A2A Agent",a.AIML="AI/ML API",a.Bedrock="Amazon Bedrock",a.Anthropic="Anthropic",a.AssemblyAI="AssemblyAI",a.SageMaker="AWS SageMaker",a.Azure="Azure",a.Azure_AI_Studio="Azure AI Foundry (Studio)",a.Cerebras="Cerebras",a.Cohere="Cohere",a.Dashscope="Dashscope",a.Databricks="Databricks (Qwen API)",a.DeepInfra="DeepInfra",a.Deepgram="Deepgram",a.Deepseek="Deepseek",a.ElevenLabs="ElevenLabs",a.FalAI="Fal AI",a.FireworksAI="Fireworks AI",a.Google_AI_Studio="Google AI Studio",a.GradientAI="GradientAI",a.Groq="Groq",a.Hosted_Vllm="vllm",a.Infinity="Infinity",a.JinaAI="Jina AI",a.MistralAI="Mistral AI",a.Ollama="Ollama",a.OpenAI="OpenAI",a.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",a.OpenAI_Text="OpenAI Text Completion",a.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",a.Openrouter="Openrouter",a.Oracle="Oracle Cloud Infrastructure (OCI)",a.Perplexity="Perplexity",a.RunwayML="RunwayML",a.Sambanova="Sambanova",a.Snowflake="Snowflake",a.TogetherAI="TogetherAI",a.Triton="Triton",a.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",a.VolcEngine="VolcEngine",a.Voyage="Voyage AI",a.xAI="xAI";let r={A2A_Agent:"a2a_agent",AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",RunwayML:"runwayml",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",FalAI:"fal_ai",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},l="../ui/assets/logos/",i={"A2A Agent":"".concat(l,"a2a_agent.png"),"AI/ML API":"".concat(l,"aiml_api.svg"),Anthropic:"".concat(l,"anthropic.svg"),AssemblyAI:"".concat(l,"assemblyai_small.png"),Azure:"".concat(l,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(l,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(l,"bedrock.svg"),"AWS SageMaker":"".concat(l,"bedrock.svg"),Cerebras:"".concat(l,"cerebras.svg"),Cohere:"".concat(l,"cohere.svg"),"Databricks (Qwen API)":"".concat(l,"databricks.svg"),Dashscope:"".concat(l,"dashscope.svg"),Deepseek:"".concat(l,"deepseek.svg"),"Fireworks AI":"".concat(l,"fireworks.svg"),Groq:"".concat(l,"groq.svg"),"Google AI Studio":"".concat(l,"google.svg"),vllm:"".concat(l,"vllm.png"),Infinity:"".concat(l,"infinity.png"),"Mistral AI":"".concat(l,"mistral.svg"),Ollama:"".concat(l,"ollama.svg"),OpenAI:"".concat(l,"openai_small.svg"),"OpenAI Text Completion":"".concat(l,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(l,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(l,"openai_small.svg"),Openrouter:"".concat(l,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(l,"oracle.svg"),Perplexity:"".concat(l,"perplexity-ai.svg"),RunwayML:"".concat(l,"runwayml.png"),Sambanova:"".concat(l,"sambanova.svg"),Snowflake:"".concat(l,"snowflake.svg"),TogetherAI:"".concat(l,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(l,"google.svg"),xAI:"".concat(l,"xai.svg"),GradientAI:"".concat(l,"gradientai.svg"),Triton:"".concat(l,"nvidia_triton.png"),Deepgram:"".concat(l,"deepgram.png"),ElevenLabs:"".concat(l,"elevenlabs.png"),"Fal AI":"".concat(l,"fal_ai.jpg"),"Voyage AI":"".concat(l,"voyage.webp"),"Jina AI":"".concat(l,"jina.png"),VolcEngine:"".concat(l,"volcengine.png"),DeepInfra:"".concat(l,"deepinfra.png")},o=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=s[t];return{logo:i[n],displayName:n}},c=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||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";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 return"gpt-3.5-turbo"},d=(e,t)=>{console.log("Provider key: ".concat(e));let n=r[e];console.log("Provider mapped to: ".concat(n));let s=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(e=>{let[t,a]=e;null!==a&&"object"==typeof a&&"litellm_provider"in a&&(a.litellm_provider===n||a.litellm_provider.includes(n))&&s.push(t)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(e=>{let[t,n]=e;null!==n&&"object"==typeof n&&"litellm_provider"in n&&"cohere_chat"===n.litellm_provider&&s.push(t)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(e=>{let[t,n]=e;null!==n&&"object"==typeof n&&"litellm_provider"in n&&"sagemaker_chat"===n.litellm_provider&&s.push(t)}))),s}},87526:function(e,t,n){n.d(t,{Z:function(){return C}});var s=n(57437),a=n(2265),r=n(19250),l=n(8048),i=n(78489),o=n(12514),c=n(84264),d=n(96761),m=n(65869),p=n(99981),u=n(3810),g=n(37592),x=n(22116),h=n(3477),f=n(17732),_=n(78867),b=n(33245),j=n(82971),v=n(8443),y=n(42673),N=n(67325),w=n(69734),A=n(9114);let{TabPane:S}=m.default;var C=e=>{var t,n,C,I,k;let{accessToken:Z,isEmbedded:E=!1}=e,[M,O]=(0,a.useState)(null),[P,T]=(0,a.useState)(null),[D,L]=(0,a.useState)(null),[z,R]=(0,a.useState)("LiteLLM Gateway"),[H,F]=(0,a.useState)(null),[G,K]=(0,a.useState)(""),[U,V]=(0,a.useState)({}),[q,W]=(0,a.useState)(!0),[B,Y]=(0,a.useState)(!0),[J,X]=(0,a.useState)(!0),[$,Q]=(0,a.useState)(""),[ee,et]=(0,a.useState)(""),[en,es]=(0,a.useState)(""),[ea,er]=(0,a.useState)([]),[el,ei]=(0,a.useState)([]),[eo,ec]=(0,a.useState)([]),[ed,em]=(0,a.useState)([]),[ep,eu]=(0,a.useState)([]),[eg,ex]=(0,a.useState)("I'm alive! ✓"),[eh,ef]=(0,a.useState)(!1),[e_,eb]=(0,a.useState)(!1),[ej,ev]=(0,a.useState)(!1),[ey,eN]=(0,a.useState)(null),[ew,eA]=(0,a.useState)(null),[eS,eC]=(0,a.useState)(null),[eI,ek]=(0,a.useState)({}),[eZ,eE]=(0,a.useState)("models"),eM=(0,a.useRef)(null),eO=(0,a.useRef)(null),eP=(0,a.useRef)(null);(0,a.useEffect)(()=>{(async()=>{try{await (0,r.getUiConfig)()}catch(e){console.error("Failed to get UI config:",e)}let e=async()=>{try{W(!0);let e=await (0,r.modelHubPublicModelsCall)();console.log("ModelHubData:",e),O(e)}catch(e){console.error("There was an error fetching the public model data",e),ex("Service unavailable")}finally{W(!1)}},t=async()=>{try{Y(!0);let e=await (0,r.agentHubPublicModelsCall)();console.log("AgentHubData:",e),T(e)}catch(e){console.error("There was an error fetching the public agent data",e)}finally{Y(!1)}},n=async()=>{try{X(!0);let e=await (0,r.mcpHubPublicServersCall)();console.log("MCPHubData:",e),L(e)}catch(e){console.error("There was an error fetching the public MCP server data",e)}finally{X(!1)}};(async()=>{let e=await (0,r.getPublicModelHubInfo)();console.log("Public Model Hub Info:",e),R(e.docs_title),F(e.custom_docs_description),K(e.litellm_version),V(e.useful_links||{})})(),e(),t(),n()})()},[]),(0,a.useEffect)(()=>{},[$,ea,el,eo]);let eT=(0,a.useMemo)(()=>{if(!M)return[];let e=M;if($.trim()){let t=$.toLowerCase(),n=t.split(/\s+/),s=M.filter(e=>{let s=e.model_group.toLowerCase();return!!s.includes(t)||n.every(e=>s.includes(e))});s.length>0&&(e=s.sort((e,n)=>{let s=e.model_group.toLowerCase(),a=n.model_group.toLowerCase(),r=s===t?1e3:0,l=a===t?1e3:0,i=s.startsWith(t)?100:0,o=a.startsWith(t)?100:0,c=t.split(/\s+/).every(e=>s.includes(e))?50:0,d=t.split(/\s+/).every(e=>a.includes(e))?50:0,m=s.length;return l+o+d+(1e3-a.length)-(r+i+c+(1e3-m))}))}return e.filter(e=>{let t=0===ea.length||ea.some(t=>e.providers.includes(t)),n=0===el.length||el.includes(e.mode||""),s=0===eo.length||Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).some(e=>{let[t]=e,n=t.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return eo.includes(n)});return t&&n&&s})},[M,$,ea,el,eo]),eD=(0,a.useMemo)(()=>{if(!P)return[];let e=P;if(ee.trim()){let t=ee.toLowerCase(),n=t.split(/\s+/);e=(e=P.filter(e=>{let s=e.name.toLowerCase(),a=e.description.toLowerCase();return!!(s.includes(t)||a.includes(t))||n.every(e=>s.includes(e)||a.includes(e))})).sort((e,n)=>{let s=e.name.toLowerCase(),a=n.name.toLowerCase(),r=s===t?1e3:0,l=a===t?1e3:0,i=s.startsWith(t)?100:0,o=a.startsWith(t)?100:0,c=r+i+(1e3-s.length);return l+o+(1e3-a.length)-c})}return e.filter(e=>{var t;return 0===ed.length||(null===(t=e.skills)||void 0===t?void 0:t.some(e=>{var t;return null===(t=e.tags)||void 0===t?void 0:t.some(e=>ed.includes(e))}))})},[P,ee,ed]),eL=(0,a.useMemo)(()=>{if(!D)return[];let e=D;if(en.trim()){let t=en.toLowerCase(),n=t.split(/\s+/);e=(e=D.filter(e=>{var s;let a=e.server_name.toLowerCase(),r=((null===(s=e.mcp_info)||void 0===s?void 0:s.description)||"").toLowerCase();return!!(a.includes(t)||r.includes(t))||n.every(e=>a.includes(e)||r.includes(e))})).sort((e,n)=>{let s=e.server_name.toLowerCase(),a=n.server_name.toLowerCase(),r=s===t?1e3:0,l=a===t?1e3:0,i=s.startsWith(t)?100:0,o=a.startsWith(t)?100:0,c=r+i+(1e3-s.length);return l+o+(1e3-a.length)-c})}return e.filter(e=>0===ep.length||ep.includes(e.transport))},[D,en,ep]),ez=e=>{eN(e),ef(!0)},eR=e=>{eA(e),eb(!0)},eH=e=>{eC(e),ev(!0)},eF=e=>{navigator.clipboard.writeText(e),A.Z.success("Copied to clipboard!")},eG=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),eK=e=>Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).map(e=>{let[t]=e;return t}),eU=e=>"$".concat((1e6*e).toFixed(4)),eV=e=>e?e>=1e3?"".concat((e/1e3).toFixed(0),"K"):e.toString():"N/A",eq=(e,t)=>{let n=[];return e&&n.push("RPM: ".concat(e.toLocaleString())),t&&n.push("TPM: ".concat(t.toLocaleString())),n.length>0?n.join(", "):"N/A"};return(0,s.jsx)(w.f,{accessToken:Z,children:(0,s.jsxs)("div",{className:E?"w-full":"min-h-screen bg-white",children:[!E&&(0,s.jsx)(N.Z,{userID:null,userEmail:null,userRole:null,premiumUser:!1,setProxySettings:ek,proxySettings:eI,accessToken:Z||null,isPublicPage:!0}),(0,s.jsxs)("div",{className:E?"w-full p-6":"w-full px-8 py-12",children:[E&&(0,s.jsx)("div",{className:"mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:(0,s.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."})}),!E&&(0,s.jsxs)(o.Z,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,s.jsx)(d.Z,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"About"}),(0,s.jsx)("p",{className:"text-gray-700 mb-6 text-base leading-relaxed",children:H||"Proxy Server to call 100+ LLMs in the OpenAI format."}),(0,s.jsx)("div",{className:"flex items-center space-x-3 text-sm text-gray-600",children:(0,s.jsxs)("span",{className:"flex items-center",children:[(0,s.jsx)("span",{className:"w-4 h-4 mr-2",children:"\uD83D\uDD27"}),"Built with litellm: v",G]})})]}),U&&Object.keys(U).length>0&&(0,s.jsxs)(o.Z,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,s.jsx)(d.Z,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Useful Links"}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Object.entries(U||{}).map(e=>{var t;let[n,s]=e;return{title:n,url:"string"==typeof s?s:s.url,index:"string"==typeof s?0:null!==(t=s.index)&&void 0!==t?t:0}}).sort((e,t)=>e.index-t.index).map(e=>{let{title:t,url:n}=e;return(0,s.jsxs)("button",{onClick:()=>window.open(n,"_blank"),className:"flex items-center space-x-3 text-blue-600 hover:text-blue-800 transition-colors p-3 rounded-lg hover:bg-blue-50 border border-gray-200",children:[(0,s.jsx)(h.Z,{className:"w-4 h-4"}),(0,s.jsx)(c.Z,{className:"text-sm font-medium",children:t})]},t)})})]}),!E&&(0,s.jsxs)(o.Z,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,s.jsx)(d.Z,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Health and Endpoint Status"}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:(0,s.jsxs)(c.Z,{className:"text-green-600 font-medium text-sm",children:["Service status: ",eg]})})]}),(0,s.jsx)(o.Z,{className:"p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:(0,s.jsxs)(m.default,{activeKey:eZ,onChange:eE,size:"large",className:"public-hub-tabs",children:[(0,s.jsxs)(S,{tab:"Model Hub",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,s.jsx)(d.Z,{className:"text-2xl font-semibold text-gray-900",children:"Available Models"})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,s.jsx)(c.Z,{className:"text-sm font-medium text-gray-700",children:"Search Models:"}),(0,s.jsx)(p.Z,{title:"Smart search with relevance ranking - finds models containing your search terms, ranked by relevance. Try searching 'xai grok-4', 'claude-4', 'gpt-4', or 'sonnet'",placement:"top",children:(0,s.jsx)(b.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(f.Z,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,s.jsx)("input",{type:"text",placeholder:"Search model names... (smart search enabled)",value:$,onChange:e=>Q(e.target.value),className:"border border-gray-300 rounded-lg pl-10 pr-4 py-2 w-full text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Provider:"}),(0,s.jsx)(g.default,{mode:"multiple",value:ea,onChange:e=>er(e),placeholder:"Select providers",className:"w-full",size:"large",allowClear:!0,optionRender:e=>{let{logo:t}=(0,y.dr)(e.value);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,s.jsx)("img",{src:t,alt:e.label,className:"w-5 h-5 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,s.jsx)("span",{className:"capitalize",children:e.label})]})},children:M&&(e=>{let t=new Set;return e.forEach(e=>{e.providers.forEach(e=>t.add(e))}),Array.from(t)})(M).map(e=>(0,s.jsx)(g.default.Option,{value:e,children:e},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Mode:"}),(0,s.jsx)(g.default,{mode:"multiple",value:el,onChange:e=>ei(e),placeholder:"Select modes",className:"w-full",size:"large",allowClear:!0,children:M&&(e=>{let t=new Set;return e.forEach(e=>{e.mode&&t.add(e.mode)}),Array.from(t)})(M).map(e=>(0,s.jsx)(g.default.Option,{value:e,children:e},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Features:"}),(0,s.jsx)(g.default,{mode:"multiple",value:eo,onChange:e=>ec(e),placeholder:"Select features",className:"w-full",size:"large",allowClear:!0,children:M&&(e=>{let t=new Set;return e.forEach(e=>{Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).forEach(e=>{let[n]=e,s=n.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");t.add(s)})}),Array.from(t).sort()})(M).map(e=>(0,s.jsx)(g.default.Option,{value:e,children:e},e))})]})]}),(0,s.jsx)(l.C,{columns:[{header:"Model Name",accessorKey:"model_group",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(p.Z,{title:t.original.model_group,children:(0,s.jsx)(i.Z,{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:()=>ez(t.original),children:t.original.model_group})})})},size:150},{header:"Providers",accessorKey:"providers",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.providers;return(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:n.map(e=>{let{logo:t}=(0,y.dr)(e);return(0,s.jsxs)("div",{className:"flex items-center space-x-1 px-2 py-1 bg-gray-100 rounded text-xs",children:[t&&(0,s.jsx)("img",{src:t,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,s.jsx)("span",{className:"capitalize",children:e})]},e)})})},size:120},{header:"Mode",accessorKey:"mode",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.mode;return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("span",{children:(e=>{switch(null==e?void 0:e.toLowerCase()){case"chat":return"\uD83D\uDCAC";case"rerank":return"\uD83D\uDD04";case"embedding":return"\uD83D\uDCC4";default:return"\uD83E\uDD16"}})(n||"")}),(0,s.jsx)(c.Z,{children:n||"Chat"})]})},size:100},{header:"Max Input",accessorKey:"max_input_tokens",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,s.jsx)(c.Z,{className:"text-center",children:eV(t.original.max_input_tokens)})},size:100,meta:{className:"text-center"}},{header:"Max Output",accessorKey:"max_output_tokens",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,s.jsx)(c.Z,{className:"text-center",children:eV(t.original.max_output_tokens)})},size:100,meta:{className:"text-center"}},{header:"Input $/1M",accessorKey:"input_cost_per_token",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.input_cost_per_token;return(0,s.jsx)(c.Z,{className:"text-center",children:n?eU(n):"Free"})},size:100,meta:{className:"text-center"}},{header:"Output $/1M",accessorKey:"output_cost_per_token",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.output_cost_per_token;return(0,s.jsx)(c.Z,{className:"text-center",children:n?eU(n):"Free"})},size:100,meta:{className:"text-center"}},{header:"Features",accessorKey:"supports_vision",enableSorting:!1,cell:e=>{let{row:t}=e,n=Object.entries(t.original).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).map(e=>{let[t]=e;return eG(t)});return 0===n.length?(0,s.jsx)(c.Z,{className:"text-gray-400",children:"-"}):1===n.length?(0,s.jsx)("div",{className:"h-6 flex items-center",children:(0,s.jsx)(u.Z,{color:"blue",className:"text-xs",children:n[0]})}):(0,s.jsxs)("div",{className:"h-6 flex items-center space-x-1",children:[(0,s.jsx)(u.Z,{color:"blue",className:"text-xs",children:n[0]}),(0,s.jsx)(p.Z,{title:(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("div",{className:"font-medium",children:"All Features:"}),n.map((e,t)=>(0,s.jsxs)("div",{className:"text-xs",children:["• ",e]},t))]}),trigger:"click",placement:"topLeft",children:(0,s.jsxs)("span",{className:"text-xs text-blue-600 cursor-pointer hover:text-blue-800 hover:underline",onClick:e=>e.stopPropagation(),children:["+",n.length-1]})})]})},size:120},{header:"Limits",accessorKey:"rpm",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original;return(0,s.jsx)(c.Z,{className:"text-xs text-gray-600",children:eq(n.rpm,n.tpm)})},size:150}],data:eT,isLoading:q,table:eM,defaultSorting:[{id:"model_group",desc:!1}]}),(0,s.jsx)("div",{className:"mt-8 text-center",children:(0,s.jsxs)(c.Z,{className:"text-sm text-gray-600",children:["Showing ",eT.length," of ",(null==M?void 0:M.length)||0," models"]})})]},"models"),P&&P.length>0&&(0,s.jsxs)(S,{tab:"Agent Hub",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,s.jsx)(d.Z,{className:"text-2xl font-semibold text-gray-900",children:"Available Agents"})}),(0,s.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,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,s.jsx)(c.Z,{className:"text-sm font-medium text-gray-700",children:"Search Agents:"}),(0,s.jsx)(p.Z,{title:"Search agents by name or description",placement:"top",children:(0,s.jsx)(b.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(f.Z,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,s.jsx)("input",{type:"text",placeholder:"Search agent names or descriptions...",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,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Skills:"}),(0,s.jsx)(g.default,{mode:"multiple",value:ed,onChange:e=>em(e),placeholder:"Select skills",className:"w-full",size:"large",allowClear:!0,children:P&&(e=>{let t=new Set;return e.forEach(e=>{var n;null===(n=e.skills)||void 0===n||n.forEach(e=>{var n;null===(n=e.tags)||void 0===n||n.forEach(e=>t.add(e))})}),Array.from(t).sort()})(P).map(e=>(0,s.jsx)(g.default.Option,{value:e,children:e},e))})]})]}),(0,s.jsx)(l.C,{columns:[{header:"Agent Name",accessorKey:"name",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(p.Z,{title:t.original.name,children:(0,s.jsx)(i.Z,{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:()=>eR(t.original),children:t.original.name})})})},size:150},{header:"Description",accessorKey:"description",enableSorting:!1,cell:e=>{let{row:t}=e,n=t.original.description,a=n.length>80?n.substring(0,80)+"...":n;return(0,s.jsx)(p.Z,{title:n,children:(0,s.jsx)(c.Z,{className:"text-sm text-gray-700",children:a})})},size:250},{header:"Version",accessorKey:"version",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,s.jsx)(c.Z,{className:"text-sm",children:t.original.version})},size:80},{header:"Provider",accessorKey:"provider",enableSorting:!1,cell:e=>{let{row:t}=e,n=t.original.provider;return n?(0,s.jsx)("div",{className:"text-sm",children:(0,s.jsx)(c.Z,{className:"font-medium",children:n.organization})}):(0,s.jsx)(c.Z,{className:"text-gray-400",children:"-"})},size:120},{header:"Skills",accessorKey:"skills",enableSorting:!1,cell:e=>{let{row:t}=e,n=t.original.skills||[];return 0===n.length?(0,s.jsx)(c.Z,{className:"text-gray-400",children:"-"}):1===n.length?(0,s.jsx)("div",{className:"h-6 flex items-center",children:(0,s.jsx)(u.Z,{color:"purple",className:"text-xs",children:n[0].name})}):(0,s.jsxs)("div",{className:"h-6 flex items-center space-x-1",children:[(0,s.jsx)(u.Z,{color:"purple",className:"text-xs",children:n[0].name}),(0,s.jsx)(p.Z,{title:(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("div",{className:"font-medium",children:"All Skills:"}),n.map((e,t)=>(0,s.jsxs)("div",{className:"text-xs",children:["• ",e.name]},t))]}),trigger:"click",placement:"topLeft",children:(0,s.jsxs)("span",{className:"text-xs text-purple-600 cursor-pointer hover:text-purple-800 hover:underline",onClick:e=>e.stopPropagation(),children:["+",n.length-1]})})]})},size:150},{header:"Capabilities",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:t}=e,n=Object.entries(t.original.capabilities||{}).filter(e=>{let[t,n]=e;return!0===n}).map(e=>{let[t]=e;return t});return 0===n.length?(0,s.jsx)(c.Z,{className:"text-gray-400",children:"-"}):(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:n.map(e=>(0,s.jsx)(u.Z,{color:"green",className:"text-xs capitalize",children:e},e))})},size:150}],data:eD,isLoading:B,table:eO,defaultSorting:[{id:"name",desc:!1}]}),(0,s.jsx)("div",{className:"mt-8 text-center",children:(0,s.jsxs)(c.Z,{className:"text-sm text-gray-600",children:["Showing ",eD.length," of ",(null==P?void 0:P.length)||0," agents"]})})]},"agents"),D&&D.length>0&&(0,s.jsxs)(S,{tab:"MCP Hub",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,s.jsx)(d.Z,{className:"text-2xl font-semibold text-gray-900",children:"Available MCP Servers"})}),(0,s.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,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,s.jsx)(c.Z,{className:"text-sm font-medium text-gray-700",children:"Search MCP Servers:"}),(0,s.jsx)(p.Z,{title:"Search MCP servers by name or description",placement:"top",children:(0,s.jsx)(b.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(f.Z,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,s.jsx)("input",{type:"text",placeholder:"Search MCP server names or descriptions...",value:en,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,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Transport:"}),(0,s.jsx)(g.default,{mode:"multiple",value:ep,onChange:e=>eu(e),placeholder:"Select transport types",className:"w-full",size:"large",allowClear:!0,children:D&&(e=>{let t=new Set;return e.forEach(e=>{e.transport&&t.add(e.transport)}),Array.from(t).sort()})(D).map(e=>(0,s.jsx)(g.default.Option,{value:e,children:e},e))})]})]}),(0,s.jsx)(l.C,{columns:[{header:"Server Name",accessorKey:"server_name",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(p.Z,{title:t.original.server_name,children:(0,s.jsx)(i.Z,{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:()=>eH(t.original),children:t.original.server_name})})})},size:150},{header:"Description",accessorKey:"mcp_info.description",enableSorting:!1,cell:e=>{var t;let{row:n}=e,a=(null===(t=n.original.mcp_info)||void 0===t?void 0:t.description)||"-",r=a.length>80?a.substring(0,80)+"...":a;return(0,s.jsx)(p.Z,{title:a,children:(0,s.jsx)(c.Z,{className:"text-sm text-gray-700",children:r})})},size:250},{header:"URL",accessorKey:"url",enableSorting:!1,cell:e=>{let{row:t}=e,n=t.original.url,a=n.length>40?n.substring(0,40)+"...":n;return(0,s.jsx)(p.Z,{title:n,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(c.Z,{className:"text-xs font-mono",children:a}),(0,s.jsx)(_.Z,{onClick:()=>eF(n),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-3 h-3"})]})})},size:200},{header:"Transport",accessorKey:"transport",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.transport;return(0,s.jsx)(u.Z,{color:"blue",className:"text-xs uppercase",children:n})},size:100},{header:"Auth Type",accessorKey:"auth_type",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.auth_type;return(0,s.jsx)(u.Z,{color:"none"===n?"gray":"green",className:"text-xs capitalize",children:n})},size:100}],data:eL,isLoading:J,table:eP,defaultSorting:[{id:"server_name",desc:!1}]}),(0,s.jsx)("div",{className:"mt-8 text-center",children:(0,s.jsxs)(c.Z,{className:"text-sm text-gray-600",children:["Showing ",eL.length," of ",(null==D?void 0:D.length)||0," MCP servers"]})})]},"mcp")]})})]}),(0,s.jsx)(x.Z,{title:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("span",{children:(null==ey?void 0:ey.model_group)||"Model Details"}),ey&&(0,s.jsx)(p.Z,{title:"Copy model name",children:(0,s.jsx)(_.Z,{onClick:()=>eF(ey.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:eh,footer:null,onOk:()=>{ef(!1),eN(null)},onCancel:()=>{ef(!1),eN(null)},children:ey&&(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Model Overview"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Model Name:"}),(0,s.jsx)(c.Z,{children:ey.model_group})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Mode:"}),(0,s.jsx)(c.Z,{children:ey.mode||"Not specified"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Providers:"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:ey.providers.map(e=>{let{logo:t}=(0,y.dr)(e);return(0,s.jsx)(u.Z,{color:"blue",children:(0,s.jsxs)("div",{className:"flex items-center space-x-1",children:[t&&(0,s.jsx)("img",{src:t,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,s.jsx)("span",{className:"capitalize",children:e})]})},e)})})]})]}),ey.model_group.includes("*")&&(0,s.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-4",children:(0,s.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,s.jsx)(b.Z,{className:"w-4 h-4 text-blue-600 mt-0.5 flex-shrink-0"}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium text-blue-900 mb-2",children:"Wildcard Routing"}),(0,s.jsxs)(c.Z,{className:"text-sm text-blue-800 mb-2",children:["This model uses wildcard routing. You can pass any value where you see the"," ",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:"*"})," symbol."]}),(0,s.jsxs)(c.Z,{className:"text-sm text-blue-800",children:["For example, with"," ",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:ey.model_group}),", you can use any string (",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:ey.model_group.replace("*","my-custom-value")}),") that matches this pattern."]})]})]})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Token & Cost Information"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Max Input Tokens:"}),(0,s.jsx)(c.Z,{children:(null===(t=ey.max_input_tokens)||void 0===t?void 0:t.toLocaleString())||"Not specified"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Max Output Tokens:"}),(0,s.jsx)(c.Z,{children:(null===(n=ey.max_output_tokens)||void 0===n?void 0:n.toLocaleString())||"Not specified"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,s.jsx)(c.Z,{children:ey.input_cost_per_token?eU(ey.input_cost_per_token):"Not specified"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,s.jsx)(c.Z,{children:ey.output_cost_per_token?eU(ey.output_cost_per_token):"Not specified"})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=eK(ey),t=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,s.jsx)(c.Z,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,n)=>(0,s.jsx)(u.Z,{color:t[n%t.length],children:eG(e)},e))})()})]}),(ey.tpm||ey.rpm)&&(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[ey.tpm&&(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Tokens per Minute:"}),(0,s.jsx)(c.Z,{children:ey.tpm.toLocaleString()})]}),ey.rpm&&(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Requests per Minute:"}),(0,s.jsx)(c.Z,{children:ey.rpm.toLocaleString()})]})]})]}),ey.supported_openai_params&&(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:ey.supported_openai_params.map(e=>(0,s.jsx)(u.Z,{color:"green",children:e},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,s.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,s.jsx)("pre",{className:"text-sm",children:(0,j.L)({apiKeySource:"custom",accessToken:null,apiKey:"your_api_key",inputMessage:"Hello, how are you?",chatHistory:[{role:"user",content:"Hello, how are you?",isImage:!1}],selectedTags:[],selectedVectorStores:[],selectedGuardrails:[],selectedMCPTools:[],endpointType:(0,v.vf)(ey.mode||"chat"),selectedModel:ey.model_group,selectedSdk:"openai"})})}),(0,s.jsx)("div",{className:"mt-2 text-right",children:(0,s.jsx)("button",{onClick:()=>{eF((0,j.L)({apiKeySource:"custom",accessToken:null,apiKey:"your_api_key",inputMessage:"Hello, how are you?",chatHistory:[{role:"user",content:"Hello, how are you?",isImage:!1}],selectedTags:[],selectedVectorStores:[],selectedGuardrails:[],selectedMCPTools:[],endpointType:(0,v.vf)(ey.mode||"chat"),selectedModel:ey.model_group,selectedSdk:"openai"}))},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]})]})}),(0,s.jsx)(x.Z,{title:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("span",{children:(null==ew?void 0:ew.name)||"Agent Details"}),ew&&(0,s.jsx)(p.Z,{title:"Copy agent name",children:(0,s.jsx)(_.Z,{onClick:()=>eF(ew.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:e_,footer:null,onOk:()=>{eb(!1),eA(null)},onCancel:()=>{eb(!1),eA(null)},children:ew&&(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Agent Overview"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Name:"}),(0,s.jsx)(c.Z,{children:ew.name})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Version:"}),(0,s.jsx)(c.Z,{children:ew.version})]}),(0,s.jsxs)("div",{className:"col-span-2",children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Description:"}),(0,s.jsx)(c.Z,{children:ew.description})]}),ew.url&&(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"URL:"}),(0,s.jsx)("a",{href:ew.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 text-sm break-all",children:ew.url})]})]})]}),ew.capabilities&&(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(ew.capabilities).filter(e=>{let[t,n]=e;return!0===n}).map(e=>{let[t]=e;return(0,s.jsx)(u.Z,{color:"green",className:"capitalize",children:t},t)})})]}),ew.skills&&ew.skills.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Skills"}),(0,s.jsx)("div",{className:"space-y-4",children:ew.skills.map((e,t)=>(0,s.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,s.jsx)("div",{className:"flex items-start justify-between mb-2",children:(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium text-base",children:e.name}),(0,s.jsx)(c.Z,{className:"text-sm text-gray-600",children:e.description})]})}),e.tags&&e.tags.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:e.tags.map(e=>(0,s.jsx)(u.Z,{color:"purple",className:"text-xs",children:e},e))})]},t))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Input/Output Modes"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Input Modes:"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:null===(C=ew.defaultInputModes)||void 0===C?void 0:C.map(e=>(0,s.jsx)(u.Z,{color:"blue",children:e},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Output Modes:"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:null===(I=ew.defaultOutputModes)||void 0===I?void 0:I.map(e=>(0,s.jsx)(u.Z,{color:"blue",children:e},e))})]})]})]}),ew.documentationUrl&&(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Documentation"}),(0,s.jsxs)("a",{href:ew.documentationUrl,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 flex items-center space-x-2",children:[(0,s.jsx)(h.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"View Documentation"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Usage Example (A2A Protocol)"}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)(c.Z,{className:"text-sm font-medium mb-2 text-gray-700",children:"Step 1: Retrieve Agent Card"}),(0,s.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,s.jsx)("pre",{className:"text-xs",children:"base_url = '".concat(ew.url,"'\n\nresolver = A2ACardResolver(\n httpx_client=httpx_client,\n base_url=base_url,\n # agent_card_path uses default, extended_agent_card_path also uses default\n)\n\n# Fetch Public Agent Card and Initialize Client\nfinal_agent_card_to_use: AgentCard | None = None\n_public_card = (\n await resolver.get_agent_card()\n) # Fetches from default public path - `/agents/{agent_id}/`\nfinal_agent_card_to_use = _public_card\n\nif _public_card.supports_authenticated_extended_card:\n try:\n auth_headers_dict = {\n 'Authorization': 'Bearer dummy-token-for-extended-card'\n }\n _extended_card = await resolver.get_agent_card(\n relative_card_path=EXTENDED_AGENT_CARD_PATH,\n http_kwargs={'headers': auth_headers_dict},\n )\n final_agent_card_to_use = (\n _extended_card # Update to use the extended card\n )\n except Exception as e_extended:\n logger.warning(\n f'Failed to fetch extended agent card: {e_extended}. Will proceed with public card.',\n exc_info=True,\n )")})}),(0,s.jsx)("div",{className:"mt-2 text-right",children:(0,s.jsx)("button",{onClick:()=>{eF("from a2a.client import A2ACardResolver, A2AClient\nfrom a2a.types import (\n AgentCard,\n MessageSendParams,\n SendMessageRequest,\n SendStreamingMessageRequest,\n)\nfrom a2a.utils.constants import (\n AGENT_CARD_WELL_KNOWN_PATH,\n EXTENDED_AGENT_CARD_PATH,\n)\n\nbase_url = '".concat(ew.url,"'\n\nresolver = A2ACardResolver(\n httpx_client=httpx_client,\n base_url=base_url,\n # agent_card_path uses default, extended_agent_card_path also uses default\n)\n\n# Fetch Public Agent Card and Initialize Client\nfinal_agent_card_to_use: AgentCard | None = None\n_public_card = (\n await resolver.get_agent_card()\n) # Fetches from default public path - `/agents/{agent_id}/`\nfinal_agent_card_to_use = _public_card\n\nif _public_card.supports_authenticated_extended_card:\n try:\n auth_headers_dict = {\n 'Authorization': 'Bearer dummy-token-for-extended-card'\n }\n _extended_card = await resolver.get_agent_card(\n relative_card_path=EXTENDED_AGENT_CARD_PATH,\n http_kwargs={'headers': auth_headers_dict},\n )\n final_agent_card_to_use = (\n _extended_card # Update to use the extended card\n )\n except Exception as e_extended:\n logger.warning(\n f'Failed to fetch extended agent card: {e_extended}. Will proceed with public card.',\n exc_info=True,\n )"))},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-sm font-medium mb-2 text-gray-700",children:"Step 2: Call the Agent"}),(0,s.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,s.jsx)("pre",{className:"text-xs",children:"client = A2AClient(\n httpx_client=httpx_client, agent_card=final_agent_card_to_use\n)\n\nsend_message_payload: dict[str, Any] = {\n 'message': {\n 'role': 'user',\n 'parts': [\n {'kind': 'text', 'text': 'how much is 10 USD in INR?'}\n ],\n 'messageId': uuid4().hex,\n },\n}\nrequest = SendMessageRequest(\n id=str(uuid4()), params=MessageSendParams(**send_message_payload)\n)\n\nresponse = await client.send_message(request)\nprint(response.model_dump(mode='json', exclude_none=True))"})}),(0,s.jsx)("div",{className:"mt-2 text-right",children:(0,s.jsx)("button",{onClick:()=>{eF("client = A2AClient(\n httpx_client=httpx_client, agent_card=final_agent_card_to_use\n)\n\nsend_message_payload: dict[str, Any] = {\n 'message': {\n 'role': 'user',\n 'parts': [\n {'kind': 'text', 'text': 'how much is 10 USD in INR?'}\n ],\n 'messageId': uuid4().hex,\n },\n}\nrequest = SendMessageRequest(\n id=str(uuid4()), params=MessageSendParams(**send_message_payload)\n)\n\nresponse = await client.send_message(request)\nprint(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,s.jsx)(x.Z,{title:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("span",{children:(null==eS?void 0:eS.server_name)||"MCP Server Details"}),eS&&(0,s.jsx)(p.Z,{title:"Copy server name",children:(0,s.jsx)(_.Z,{onClick:()=>eF(eS.server_name),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:ej,footer:null,onOk:()=>{ev(!1),eC(null)},onCancel:()=>{ev(!1),eC(null)},children:eS&&(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Server Overview"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Server Name:"}),(0,s.jsx)(c.Z,{children:eS.server_name})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Transport:"}),(0,s.jsx)(u.Z,{color:"blue",children:eS.transport})]}),eS.alias&&(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Alias:"}),(0,s.jsx)(c.Z,{children:eS.alias})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Auth Type:"}),(0,s.jsx)(u.Z,{color:"none"===eS.auth_type?"gray":"green",children:eS.auth_type})]}),(0,s.jsxs)("div",{className:"col-span-2",children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"Description:"}),(0,s.jsx)(c.Z,{children:(null===(k=eS.mcp_info)||void 0===k?void 0:k.description)||"-"})]}),(0,s.jsxs)("div",{className:"col-span-2",children:[(0,s.jsx)(c.Z,{className:"font-medium",children:"URL:"}),(0,s.jsxs)("a",{href:eS.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,s.jsx)("span",{children:eS.url}),(0,s.jsx)(h.Z,{className:"w-4 h-4"})]})]})]})]}),eS.mcp_info&&Object.keys(eS.mcp_info).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Additional Information"}),(0,s.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,s.jsx)("pre",{className:"text-xs overflow-x-auto",children:JSON.stringify(eS.mcp_info,null,2)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,s.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,s.jsx)("pre",{className:"text-sm",children:'# Using MCP Server with Python FastMCP\n\nfrom fastmcp import Client\nimport asyncio\n\n# Standard MCP configuration\nconfig = {\n "mcpServers": {\n "'.concat(eS.server_name,'": {\n "url": "http://localhost:4000/').concat(eS.server_name,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer sk-1234"\n }\n }\n }\n}\n\n# Create a client that connects to the server\nclient = Client(config)\n\nasync def main():\n async with client:\n # List available tools\n tools = await client.list_tools()\n print(f"Available tools: {[tool.name for tool in tools]}")\n\n # Call a tool\n response = await client.call_tool(\n name="tool_name", \n arguments={"arg": "value"}\n )\n print(f"Response: {response}")\n\nif __name__ == "__main__":\n asyncio.run(main())')})}),(0,s.jsx)("div",{className:"mt-2 text-right",children:(0,s.jsx)("button",{onClick:()=>{eF('# Using MCP Server with Python FastMCP\n\nfrom fastmcp import Client\nimport asyncio\n\n# Standard MCP configuration\nconfig = {\n "mcpServers": {\n "'.concat(eS.server_name,'": {\n "url": "http://localhost:4000/').concat(eS.server_name,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer sk-1234"\n }\n }\n }\n}\n\n# Create a client that connects to the server\nclient = Client(config)\n\nasync def main():\n async with client:\n # List available tools\n tools = await client.list_tools()\n print(f"Available tools: {[tool.name for tool in tools]}")\n\n # Call a tool\n response = await client.call_tool(\n name="tool_name", \n arguments={"arg": "value"}\n )\n print(f"Response: {response}")\n\nif __name__ == "__main__":\n asyncio.run(main())'))},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]})]})})]})})}},69734:function(e,t,n){n.d(t,{F:function(){return i},f:function(){return o}});var s=n(57437),a=n(2265),r=n(19250);let l=(0,a.createContext)(void 0),i=()=>{let e=(0,a.useContext)(l);if(!e)throw Error("useTheme must be used within a ThemeProvider");return e},o=e=>{let{children:t,accessToken:n}=e,[i,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{(async()=>{try{let t=(0,r.getProxyBaseUrl)(),n=await fetch(t?"".concat(t,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{"Content-Type":"application/json"}});if(n.ok){var e;let t=await n.json();(null===(e=t.values)||void 0===e?void 0:e.logo_url)&&o(t.values.logo_url)}}catch(e){console.warn("Failed to load logo settings from backend:",e)}})()},[]),(0,s.jsx)(l.Provider,{value:{logoUrl:i,setLogoUrl:o},children:t})}},91624:function(e,t,n){n.d(t,{C:function(){return a}});var s=n(19250);let a=async e=>{if(!e)return null;try{return await (0,s.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7526-997a4faae4b21df5.js b/litellm/proxy/_experimental/out/_next/static/chunks/7526-997a4faae4b21df5.js deleted file mode 100644 index 660c24f8aaf..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/7526-997a4faae4b21df5.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7526],{19130:function(e,t,n){n.d(t,{RM:function(){return s.Z},SC:function(){return o.Z},iA:function(){return a.Z},pj:function(){return r.Z},ss:function(){return l.Z},xs:function(){return i.Z}});var a=n(21626),s=n(97214),r=n(28241),l=n(58834),i=n(69552),o=n(71876)},8048:function(e,t,n){n.d(t,{C:function(){return m}});var a=n(57437),s=n(71594),r=n(24525),l=n(2265),i=n(19130),o=n(44633),c=n(86462),d=n(49084);function m(e){let{data:t=[],columns:n,isLoading:m=!1,table:p,defaultSorting:u=[]}=e,[g,x]=l.useState(u),[h]=l.useState("onChange"),[f,_]=l.useState({}),[b,j]=l.useState({}),v=(0,s.b7)({data:t,columns:n,state:{sorting:g,columnSizing:f,columnVisibility:b},columnResizeMode:h,onSortingChange:x,onColumnSizingChange:_,onColumnVisibilityChange:j,getCoreRowModel:(0,r.sC)(),getSortedRowModel:(0,r.tj)(),enableSorting:!0,enableColumnResizing:!0,defaultColumn:{minSize:40,maxSize:500}});return l.useEffect(()=>{p&&(p.current=v)},[v,p]),(0,a.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsx)("div",{className:"relative min-w-full",children:(0,a.jsxs)(i.iA,{className:"[&_td]:py-2 [&_th]:py-2 w-full",children:[(0,a.jsx)(i.ss,{children:v.getHeaderGroups().map(e=>(0,a.jsx)(i.SC,{children:e.headers.map(e=>{var t;return(0,a.jsxs)(i.xs,{className:"py-1 h-8 relative ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.id?120:e.getSize(),position:"actions"===e.id?"sticky":"relative",right:"actions"===e.id?0:"auto"},onClick:e.column.getCanSort()?e.column.getToggleSortingHandler():void 0,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,s.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,a.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,a.jsx)(o.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,a.jsx)(c.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,a.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"})})]}),e.column.getCanResize()&&(0,a.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"absolute right-0 top-0 h-full w-2 cursor-col-resize select-none touch-none ".concat(e.column.getIsResizing()?"bg-blue-500":"hover:bg-blue-200")})]},e.id)})},e.id))}),(0,a.jsx)(i.RM,{children:m?(0,a.jsx)(i.SC,{children:(0,a.jsx)(i.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,a.jsx)("div",{className:"text-center text-gray-500",children:(0,a.jsx)("p",{children:"\uD83D\uDE85 Loading models..."})})})}):v.getRowModel().rows.length>0?v.getRowModel().rows.map(e=>(0,a.jsx)(i.SC,{children:e.getVisibleCells().map(e=>{var t;return(0,a.jsx)(i.pj,{className:"py-0.5 ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.column.id?120:e.column.getSize(),position:"actions"===e.column.id?"sticky":"relative",right:"actions"===e.column.id?0:"auto"},children:(0,s.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)):(0,a.jsx)(i.SC,{children:(0,a.jsx)(i.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,a.jsx)("div",{className:"text-center text-gray-500",children:(0,a.jsx)("p",{children:"No models found"})})})})})]})})})})}},67325:function(e,t,n){var a=n(57437),s=n(27648),r=n(2265),l=n(99981),i=n(73705),o=n(19250),c=n(15883),d=n(46346),m=n(57400),p=n(91870),u=n(40428),g=n(83884),x=n(45524),h=n(3914),f=n(91624),_=n(69734);t.Z=e=>{let{userID:t,userEmail:n,userRole:b,premiumUser:j,proxySettings:v,setProxySettings:y,accessToken:N,isPublicPage:w=!1,sidebarCollapsed:A=!1,onToggleSidebar:S}=e,C=(0,o.getProxyBaseUrl)(),[I,k]=(0,r.useState)(""),{logoUrl:Z}=(0,_.F)();(0,r.useEffect)(()=>{(async()=>{if(N){let e=await (0,f.C)(N);console.log("response from fetchProxySettings",e),e&&y(e)}})()},[N]),(0,r.useEffect)(()=>{k((null==v?void 0:v.PROXY_LOGOUT_URL)||"")},[v]);let E=[{key:"user-info",onClick:e=>{var t;return null===(t=e.domEvent)||void 0===t?void 0:t.stopPropagation()},label:(0,a.jsxs)("div",{className:"px-3 py-3 border-b border-gray-100",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(c.Z,{className:"mr-2 text-gray-700"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:t})]}),j?(0,a.jsx)(l.Z,{title:"Premium User",placement:"left",children:(0,a.jsxs)("div",{className:"flex items-center bg-gradient-to-r from-amber-500 to-yellow-500 text-white px-2 py-0.5 rounded-full cursor-help",children:[(0,a.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,a.jsx)("span",{className:"text-xs font-medium",children:"Premium"})]})}):(0,a.jsx)(l.Z,{title:"Upgrade to Premium for advanced features",placement:"left",children:(0,a.jsxs)("div",{className:"flex items-center bg-gray-100 text-gray-500 px-2 py-0.5 rounded-full cursor-help",children:[(0,a.jsx)(d.Z,{className:"mr-1 text-xs"}),(0,a.jsx)("span",{className:"text-xs font-medium",children:"Standard"})]})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center text-sm",children:[(0,a.jsx)(m.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,a.jsx)("span",{className:"text-gray-500 text-xs",children:"Role"}),(0,a.jsx)("span",{className:"ml-auto text-gray-700 font-medium",children:b})]}),(0,a.jsxs)("div",{className:"flex items-center text-sm",children:[(0,a.jsx)(p.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,a.jsx)("span",{className:"text-gray-500 text-xs",children:"Email"}),(0,a.jsx)("span",{className:"ml-auto text-gray-700 font-medium truncate max-w-[150px]",title:n||"Unknown",children:n||"Unknown"})]})]})]})},{key:"logout",label:(0,a.jsxs)("div",{className:"flex items-center py-2 px-3 hover:bg-gray-50 rounded-md mx-1 my-1",onClick:()=>{(0,h.b)(),window.location.href=I},children:[(0,a.jsx)(u.Z,{className:"mr-3 text-gray-600"}),(0,a.jsx)("span",{className:"text-gray-800",children:"Logout"})]})}];return(0,a.jsx)("nav",{className:"bg-white border-b border-gray-200 sticky top-0 z-10",children:(0,a.jsx)("div",{className:"w-full",children:(0,a.jsxs)("div",{className:"flex items-center h-14 px-4",children:[" ",(0,a.jsxs)("div",{className:"flex items-center flex-shrink-0",children:[S&&(0,a.jsx)("button",{onClick:S,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:A?"Expand sidebar":"Collapse sidebar",children:(0,a.jsx)("span",{className:"text-lg",children:A?(0,a.jsx)(g.Z,{}):(0,a.jsx)(x.Z,{})})}),(0,a.jsx)(s.default,{href:"/",className:"flex items-center",children:(0,a.jsx)("img",{src:Z||"".concat(C,"/get_image"),alt:"LiteLLM Brand",className:"h-10 w-auto"})})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-5 ml-auto",children:[(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-gray-600 hover:text-gray-900 transition-colors",children:"Docs"}),!w&&(0,a.jsx)(i.Z,{menu:{items:E,className:"min-w-[200px]",style:{padding:"8px",marginTop:"8px",borderRadius:"12px",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.08)"}},overlayStyle:{minWidth:"200px"},children:(0,a.jsxs)("button",{className:"inline-flex items-center text-sm text-gray-600 hover:text-gray-900 transition-colors",children:["User",(0,a.jsx)("svg",{className:"ml-1 w-5 h-5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 9l-7 7-7-7"})})]})})]})]})})})}},82971:function(e,t,n){n.d(t,{L:function(){return s}});var a=n(8443);let s=e=>{let t;let{apiKeySource:n,accessToken:s,apiKey:r,inputMessage:l,chatHistory:i,selectedTags:o,selectedVectorStores:c,selectedGuardrails:d,selectedMCPTools:m,selectedVoice:p,endpointType:u,selectedModel:g,selectedSdk:x,proxySettings:h}=e,f="session"===n?s:r,_=window.location.origin,b=null==h?void 0:h.LITELLM_UI_API_DOC_BASE_URL;b&&b.trim()?_=b:(null==h?void 0:h.PROXY_BASE_URL)&&(_=h.PROXY_BASE_URL);let j=l||"Your prompt here",v=j.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),y=i.filter(e=>!e.isImage).map(e=>{let{role:t,content:n}=e;return{role:t,content:n}}),N={};o.length>0&&(N.tags=o),c.length>0&&(N.vector_stores=c),d.length>0&&(N.guardrails=d);let w=g||"your-model-name",A="azure"===x?'import openai\n\nclient = openai.AzureOpenAI(\n api_key="'.concat(f||"YOUR_LITELLM_API_KEY",'",\n azure_endpoint="').concat(_,'",\n api_version="2024-02-01"\n)'):'import openai\n\nclient = openai.OpenAI(\n api_key="'.concat(f||"YOUR_LITELLM_API_KEY",'",\n base_url="').concat(_,'"\n)');switch(u){case a.KP.CHAT:{let e=Object.keys(N).length>0,n="";if(e){let e=JSON.stringify({metadata:N},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();n=",\n extra_body=".concat(e)}let a=y.length>0?y:[{role:"user",content:j}];t='\nimport base64\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# Example with text only\nresponse = client.chat.completions.create(\n model="'.concat(w,'",\n messages=').concat(JSON.stringify(a,null,4)).concat(n,'\n)\n\nprint(response)\n\n# Example with image or PDF (uncomment and provide file path to use)\n# base64_file = encode_image("path/to/your/file.jpg") # or .pdf\n# response_with_file = client.chat.completions.create(\n# model="').concat(w,'",\n# messages=[\n# {\n# "role": "user",\n# "content": [\n# {\n# "type": "text",\n# "text": "').concat(v,'"\n# },\n# {\n# "type": "image_url",\n# "image_url": {\n# "url": f"data:image/jpeg;base64,{base64_file}" # or data:application/pdf;base64,{base64_file}\n# }\n# }\n# ]\n# }\n# ]').concat(n,"\n# )\n# print(response_with_file)\n");break}case a.KP.RESPONSES:{let e=Object.keys(N).length>0,n="";if(e){let e=JSON.stringify({metadata:N},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();n=",\n extra_body=".concat(e)}let a=y.length>0?y:[{role:"user",content:j}];t='\nimport base64\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# Example with text only\nresponse = client.responses.create(\n model="'.concat(w,'",\n input=').concat(JSON.stringify(a,null,4)).concat(n,'\n)\n\nprint(response.output_text)\n\n# Example with image or PDF (uncomment and provide file path to use)\n# base64_file = encode_image("path/to/your/file.jpg") # or .pdf\n# response_with_file = client.responses.create(\n# model="').concat(w,'",\n# input=[\n# {\n# "role": "user",\n# "content": [\n# {"type": "input_text", "text": "').concat(v,'"},\n# {\n# "type": "input_image",\n# "image_url": f"data:image/jpeg;base64,{base64_file}", # or data:application/pdf;base64,{base64_file}\n# },\n# ],\n# }\n# ]').concat(n,"\n# )\n# print(response_with_file.output_text)\n");break}case a.KP.IMAGE:t="azure"===x?"\n# NOTE: The Azure SDK does not have a direct equivalent to the multi-modal 'responses.create' method shown for OpenAI.\n# This snippet uses 'client.images.generate' and will create a new image based on your prompt.\n# It does not use the uploaded image, as 'client.images.generate' does not support image inputs in this context.\nimport os\nimport requests\nimport json\nimport time\nfrom PIL import Image\n\nresult = client.images.generate(\n model=\"".concat(w,'",\n prompt="').concat(l,'",\n n=1\n)\n\njson_response = json.loads(result.model_dump_json())\n\n# Set the directory for the stored image\nimage_dir = os.path.join(os.curdir, \'images\')\n\n# If the directory doesn\'t exist, create it\nif not os.path.isdir(image_dir):\n os.mkdir(image_dir)\n\n# Initialize the image path\nimage_filename = f"generated_image_{int(time.time())}.png"\nimage_path = os.path.join(image_dir, image_filename)\n\ntry:\n # Retrieve the generated image\n if json_response.get("data") && len(json_response["data"]) > 0 && json_response["data"][0].get("url"):\n image_url = json_response["data"][0]["url"]\n generated_image = requests.get(image_url).content\n with open(image_path, "wb") as image_file:\n image_file.write(generated_image)\n\n print(f"Image saved to {image_path}")\n # Display the image\n image = Image.open(image_path)\n image.show()\n else:\n print("Could not find image URL in response.")\n print("Full response:", json_response)\nexcept Exception as e:\n print(f"An error occurred: {e}")\n print("Full response:", json_response)\n'):"\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(v,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(w,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;case a.KP.IMAGE_EDITS:t="azure"===x?'\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# The prompt entered by the user\nprompt = "'.concat(v,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(w,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n'):"\nimport base64\nimport os\nimport time\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(v,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(w,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;case a.KP.EMBEDDINGS:t='\nresponse = client.embeddings.create(\n input="'.concat(l||"Your string here",'",\n model="').concat(w,'",\n encoding_format="base64" # or "float"\n)\n\nprint(response.data[0].embedding)\n');break;case a.KP.TRANSCRIPTION:t='\n# Open the audio file\naudio_file = open("path/to/your/audio/file.mp3", "rb")\n\n# Make the transcription request\nresponse = client.audio.transcriptions.create(\n model="'.concat(w,'",\n file=audio_file').concat(l?',\n prompt="'.concat(l.replace(/"/g,'\\"'),'"'):"","\n)\n\nprint(response.text)\n");break;case a.KP.SPEECH:t='\n# Make the text-to-speech request\nresponse = client.audio.speech.create(\n model="'.concat(w,'",\n input="').concat(l||"Your text to convert to speech here",'",\n voice="').concat(p,'" # Options: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer\n)\n\n# Save the audio to a file\noutput_filename = "output_speech.mp3"\nresponse.stream_to_file(output_filename)\nprint(f"Audio saved to {output_filename}")\n\n# Optional: Customize response format and speed\n# response = client.audio.speech.create(\n# model="').concat(w,'",\n# input="').concat(l||"Your text to convert to speech here",'",\n# voice="alloy",\n# response_format="mp3", # Options: mp3, opus, aac, flac, wav, pcm\n# speed=1.0 # Range: 0.25 to 4.0\n# )\n# response.stream_to_file("output_speech.mp3")\n');break;default:t="\n# Code generation for this endpoint is not implemented yet."}return"".concat(A,"\n").concat(t)}},8443:function(e,t,n){var a,s,r,l;n.d(t,{KP:function(){return s},vf:function(){return o}}),(r=a||(a={})).AUDIO_SPEECH="audio_speech",r.AUDIO_TRANSCRIPTION="audio_transcription",r.IMAGE_GENERATION="image_generation",r.VIDEO_GENERATION="video_generation",r.CHAT="chat",r.RESPONSES="responses",r.IMAGE_EDITS="image_edits",r.ANTHROPIC_MESSAGES="anthropic_messages",r.EMBEDDING="embedding",(l=s||(s={})).IMAGE="image",l.VIDEO="video",l.CHAT="chat",l.RESPONSES="responses",l.IMAGE_EDITS="image_edits",l.ANTHROPIC_MESSAGES="anthropic_messages",l.EMBEDDINGS="embeddings",l.SPEECH="speech",l.TRANSCRIPTION="transcription",l.A2A_AGENTS="a2a_agents";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"},o=e=>{if(console.log("getEndpointType:",e),Object.values(a).includes(e)){let t=i[e];return console.log("endpointType:",t),t}return"chat"}},42673:function(e,t,n){var a,s;n.d(t,{Cl:function(){return a},bK:function(){return d},cd:function(){return i},dr:function(){return o},fK:function(){return r},ph:function(){return c}}),(s=a||(a={})).A2A_Agent="A2A Agent",s.AIML="AI/ML API",s.Bedrock="Amazon Bedrock",s.Anthropic="Anthropic",s.AssemblyAI="AssemblyAI",s.SageMaker="AWS SageMaker",s.Azure="Azure",s.Azure_AI_Studio="Azure AI Foundry (Studio)",s.Cerebras="Cerebras",s.Cohere="Cohere",s.Dashscope="Dashscope",s.Databricks="Databricks (Qwen API)",s.DeepInfra="DeepInfra",s.Deepgram="Deepgram",s.Deepseek="Deepseek",s.ElevenLabs="ElevenLabs",s.FalAI="Fal AI",s.FireworksAI="Fireworks AI",s.Google_AI_Studio="Google AI Studio",s.GradientAI="GradientAI",s.Groq="Groq",s.Hosted_Vllm="vllm",s.Infinity="Infinity",s.JinaAI="Jina AI",s.MistralAI="Mistral AI",s.Ollama="Ollama",s.OpenAI="OpenAI",s.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",s.OpenAI_Text="OpenAI Text Completion",s.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",s.Openrouter="Openrouter",s.Oracle="Oracle Cloud Infrastructure (OCI)",s.Perplexity="Perplexity",s.RunwayML="RunwayML",s.Sambanova="Sambanova",s.Snowflake="Snowflake",s.TogetherAI="TogetherAI",s.Triton="Triton",s.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",s.VolcEngine="VolcEngine",s.Voyage="Voyage AI",s.xAI="xAI";let r={A2A_Agent:"a2a_agent",AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",RunwayML:"runwayml",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",FalAI:"fal_ai",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity"},l="../ui/assets/logos/",i={"A2A Agent":"".concat(l,"a2a_agent.png"),"AI/ML API":"".concat(l,"aiml_api.svg"),Anthropic:"".concat(l,"anthropic.svg"),AssemblyAI:"".concat(l,"assemblyai_small.png"),Azure:"".concat(l,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(l,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(l,"bedrock.svg"),"AWS SageMaker":"".concat(l,"bedrock.svg"),Cerebras:"".concat(l,"cerebras.svg"),Cohere:"".concat(l,"cohere.svg"),"Databricks (Qwen API)":"".concat(l,"databricks.svg"),Dashscope:"".concat(l,"dashscope.svg"),Deepseek:"".concat(l,"deepseek.svg"),"Fireworks AI":"".concat(l,"fireworks.svg"),Groq:"".concat(l,"groq.svg"),"Google AI Studio":"".concat(l,"google.svg"),vllm:"".concat(l,"vllm.png"),Infinity:"".concat(l,"infinity.png"),"Mistral AI":"".concat(l,"mistral.svg"),Ollama:"".concat(l,"ollama.svg"),OpenAI:"".concat(l,"openai_small.svg"),"OpenAI Text Completion":"".concat(l,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(l,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(l,"openai_small.svg"),Openrouter:"".concat(l,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(l,"oracle.svg"),Perplexity:"".concat(l,"perplexity-ai.svg"),RunwayML:"".concat(l,"runwayml.png"),Sambanova:"".concat(l,"sambanova.svg"),Snowflake:"".concat(l,"snowflake.svg"),TogetherAI:"".concat(l,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(l,"google.svg"),xAI:"".concat(l,"xai.svg"),GradientAI:"".concat(l,"gradientai.svg"),Triton:"".concat(l,"nvidia_triton.png"),Deepgram:"".concat(l,"deepgram.png"),ElevenLabs:"".concat(l,"elevenlabs.png"),"Fal AI":"".concat(l,"fal_ai.jpg"),"Voyage AI":"".concat(l,"voyage.webp"),"Jina AI":"".concat(l,"jina.png"),VolcEngine:"".concat(l,"volcengine.png"),DeepInfra:"".concat(l,"deepinfra.png")},o=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}},c=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||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";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 return"gpt-3.5-turbo"},d=(e,t)=>{console.log("Provider key: ".concat(e));let n=r[e];console.log("Provider mapped to: ".concat(n));let a=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(e=>{let[t,s]=e;null!==s&&"object"==typeof s&&"litellm_provider"in s&&(s.litellm_provider===n||s.litellm_provider.includes(n))&&a.push(t)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(e=>{let[t,n]=e;null!==n&&"object"==typeof n&&"litellm_provider"in n&&"cohere_chat"===n.litellm_provider&&a.push(t)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(e=>{let[t,n]=e;null!==n&&"object"==typeof n&&"litellm_provider"in n&&"sagemaker_chat"===n.litellm_provider&&a.push(t)}))),a}},87526:function(e,t,n){n.d(t,{Z:function(){return C}});var a=n(57437),s=n(2265),r=n(19250),l=n(8048),i=n(78489),o=n(12514),c=n(84264),d=n(96761),m=n(65869),p=n(99981),u=n(3810),g=n(37592),x=n(22116),h=n(3477),f=n(17732),_=n(78867),b=n(33245),j=n(82971),v=n(8443),y=n(42673),N=n(67325),w=n(69734),A=n(9114);let{TabPane:S}=m.default;var C=e=>{var t,n,C,I,k;let{accessToken:Z,isEmbedded:E=!1}=e,[M,O]=(0,s.useState)(null),[P,T]=(0,s.useState)(null),[D,L]=(0,s.useState)(null),[z,R]=(0,s.useState)("LiteLLM Gateway"),[H,F]=(0,s.useState)(null),[G,K]=(0,s.useState)(""),[U,V]=(0,s.useState)({}),[q,W]=(0,s.useState)(!0),[B,Y]=(0,s.useState)(!0),[J,X]=(0,s.useState)(!0),[$,Q]=(0,s.useState)(""),[ee,et]=(0,s.useState)(""),[en,ea]=(0,s.useState)(""),[es,er]=(0,s.useState)([]),[el,ei]=(0,s.useState)([]),[eo,ec]=(0,s.useState)([]),[ed,em]=(0,s.useState)([]),[ep,eu]=(0,s.useState)([]),[eg,ex]=(0,s.useState)("I'm alive! ✓"),[eh,ef]=(0,s.useState)(!1),[e_,eb]=(0,s.useState)(!1),[ej,ev]=(0,s.useState)(!1),[ey,eN]=(0,s.useState)(null),[ew,eA]=(0,s.useState)(null),[eS,eC]=(0,s.useState)(null),[eI,ek]=(0,s.useState)({}),[eZ,eE]=(0,s.useState)("models"),eM=(0,s.useRef)(null),eO=(0,s.useRef)(null),eP=(0,s.useRef)(null);(0,s.useEffect)(()=>{(async()=>{try{await (0,r.getUiConfig)()}catch(e){console.error("Failed to get UI config:",e)}let e=async()=>{try{W(!0);let e=await (0,r.modelHubPublicModelsCall)();console.log("ModelHubData:",e),O(e)}catch(e){console.error("There was an error fetching the public model data",e),ex("Service unavailable")}finally{W(!1)}},t=async()=>{try{Y(!0);let e=await (0,r.agentHubPublicModelsCall)();console.log("AgentHubData:",e),T(e)}catch(e){console.error("There was an error fetching the public agent data",e)}finally{Y(!1)}},n=async()=>{try{X(!0);let e=await (0,r.mcpHubPublicServersCall)();console.log("MCPHubData:",e),L(e)}catch(e){console.error("There was an error fetching the public MCP server data",e)}finally{X(!1)}};(async()=>{let e=await (0,r.getPublicModelHubInfo)();console.log("Public Model Hub Info:",e),R(e.docs_title),F(e.custom_docs_description),K(e.litellm_version),V(e.useful_links||{})})(),e(),t(),n()})()},[]),(0,s.useEffect)(()=>{},[$,es,el,eo]);let eT=(0,s.useMemo)(()=>{if(!M)return[];let e=M;if($.trim()){let t=$.toLowerCase(),n=t.split(/\s+/),a=M.filter(e=>{let a=e.model_group.toLowerCase();return!!a.includes(t)||n.every(e=>a.includes(e))});a.length>0&&(e=a.sort((e,n)=>{let a=e.model_group.toLowerCase(),s=n.model_group.toLowerCase(),r=a===t?1e3:0,l=s===t?1e3:0,i=a.startsWith(t)?100:0,o=s.startsWith(t)?100:0,c=t.split(/\s+/).every(e=>a.includes(e))?50:0,d=t.split(/\s+/).every(e=>s.includes(e))?50:0,m=a.length;return l+o+d+(1e3-s.length)-(r+i+c+(1e3-m))}))}return e.filter(e=>{let t=0===es.length||es.some(t=>e.providers.includes(t)),n=0===el.length||el.includes(e.mode||""),a=0===eo.length||Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).some(e=>{let[t]=e,n=t.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return eo.includes(n)});return t&&n&&a})},[M,$,es,el,eo]),eD=(0,s.useMemo)(()=>{if(!P)return[];let e=P;if(ee.trim()){let t=ee.toLowerCase(),n=t.split(/\s+/);e=(e=P.filter(e=>{let a=e.name.toLowerCase(),s=e.description.toLowerCase();return!!(a.includes(t)||s.includes(t))||n.every(e=>a.includes(e)||s.includes(e))})).sort((e,n)=>{let a=e.name.toLowerCase(),s=n.name.toLowerCase(),r=a===t?1e3:0,l=s===t?1e3:0,i=a.startsWith(t)?100:0,o=s.startsWith(t)?100:0,c=r+i+(1e3-a.length);return l+o+(1e3-s.length)-c})}return e.filter(e=>{var t;return 0===ed.length||(null===(t=e.skills)||void 0===t?void 0:t.some(e=>{var t;return null===(t=e.tags)||void 0===t?void 0:t.some(e=>ed.includes(e))}))})},[P,ee,ed]),eL=(0,s.useMemo)(()=>{if(!D)return[];let e=D;if(en.trim()){let t=en.toLowerCase(),n=t.split(/\s+/);e=(e=D.filter(e=>{var a;let s=e.server_name.toLowerCase(),r=((null===(a=e.mcp_info)||void 0===a?void 0:a.description)||"").toLowerCase();return!!(s.includes(t)||r.includes(t))||n.every(e=>s.includes(e)||r.includes(e))})).sort((e,n)=>{let a=e.server_name.toLowerCase(),s=n.server_name.toLowerCase(),r=a===t?1e3:0,l=s===t?1e3:0,i=a.startsWith(t)?100:0,o=s.startsWith(t)?100:0,c=r+i+(1e3-a.length);return l+o+(1e3-s.length)-c})}return e.filter(e=>0===ep.length||ep.includes(e.transport))},[D,en,ep]),ez=e=>{eN(e),ef(!0)},eR=e=>{eA(e),eb(!0)},eH=e=>{eC(e),ev(!0)},eF=e=>{navigator.clipboard.writeText(e),A.Z.success("Copied to clipboard!")},eG=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),eK=e=>Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).map(e=>{let[t]=e;return t}),eU=e=>"$".concat((1e6*e).toFixed(4)),eV=e=>e?e>=1e3?"".concat((e/1e3).toFixed(0),"K"):e.toString():"N/A",eq=(e,t)=>{let n=[];return e&&n.push("RPM: ".concat(e.toLocaleString())),t&&n.push("TPM: ".concat(t.toLocaleString())),n.length>0?n.join(", "):"N/A"};return(0,a.jsx)(w.f,{accessToken:Z,children:(0,a.jsxs)("div",{className:E?"w-full":"min-h-screen bg-white",children:[!E&&(0,a.jsx)(N.Z,{userID:null,userEmail:null,userRole:null,premiumUser:!1,setProxySettings:ek,proxySettings:eI,accessToken:Z||null,isPublicPage:!0}),(0,a.jsxs)("div",{className:E?"w-full p-6":"w-full px-8 py-12",children:[E&&(0,a.jsx)("div",{className:"mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:(0,a.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."})}),!E&&(0,a.jsxs)(o.Z,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,a.jsx)(d.Z,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"About"}),(0,a.jsx)("p",{className:"text-gray-700 mb-6 text-base leading-relaxed",children:H||"Proxy Server to call 100+ LLMs in the OpenAI format."}),(0,a.jsx)("div",{className:"flex items-center space-x-3 text-sm text-gray-600",children:(0,a.jsxs)("span",{className:"flex items-center",children:[(0,a.jsx)("span",{className:"w-4 h-4 mr-2",children:"\uD83D\uDD27"}),"Built with litellm: v",G]})})]}),U&&Object.keys(U).length>0&&(0,a.jsxs)(o.Z,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,a.jsx)(d.Z,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Useful Links"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Object.entries(U||{}).map(e=>{let[t,n]=e;return(0,a.jsxs)("button",{onClick:()=>window.open(n,"_blank"),className:"flex items-center space-x-3 text-blue-600 hover:text-blue-800 transition-colors p-3 rounded-lg hover:bg-blue-50 border border-gray-200",children:[(0,a.jsx)(h.Z,{className:"w-4 h-4"}),(0,a.jsx)(c.Z,{className:"text-sm font-medium",children:t})]},t)})})]}),!E&&(0,a.jsxs)(o.Z,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,a.jsx)(d.Z,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Health and Endpoint Status"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:(0,a.jsxs)(c.Z,{className:"text-green-600 font-medium text-sm",children:["Service status: ",eg]})})]}),(0,a.jsx)(o.Z,{className:"p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:(0,a.jsxs)(m.default,{activeKey:eZ,onChange:eE,size:"large",className:"public-hub-tabs",children:[(0,a.jsxs)(S,{tab:"Model Hub",children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,a.jsx)(d.Z,{className:"text-2xl font-semibold text-gray-900",children:"Available Models"})}),(0,a.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,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium text-gray-700",children:"Search Models:"}),(0,a.jsx)(p.Z,{title:"Smart search with relevance ranking - finds models containing your search terms, ranked by relevance. Try searching 'xai grok-4', 'claude-4', 'gpt-4', or 'sonnet'",placement:"top",children:(0,a.jsx)(b.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(f.Z,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,a.jsx)("input",{type:"text",placeholder:"Search model names... (smart search enabled)",value:$,onChange:e=>Q(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,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Provider:"}),(0,a.jsx)(g.default,{mode:"multiple",value:es,onChange:e=>er(e),placeholder:"Select providers",className:"w-full",size:"large",allowClear:!0,optionRender:e=>{let{logo:t}=(0,y.dr)(e.value);return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,a.jsx)("img",{src:t,alt:e.label,className:"w-5 h-5 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,a.jsx)("span",{className:"capitalize",children:e.label})]})},children:M&&(e=>{let t=new Set;return e.forEach(e=>{e.providers.forEach(e=>t.add(e))}),Array.from(t)})(M).map(e=>(0,a.jsx)(g.default.Option,{value:e,children:e},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Mode:"}),(0,a.jsx)(g.default,{mode:"multiple",value:el,onChange:e=>ei(e),placeholder:"Select modes",className:"w-full",size:"large",allowClear:!0,children:M&&(e=>{let t=new Set;return e.forEach(e=>{e.mode&&t.add(e.mode)}),Array.from(t)})(M).map(e=>(0,a.jsx)(g.default.Option,{value:e,children:e},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Features:"}),(0,a.jsx)(g.default,{mode:"multiple",value:eo,onChange:e=>ec(e),placeholder:"Select features",className:"w-full",size:"large",allowClear:!0,children:M&&(e=>{let t=new Set;return e.forEach(e=>{Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).forEach(e=>{let[n]=e,a=n.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");t.add(a)})}),Array.from(t).sort()})(M).map(e=>(0,a.jsx)(g.default.Option,{value:e,children:e},e))})]})]}),(0,a.jsx)(l.C,{columns:[{header:"Model Name",accessorKey:"model_group",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(p.Z,{title:t.original.model_group,children:(0,a.jsx)(i.Z,{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:()=>ez(t.original),children:t.original.model_group})})})},size:150},{header:"Providers",accessorKey:"providers",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.providers;return(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:n.map(e=>{let{logo:t}=(0,y.dr)(e);return(0,a.jsxs)("div",{className:"flex items-center space-x-1 px-2 py-1 bg-gray-100 rounded text-xs",children:[t&&(0,a.jsx)("img",{src:t,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,a.jsx)("span",{className:"capitalize",children:e})]},e)})})},size:120},{header:"Mode",accessorKey:"mode",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.mode;return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{children:(e=>{switch(null==e?void 0:e.toLowerCase()){case"chat":return"\uD83D\uDCAC";case"rerank":return"\uD83D\uDD04";case"embedding":return"\uD83D\uDCC4";default:return"\uD83E\uDD16"}})(n||"")}),(0,a.jsx)(c.Z,{children:n||"Chat"})]})},size:100},{header:"Max Input",accessorKey:"max_input_tokens",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,a.jsx)(c.Z,{className:"text-center",children:eV(t.original.max_input_tokens)})},size:100,meta:{className:"text-center"}},{header:"Max Output",accessorKey:"max_output_tokens",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,a.jsx)(c.Z,{className:"text-center",children:eV(t.original.max_output_tokens)})},size:100,meta:{className:"text-center"}},{header:"Input $/1M",accessorKey:"input_cost_per_token",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.input_cost_per_token;return(0,a.jsx)(c.Z,{className:"text-center",children:n?eU(n):"Free"})},size:100,meta:{className:"text-center"}},{header:"Output $/1M",accessorKey:"output_cost_per_token",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.output_cost_per_token;return(0,a.jsx)(c.Z,{className:"text-center",children:n?eU(n):"Free"})},size:100,meta:{className:"text-center"}},{header:"Features",accessorKey:"supports_vision",enableSorting:!1,cell:e=>{let{row:t}=e,n=Object.entries(t.original).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).map(e=>{let[t]=e;return eG(t)});return 0===n.length?(0,a.jsx)(c.Z,{className:"text-gray-400",children:"-"}):1===n.length?(0,a.jsx)("div",{className:"h-6 flex items-center",children:(0,a.jsx)(u.Z,{color:"blue",className:"text-xs",children:n[0]})}):(0,a.jsxs)("div",{className:"h-6 flex items-center space-x-1",children:[(0,a.jsx)(u.Z,{color:"blue",className:"text-xs",children:n[0]}),(0,a.jsx)(p.Z,{title:(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("div",{className:"font-medium",children:"All Features:"}),n.map((e,t)=>(0,a.jsxs)("div",{className:"text-xs",children:["• ",e]},t))]}),trigger:"click",placement:"topLeft",children:(0,a.jsxs)("span",{className:"text-xs text-blue-600 cursor-pointer hover:text-blue-800 hover:underline",onClick:e=>e.stopPropagation(),children:["+",n.length-1]})})]})},size:120},{header:"Limits",accessorKey:"rpm",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original;return(0,a.jsx)(c.Z,{className:"text-xs text-gray-600",children:eq(n.rpm,n.tpm)})},size:150}],data:eT,isLoading:q,table:eM,defaultSorting:[{id:"model_group",desc:!1}]}),(0,a.jsx)("div",{className:"mt-8 text-center",children:(0,a.jsxs)(c.Z,{className:"text-sm text-gray-600",children:["Showing ",eT.length," of ",(null==M?void 0:M.length)||0," models"]})})]},"models"),P&&P.length>0&&(0,a.jsxs)(S,{tab:"Agent Hub",children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,a.jsx)(d.Z,{className:"text-2xl font-semibold text-gray-900",children:"Available Agents"})}),(0,a.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,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium text-gray-700",children:"Search Agents:"}),(0,a.jsx)(p.Z,{title:"Search agents by name or description",placement:"top",children:(0,a.jsx)(b.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(f.Z,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,a.jsx)("input",{type:"text",placeholder:"Search agent names or descriptions...",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,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Skills:"}),(0,a.jsx)(g.default,{mode:"multiple",value:ed,onChange:e=>em(e),placeholder:"Select skills",className:"w-full",size:"large",allowClear:!0,children:P&&(e=>{let t=new Set;return e.forEach(e=>{var n;null===(n=e.skills)||void 0===n||n.forEach(e=>{var n;null===(n=e.tags)||void 0===n||n.forEach(e=>t.add(e))})}),Array.from(t).sort()})(P).map(e=>(0,a.jsx)(g.default.Option,{value:e,children:e},e))})]})]}),(0,a.jsx)(l.C,{columns:[{header:"Agent Name",accessorKey:"name",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(p.Z,{title:t.original.name,children:(0,a.jsx)(i.Z,{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:()=>eR(t.original),children:t.original.name})})})},size:150},{header:"Description",accessorKey:"description",enableSorting:!1,cell:e=>{let{row:t}=e,n=t.original.description,s=n.length>80?n.substring(0,80)+"...":n;return(0,a.jsx)(p.Z,{title:n,children:(0,a.jsx)(c.Z,{className:"text-sm text-gray-700",children:s})})},size:250},{header:"Version",accessorKey:"version",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,a.jsx)(c.Z,{className:"text-sm",children:t.original.version})},size:80},{header:"Provider",accessorKey:"provider",enableSorting:!1,cell:e=>{let{row:t}=e,n=t.original.provider;return n?(0,a.jsx)("div",{className:"text-sm",children:(0,a.jsx)(c.Z,{className:"font-medium",children:n.organization})}):(0,a.jsx)(c.Z,{className:"text-gray-400",children:"-"})},size:120},{header:"Skills",accessorKey:"skills",enableSorting:!1,cell:e=>{let{row:t}=e,n=t.original.skills||[];return 0===n.length?(0,a.jsx)(c.Z,{className:"text-gray-400",children:"-"}):1===n.length?(0,a.jsx)("div",{className:"h-6 flex items-center",children:(0,a.jsx)(u.Z,{color:"purple",className:"text-xs",children:n[0].name})}):(0,a.jsxs)("div",{className:"h-6 flex items-center space-x-1",children:[(0,a.jsx)(u.Z,{color:"purple",className:"text-xs",children:n[0].name}),(0,a.jsx)(p.Z,{title:(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("div",{className:"font-medium",children:"All Skills:"}),n.map((e,t)=>(0,a.jsxs)("div",{className:"text-xs",children:["• ",e.name]},t))]}),trigger:"click",placement:"topLeft",children:(0,a.jsxs)("span",{className:"text-xs text-purple-600 cursor-pointer hover:text-purple-800 hover:underline",onClick:e=>e.stopPropagation(),children:["+",n.length-1]})})]})},size:150},{header:"Capabilities",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:t}=e,n=Object.entries(t.original.capabilities||{}).filter(e=>{let[t,n]=e;return!0===n}).map(e=>{let[t]=e;return t});return 0===n.length?(0,a.jsx)(c.Z,{className:"text-gray-400",children:"-"}):(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:n.map(e=>(0,a.jsx)(u.Z,{color:"green",className:"text-xs capitalize",children:e},e))})},size:150}],data:eD,isLoading:B,table:eO,defaultSorting:[{id:"name",desc:!1}]}),(0,a.jsx)("div",{className:"mt-8 text-center",children:(0,a.jsxs)(c.Z,{className:"text-sm text-gray-600",children:["Showing ",eD.length," of ",(null==P?void 0:P.length)||0," agents"]})})]},"agents"),D&&D.length>0&&(0,a.jsxs)(S,{tab:"MCP Hub",children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,a.jsx)(d.Z,{className:"text-2xl font-semibold text-gray-900",children:"Available MCP Servers"})}),(0,a.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,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium text-gray-700",children:"Search MCP Servers:"}),(0,a.jsx)(p.Z,{title:"Search MCP servers by name or description",placement:"top",children:(0,a.jsx)(b.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(f.Z,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,a.jsx)("input",{type:"text",placeholder:"Search MCP server names or descriptions...",value:en,onChange:e=>ea(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,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Transport:"}),(0,a.jsx)(g.default,{mode:"multiple",value:ep,onChange:e=>eu(e),placeholder:"Select transport types",className:"w-full",size:"large",allowClear:!0,children:D&&(e=>{let t=new Set;return e.forEach(e=>{e.transport&&t.add(e.transport)}),Array.from(t).sort()})(D).map(e=>(0,a.jsx)(g.default.Option,{value:e,children:e},e))})]})]}),(0,a.jsx)(l.C,{columns:[{header:"Server Name",accessorKey:"server_name",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(p.Z,{title:t.original.server_name,children:(0,a.jsx)(i.Z,{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:()=>eH(t.original),children:t.original.server_name})})})},size:150},{header:"Description",accessorKey:"mcp_info.description",enableSorting:!1,cell:e=>{var t;let{row:n}=e,s=(null===(t=n.original.mcp_info)||void 0===t?void 0:t.description)||"-",r=s.length>80?s.substring(0,80)+"...":s;return(0,a.jsx)(p.Z,{title:s,children:(0,a.jsx)(c.Z,{className:"text-sm text-gray-700",children:r})})},size:250},{header:"URL",accessorKey:"url",enableSorting:!1,cell:e=>{let{row:t}=e,n=t.original.url,s=n.length>40?n.substring(0,40)+"...":n;return(0,a.jsx)(p.Z,{title:n,children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(c.Z,{className:"text-xs font-mono",children:s}),(0,a.jsx)(_.Z,{onClick:()=>eF(n),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-3 h-3"})]})})},size:200},{header:"Transport",accessorKey:"transport",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.transport;return(0,a.jsx)(u.Z,{color:"blue",className:"text-xs uppercase",children:n})},size:100},{header:"Auth Type",accessorKey:"auth_type",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.auth_type;return(0,a.jsx)(u.Z,{color:"none"===n?"gray":"green",className:"text-xs capitalize",children:n})},size:100}],data:eL,isLoading:J,table:eP,defaultSorting:[{id:"server_name",desc:!1}]}),(0,a.jsx)("div",{className:"mt-8 text-center",children:(0,a.jsxs)(c.Z,{className:"text-sm text-gray-600",children:["Showing ",eL.length," of ",(null==D?void 0:D.length)||0," MCP servers"]})})]},"mcp")]})})]}),(0,a.jsx)(x.Z,{title:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{children:(null==ey?void 0:ey.model_group)||"Model Details"}),ey&&(0,a.jsx)(p.Z,{title:"Copy model name",children:(0,a.jsx)(_.Z,{onClick:()=>eF(ey.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:eh,footer:null,onOk:()=>{ef(!1),eN(null)},onCancel:()=>{ef(!1),eN(null)},children:ey&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Model Overview"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Model Name:"}),(0,a.jsx)(c.Z,{children:ey.model_group})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Mode:"}),(0,a.jsx)(c.Z,{children:ey.mode||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Providers:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:ey.providers.map(e=>{let{logo:t}=(0,y.dr)(e);return(0,a.jsx)(u.Z,{color:"blue",children:(0,a.jsxs)("div",{className:"flex items-center space-x-1",children:[t&&(0,a.jsx)("img",{src:t,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,a.jsx)("span",{className:"capitalize",children:e})]})},e)})})]})]}),ey.model_group.includes("*")&&(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-4",children:(0,a.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,a.jsx)(b.Z,{className:"w-4 h-4 text-blue-600 mt-0.5 flex-shrink-0"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium text-blue-900 mb-2",children:"Wildcard Routing"}),(0,a.jsxs)(c.Z,{className:"text-sm text-blue-800 mb-2",children:["This model uses wildcard routing. You can pass any value where you see the"," ",(0,a.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:"*"})," symbol."]}),(0,a.jsxs)(c.Z,{className:"text-sm text-blue-800",children:["For example, with"," ",(0,a.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:ey.model_group}),", you can use any string (",(0,a.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:ey.model_group.replace("*","my-custom-value")}),") that matches this pattern."]})]})]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Token & Cost Information"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Max Input Tokens:"}),(0,a.jsx)(c.Z,{children:(null===(t=ey.max_input_tokens)||void 0===t?void 0:t.toLocaleString())||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Max Output Tokens:"}),(0,a.jsx)(c.Z,{children:(null===(n=ey.max_output_tokens)||void 0===n?void 0:n.toLocaleString())||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,a.jsx)(c.Z,{children:ey.input_cost_per_token?eU(ey.input_cost_per_token):"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,a.jsx)(c.Z,{children:ey.output_cost_per_token?eU(ey.output_cost_per_token):"Not specified"})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=eK(ey),t=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,a.jsx)(c.Z,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,n)=>(0,a.jsx)(u.Z,{color:t[n%t.length],children:eG(e)},e))})()})]}),(ey.tpm||ey.rpm)&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[ey.tpm&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Tokens per Minute:"}),(0,a.jsx)(c.Z,{children:ey.tpm.toLocaleString()})]}),ey.rpm&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Requests per Minute:"}),(0,a.jsx)(c.Z,{children:ey.rpm.toLocaleString()})]})]})]}),ey.supported_openai_params&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:ey.supported_openai_params.map(e=>(0,a.jsx)(u.Z,{color:"green",children:e},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,a.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("pre",{className:"text-sm",children:(0,j.L)({apiKeySource:"custom",accessToken:null,apiKey:"your_api_key",inputMessage:"Hello, how are you?",chatHistory:[{role:"user",content:"Hello, how are you?",isImage:!1}],selectedTags:[],selectedVectorStores:[],selectedGuardrails:[],selectedMCPTools:[],endpointType:(0,v.vf)(ey.mode||"chat"),selectedModel:ey.model_group,selectedSdk:"openai"})})}),(0,a.jsx)("div",{className:"mt-2 text-right",children:(0,a.jsx)("button",{onClick:()=>{eF((0,j.L)({apiKeySource:"custom",accessToken:null,apiKey:"your_api_key",inputMessage:"Hello, how are you?",chatHistory:[{role:"user",content:"Hello, how are you?",isImage:!1}],selectedTags:[],selectedVectorStores:[],selectedGuardrails:[],selectedMCPTools:[],endpointType:(0,v.vf)(ey.mode||"chat"),selectedModel:ey.model_group,selectedSdk:"openai"}))},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]})]})}),(0,a.jsx)(x.Z,{title:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{children:(null==ew?void 0:ew.name)||"Agent Details"}),ew&&(0,a.jsx)(p.Z,{title:"Copy agent name",children:(0,a.jsx)(_.Z,{onClick:()=>eF(ew.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:e_,footer:null,onOk:()=>{eb(!1),eA(null)},onCancel:()=>{eb(!1),eA(null)},children:ew&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Agent Overview"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Name:"}),(0,a.jsx)(c.Z,{children:ew.name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Version:"}),(0,a.jsx)(c.Z,{children:ew.version})]}),(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Description:"}),(0,a.jsx)(c.Z,{children:ew.description})]}),ew.url&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"URL:"}),(0,a.jsx)("a",{href:ew.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 text-sm break-all",children:ew.url})]})]})]}),ew.capabilities&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(ew.capabilities).filter(e=>{let[t,n]=e;return!0===n}).map(e=>{let[t]=e;return(0,a.jsx)(u.Z,{color:"green",className:"capitalize",children:t},t)})})]}),ew.skills&&ew.skills.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Skills"}),(0,a.jsx)("div",{className:"space-y-4",children:ew.skills.map((e,t)=>(0,a.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,a.jsx)("div",{className:"flex items-start justify-between mb-2",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium text-base",children:e.name}),(0,a.jsx)(c.Z,{className:"text-sm text-gray-600",children:e.description})]})}),e.tags&&e.tags.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:e.tags.map(e=>(0,a.jsx)(u.Z,{color:"purple",className:"text-xs",children:e},e))})]},t))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Input/Output Modes"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Input Modes:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:null===(C=ew.defaultInputModes)||void 0===C?void 0:C.map(e=>(0,a.jsx)(u.Z,{color:"blue",children:e},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Output Modes:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:null===(I=ew.defaultOutputModes)||void 0===I?void 0:I.map(e=>(0,a.jsx)(u.Z,{color:"blue",children:e},e))})]})]})]}),ew.documentationUrl&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Documentation"}),(0,a.jsxs)("a",{href:ew.documentationUrl,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 flex items-center space-x-2",children:[(0,a.jsx)(h.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"View Documentation"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Usage Example (A2A Protocol)"}),(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-2 text-gray-700",children:"Step 1: Retrieve Agent Card"}),(0,a.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("pre",{className:"text-xs",children:"base_url = '".concat(ew.url,"'\n\nresolver = A2ACardResolver(\n httpx_client=httpx_client,\n base_url=base_url,\n # agent_card_path uses default, extended_agent_card_path also uses default\n)\n\n# Fetch Public Agent Card and Initialize Client\nfinal_agent_card_to_use: AgentCard | None = None\n_public_card = (\n await resolver.get_agent_card()\n) # Fetches from default public path - `/agents/{agent_id}/`\nfinal_agent_card_to_use = _public_card\n\nif _public_card.supports_authenticated_extended_card:\n try:\n auth_headers_dict = {\n 'Authorization': 'Bearer dummy-token-for-extended-card'\n }\n _extended_card = await resolver.get_agent_card(\n relative_card_path=EXTENDED_AGENT_CARD_PATH,\n http_kwargs={'headers': auth_headers_dict},\n )\n final_agent_card_to_use = (\n _extended_card # Update to use the extended card\n )\n except Exception as e_extended:\n logger.warning(\n f'Failed to fetch extended agent card: {e_extended}. Will proceed with public card.',\n exc_info=True,\n )")})}),(0,a.jsx)("div",{className:"mt-2 text-right",children:(0,a.jsx)("button",{onClick:()=>{eF("from a2a.client import A2ACardResolver, A2AClient\nfrom a2a.types import (\n AgentCard,\n MessageSendParams,\n SendMessageRequest,\n SendStreamingMessageRequest,\n)\nfrom a2a.utils.constants import (\n AGENT_CARD_WELL_KNOWN_PATH,\n EXTENDED_AGENT_CARD_PATH,\n)\n\nbase_url = '".concat(ew.url,"'\n\nresolver = A2ACardResolver(\n httpx_client=httpx_client,\n base_url=base_url,\n # agent_card_path uses default, extended_agent_card_path also uses default\n)\n\n# Fetch Public Agent Card and Initialize Client\nfinal_agent_card_to_use: AgentCard | None = None\n_public_card = (\n await resolver.get_agent_card()\n) # Fetches from default public path - `/agents/{agent_id}/`\nfinal_agent_card_to_use = _public_card\n\nif _public_card.supports_authenticated_extended_card:\n try:\n auth_headers_dict = {\n 'Authorization': 'Bearer dummy-token-for-extended-card'\n }\n _extended_card = await resolver.get_agent_card(\n relative_card_path=EXTENDED_AGENT_CARD_PATH,\n http_kwargs={'headers': auth_headers_dict},\n )\n final_agent_card_to_use = (\n _extended_card # Update to use the extended card\n )\n except Exception as e_extended:\n logger.warning(\n f'Failed to fetch extended agent card: {e_extended}. Will proceed with public card.',\n exc_info=True,\n )"))},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-2 text-gray-700",children:"Step 2: Call the Agent"}),(0,a.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("pre",{className:"text-xs",children:"client = A2AClient(\n httpx_client=httpx_client, agent_card=final_agent_card_to_use\n)\n\nsend_message_payload: dict[str, Any] = {\n 'message': {\n 'role': 'user',\n 'parts': [\n {'kind': 'text', 'text': 'how much is 10 USD in INR?'}\n ],\n 'messageId': uuid4().hex,\n },\n}\nrequest = SendMessageRequest(\n id=str(uuid4()), params=MessageSendParams(**send_message_payload)\n)\n\nresponse = await client.send_message(request)\nprint(response.model_dump(mode='json', exclude_none=True))"})}),(0,a.jsx)("div",{className:"mt-2 text-right",children:(0,a.jsx)("button",{onClick:()=>{eF("client = A2AClient(\n httpx_client=httpx_client, agent_card=final_agent_card_to_use\n)\n\nsend_message_payload: dict[str, Any] = {\n 'message': {\n 'role': 'user',\n 'parts': [\n {'kind': 'text', 'text': 'how much is 10 USD in INR?'}\n ],\n 'messageId': uuid4().hex,\n },\n}\nrequest = SendMessageRequest(\n id=str(uuid4()), params=MessageSendParams(**send_message_payload)\n)\n\nresponse = await client.send_message(request)\nprint(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,a.jsx)(x.Z,{title:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{children:(null==eS?void 0:eS.server_name)||"MCP Server Details"}),eS&&(0,a.jsx)(p.Z,{title:"Copy server name",children:(0,a.jsx)(_.Z,{onClick:()=>eF(eS.server_name),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:ej,footer:null,onOk:()=>{ev(!1),eC(null)},onCancel:()=>{ev(!1),eC(null)},children:eS&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Server Overview"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Server Name:"}),(0,a.jsx)(c.Z,{children:eS.server_name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Transport:"}),(0,a.jsx)(u.Z,{color:"blue",children:eS.transport})]}),eS.alias&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Alias:"}),(0,a.jsx)(c.Z,{children:eS.alias})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Auth Type:"}),(0,a.jsx)(u.Z,{color:"none"===eS.auth_type?"gray":"green",children:eS.auth_type})]}),(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Description:"}),(0,a.jsx)(c.Z,{children:(null===(k=eS.mcp_info)||void 0===k?void 0:k.description)||"-"})]}),(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"URL:"}),(0,a.jsxs)("a",{href:eS.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,a.jsx)("span",{children:eS.url}),(0,a.jsx)(h.Z,{className:"w-4 h-4"})]})]})]})]}),eS.mcp_info&&Object.keys(eS.mcp_info).length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Additional Information"}),(0,a.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,a.jsx)("pre",{className:"text-xs overflow-x-auto",children:JSON.stringify(eS.mcp_info,null,2)})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,a.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("pre",{className:"text-sm",children:'# Using MCP Server with Python FastMCP\n\nfrom fastmcp import Client\nimport asyncio\n\n# Standard MCP configuration\nconfig = {\n "mcpServers": {\n "'.concat(eS.server_name,'": {\n "url": "http://localhost:4000/').concat(eS.server_name,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer sk-1234"\n }\n }\n }\n}\n\n# Create a client that connects to the server\nclient = Client(config)\n\nasync def main():\n async with client:\n # List available tools\n tools = await client.list_tools()\n print(f"Available tools: {[tool.name for tool in tools]}")\n\n # Call a tool\n response = await client.call_tool(\n name="tool_name", \n arguments={"arg": "value"}\n )\n print(f"Response: {response}")\n\nif __name__ == "__main__":\n asyncio.run(main())')})}),(0,a.jsx)("div",{className:"mt-2 text-right",children:(0,a.jsx)("button",{onClick:()=>{eF('# Using MCP Server with Python FastMCP\n\nfrom fastmcp import Client\nimport asyncio\n\n# Standard MCP configuration\nconfig = {\n "mcpServers": {\n "'.concat(eS.server_name,'": {\n "url": "http://localhost:4000/').concat(eS.server_name,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer sk-1234"\n }\n }\n }\n}\n\n# Create a client that connects to the server\nclient = Client(config)\n\nasync def main():\n async with client:\n # List available tools\n tools = await client.list_tools()\n print(f"Available tools: {[tool.name for tool in tools]}")\n\n # Call a tool\n response = await client.call_tool(\n name="tool_name", \n arguments={"arg": "value"}\n )\n print(f"Response: {response}")\n\nif __name__ == "__main__":\n asyncio.run(main())'))},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]})]})})]})})}},69734:function(e,t,n){n.d(t,{F:function(){return i},f:function(){return o}});var a=n(57437),s=n(2265),r=n(19250);let l=(0,s.createContext)(void 0),i=()=>{let e=(0,s.useContext)(l);if(!e)throw Error("useTheme must be used within a ThemeProvider");return e},o=e=>{let{children:t,accessToken:n}=e,[i,o]=(0,s.useState)(null);return(0,s.useEffect)(()=>{(async()=>{try{let t=(0,r.getProxyBaseUrl)(),n=await fetch(t?"".concat(t,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{"Content-Type":"application/json"}});if(n.ok){var e;let t=await n.json();(null===(e=t.values)||void 0===e?void 0:e.logo_url)&&o(t.values.logo_url)}}catch(e){console.warn("Failed to load logo settings from backend:",e)}})()},[]),(0,a.jsx)(l.Provider,{value:{logoUrl:i,setLogoUrl:o},children:t})}},91624:function(e,t,n){n.d(t,{C:function(){return s}});var a=n(19250);let s=async e=>{if(!e)return null;try{return await (0,a.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7641-90e15c72e10330f1.js b/litellm/proxy/_experimental/out/_next/static/chunks/7641-90e15c72e10330f1.js deleted file mode 100644 index b43a64fc045..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/7641-90e15c72e10330f1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7641],{71668:function(e,s,r){r.d(s,{Dx:function(){return d.Z},OK:function(){return l.Z},nP:function(){return o.Z},td:function(){return n.Z},v0:function(){return a.Z},x4:function(){return i.Z},xv:function(){return c.Z},zx:function(){return t.Z}});var t=r(78489),l=r(12485),a=r(18135),n=r(35242),i=r(29706),o=r(77991),c=r(84264),d=r(96761)},58927:function(e,s,r){r.d(s,{J:function(){return t.Z}});var t=r(47323)},87641:function(e,s,r){r.d(s,{d:function(){return eX},o:function(){return e4}});var t=r(57437),l=r(20347),a=r(67187),n=r(11713),i=r(71668),o=r(57840),c=r(37592),d=r(99981),m=r(22116),u=r(76188),x=r(2265),h=r(9114),p=r(19250),g=r(12322),j=r(10032),v=r(4260),f=r(15424),b=r(64504);let y={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",BASIC:"basic",OAUTH2:"oauth2"},N={SSE:"sse"},_=e=>(console.log(e),null==e)?N.SSE:e,w=e=>null==e?y.NONE:e;var Z=r(19015),C=r(44851),S=r(33866),k=r(62670),P=r(58630),A=r(12514),T=r(84264),M=r(96761),I=e=>{let{value:s={},onChange:r,tools:l=[],disabled:a=!1}=e,n=(e,t)=>{let l={...s,tool_name_to_cost_per_query:{...s.tool_name_to_cost_per_query,[e]:t}};null==r||r(l)};return(0,t.jsx)(A.Z,{children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,t.jsx)(k.Z,{className:"text-green-600"}),(0,t.jsx)(M.Z,{children:"Cost Configuration"}),(0,t.jsx)(d.Z,{title:"Configure costs for this MCP server's tool calls. Set a default rate and per-tool overrides.",children:(0,t.jsx)(f.Z,{className:"text-gray-400"})})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Default Cost per Query ($)",(0,t.jsx)(d.Z,{title:"Default cost charged for each tool call to this server.",children:(0,t.jsx)(f.Z,{className:"ml-1 text-gray-400"})})]}),(0,t.jsx)(Z.Z,{min:0,step:1e-4,precision:4,placeholder:"0.0000",value:s.default_cost_per_query,onChange:e=>{let t={...s,default_cost_per_query:e};null==r||r(t)},disabled:a,style:{width:"200px"},addonBefore:"$"}),(0,t.jsx)(T.Z,{className:"block mt-1 text-gray-500 text-sm",children:"Set a default cost for all tool calls to this server"})]}),l.length>0&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Tool-Specific Costs ($)",(0,t.jsx)(d.Z,{title:"Override the default cost for specific tools. Leave blank to use the default rate.",children:(0,t.jsx)(f.Z,{className:"ml-1 text-gray-400"})})]}),(0,t.jsx)(C.default,{items:[{key:"1",label:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(P.Z,{className:"mr-2 text-blue-500"}),(0,t.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,t.jsx)(S.Z,{count:l.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,t.jsx)("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:l.map((e,r)=>{var l;return(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(T.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,t.jsx)(T.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]}),(0,t.jsx)("div",{className:"ml-4",children:(0,t.jsx)(Z.Z,{min:0,step:1e-4,precision:4,placeholder:"Use default",value:null===(l=s.tool_name_to_cost_per_query)||void 0===l?void 0:l[e.name],onChange:s=>n(e.name,s),disabled:a,style:{width:"120px"},addonBefore:"$"})})]},r)})})}]})]})]}),(s.default_cost_per_query||s.tool_name_to_cost_per_query&&Object.keys(s.tool_name_to_cost_per_query).length>0)&&(0,t.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,t.jsx)(T.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[s.default_cost_per_query&&(0,t.jsxs)(T.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),s.tool_name_to_cost_per_query&&Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,r]=e;return null!=r&&(0,t.jsxs)(T.Z,{className:"text-blue-700",children:["• ",s,": $",r.toFixed(4)," per query"]},s)})]})]})]})})},O=r(10353),L=r(51653),E=r(5545),z=r(83669),q=r(29271),U=r(89245);let R=e=>{var s,r;let{accessToken:t,oauthAccessToken:l,formValues:a,enabled:n=!0}=e,[i,o]=(0,x.useState)([]),[c,d]=(0,x.useState)(!1),[m,u]=(0,x.useState)(null),[h,g]=(0,x.useState)(null),[j,v]=(0,x.useState)(!1),f=a.auth_type===y.OAUTH2,b=!!(a.url&&a.transport&&a.auth_type&&t&&(!f||l)),N=JSON.stringify(null!==(s=a.static_headers)&&void 0!==s?s:{}),_=JSON.stringify(null!==(r=a.credentials)&&void 0!==r?r:{}),w=async()=>{if(t&&a.url&&(!f||l)){d(!0),u(null);try{let e=Array.isArray(a.static_headers)?a.static_headers.reduce((e,s)=>{var r;let t=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return t&&(e[t]=(null==s?void 0:s.value)!=null?String(s.value):""),e},{}):!Array.isArray(a.static_headers)&&a.static_headers&&"object"==typeof a.static_headers?Object.entries(a.static_headers).reduce((e,s)=>{let[r,t]=s;return r&&(e[r]=null!=t?String(t):""),e},{}):{},s=a.credentials&&"object"==typeof a.credentials?Object.entries(a.credentials).reduce((e,s)=>{let[r,t]=s;if(null==t||""===t)return e;if("scopes"===r){if(Array.isArray(t)){let s=t.filter(e=>null!=e&&""!==e);s.length>0&&(e[r]=s)}}else e[r]=t;return e},{}):void 0,r={server_id:a.server_id||"",server_name:a.server_name||"",url:a.url,transport:a.transport,auth_type:a.auth_type,mcp_info:a.mcp_info,static_headers:e};s&&Object.keys(s).length>0&&(r.credentials=s);let n=await (0,p.testMCPToolsListRequest)(t,r,l);if(n.tools&&!n.error)o(n.tools),u(null),g(null),n.tools.length>0&&!j&&v(!0);else{let e=n.message||"Failed to retrieve tools list";u(e),g(n.stack_trace||null),o([]),v(!1)}}catch(e){console.error("Tools fetch error:",e),u(e instanceof Error?e.message:String(e)),g(null),o([]),v(!1)}finally{d(!1)}}},Z=()=>{o([]),u(null),g(null),v(!1)};return(0,x.useEffect)(()=>{n&&(b?w():Z())},[a.url,a.transport,a.auth_type,t,n,l,b,N,_]),{tools:i,isLoadingTools:c,toolsError:m,toolsErrorStackTrace:h,hasShownSuccessMessage:j,canFetchTools:b,fetchTools:w,clearTools:Z}};var F=e=>{let{accessToken:s,oauthAccessToken:r,formValues:l,onToolsLoaded:a}=e,{tools:n,isLoadingTools:i,toolsError:o,toolsErrorStackTrace:c,canFetchTools:d,fetchTools:m}=R({accessToken:s,oauthAccessToken:r,formValues:l,enabled:!0});return((0,x.useEffect)(()=>{null==a||a(n)},[n,a]),d||l.url)?(0,t.jsx)(A.Z,{children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(z.Z,{className:"text-blue-600"}),(0,t.jsx)(M.Z,{children:"Connection Status"})]}),!d&&l.url&&(0,t.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,t.jsx)(P.Z,{className:"text-2xl mb-2"}),(0,t.jsx)(T.Z,{children:"Complete required fields to test connection"}),(0,t.jsx)("br",{}),(0,t.jsx)(T.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to test MCP server connection"})]}),d&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"text-gray-700 font-medium",children:i?"Testing connection to MCP server...":n.length>0?"Connection successful":o?"Connection failed":"Ready to test connection"}),(0,t.jsx)("br",{}),(0,t.jsxs)(T.Z,{className:"text-gray-500 text-sm",children:["Server: ",l.url]})]}),i&&(0,t.jsxs)("div",{className:"flex items-center text-blue-600",children:[(0,t.jsx)(O.Z,{size:"small",className:"mr-2"}),(0,t.jsx)(T.Z,{className:"text-blue-600",children:"Connecting..."})]}),!i&&!o&&n.length>0&&(0,t.jsxs)("div",{className:"flex items-center text-green-600",children:[(0,t.jsx)(z.Z,{className:"mr-1"}),(0,t.jsx)(T.Z,{className:"text-green-600 font-medium",children:"Connected"})]}),o&&(0,t.jsxs)("div",{className:"flex items-center text-red-600",children:[(0,t.jsx)(q.Z,{className:"mr-1"}),(0,t.jsx)(T.Z,{className:"text-red-600 font-medium",children:"Failed"})]})]}),i&&(0,t.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,t.jsx)(O.Z,{size:"large"}),(0,t.jsx)(T.Z,{className:"ml-3",children:"Testing connection and loading tools..."})]}),o&&(0,t.jsx)(L.Z,{message:"Connection Failed",description:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{children:o}),c&&(0,t.jsx)(C.default,{items:[{key:"stack-trace",label:"Stack Trace",children:(0,t.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"12px",fontFamily:"monospace",margin:0,padding:"8px",backgroundColor:"#f5f5f5",borderRadius:"4px",maxHeight:"400px",overflow:"auto"},children:c})}],style:{marginTop:"12px"}})]}),type:"error",showIcon:!0,action:(0,t.jsx)(E.ZP,{icon:(0,t.jsx)(U.Z,{}),onClick:m,size:"small",children:"Retry"})}),!i&&0===n.length&&!o&&(0,t.jsxs)("div",{className:"text-center py-6 text-gray-500 border rounded-lg border-dashed",children:[(0,t.jsx)(z.Z,{className:"text-2xl mb-2 text-green-500"}),(0,t.jsx)(T.Z,{className:"text-green-600 font-medium",children:"Connection successful!"}),(0,t.jsx)("br",{}),(0,t.jsx)(T.Z,{className:"text-gray-500",children:"No tools found for this MCP server"})]})]})]})}):null},V=r(61994),B=e=>{let{accessToken:s,oauthAccessToken:r,formValues:l,allowedTools:a,existingAllowedTools:n,onAllowedToolsChange:i}=e,o=(0,x.useRef)(0),{tools:c,isLoadingTools:d,toolsError:m,canFetchTools:u}=R({accessToken:s,oauthAccessToken:r,formValues:l,enabled:!0});(0,x.useEffect)(()=>{if(c.length>0&&c.length!==o.current&&0===a.length){if(n&&n.length>0){let e=c.map(e=>e.name);i(n.filter(s=>e.includes(s)))}else i(c.map(e=>e.name))}o.current=c.length},[c,a.length,n,i]);let h=e=>{a.includes(e)?i(a.filter(s=>s!==e)):i([...a,e])};return u||l.url?(0,t.jsx)(A.Z,{children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(P.Z,{className:"text-blue-600"}),(0,t.jsx)(M.Z,{children:"Tool Configuration"}),c.length>0&&(0,t.jsx)(S.Z,{count:c.length,style:{backgroundColor:"#52c41a"}})]})}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(T.Z,{className:"text-blue-800 text-sm",children:[(0,t.jsx)("strong",{children:"Select which tools users can call:"})," Only checked tools will be available for users to invoke. Unchecked tools will be blocked from execution."]})}),d&&(0,t.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,t.jsx)(O.Z,{size:"large"}),(0,t.jsx)(T.Z,{className:"ml-3",children:"Loading tools..."})]}),m&&!d&&(0,t.jsxs)("div",{className:"text-center py-6 text-red-500 border rounded-lg border-dashed border-red-300 bg-red-50",children:[(0,t.jsx)(P.Z,{className:"text-2xl mb-2"}),(0,t.jsx)(T.Z,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,t.jsx)("br",{}),(0,t.jsx)(T.Z,{className:"text-sm text-red-500",children:m})]}),!d&&!m&&0===c.length&&u&&(0,t.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,t.jsx)(P.Z,{className:"text-2xl mb-2"}),(0,t.jsx)(T.Z,{children:"No tools available for configuration"}),(0,t.jsx)("br",{}),(0,t.jsx)(T.Z,{className:"text-sm",children:"Connect to an MCP server with tools to configure them"})]}),!u&&l.url&&(0,t.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,t.jsx)(P.Z,{className:"text-2xl mb-2"}),(0,t.jsx)(T.Z,{children:"Complete required fields to configure tools"}),(0,t.jsx)("br",{}),(0,t.jsx)(T.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to load available tools"})]}),!d&&!m&&c.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-green-50 rounded-lg border border-green-200 flex-1",children:[(0,t.jsx)(z.Z,{className:"text-green-600"}),(0,t.jsxs)(T.Z,{className:"text-green-700 font-medium",children:[a.length," of ",c.length," ",1===c.length?"tool":"tools"," enabled for user access"]})]}),(0,t.jsxs)("div",{className:"flex gap-2 ml-3",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{i(c.map(e=>e.name))},className:"px-3 py-1.5 text-sm text-blue-600 hover:text-blue-700 hover:bg-blue-50 rounded-md transition-colors",children:"Enable All"}),(0,t.jsx)("button",{type:"button",onClick:()=>{i([])},className:"px-3 py-1.5 text-sm text-gray-600 hover:text-gray-700 hover:bg-gray-100 rounded-md transition-colors",children:"Disable All"})]})]}),(0,t.jsx)("div",{className:"space-y-2",children:c.map((e,s)=>(0,t.jsx)("div",{className:"p-4 rounded-lg border transition-colors cursor-pointer ".concat(a.includes(e.name)?"bg-blue-50 border-blue-300 hover:border-blue-400":"bg-gray-50 border-gray-200 hover:border-gray-300"),onClick:()=>h(e.name),children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(V.Z,{checked:a.includes(e.name),onChange:()=>h(e.name)}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(T.Z,{className:"font-medium text-gray-900",children:e.name}),(0,t.jsx)("span",{className:"px-2 py-0.5 text-xs rounded-full font-medium ".concat(a.includes(e.name)?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:a.includes(e.name)?"Enabled":"Disabled"})]}),e.description&&(0,t.jsx)(T.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description}),(0,t.jsx)(T.Z,{className:"text-gray-400 text-xs block mt-1",children:a.includes(e.name)?"✓ Users can call this tool":"✗ Users cannot call this tool"})]})]})},s))})]})]})}):null},K=e=>{let{isVisible:s}=e;return s?(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Stdio Configuration (JSON)",(0,t.jsx)(d.Z,{title:"Paste your stdio MCP server configuration in JSON format. You can use the full mcpServers structure from config.yaml or just the inner server configuration.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"stdio_config",rules:[{required:!0,message:"Please enter stdio configuration"},{validator:(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}}}],children:(0,t.jsx)(v.default.TextArea,{placeholder:'{\n "mcpServers": {\n "circleci-mcp-server": {\n "command": "npx",\n "args": ["-y", "@circleci/mcp-server-circleci"],\n "env": {\n "CIRCLECI_TOKEN": "your-circleci-token",\n "CIRCLECI_BASE_URL": "https://circleci.com"\n }\n }\n }\n}',rows:12,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm"})}):null},H=r(58760),D=r(45246),J=r(96473);let{Panel:G}=C.default;var Y=e=>{let{availableAccessGroups:s,mcpServer:r,searchValue:l,setSearchValue:a,getAccessGroupOptions:n}=e,i=j.Z.useFormInstance();return(0,x.useEffect)(()=>{if(r&&(r.extra_headers&&i.setFieldValue("extra_headers",r.extra_headers),r.static_headers)){let e=Object.entries(r.static_headers).map(e=>{let[s,r]=e;return{header:s,value:null!=r?String(r):""}});i.setFieldValue("static_headers",e)}},[r,i]),(0,t.jsx)(C.default,{className:"bg-gray-50 border border-gray-200 rounded-lg",expandIconPosition:"end",ghost:!1,children:(0,t.jsx)(G,{header:(0,t.jsxs)("div",{className:"flex items-center",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)("h3",{className:"text-lg font-semibold text-gray-900",children:"Permission Management / Access Control"})]}),(0,t.jsx)("p",{className:"text-sm text-gray-600 ml-4",children:"Configure access permissions and security settings (Optional)"})]}),className:"border-0",children:(0,t.jsxs)("div",{className:"space-y-6 pt-4",children:[(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,t.jsx)(d.Z,{title:"Specify access groups for this MCP server. Users must be in at least one of these groups to access the server.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",className:"mb-4",children:(0,t.jsx)(c.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"value",filterOption:(e,s)=>{var r;return(null!==(r=null==s?void 0:s.value)&&void 0!==r?r:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>a(e),tokenSeparators:[","],options:n(),maxTagCount:"responsive",allowClear:!0})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Extra Headers",(0,t.jsx)(d.Z,{title:"Forward custom headers from incoming requests to this MCP server (e.g., Authorization, X-Custom-Header, User-Agent)",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})}),(null==r?void 0:r.extra_headers)&&r.extra_headers.length>0&&(0,t.jsxs)("span",{className:"ml-2 text-xs bg-blue-100 text-blue-700 px-2 py-1 rounded-full",children:[r.extra_headers.length," configured"]})]}),name:"extra_headers",children:(0,t.jsx)(c.default,{mode:"tags",placeholder:(null==r?void 0:r.extra_headers)&&r.extra_headers.length>0?"Currently: ".concat(r.extra_headers.join(", ")):"Enter header names (e.g., Authorization, X-Custom-Header)",className:"rounded-lg",size:"large",tokenSeparators:[","],allowClear:!0})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Static Headers",(0,t.jsx)(d.Z,{title:"Send these key-value headers with every request to this MCP server.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),required:!1,children:(0,t.jsx)(j.Z.List,{name:"static_headers",children:(e,s)=>{let{add:r,remove:l}=s;return(0,t.jsxs)("div",{className:"space-y-3",children:[e.map(e=>{let{key:s,name:r,...a}=e;return(0,t.jsxs)(H.Z,{className:"flex w-full",align:"baseline",size:"middle",children:[(0,t.jsx)(j.Z.Item,{...a,name:[r,"header"],className:"flex-1",rules:[{required:!0,message:"Header name is required"}],children:(0,t.jsx)(v.default,{size:"large",allowClear:!0,className:"rounded-lg",placeholder:"Header name (e.g., X-API-Key)"})}),(0,t.jsx)(j.Z.Item,{...a,name:[r,"value"],className:"flex-1",rules:[{required:!0,message:"Header value is required"}],children:(0,t.jsx)(v.default,{size:"large",allowClear:!0,className:"rounded-lg",placeholder:"Header value"})}),(0,t.jsx)(D.Z,{onClick:()=>l(r),className:"text-gray-500 hover:text-red-500 cursor-pointer"})]},s)}),(0,t.jsx)(E.ZP,{type:"dashed",onClick:()=>r(),icon:(0,t.jsx)(J.Z,{}),block:!0,children:"Add Static Header"})]})}})})]})},"permissions")})};let $=e=>{try{let s=e.indexOf("/mcp/");if(-1===s)return{token:null,baseUrl:e};let r=e.split("/mcp/");if(2!==r.length)return{token:null,baseUrl:e};let t=r[0]+"/mcp/",l=r[1];if(!l)return{token:null,baseUrl:e};return{token:l,baseUrl:t}}catch(s){return console.error("Error parsing MCP URL:",s),{token:null,baseUrl:e}}},W=e=>{let{token:s,baseUrl:r}=$(e);return s?r+"...":e},Q=e=>{let{token:s}=$(e);return{maskedUrl:W(e),hasToken:!!s}},X=e=>e?/^https?:\/\/[^\s/$.?#].[^\s]*$/i.test(e)?Promise.resolve():Promise.reject("Please enter a valid URL (e.g., http://service-name.domain:1234/path or https://example.com)"):Promise.resolve(),ee=e=>e&&e.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve(),es=e=>{let s=new Uint8Array(e),r="";return s.forEach(e=>r+=String.fromCharCode(e)),btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},er=()=>{let e=new Uint8Array(32);return window.crypto.getRandomValues(e),es(e.buffer)},et=async e=>{let s=new TextEncoder().encode(e);return es(await window.crypto.subtle.digest("SHA-256",s))},el=e=>{let{accessToken:s,getCredentials:r,getTemporaryPayload:t,onTokenReceived:l,onBeforeRedirect:a}=e,[n,i]=(0,x.useState)("idle"),[o,c]=(0,x.useState)(null),[d,m]=(0,x.useState)(null),u="litellm-mcp-oauth-flow-state",g="litellm-mcp-oauth-result",j="litellm-mcp-oauth-return-url",v=()=>{try{window.sessionStorage.removeItem(u),window.sessionStorage.removeItem(g),window.sessionStorage.removeItem(j)}catch(e){console.warn("Failed to clear OAuth storage",e)}},f=()=>"".concat(window.location.origin,"/mcp/oauth/callback"),b=(0,x.useCallback)(async()=>{let e=r()||{};if(!s){c("Missing admin token"),h.Z.error("Access token missing. Please re-authenticate and try again.");return}let l=t();if(!l||!l.url||!l.transport){let e="Please complete server URL and transport before starting OAuth.";c(e),h.Z.error(e);return}try{var n,o,d;i("authorizing"),c(null);let r=await (0,p.cacheTemporaryMcpServer)(s,l),t=null==r?void 0:null===(n=r.server_id)||void 0===n?void 0:n.trim();if(!t)throw Error("Temporary MCP server identifier missing. Please retry.");let m={};if(!((null===(o=l.credentials)||void 0===o?void 0:o.client_id)&&(null===(d=l.credentials)||void 0===d?void 0:d.client_secret))){let e=await (0,p.registerMcpOAuthClient)(s,t,{client_name:l.alias||l.server_name||t,grant_types:["authorization_code"],response_types:["code"],token_endpoint_auth_method:l.credentials&&l.credentials.client_secret?"client_secret_post":"none"});m={clientId:null==e?void 0:e.client_id,clientSecret:null==e?void 0:e.client_secret}}let x=er(),h=await et(x),g=crypto.randomUUID(),v=m.clientId||e.client_id,b=Array.isArray(e.scopes)?e.scopes.filter(e=>e&&e.trim().length>0).join(" "):void 0,y=(0,p.buildMcpOAuthAuthorizeUrl)({serverId:t,clientId:v,redirectUri:f(),state:g,codeChallenge:h,scope:b}),N={state:g,codeVerifier:x,clientId:v,clientSecret:m.clientSecret||e.client_secret,serverId:t,redirectUri:f()};if(a)try{a()}catch(e){console.error("Failed to prepare for OAuth redirect",e)}try{window.sessionStorage.setItem(u,JSON.stringify(N)),window.sessionStorage.setItem(j,window.location.href)}catch(e){throw console.error("Unable to persist OAuth state",e),Error("Unable to access browser storage for OAuth. Please enable storage and retry.")}window.location.href=y}catch(s){console.error("Failed to start OAuth flow",s),i("error");let e=s instanceof Error?s.message:String(s);c(e),h.Z.error(e)}},[s,r,t,a]),y=(0,x.useCallback)(async()=>{let e=null,s=null;try{let r=window.sessionStorage.getItem(g);if(!r)return;e=JSON.parse(r),s=JSON.parse(window.sessionStorage.getItem(u)||"null")}catch(e){console.error("Failed to read OAuth session state",e),v(),c("Failed to resume OAuth flow. Please retry."),i("error"),h.Z.error("Failed to resume OAuth flow. Please retry.");return}if(e){window.sessionStorage.removeItem(g);try{if(!s||!s.state||!s.codeVerifier||!s.serverId)throw Error("Missing OAuth session state. Please retry.");if(!e.state||e.state!==s.state)throw Error("OAuth state mismatch. Please retry.");if(e.error)throw Error(e.error_description||e.error);if(!e.code)throw Error("Authorization code missing in callback.");i("exchanging");let r=await (0,p.exchangeMcpOAuthToken)({serverId:s.serverId,code:e.code,clientId:s.clientId,clientSecret:s.clientSecret,codeVerifier:s.codeVerifier,redirectUri:s.redirectUri});l(r),m(r),i("success"),c(null),h.Z.success("OAuth token retrieved successfully")}catch(s){console.error("OAuth flow failed",s);let e=s instanceof Error?s.message:String(s);c(e),i("error"),h.Z.error(e)}finally{v()}}},[l]);return(0,x.useEffect)(()=>{let e=!1;return(async()=>{e||await y()})(),()=>{e=!0}},[y]),{startOAuthFlow:b,status:n,error:o,tokenResponse:d}},ea="".concat("../ui/assets/logos/","mcp_logo.png"),en=[y.API_KEY,y.BEARER_TOKEN,y.BASIC],ei=[...en,y.OAUTH2],eo="litellm-mcp-oauth-create-state";var ec=e=>{var s;let{userRole:r,accessToken:a,onCreateSuccess:n,isModalVisible:i,setModalVisible:o,availableAccessGroups:u}=e,[g]=j.Z.useForm(),[N,_]=(0,x.useState)(!1),[w,Z]=(0,x.useState)({}),[C,S]=(0,x.useState)({}),[k,P]=(0,x.useState)(null),[A,T]=(0,x.useState)(!1),[M,O]=(0,x.useState)([]),[L,E]=(0,x.useState)([]),[z,q]=(0,x.useState)(""),[U,R]=(0,x.useState)(""),[V,H]=(0,x.useState)(null),D=C.auth_type,J=!!D&&en.includes(D),G=D===y.OAUTH2,{startOAuthFlow:$,status:W,error:Q,tokenResponse:es}=el({accessToken:a,getCredentials:()=>g.getFieldValue("credentials"),getTemporaryPayload:()=>{let e=g.getFieldsValue(!0),s=e.url,r=e.transport||z;if(!s||!r)return null;let t=Array.isArray(e.static_headers)?e.static_headers.reduce((e,s)=>{var r,t;let l=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return l&&(e[l]=null!==(t=null==s?void 0:s.value)&&void 0!==t?t:""),e},{}):{};return{server_id:void 0,server_name:e.server_name,alias:e.alias,description:e.description,url:s,transport:r,auth_type:y.OAUTH2,credentials:e.credentials,mcp_access_groups:e.mcp_access_groups,static_headers:t,command:e.command,args:e.args,env:e.env}},onTokenReceived:e=>{var s;H(null!==(s=null==e?void 0:e.access_token)&&void 0!==s?s:null)},onBeforeRedirect:()=>{try{let e=g.getFieldsValue(!0);window.sessionStorage.setItem(eo,JSON.stringify({modalVisible:i,formValues:e,transportType:z,costConfig:w,allowedTools:L,searchValue:U,aliasManuallyEdited:A}))}catch(e){console.warn("Failed to persist MCP create state",e)}}});x.useEffect(()=>{let e=window.sessionStorage.getItem(eo);if(e)try{var s;let r=JSON.parse(e);r.modalVisible&&o(!0);let t=(null===(s=r.formValues)||void 0===s?void 0:s.transport)||r.transportType||"";t&&q(t),r.formValues&&P({values:r.formValues,transport:t}),r.costConfig&&Z(r.costConfig),r.allowedTools&&E(r.allowedTools),r.searchValue&&R(r.searchValue),"boolean"==typeof r.aliasManuallyEdited&&T(r.aliasManuallyEdited)}catch(e){console.error("Failed to restore MCP create state",e)}finally{window.sessionStorage.removeItem(eo)}},[g,o]),x.useEffect(()=>{k&&(z||k.transport,(!k.transport||z)&&(g.setFieldsValue(k.values),S(k.values),P(null)))},[k,g,z]);let er=async e=>{_(!0);try{let{static_headers:s,stdio_config:r,credentials:t,...l}=e,i=l.mcp_access_groups,c=Array.isArray(s)?s.reduce((e,s)=>{var r,t;let l=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return l&&(e[l]=null!==(t=null==s?void 0:s.value)&&void 0!==t?t:""),e},{}):{},d=t&&"object"==typeof t?Object.entries(t).reduce((e,s)=>{let[r,t]=s;if(null==t||""===t)return e;if("scopes"===r){if(Array.isArray(t)){let s=t.filter(e=>null!=e&&""!==e);s.length>0&&(e[r]=s)}}else e[r]=t;return e},{}):void 0,m={};if(r&&"stdio"===z)try{let e=JSON.parse(r),s=e;if(e.mcpServers&&"object"==typeof e.mcpServers){let r=Object.keys(e.mcpServers);if(r.length>0){let t=r[0];s=e.mcpServers[t],l.server_name||(l.server_name=t.replace(/-/g,"_"))}}m={command:s.command,args:s.args,env:s.env},console.log("Parsed stdio config:",m)}catch(e){h.Z.fromBackend("Invalid JSON in stdio configuration");return}let u={...l,...m,stdio_config:void 0,mcp_info:{server_name:l.server_name||l.url,description:l.description,mcp_server_cost_info:Object.keys(w).length>0?w:null},mcp_access_groups:i,alias:l.alias,allowed_tools:L.length>0?L:null,static_headers:c};if(u.static_headers=c,l.auth_type&&ei.includes(l.auth_type)&&d&&Object.keys(d).length>0&&(u.credentials=d),console.log("Payload: ".concat(JSON.stringify(u))),null!=a){let e=await (0,p.createMCPServer)(a,u);h.Z.success("MCP Server created successfully"),g.resetFields(),Z({}),O([]),E([]),T(!1),o(!1),n(e)}}catch(e){h.Z.fromBackend("Error creating MCP Server: "+e)}finally{_(!1)}},et=()=>{g.resetFields(),Z({}),O([]),E([]),T(!1),o(!1)};return(x.useEffect(()=>{if(!A&&C.server_name){let e=C.server_name.replace(/\s+/g,"_");g.setFieldsValue({alias:e}),S(s=>({...s,alias:e}))}},[C.server_name]),x.useEffect(()=>{i||S({})},[i]),(0,l.tY)(r))?(0,t.jsx)(m.Z,{title:(0,t.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,t.jsx)("img",{src:ea,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"}}),(0,t.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add New MCP Server"})]}),open:i,width:1e3,onCancel:et,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsxs)(j.Z,{form:g,onFinish:er,onValuesChange:(e,s)=>S(s),layout:"vertical",className:"space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Server Name",(0,t.jsx)(d.Z,{title:"Best practice: Use a descriptive name that indicates the server's purpose (e.g., 'GitHub_MCP', 'Email_Service'). Hyphens '-' are not allowed; use underscores '_' instead.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"server_name",rules:[{required:!1,message:"Please enter a server name"},{validator:(e,s)=>ee(s)}],children:(0,t.jsx)(b.o,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Alias",(0,t.jsx)(d.Z,{title:"A short, unique identifier for this server. Defaults to the server name with spaces replaced by underscores.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"alias",rules:[{required:!1},{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Alias cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,t.jsx)(b.o,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:()=>T(!0)})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description"}),name:"description",rules:[{required:!1,message:"Please enter a server description!!!!!!!!!"}],children:(0,t.jsx)(b.o,{placeholder:"Brief description of what this server does",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Transport Type"}),name:"transport",rules:[{required:!0,message:"Please select a transport type"}],children:(0,t.jsxs)(c.default,{placeholder:"Select transport",className:"rounded-lg",size:"large",onChange:e=>{q(e),"stdio"===e?g.setFieldsValue({url:void 0,auth_type:void 0,credentials:void 0}):g.setFieldsValue({command:void 0,args:void 0,env:void 0})},value:z,children:[(0,t.jsx)(c.default.Option,{value:"http",children:"HTTP"}),(0,t.jsx)(c.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,t.jsx)(c.default.Option,{value:"stdio",children:"Standard Input/Output (stdio)"})]})}),"stdio"!==z&&(0,t.jsx)(j.Z.Item,{label:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"MCP Server URL"}),name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,s)=>X(s)}],children:(0,t.jsx)(v.default,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),"stdio"!==z&&(0,t.jsx)(j.Z.Item,{label:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Authentication"}),name:"auth_type",rules:[{required:!0,message:"Please select an auth type"}],children:(0,t.jsxs)(c.default,{placeholder:"Select auth type",className:"rounded-lg",size:"large",children:[(0,t.jsx)(c.default.Option,{value:"none",children:"None"}),(0,t.jsx)(c.default.Option,{value:"api_key",children:"API Key"}),(0,t.jsx)(c.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,t.jsx)(c.default.Option,{value:"basic",children:"Basic Auth"}),(0,t.jsx)(c.default.Option,{value:"oauth2",children:"OAuth"})]})}),"stdio"!==z&&J&&(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Value",(0,t.jsx)(d.Z,{title:"Token, password, or header value to send with each request for the selected auth type.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","auth_value"],rules:[{required:!0,message:"Please enter the authentication value"}],children:(0,t.jsx)(b.o,{type:"password",placeholder:"Enter token or secret",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),"stdio"!==z&&G&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client ID (optional)",(0,t.jsx)(d.Z,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_id"],children:(0,t.jsx)(b.o,{type:"password",placeholder:"Enter OAuth client ID",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client Secret (optional)",(0,t.jsx)(d.Z,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_secret"],children:(0,t.jsx)(b.o,{type:"password",placeholder:"Enter OAuth client secret",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Scopes (optional)",(0,t.jsx)(d.Z,{title:"Optional scopes requested during token exchange. Separate multiple scopes with enter or commas.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","scopes"],children:(0,t.jsx)(c.default,{mode:"tags",tokenSeparators:[","],placeholder:"Add scopes",className:"rounded-lg",size:"large"})}),(0,t.jsxs)("div",{className:"rounded-lg border border-dashed border-gray-300 p-4 space-y-2",children:[(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Complete the OAuth authorization flow to fetch an access token and store it as the authentication value."}),(0,t.jsx)(b.z,{variant:"secondary",onClick:$,disabled:"authorizing"===W||"exchanging"===W,children:"authorizing"===W?"Waiting for authorization...":"exchanging"===W?"Exchanging authorization code...":"Authorize & Fetch Token"}),Q&&(0,t.jsx)("p",{className:"text-sm text-red-500",children:Q}),"success"===W&&(null==es?void 0:es.access_token)&&(0,t.jsxs)("p",{className:"text-sm text-green-600",children:["Token fetched. Expires in ",null!==(s=es.expires_in)&&void 0!==s?s:"?"," seconds."]})]})]}),(0,t.jsx)(K,{isVisible:"stdio"===z})]}),(0,t.jsx)("div",{className:"mt-8",children:(0,t.jsx)(Y,{availableAccessGroups:u,mcpServer:null,searchValue:U,setSearchValue:R,getAccessGroupOptions:()=>{let e=u.map(e=>({value:e,label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:e})]})}));return U&&!u.some(e=>e.toLowerCase().includes(U.toLowerCase()))&&e.push({value:U,label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:U}),(0,t.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,t.jsx)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:(0,t.jsx)(F,{accessToken:a,oauthAccessToken:V,formValues:C,onToolsLoaded:O})}),(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(B,{accessToken:a,oauthAccessToken:V,formValues:C,allowedTools:L,existingAllowedTools:null,onAllowedToolsChange:E})}),(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(I,{value:w,onChange:Z,tools:M.filter(e=>L.includes(e.name)),disabled:!1})}),(0,t.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,t.jsx)(b.z,{variant:"secondary",onClick:et,children:"Cancel"}),(0,t.jsx)(b.z,{variant:"primary",loading:N,children:N?"Creating...":"Add MCP Server"})]})]})})}):null},ed=r(5945),em=r(63709),eu=r(12485),ex=r(18135),eh=r(35242),ep=r(29706),eg=r(77991),ej=r(64935),ev=r(30401),ef=r(78867),eb=r(11239),ey=r(54001),eN=r(96137),e_=r(96362),ew=r(80221),eZ=r(29202),eC=r(59872);let{Title:eS,Text:ek}=o.default,{Panel:eP}=C.default,eA=e=>{let{icon:s,title:r,description:l,children:a,serverName:n,accessGroups:i=["dev"]}=e,[o,c]=(0,x.useState)(!1),d=()=>{let e={"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"};if(o&&n){let s=[n.replace(/\s+/g,"_"),...i].join(",");e["x-mcp-servers"]=[s]}return e};return(0,t.jsxs)(ed.Z,{className:"border border-gray-200",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)("span",{className:"p-2 rounded-lg bg-gray-50",children:s}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eS,{level:5,className:"mb-0",children:r}),(0,t.jsx)(ek,{className:"text-gray-600",children:l})]})]}),n&&("Implementation Example"===r||"Configuration"===r)&&(0,t.jsxs)(j.Z.Item,{className:"mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(em.Z,{size:"small",checked:o,onChange:c}),(0,t.jsxs)(ek,{className:"text-sm",children:["Limit tools to specific MCP servers or MCP groups by passing the ",(0,t.jsx)("code",{children:"x-mcp-servers"})," header"]})]}),o&&(0,t.jsx)(L.Z,{className:"mt-2",type:"info",showIcon:!0,message:"Two Options",description:(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Option 1:"})," Get a specific server: ",(0,t.jsxs)("code",{children:['["',n.replace(/\s+/g,"_"),'"]']})]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Option 2:"})," Get a group of MCPs: ",(0,t.jsx)("code",{children:'["dev-group"]'})]}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:["You can also mix both: ",(0,t.jsx)("code",{children:'["Server1,dev-group"]'})]})]})})]}),x.Children.map(a,e=>{if(x.isValidElement(e)&&e.props.hasOwnProperty("code")&&e.props.hasOwnProperty("copyKey")){let s=e.props.code;if(s&&s.includes('"headers":'))return x.cloneElement(e,{code:s.replace(/"headers":\s*{[^}]*}/,'"headers": '.concat(JSON.stringify(d(),null,8)))})}return e})]})};var eT=e=>{let{currentServerAccessGroups:s=[]}=e,r=(0,p.getProxyBaseUrl)(),[l,a]=(0,x.useState)({}),[n,i]=(0,x.useState)({openai:[],litellm:[],cursor:[],http:[]}),[o]=(0,x.useState)("Zapier_MCP"),c=async(e,s)=>{await (0,eC.vQ)(e)&&(a(e=>({...e,[s]:!0})),setTimeout(()=>{a(e=>({...e,[s]:!1}))},2e3))},d=e=>{let{code:s,copyKey:r,title:a,className:n=""}=e;return(0,t.jsxs)("div",{className:"relative group",children:[a&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(ej.Z,{size:16,className:"text-blue-600"}),(0,t.jsx)(ek,{strong:!0,className:"text-gray-700",children:a})]}),(0,t.jsxs)(ed.Z,{className:"bg-gray-50 border border-gray-200 relative ".concat(n),children:[(0,t.jsx)(E.ZP,{type:"text",size:"small",icon:l[r]?(0,t.jsx)(ev.Z,{size:12}):(0,t.jsx)(ef.Z,{size:12}),onClick:()=>c(s,r),className:"absolute top-2 right-2 z-10 transition-all duration-200 ".concat(l[r]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),(0,t.jsx)("pre",{className:"text-sm overflow-x-auto pr-10 text-gray-800 font-mono leading-relaxed",children:s})]})]})},m=e=>{let{step:s,title:r,children:l}=e;return(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("div",{className:"w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-semibold",children:s})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(ek,{strong:!0,className:"text-gray-800 block mb-2",children:r}),l]})]})};return(0,t.jsx)("div",{children:(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(M.Z,{className:"text-3xl font-bold text-gray-900 mb-3",children:"Connect to your MCP client"}),(0,t.jsx)(T.Z,{className:"text-lg text-gray-600",children:"Use tools directly from any MCP client with LiteLLM MCP. Enable your AI assistant to perform real-world tasks through a simple, secure connection."})]}),(0,t.jsxs)(ex.Z,{className:"w-full",children:[(0,t.jsx)(eh.Z,{className:"flex justify-start mt-8 mb-6",children:(0,t.jsxs)("div",{className:"flex bg-gray-100 p-1 rounded-lg",children:[(0,t.jsx)(eu.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(ej.Z,{size:18}),"OpenAI API"]})}),(0,t.jsx)(eu.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(eb.Z,{size:18}),"LiteLLM Proxy"]})}),(0,t.jsx)(eu.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(ew.Z,{size:18}),"Cursor"]})}),(0,t.jsx)(eu.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(eZ.Z,{size:18}),"Streamable HTTP"]})})]})}),(0,t.jsxs)(eg.Z,{children:[(0,t.jsx)(ep.Z,{className:"mt-6",children:(0,t.jsx)(()=>(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-lg border border-blue-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)(ej.Z,{className:"text-blue-600",size:24}),(0,t.jsx)(eS,{level:4,className:"mb-0 text-blue-900",children:"OpenAI Responses API Integration"})]}),(0,t.jsx)(ek,{className:"text-blue-700",children:"Connect OpenAI Responses API to your LiteLLM MCP server for seamless tool integration"})]}),(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsx)(eA,{icon:(0,t.jsx)(ey.Z,{className:"text-blue-600",size:16}),title:"API Key Setup",description:"Configure your OpenAI API key for authentication",children:(0,t.jsxs)(H.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,t.jsx)("div",{children:(0,t.jsxs)(ek,{children:["Get your API key from the"," ",(0,t.jsxs)("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 inline-flex items-center gap-1",children:["OpenAI platform ",(0,t.jsx)(e_.Z,{size:12})]})]})}),(0,t.jsx)(d,{title:"Environment Variable",code:'export OPENAI_API_KEY="sk-..."',copyKey:"openai-env"})]})}),(0,t.jsx)(eA,{icon:(0,t.jsx)(eN.Z,{className:"text-blue-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,t.jsx)(d,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"openai-server-url"})}),(0,t.jsx)(eA,{icon:(0,t.jsx)(ej.Z,{className:"text-blue-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the Responses API",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,t.jsx)(d,{code:'curl --location \'https://api.openai.com/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $OPENAI_API_KEY" \\\n--data \'{\n "model": "gpt-4.1",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "'.concat(r,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"openai-curl",className:"text-xs"})})]})]}),{})}),(0,t.jsx)(ep.Z,{className:"mt-6",children:(0,t.jsx)(()=>(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-green-50 p-6 rounded-lg border border-emerald-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)(eb.Z,{className:"text-emerald-600",size:24}),(0,t.jsx)(eS,{level:4,className:"mb-0 text-emerald-900",children:"LiteLLM Proxy API Integration"})]}),(0,t.jsx)(ek,{className:"text-emerald-700",children:"Connect to LiteLLM Proxy Responses API for seamless tool integration with multiple model providers"})]}),(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsx)(eA,{icon:(0,t.jsx)(ey.Z,{className:"text-emerald-600",size:16}),title:"Virtual Key Setup",description:"Configure your LiteLLM Proxy Virtual Key for authentication",children:(0,t.jsxs)(H.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,t.jsx)("div",{children:(0,t.jsx)(ek,{children:"Get your Virtual Key from your LiteLLM Proxy dashboard or contact your administrator"})}),(0,t.jsx)(d,{title:"Environment Variable",code:'export LITELLM_API_KEY="sk-..."',copyKey:"litellm-env"})]})}),(0,t.jsx)(eA,{icon:(0,t.jsx)(eN.Z,{className:"text-emerald-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,t.jsx)(d,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"litellm-server-url"})}),(0,t.jsx)(eA,{icon:(0,t.jsx)(ej.Z,{className:"text-emerald-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the LiteLLM Proxy Responses API",serverName:o,accessGroups:["dev"],children:(0,t.jsx)(d,{code:"curl --location '".concat(r,'/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $LITELLM_VIRTUAL_KEY" \\\n--data \'{\n "model": "gpt-4",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "').concat(r,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_VIRTUAL_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"litellm-curl",className:"text-xs"})})]})]}),{})}),(0,t.jsx)(ep.Z,{className:"mt-6",children:(0,t.jsx)(()=>(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 p-6 rounded-lg border border-purple-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)(ew.Z,{className:"text-purple-600",size:24}),(0,t.jsx)(eS,{level:4,className:"mb-0 text-purple-900",children:"Cursor IDE Integration"})]}),(0,t.jsx)(ek,{className:"text-purple-700",children:"Use tools directly from Cursor IDE with LiteLLM MCP. Enable your AI assistant to perform real-world tasks without leaving your coding environment."})]}),(0,t.jsxs)(ed.Z,{className:"border border-gray-200",children:[(0,t.jsx)(eS,{level:5,className:"mb-4 text-gray-800",children:"Setup Instructions"}),(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsx)(m,{step:1,title:"Open Cursor Settings",children:(0,t.jsxs)(ek,{className:"text-gray-600",children:["Use the keyboard shortcut ",(0,t.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"⇧+⌘+J"})," (Mac) or"," ",(0,t.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+Shift+J"})," (Windows/Linux)"]})}),(0,t.jsx)(m,{step:2,title:"Navigate to MCP Tools",children:(0,t.jsx)(ek,{className:"text-gray-600",children:'Go to the "MCP Tools" tab and click "New MCP Server"'})}),(0,t.jsxs)(m,{step:3,title:"Add Configuration",children:[(0,t.jsxs)(ek,{className:"text-gray-600 mb-3",children:["Copy the JSON configuration below and paste it into Cursor, then save with"," ",(0,t.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Cmd+S"})," or"," ",(0,t.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+S"})]}),(0,t.jsx)(eA,{icon:(0,t.jsx)(ej.Z,{className:"text-purple-600",size:16}),title:"Configuration",description:"Cursor MCP configuration",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,t.jsx)(d,{code:'{\n "mcpServers": {\n "Zapier_MCP": {\n "url": "'.concat(r,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n }\n}'),copyKey:"cursor-config",className:"text-xs"})})]})]})]})]}),{})}),(0,t.jsx)(ep.Z,{className:"mt-6",children:(0,t.jsx)(()=>(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-teal-50 p-6 rounded-lg border border-green-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)(eZ.Z,{className:"text-green-600",size:24}),(0,t.jsx)(eS,{level:4,className:"mb-0 text-green-900",children:"Streamable HTTP Transport"})]}),(0,t.jsx)(ek,{className:"text-green-700",children:"Connect to LiteLLM MCP using HTTP transport. Compatible with any MCP client that supports HTTP streaming."})]}),(0,t.jsx)(eA,{icon:(0,t.jsx)(eZ.Z,{className:"text-green-600",size:16}),title:"Universal MCP Connection",description:"Use this URL with any MCP client that supports HTTP transport",children:(0,t.jsxs)(H.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,t.jsx)("div",{children:(0,t.jsx)(ek,{children:"Each MCP client supports different transports. Refer to your client documentation to determine the appropriate transport method."})}),(0,t.jsx)(d,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"http-server-url"}),(0,t.jsx)(d,{title:"Headers Configuration",code:JSON.stringify({"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"},null,2),copyKey:"http-headers"}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(E.ZP,{type:"link",className:"p-0 h-auto text-blue-600 hover:text-blue-700",href:"https://modelcontextprotocol.io/docs/concepts/transports",icon:(0,t.jsx)(e_.Z,{size:14}),children:"Learn more about MCP transports"})})]})})]}),{})})]})]})]})})},eM=r(58927),eI=r(53410),eO=r(74998);let eL=(e,s,r,l)=>[{accessorKey:"server_id",header:"Server ID",cell:e=>{let{row:r}=e;return(0,t.jsxs)("button",{onClick:()=>s(r.original.server_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:[r.original.server_id.slice(0,7),"..."]})}},{accessorKey:"server_name",header:"Name"},{accessorKey:"alias",header:"Alias"},{id:"url",header:"URL",cell:e=>{let{row:s}=e,{maskedUrl:r}=Q(s.original.url);return(0,t.jsx)("span",{className:"font-mono text-sm",children:r})}},{accessorKey:"transport",header:"Transport",cell:e=>{let{getValue:s}=e;return(0,t.jsx)("span",{children:(s()||"http").toUpperCase()})}},{accessorKey:"auth_type",header:"Auth Type",cell:e=>{let{getValue:s}=e;return(0,t.jsx)("span",{children:s()||"none"})}},{id:"health_status",header:"Health Status",cell:e=>{let{row:s}=e,r=s.original,l=r.status||"unknown",a=r.last_health_check,n=r.health_check_error,i=(0,t.jsxs)("div",{className:"max-w-xs",children:[(0,t.jsxs)("div",{className:"font-semibold mb-1",children:["Health Status: ",l]}),a&&(0,t.jsxs)("div",{className:"text-xs mb-1",children:["Last Check: ",new Date(a).toLocaleString()]}),n&&(0,t.jsxs)("div",{className:"text-xs",children:[(0,t.jsx)("div",{className:"font-medium text-red-400 mb-1",children:"Error:"}),(0,t.jsx)("div",{className:"break-words",children:n})]}),!a&&!n&&(0,t.jsx)("div",{className:"text-xs text-gray-400",children:"No health check data available"})]});return(0,t.jsx)(d.Z,{title:i,placement:"top",children:(0,t.jsxs)("button",{className:"font-mono text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[10ch] ".concat((e=>{switch(e){case"healthy":return"text-green-500 bg-green-50 hover:bg-green-100";case"unhealthy":return"text-red-500 bg-red-50 hover:bg-red-100";default:return"text-gray-500 bg-gray-50 hover:bg-gray-100"}})(l)),children:[(0,t.jsx)("span",{className:"mr-1",children:"●"}),l.charAt(0).toUpperCase()+l.slice(1)]})})}},{id:"mcp_access_groups",header:"Access Groups",cell:e=>{let{row:s}=e,r=s.original.mcp_access_groups;if(Array.isArray(r)&&r.length>0&&"string"==typeof r[0]){let e=r.join(", ");return(0,t.jsx)(d.Z,{title:e,children:(0,t.jsx)("span",{className:"max-w-[200px] truncate block",children:e.length>30?"".concat(e.slice(0,30),"..."):e})})}return(0,t.jsx)("span",{className:"text-gray-400 italic",children:"None"})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,r=s.original;return(0,t.jsx)("span",{className:"text-xs",children:r.created_at?new Date(r.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,r=s.original;return(0,t.jsx)("span",{className:"text-xs",children:r.updated_at?new Date(r.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"Actions",cell:e=>{let{row:s}=e;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Z,{title:"Edit MCP Server",children:(0,t.jsx)(eM.J,{icon:eI.Z,size:"sm",onClick:()=>r(s.original.server_id),className:"cursor-pointer hover:text-blue-600"})}),(0,t.jsx)(d.Z,{title:"Delete MCP Server",children:(0,t.jsx)(eM.J,{icon:eO.Z,size:"sm",onClick:()=>l(s.original.server_id),className:"cursor-pointer hover:text-red-600"})})]})}}];var eE=r(10900),ez=r(82376),eq=r(71437),eU=r(78489),eR=r(67101),eF=r(47323),eV=r(49566);let eB=[y.API_KEY,y.BEARER_TOKEN,y.BASIC],eK=[...eB,y.OAUTH2],eH="litellm-mcp-oauth-edit-state";var eD=e=>{var s;let{mcpServer:r,accessToken:l,onCancel:a,onSuccess:n,availableAccessGroups:i}=e,[o]=j.Z.useForm(),[m,u]=(0,x.useState)({}),[g,v]=(0,x.useState)([]),[b,N]=(0,x.useState)(!1),[_,w]=(0,x.useState)(""),[Z,C]=(0,x.useState)(!1),[S,k]=(0,x.useState)([]),[P,A]=(0,x.useState)(null),T=j.Z.useWatch("auth_type",o),M=!!T&&eB.includes(T),O=T===y.OAUTH2,[L,z]=(0,x.useState)(null),{startOAuthFlow:q,status:U,error:R,tokenResponse:F}=el({accessToken:l,getCredentials:()=>o.getFieldValue("credentials"),getTemporaryPayload:()=>{let e=o.getFieldsValue(!0),s=e.url||r.url,t=e.transport||r.transport;if(!s||!t)return null;let l=Array.isArray(e.static_headers)?e.static_headers.reduce((e,s)=>{var r,t;let l=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return l&&(e[l]=null!==(t=null==s?void 0:s.value)&&void 0!==t?t:""),e},{}):{};return{server_id:r.server_id,server_name:e.server_name||r.server_name||r.alias,alias:e.alias||r.alias,description:e.description||r.description,url:s,transport:t,auth_type:y.OAUTH2,credentials:e.credentials,mcp_access_groups:e.mcp_access_groups||r.mcp_access_groups,static_headers:l,command:e.command,args:e.args,env:e.env}},onTokenReceived:e=>{var s;z(null!==(s=null==e?void 0:e.access_token)&&void 0!==s?s:null)},onBeforeRedirect:()=>{try{let e=o.getFieldsValue(!0);window.sessionStorage.setItem(eH,JSON.stringify({serverId:r.server_id,formValues:e,costConfig:m,allowedTools:S,searchValue:_,aliasManuallyEdited:Z}))}catch(e){console.warn("Failed to persist MCP edit state",e)}}}),V=x.useMemo(()=>r.static_headers?Object.entries(r.static_headers).map(e=>{let[s,r]=e;return{header:s,value:null!=r?String(r):""}}):[],[r.static_headers]),K=x.useMemo(()=>({...r,static_headers:V}),[r,V]);(0,x.useEffect)(()=>{var e;(null===(e=r.mcp_info)||void 0===e?void 0:e.mcp_server_cost_info)&&u(r.mcp_info.mcp_server_cost_info)},[r]),(0,x.useEffect)(()=>{r.allowed_tools&&k(r.allowed_tools)},[r]),(0,x.useEffect)(()=>{let e=window.sessionStorage.getItem(eH);if(e)try{let s=JSON.parse(e);if(!s||s.serverId!==r.server_id)return;s.formValues&&A({...r,...s.formValues}),s.costConfig&&u(s.costConfig),s.allowedTools&&k(s.allowedTools),s.searchValue&&w(s.searchValue),"boolean"==typeof s.aliasManuallyEdited&&C(s.aliasManuallyEdited)}catch(e){console.error("Failed to restore MCP edit state",e)}finally{window.sessionStorage.removeItem(eH)}},[o,r]),(0,x.useEffect)(()=>{if(!P)return;let e=P.transport||r.transport;if(e&&e!==o.getFieldValue("transport")){o.setFieldsValue({transport:e});return}o.setFieldsValue(P),A(null)},[P,o,r.transport]),(0,x.useEffect)(()=>{if(r.mcp_access_groups){let e=r.mcp_access_groups.map(e=>"string"==typeof e?e:e.name||String(e));o.setFieldValue("mcp_access_groups",e)}},[r]),(0,x.useEffect)(()=>{H()},[r,l,L]);let H=async()=>{if(l&&r.url&&(r.auth_type!==y.OAUTH2||L)){N(!0);try{let e={server_id:r.server_id,server_name:r.server_name,url:r.url,transport:r.transport,auth_type:r.auth_type,mcp_info:r.mcp_info},s=await (0,p.testMCPToolsListRequest)(l,e,L);s.tools&&!s.error?v(s.tools):(console.error("Failed to fetch tools:",s.message),v([]))}catch(e){console.error("Tools fetch error:",e),v([])}finally{N(!1)}}},D=async e=>{if(l)try{let{static_headers:s,credentials:t,...a}=e,i=(a.mcp_access_groups||[]).map(e=>"string"==typeof e?e:e.name||String(e)),o=Array.isArray(s)?s.reduce((e,s)=>{var r,t;let l=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return l&&(e[l]=null!==(t=null==s?void 0:s.value)&&void 0!==t?t:""),e},{}):{},c=t&&"object"==typeof t?Object.entries(t).reduce((e,s)=>{let[r,t]=s;if(null==t||""===t)return e;if("scopes"===r){if(Array.isArray(t)){let s=t.filter(e=>null!=e&&""!==e);s.length>0&&(e[r]=s)}}else e[r]=t;return e},{}):void 0,d={...a,server_id:r.server_id,mcp_info:{server_name:a.server_name||a.url,description:a.description,mcp_server_cost_info:Object.keys(m).length>0?m:null},mcp_access_groups:i,alias:a.alias,extra_headers:a.extra_headers||[],allowed_tools:S.length>0?S:null,disallowed_tools:a.disallowed_tools||[],static_headers:o};a.auth_type&&eK.includes(a.auth_type)&&c&&Object.keys(c).length>0&&(d.credentials=c);let u=await (0,p.updateMCPServer)(l,d);h.Z.success("MCP Server updated successfully"),n(u)}catch(e){h.Z.fromBackend("Failed to update MCP Server"+((null==e?void 0:e.message)?": ".concat(e.message):""))}};return(0,t.jsxs)(ex.Z,{children:[(0,t.jsxs)(eh.Z,{className:"grid w-full grid-cols-2",children:[(0,t.jsx)(eu.Z,{children:"Server Configuration"}),(0,t.jsx)(eu.Z,{children:"Cost Configuration"})]}),(0,t.jsxs)(eg.Z,{className:"mt-6",children:[(0,t.jsx)(ep.Z,{children:(0,t.jsxs)(j.Z,{form:o,onFinish:D,initialValues:K,layout:"vertical",children:[(0,t.jsx)(j.Z.Item,{label:"MCP Server Name",name:"server_name",rules:[{validator:(e,s)=>ee(s)}],children:(0,t.jsx)(eV.Z,{})}),(0,t.jsx)(j.Z.Item,{label:"Alias",name:"alias",rules:[{validator:(e,s)=>ee(s)}],children:(0,t.jsx)(eV.Z,{onChange:()=>C(!0)})}),(0,t.jsx)(j.Z.Item,{label:"Description",name:"description",children:(0,t.jsx)(eV.Z,{})}),(0,t.jsx)(j.Z.Item,{label:"MCP Server URL",name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,s)=>X(s)}],children:(0,t.jsx)(eV.Z,{})}),(0,t.jsx)(j.Z.Item,{label:"Transport Type",name:"transport",rules:[{required:!0}],children:(0,t.jsxs)(c.default,{children:[(0,t.jsx)(c.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,t.jsx)(c.default.Option,{value:"http",children:"HTTP"})]})}),(0,t.jsx)(j.Z.Item,{label:"Authentication",name:"auth_type",rules:[{required:!0}],children:(0,t.jsxs)(c.default,{children:[(0,t.jsx)(c.default.Option,{value:"none",children:"None"}),(0,t.jsx)(c.default.Option,{value:"api_key",children:"API Key"}),(0,t.jsx)(c.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,t.jsx)(c.default.Option,{value:"basic",children:"Basic Auth"}),(0,t.jsx)(c.default.Option,{value:"oauth2",children:"OAuth"})]})}),M&&(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Value",(0,t.jsx)(d.Z,{title:"Token, password, or header value to send with each request for the selected auth type.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","auth_value"],rules:[{validator:(e,s)=>s&&"string"==typeof s&&""===s.trim()?Promise.reject(Error("Authentication value cannot be empty")):Promise.resolve()}],children:(0,t.jsx)(eV.Z,{type:"password",placeholder:"Enter token or secret (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),O&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client ID (optional)",(0,t.jsx)(d.Z,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_id"],children:(0,t.jsx)(eV.Z,{type:"password",placeholder:"Enter OAuth client ID (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client Secret (optional)",(0,t.jsx)(d.Z,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_secret"],children:(0,t.jsx)(eV.Z,{type:"password",placeholder:"Enter OAuth client secret (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Scopes (optional)",(0,t.jsx)(d.Z,{title:"Add scopes to override the default scope list used for this MCP server.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","scopes"],children:(0,t.jsx)(c.default,{mode:"tags",tokenSeparators:[","],placeholder:"Add scopes",className:"rounded-lg",size:"large"})}),(0,t.jsxs)("div",{className:"rounded-lg border border-dashed border-gray-300 p-4 space-y-2",children:[(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Use OAuth to fetch a fresh access token and save it as the authentication value."}),(0,t.jsx)(eU.Z,{variant:"secondary",onClick:q,disabled:"authorizing"===U||"exchanging"===U,children:"authorizing"===U?"Waiting for authorization...":"exchanging"===U?"Exchanging authorization code...":"Authorize & Fetch Token"}),R&&(0,t.jsx)("p",{className:"text-sm text-red-500",children:R}),"success"===U&&(null==F?void 0:F.access_token)&&(0,t.jsxs)("p",{className:"text-sm text-green-600",children:["Token fetched. Expires in ",null!==(s=F.expires_in)&&void 0!==s?s:"?"," seconds."]})]})]}),(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(Y,{availableAccessGroups:i,mcpServer:r,searchValue:_,setSearchValue:w,getAccessGroupOptions:()=>{let e=i.map(e=>({value:e,label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:e})]})}));return _&&!i.some(e=>e.toLowerCase().includes(_.toLowerCase()))&&e.push({value:_,label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:_}),(0,t.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(B,{accessToken:l,oauthAccessToken:L,formValues:{server_id:r.server_id,server_name:r.server_name,url:r.url,transport:r.transport,auth_type:r.auth_type,mcp_info:r.mcp_info},allowedTools:S,existingAllowedTools:r.allowed_tools||null,onAllowedToolsChange:k})}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(E.ZP,{onClick:a,children:"Cancel"}),(0,t.jsx)(eU.Z,{type:"submit",children:"Save Changes"})]})]})}),(0,t.jsx)(ep.Z,{children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(I,{value:m,onChange:u,tools:g,disabled:b}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(E.ZP,{onClick:a,children:"Cancel"}),(0,t.jsx)(eU.Z,{onClick:()=>o.submit(),children:"Save Changes"})]})]})})]})]})},eJ=r(92280),eG=e=>{let{costConfig:s}=e,r=(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null,l=(null==s?void 0:s.tool_name_to_cost_per_query)&&Object.keys(s.tool_name_to_cost_per_query).length>0;return r||l?(0,t.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,t.jsxs)("div",{className:"space-y-4",children:[r&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,t.jsxs)("div",{children:[(0,t.jsx)(eJ.x,{className:"font-medium",children:"Default Cost per Query"}),(0,t.jsxs)("div",{className:"text-green-600 font-mono",children:["$",s.default_cost_per_query.toFixed(4)]})]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,t.jsxs)("div",{children:[(0,t.jsx)(eJ.x,{className:"font-medium",children:"Tool-Specific Costs"}),(0,t.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,r]=e;return null!=r&&(0,t.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,t.jsx)(eJ.x,{className:"font-medium",children:s}),(0,t.jsxs)(eJ.x,{className:"text-green-600 font-mono",children:["$",r.toFixed(4)," per query"]})]},s)})})]}),(0,t.jsxs)("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,t.jsx)(eJ.x,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[r&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,t.jsxs)(eJ.x,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,t.jsxs)(eJ.x,{className:"text-blue-700",children:["• ",Object.keys(s.tool_name_to_cost_per_query).length," tool(s) with custom pricing"]})]})]})]})}):(0,t.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,t.jsx)("div",{className:"space-y-4",children:(0,t.jsx)("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-lg",children:(0,t.jsx)(eJ.x,{className:"text-gray-600",children:"No cost configuration set for this server. Tool calls will be charged at $0.00 per tool call."})})})})};let eY=e=>{var s,r,l,a,n;let{mcpServer:i,onBack:o,isEditing:c,isProxyAdmin:d,accessToken:m,userRole:u,userID:h,availableAccessGroups:p}=e,[g,j]=(0,x.useState)(c),[v,f]=(0,x.useState)(!1),[b,y]=(0,x.useState)({}),{maskedUrl:N,hasToken:Z}=Q(i.url),C=(e,s)=>Z?s?e:N:e,S=async(e,s)=>{await (0,eC.vQ)(e)&&(y(e=>({...e,[s]:!0})),setTimeout(()=>{y(e=>({...e,[s]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4 max-w-full",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(eU.Z,{icon:eE.Z,variant:"light",className:"mb-4",onClick:o,children:"Back to All Servers"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(M.Z,{children:i.server_name}),(0,t.jsx)(E.ZP,{type:"text",size:"small",icon:b["mcp-server_name"]?(0,t.jsx)(ev.Z,{size:12}):(0,t.jsx)(ef.Z,{size:12}),onClick:()=>S(i.server_name,"mcp-server_name"),className:"left-2 z-10 transition-all duration-200 ".concat(b["mcp-server_name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),i.alias&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"ml-4 text-gray-500",children:"Alias:"}),(0,t.jsx)("span",{className:"ml-1 font-mono text-blue-600",children:i.alias}),(0,t.jsx)(E.ZP,{type:"text",size:"small",icon:b["mcp-alias"]?(0,t.jsx)(ev.Z,{size:12}):(0,t.jsx)(ef.Z,{size:12}),onClick:()=>S(i.alias,"mcp-alias"),className:"left-2 z-10 transition-all duration-200 ".concat(b["mcp-alias"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(T.Z,{className:"text-gray-500 font-mono",children:i.server_id}),(0,t.jsx)(E.ZP,{type:"text",size:"small",icon:b["mcp-server-id"]?(0,t.jsx)(ev.Z,{size:12}):(0,t.jsx)(ef.Z,{size:12}),onClick:()=>S(i.server_id,"mcp-server-id"),className:"left-2 z-10 transition-all duration-200 ".concat(b["mcp-server-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,t.jsxs)(ex.Z,{defaultIndex:g?2:0,children:[(0,t.jsx)(eh.Z,{className:"mb-4",children:[(0,t.jsx)(eu.Z,{children:"Overview"},"overview"),(0,t.jsx)(eu.Z,{children:"MCP Tools"},"tools"),...d?[(0,t.jsx)(eu.Z,{children:"Settings"},"settings")]:[]]}),(0,t.jsxs)(eg.Z,{children:[(0,t.jsxs)(ep.Z,{children:[(0,t.jsxs)(eR.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(A.Z,{children:[(0,t.jsx)(T.Z,{children:"Transport"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(M.Z,{children:_(null!==(a=i.transport)&&void 0!==a?a:void 0)})})]}),(0,t.jsxs)(A.Z,{children:[(0,t.jsx)(T.Z,{children:"Auth Type"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(T.Z,{children:w(null!==(n=i.auth_type)&&void 0!==n?n:void 0)})})]}),(0,t.jsxs)(A.Z,{children:[(0,t.jsx)(T.Z,{children:"Host Url"}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsx)(T.Z,{className:"break-all overflow-wrap-anywhere",children:C(i.url,v)}),Z&&(0,t.jsx)("button",{onClick:()=>f(!v),className:"p-1 hover:bg-gray-100 rounded",children:(0,t.jsx)(eF.Z,{icon:v?ez.Z:eq.Z,size:"sm",className:"text-gray-500"})})]})]})]}),(0,t.jsxs)(A.Z,{className:"mt-2",children:[(0,t.jsx)(M.Z,{children:"Cost Configuration"}),(0,t.jsx)(eG,{costConfig:null===(s=i.mcp_info)||void 0===s?void 0:s.mcp_server_cost_info})]})]}),(0,t.jsx)(ep.Z,{children:(0,t.jsx)(e4,{serverId:i.server_id,accessToken:m,auth_type:i.auth_type,userRole:u,userID:h,serverAlias:i.alias})}),(0,t.jsx)(ep.Z,{children:(0,t.jsxs)(A.Z,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(M.Z,{children:"MCP Server Settings"}),g?null:(0,t.jsx)(eU.Z,{variant:"light",onClick:()=>j(!0),children:"Edit Settings"})]}),g?(0,t.jsx)(eD,{mcpServer:i,accessToken:m,onCancel:()=>j(!1),onSuccess:e=>{j(!1),o()},availableAccessGroups:p}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Server Name"}),(0,t.jsx)("div",{children:i.server_name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Alias"}),(0,t.jsx)("div",{children:i.alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Description"}),(0,t.jsx)("div",{children:i.description})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"URL"}),(0,t.jsxs)("div",{className:"font-mono break-all overflow-wrap-anywhere max-w-full flex items-center gap-2",children:[C(i.url,v),Z&&(0,t.jsx)("button",{onClick:()=>f(!v),className:"p-1 hover:bg-gray-100 rounded",children:(0,t.jsx)(eF.Z,{icon:v?ez.Z:eq.Z,size:"sm",className:"text-gray-500"})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Transport"}),(0,t.jsx)("div",{children:_(i.transport)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Extra Headers"}),(0,t.jsx)("div",{children:null===(r=i.extra_headers)||void 0===r?void 0:r.join(", ")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Auth Type"}),(0,t.jsx)("div",{children:w(i.auth_type)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Access Groups"}),(0,t.jsx)("div",{children:i.mcp_access_groups&&i.mcp_access_groups.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:i.mcp_access_groups.map((e,s)=>{var r;return(0,t.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded-md text-sm",children:"string"==typeof e?e:null!==(r=null==e?void 0:e.name)&&void 0!==r?r:""},s)})}):(0,t.jsx)(T.Z,{className:"text-gray-500",children:"No access groups defined"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Allowed Tools"}),(0,t.jsx)("div",{children:i.allowed_tools&&i.allowed_tools.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:i.allowed_tools.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-50 border border-blue-200 rounded-md text-sm",children:e},s))}):(0,t.jsx)(T.Z,{className:"text-gray-500",children:"All tools enabled"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Cost Configuration"}),(0,t.jsx)(eG,{costConfig:null===(l=i.mcp_info)||void 0===l?void 0:l.mcp_server_cost_info})]})]})]})})]})]})]})},{Text:e$,Title:eW}=o.default,{Option:eQ}=c.default;var eX=e=>{let{accessToken:s,userRole:r,userID:o}=e,{data:j,isLoading:v,refetch:f,dataUpdatedAt:b}=(0,n.a)({queryKey:["mcpServers"],queryFn:()=>{if(!s)throw Error("Access Token required");return(0,p.fetchMCPServers)(s)},enabled:!!s});x.useEffect(()=>{j&&(console.log("MCP Servers fetched:",j),j.forEach(e=>{console.log("Server: ".concat(e.server_name||e.server_id)),console.log(" allowed_tools:",e.allowed_tools)}))},[j]);let[y,N]=(0,x.useState)(null),[_,w]=(0,x.useState)(!1),[Z,C]=(0,x.useState)(null),[S,k]=(0,x.useState)(!1),[P,A]=(0,x.useState)("all"),[T,M]=(0,x.useState)("all"),[I,O]=(0,x.useState)([]),[L,E]=(0,x.useState)(!1),[z,q]=(0,x.useState)(!1),U="Internal User"===r;(0,x.useEffect)(()=>{try{let e=window.sessionStorage.getItem("litellm-mcp-oauth-edit-state");if(!e)return;let s=JSON.parse(e);(null==s?void 0:s.serverId)&&(C(s.serverId),k(!0))}catch(e){console.error("Failed to restore MCP edit view state",e)}},[]);let R=x.useMemo(()=>{if(!j)return[];let e=new Set,s=[];return j.forEach(r=>{r.teams&&r.teams.forEach(r=>{let t=r.team_id;e.has(t)||(e.add(t),s.push(r))})}),s},[j]),F=x.useMemo(()=>j?Array.from(new Set(j.flatMap(e=>e.mcp_access_groups).filter(e=>null!=e))):[],[j]),V=e=>{A(e),K(e,T)},B=e=>{M(e),K(P,e)},K=(e,s)=>{if(!j)return O([]);let r=j;if("personal"===e){O([]);return}"all"!==e&&(r=r.filter(s=>{var r;return null===(r=s.teams)||void 0===r?void 0:r.some(s=>s.team_id===e)})),"all"!==s&&(r=r.filter(e=>{var r;return null===(r=e.mcp_access_groups)||void 0===r?void 0:r.some(e=>"string"==typeof e?e===s:e&&e.name===s)})),O(r)};(0,x.useEffect)(()=>{K(P,T)},[b]);let H=x.useMemo(()=>eL(null!=r?r:"",e=>{C(e),k(!1)},e=>{C(e),k(!0)},D),[r]);function D(e){N(e),w(!0)}let J=async()=>{if(null!=y&&null!=s)try{q(!0),await (0,p.deleteMCPServer)(s,y),h.Z.success("Deleted MCP Server successfully"),f()}catch(e){console.error("Error deleting the mcp server:",e)}finally{q(!1),w(!1),N(null)}},G=y?(j||[]).find(e=>e.server_id===y):null;return s&&r&&o?(0,t.jsxs)("div",{className:"w-full h-full p-6",children:[(0,t.jsx)(m.Z,{open:_,title:"Delete MCP Server?",onOk:J,okText:z?"Deleting...":"Delete",onCancel:()=>{w(!1),N(null)},cancelText:"Cancel",cancelButtonProps:{disabled:z},okButtonProps:{danger:!0},confirmLoading:z,children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(e$,{children:"Are you sure you want to delete this MCP Server? This action cannot be undone."}),G&&(0,t.jsxs)("div",{className:"mt-4 p-4 bg-red-50 rounded-lg border border-red-200",children:[(0,t.jsx)(eW,{level:5,className:"mb-3 text-gray-900",children:"Server Information"}),(0,t.jsxs)(u.Z,{column:1,size:"small",children:[G.server_name&&(0,t.jsx)(u.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:"Server Name"}),children:(0,t.jsx)(e$,{className:"text-sm",children:G.server_name})}),G.alias&&(0,t.jsx)(u.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:"Alias"}),children:(0,t.jsx)(e$,{className:"text-sm",children:G.alias})}),(0,t.jsx)(u.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:"Server ID"}),children:(0,t.jsx)(e$,{code:!0,className:"text-sm",children:G.server_id})}),(0,t.jsx)(u.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:"URL"}),children:(0,t.jsx)(e$,{code:!0,className:"text-sm",children:G.url})})]})]})]})}),(0,t.jsx)(ec,{userRole:r,accessToken:s,onCreateSuccess:e=>{O(s=>[...s,e]),E(!1)},isModalVisible:L,setModalVisible:E,availableAccessGroups:F}),(0,t.jsx)(i.Dx,{children:"MCP Servers"}),(0,t.jsx)(i.xv,{className:"text-tremor-content mt-2",children:"Configure and manage your MCP servers"}),(0,l.tY)(r)&&(0,t.jsx)(i.zx,{className:"mt-4 mb-4",onClick:()=>E(!0),children:"+ Add New MCP Server"}),(0,t.jsxs)(i.v0,{className:"w-full h-full",children:[(0,t.jsx)(i.td,{className:"flex justify-between mt-2 w-full items-center",children:(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)(i.OK,{children:"All Servers"}),(0,t.jsx)(i.OK,{children:"Connect"})]})}),(0,t.jsxs)(i.nP,{children:[(0,t.jsx)(i.x4,{children:(0,t.jsx)(()=>Z?(0,t.jsx)(eY,{mcpServer:I.find(e=>e.server_id===Z)||{server_id:"",server_name:"",alias:"",url:"",transport:"",auth_type:"",created_at:"",created_by:"",updated_at:"",updated_by:""},onBack:()=>{k(!1),C(null),f()},isProxyAdmin:(0,l.tY)(r),isEditing:S,accessToken:s,userID:o,userRole:r,availableAccessGroups:F}):(0,t.jsxs)("div",{className:"w-full h-full",children:[(0,t.jsx)("div",{className:"w-full px-6",children:(0,t.jsx)("div",{className:"flex flex-col space-y-4",children:(0,t.jsx)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(i.xv,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,t.jsxs)(c.default,{value:P,onChange:V,style:{width:300},children:[(0,t.jsx)(eQ,{value:"all",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:U?"All Available Servers":"All Servers"})]})}),(0,t.jsx)(eQ,{value:"personal",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:"Personal"})]})}),R.map(e=>(0,t.jsx)(eQ,{value:e.team_id,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:e.team_alias||e.team_id})]})},e.team_id))]}),(0,t.jsxs)(i.xv,{className:"text-lg font-semibold text-gray-900 ml-6",children:["Access Group:",(0,t.jsx)(d.Z,{title:"An MCP Access Group is a set of users or teams that have permission to access specific MCP servers. Use access groups to control and organize who can connect to which servers.",children:(0,t.jsx)(a.Z,{style:{marginLeft:4,color:"#888"}})})]}),(0,t.jsxs)(c.default,{value:T,onChange:B,style:{width:300},children:[(0,t.jsx)(eQ,{value:"all",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:"All Access Groups"})]})}),F.map(e=>(0,t.jsx)(eQ,{value:e,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:e})]})},e))]})]})})})}),(0,t.jsx)("div",{className:"w-full px-6 mt-6",children:(0,t.jsx)(g.w,{data:I,columns:H,renderSubComponent:()=>(0,t.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:v,noDataMessage:"No MCP servers configured",loadingMessage:"\uD83D\uDE85 Loading MCP servers..."})})]}),{})}),(0,t.jsx)(i.x4,{children:(0,t.jsx)(eT,{})})]})]})]}):(console.log("Missing required authentication parameters",{accessToken:s,userRole:r,userID:o}),(0,t.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))},e0=r(21770);function e2(e){let{tool:s,onSubmit:r,isLoading:l,result:a,error:n,onClose:i}=e,[o]=j.Z.useForm(),[c,m]=x.useState("formatted"),[u,p]=x.useState(null),[g,v]=x.useState(null),y=x.useMemo(()=>"string"==typeof s.inputSchema?{type:"object",properties:{input:{type:"string",description:"Input for this tool"}},required:["input"]}:s.inputSchema,[s.inputSchema]),N=x.useMemo(()=>y.properties&&y.properties.params&&"object"===y.properties.params.type&&y.properties.params.properties?{type:"object",properties:y.properties.params.properties,required:y.properties.params.required||[]}:y,[y]);x.useEffect(()=>{u&&(a||n)&&v(Date.now()-u)},[a,n,u]);let _=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let r=document.execCommand("copy");if(document.body.removeChild(s),!r)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},w=async()=>{await _(JSON.stringify(a,null,2))?h.Z.success("Result copied to clipboard"):h.Z.fromBackend("Failed to copy result")},Z=async()=>{await _(s.name)?h.Z.success("Tool name copied to clipboard"):h.Z.fromBackend("Failed to copy tool name")};return(0,t.jsxs)("div",{className:"space-y-4 h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[s.mcp_info.logo_url&&(0,t.jsx)("img",{src:s.mcp_info.logo_url,alt:"".concat(s.mcp_info.server_name," logo"),className:"w-6 h-6 object-contain"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Tool:"}),(0,t.jsxs)("div",{className:"group inline-flex items-center space-x-1 bg-slate-50 hover:bg-slate-100 px-3 py-1 rounded-md cursor-pointer transition-colors border border-slate-200",onClick:Z,title:"Click to copy tool name",children:[(0,t.jsx)("span",{className:"font-mono text-slate-700 font-medium text-sm",children:s.name}),(0,t.jsx)("svg",{className:"w-3 h-3 text-slate-400 group-hover:text-slate-600 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]}),(0,t.jsx)("p",{className:"text-xs text-gray-600",children:s.description}),(0,t.jsxs)("p",{className:"text-xs text-gray-500",children:["Provider: ",s.mcp_info.server_name]})]})]}),(0,t.jsx)(b.z,{onClick:i,variant:"light",size:"sm",className:"text-gray-500 hover:text-gray-700",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:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 h-full",children:[(0,t.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,t.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Input Parameters"}),(0,t.jsx)(d.Z,{title:"Configure the input parameters for this tool call",children:(0,t.jsx)(f.Z,{className:"text-gray-400 hover:text-gray-600"})})]})}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsxs)(j.Z,{form:o,onFinish:e=>{p(Date.now()),v(null);let s={};Object.entries(e).forEach(e=>{var r;let[t,l]=e,a=null===(r=N.properties)||void 0===r?void 0:r[t];if(a&&null!=l&&""!==l)switch(a.type){case"boolean":s[t]="true"===l||!0===l;break;case"number":s[t]=Number(l);break;case"string":s[t]=String(l);break;default:s[t]=l}else null!=l&&""!==l&&(s[t]=l)}),r(y.properties&&y.properties.params&&"object"===y.properties.params.type&&y.properties.params.properties?{params:s}:s)},layout:"vertical",className:"space-y-3",children:["string"==typeof s.inputSchema?(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Input ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"input",rules:[{required:!0,message:"Please enter input for this tool"}],className:"mb-3",children:(0,t.jsx)(b.o,{placeholder:"Enter input for this tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})}):void 0===N.properties?(0,t.jsx)("div",{className:"text-center py-6 bg-gray-50 rounded-lg border border-gray-200",children:(0,t.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No Parameters Required"}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"This tool can be called without any input parameters."})]})}):(0,t.jsx)("div",{className:"space-y-3",children:Object.entries(N.properties).map(e=>{var s,r,l,a,n;let[i,o]=e;return(0,t.jsxs)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[i," ",(null===(s=N.required)||void 0===s?void 0:s.includes(i))&&(0,t.jsx)("span",{className:"text-red-500",children:"*"}),o.description&&(0,t.jsx)(d.Z,{title:o.description,children:(0,t.jsx)(f.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:i,rules:[{required:null===(r=N.required)||void 0===r?void 0:r.includes(i),message:"Please enter ".concat(i)}],className:"mb-3",children:["string"===o.type&&o.enum&&(0,t.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:o.default,children:[!(null===(l=N.required)||void 0===l?void 0:l.includes(i))&&(0,t.jsxs)("option",{value:"",children:["Select ",i]}),o.enum.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]}),"string"===o.type&&!o.enum&&(0,t.jsx)(b.o,{placeholder:o.description||"Enter ".concat(i),className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"}),"number"===o.type&&(0,t.jsx)("input",{type:"number",placeholder:o.description||"Enter ".concat(i),className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"}),"boolean"===o.type&&(0,t.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:(null===(a=o.default)||void 0===a?void 0:a.toString())||"",children:[!(null===(n=N.required)||void 0===n?void 0:n.includes(i))&&(0,t.jsxs)("option",{value:"",children:["Select ",i]}),(0,t.jsx)("option",{value:"true",children:"True"}),(0,t.jsx)("option",{value:"false",children:"False"})]})]},i)})}),(0,t.jsx)("div",{className:"pt-3 border-t border-gray-100",children:(0,t.jsx)(b.z,{onClick:()=>o.submit(),disabled:l,variant:"primary",className:"w-full",loading:l,children:l?"Calling Tool...":a||n?"Call Again":"Call Tool"})})]})})]}),(0,t.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,t.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Tool Result"})}),(0,t.jsx)("div",{className:"p-4",children:a||n||l?(0,t.jsxs)("div",{className:"space-y-3",children:[a&&!l&&!n&&(0,t.jsx)("div",{className:"p-2 bg-green-50 border border-green-200 rounded-lg",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("svg",{className:"h-4 w-4 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,t.jsx)("h4",{className:"text-xs font-medium text-green-900",children:"Tool executed successfully"}),null!==g&&(0,t.jsxs)("span",{className:"text-xs text-green-600 ml-1",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,t.jsxs)("div",{className:"flex bg-white rounded border border-green-300 p-0.5",children:[(0,t.jsx)("button",{onClick:()=>m("formatted"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("formatted"===c?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"Formatted"}),(0,t.jsx)("button",{onClick:()=>m("json"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("json"===c?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"JSON"})]}),(0,t.jsx)("button",{onClick:w,className:"p-1 hover:bg-green-100 rounded text-green-700",title:"Copy response",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})}),(0,t.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[l&&(0,t.jsxs)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-gray-200"}),(0,t.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,t.jsx)("p",{className:"text-sm font-medium mt-3",children:"Calling tool..."}),(0,t.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Please wait while we process your request"})]}),n&&(0,t.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,t.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("svg",{className:"h-4 w-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-red-900",children:"Tool Call Failed"}),null!==g&&(0,t.jsxs)("span",{className:"text-xs text-red-600",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,t.jsx)("div",{className:"bg-white border border-red-200 rounded p-2 max-h-48 overflow-y-auto",children:(0,t.jsx)("pre",{className:"text-xs whitespace-pre-wrap text-red-700 font-mono",children:n.message})})]})]})}),a&&!l&&!n&&(0,t.jsx)("div",{className:"space-y-3",children:"formatted"===c?a.map((e,s)=>(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:["text"===e.type&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Text Response"})}),(0,t.jsx)("div",{className:"p-3",children:(0,t.jsx)("div",{className:"bg-white rounded border border-gray-200 max-h-64 overflow-y-auto",children:(0,t.jsx)("div",{className:"p-3 space-y-2",children:e.text.split("\n\n").map((e,s)=>{if(""===e.trim())return null;if(e.startsWith("##")){let r=e.replace(/^#+\s/,"");return(0,t.jsx)("div",{className:"border-b border-gray-200 pb-1 mb-2",children:(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:r})},s)}let r=/(https?:\/\/[^\s\)]+)/g;if(r.test(e)){let l=e.split(r);return(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded p-2",children:(0,t.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap",children:l.map((e,s)=>r.test(e)?(0,t.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline break-all",children:e},s):e)})},s)}return e.includes("Score:")?(0,t.jsx)("div",{className:"bg-green-50 border-l-4 border-green-400 p-2 rounded-r",children:(0,t.jsx)("p",{className:"text-xs text-green-800 font-medium whitespace-pre-wrap",children:e})},s):(0,t.jsx)("div",{className:"bg-gray-50 rounded p-2 border border-gray-200",children:(0,t.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap font-mono",children:e})},s)}).filter(Boolean)})})})]}),"image"===e.type&&e.url&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Image Response"})}),(0,t.jsx)("div",{className:"p-3",children:(0,t.jsx)("div",{className:"bg-gray-50 rounded p-3 border border-gray-200",children:(0,t.jsx)("img",{src:e.url,alt:"Tool result",className:"max-w-full h-auto rounded shadow-sm"})})})]}),"embedded_resource"===e.type&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Embedded Resource"})}),(0,t.jsx)("div",{className:"p-3",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2 p-3 bg-blue-50 border border-blue-200 rounded",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("svg",{className:"h-5 w-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("p",{className:"text-xs font-medium text-blue-900",children:["Resource Type: ",e.resource_type]}),e.url&&(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-xs text-blue-600 hover:text-blue-800 hover:underline mt-1 transition-colors",children:["View Resource",(0,t.jsxs)("svg",{className:"ml-1 h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:[(0,t.jsx)("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),(0,t.jsx)("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})]})]})})]})]},s)):(0,t.jsx)("div",{className:"bg-white rounded border border-gray-200",children:(0,t.jsx)("div",{className:"p-3 overflow-auto max-h-80 bg-gray-50",children:(0,t.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all text-gray-800",children:JSON.stringify(a,null,2)})})})})]})]}):(0,t.jsx)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:(0,t.jsxs)("div",{className:"text-center max-w-sm",children:[(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"Ready to Call Tool"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 leading-relaxed",children:'Configure the input parameters and click "Call Tool" to see the results here.'})]})})})]})]})]})}var e1=r(69993),e4=e=>{let{serverId:s,accessToken:r,auth_type:l,userRole:a,userID:i,serverAlias:o}=e,[c,d]=(0,x.useState)(null),[m,u]=(0,x.useState)(null),[h,g]=(0,x.useState)(null),{data:j,isLoading:v,error:f}=(0,n.a)({queryKey:["mcpTools",s],queryFn:()=>{if(!r)throw Error("Access Token required");return(0,p.listMCPTools)(r,s)},enabled:!!r,staleTime:3e4}),{mutate:b,isPending:y}=(0,e0.D)({mutationFn:async e=>{if(!r)throw Error("Access Token required");try{return await (0,p.callMCPTool)(r,e.tool.name,e.arguments)}catch(e){throw e}},onSuccess:e=>{u(e.content),g(null)},onError:e=>{g(e),u(null)}}),N=(null==j?void 0:j.tools)||[];return(0,t.jsx)("div",{className:"w-full h-screen p-4 bg-white",children:(0,t.jsx)(A.Z,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,t.jsxs)("div",{className:"flex h-auto w-full gap-4",children:[(0,t.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 flex flex-col",children:[(0,t.jsx)(M.Z,{className:"text-xl font-semibold mb-6 mt-2",children:"MCP Tools"}),(0,t.jsx)("div",{className:"flex flex-col flex-1",children:(0,t.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,t.jsxs)(T.Z,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,t.jsx)(P.Z,{className:"mr-2"})," Available Tools",N.length>0&&(0,t.jsx)("span",{className:"ml-2 bg-blue-100 text-blue-800 text-xs font-medium px-2 py-0.5 rounded-full",children:N.length})]}),v&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 bg-white border border-gray-200 rounded-lg",children:[(0,t.jsxs)("div",{className:"relative mb-3",children:[(0,t.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-gray-200"}),(0,t.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,t.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Loading tools..."})]}),(null==j?void 0:j.error)&&!v&&!N.length&&(0,t.jsx)("div",{className:"p-3 text-xs text-red-800 rounded-lg bg-red-50 border border-red-200",children:(0,t.jsxs)("p",{className:"font-medium",children:["Error: ",j.message]})}),!v&&!(null==j?void 0:j.error)&&(!N||0===N.length)&&(0,t.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,t.jsx)("div",{className:"mx-auto w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center mb-2",children:(0,t.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 8.172V5L8 4z"})})}),(0,t.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools available"}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"No tools found for this server"})]}),!v&&!(null==j?void 0:j.error)&&N.length>0&&(0,t.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto min-h-0 mcp-tools-scrollable",style:{maxHeight:"400px",scrollbarWidth:"auto",scrollbarColor:"#cbd5e0 #f7fafc"},children:N.map(e=>(0,t.jsxs)("div",{className:"border rounded-lg p-3 cursor-pointer transition-all hover:shadow-sm ".concat((null==c?void 0:c.name)===e.name?"border-blue-500 bg-blue-50 ring-1 ring-blue-200":"border-gray-200 bg-white hover:border-gray-300"),onClick:()=>{d(e),u(null),g(null)},children:[(0,t.jsxs)("div",{className:"flex items-start space-x-2",children:[e.mcp_info.logo_url&&(0,t.jsx)("img",{src:e.mcp_info.logo_url,alt:"".concat(e.mcp_info.server_name," logo"),className:"w-4 h-4 object-contain flex-shrink-0 mt-0.5"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h4",{className:"font-mono text-xs font-medium text-gray-900 truncate",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.mcp_info.server_name}),(0,t.jsx)("p",{className:"text-xs text-gray-600 mt-1 line-clamp-2 leading-relaxed",children:e.description})]})]}),(null==c?void 0:c.name)===e.name&&(0,t.jsx)("div",{className:"mt-2 pt-2 border-t border-blue-200",children:(0,t.jsxs)("div",{className:"flex items-center text-xs font-medium text-blue-700",children:[(0,t.jsx)("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Selected"]})})]},e.name))})]})})]}),(0,t.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,t.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,t.jsx)(M.Z,{className:"text-xl font-semibold mb-0",children:"Tool Testing Playground"})}),(0,t.jsx)("div",{className:"flex-1 overflow-auto p-4",children:c?(0,t.jsx)("div",{className:"h-full",children:(0,t.jsx)(e2,{tool:c,onSubmit:e=>{b({tool:c,arguments:e})},result:m,error:h,isLoading:y,onClose:()=>d(null)})}):(0,t.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,t.jsx)(e1.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,t.jsx)(T.Z,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select a Tool to Test"}),(0,t.jsx)(T.Z,{className:"text-center text-gray-500 max-w-md",children:"Choose a tool from the left sidebar to start testing its functionality with custom inputs."})]})})]})]})})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7641-b096010ad3f11a08.js b/litellm/proxy/_experimental/out/_next/static/chunks/7641-b096010ad3f11a08.js new file mode 100644 index 00000000000..b0ddf2534c5 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/7641-b096010ad3f11a08.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7641],{71668:function(e,s,r){r.d(s,{Dx:function(){return d.Z},OK:function(){return l.Z},nP:function(){return o.Z},td:function(){return n.Z},v0:function(){return a.Z},x4:function(){return i.Z},xv:function(){return c.Z},zx:function(){return t.Z}});var t=r(78489),l=r(12485),a=r(18135),n=r(35242),i=r(29706),o=r(77991),c=r(84264),d=r(96761)},87641:function(e,s,r){r.d(s,{d:function(){return eX},o:function(){return e4}});var t=r(57437),l=r(20347),a=r(67187),n=r(11713),i=r(71668),o=r(57840),c=r(37592),d=r(99981),m=r(22116),u=r(76188),x=r(2265),h=r(9114),p=r(19250),g=r(12322),j=r(10032),v=r(4260),f=r(15424),b=r(64504);let y={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",BASIC:"basic",OAUTH2:"oauth2"},N={SSE:"sse"},_=e=>(console.log(e),null==e)?N.SSE:e,w=e=>null==e?y.NONE:e;var Z=r(19015),C=r(44851),S=r(33866),k=r(62670),P=r(58630),A=r(12514),T=r(84264),M=r(96761),I=e=>{let{value:s={},onChange:r,tools:l=[],disabled:a=!1}=e,n=(e,t)=>{let l={...s,tool_name_to_cost_per_query:{...s.tool_name_to_cost_per_query,[e]:t}};null==r||r(l)};return(0,t.jsx)(A.Z,{children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,t.jsx)(k.Z,{className:"text-green-600"}),(0,t.jsx)(M.Z,{children:"Cost Configuration"}),(0,t.jsx)(d.Z,{title:"Configure costs for this MCP server's tool calls. Set a default rate and per-tool overrides.",children:(0,t.jsx)(f.Z,{className:"text-gray-400"})})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Default Cost per Query ($)",(0,t.jsx)(d.Z,{title:"Default cost charged for each tool call to this server.",children:(0,t.jsx)(f.Z,{className:"ml-1 text-gray-400"})})]}),(0,t.jsx)(Z.Z,{min:0,step:1e-4,precision:4,placeholder:"0.0000",value:s.default_cost_per_query,onChange:e=>{let t={...s,default_cost_per_query:e};null==r||r(t)},disabled:a,style:{width:"200px"},addonBefore:"$"}),(0,t.jsx)(T.Z,{className:"block mt-1 text-gray-500 text-sm",children:"Set a default cost for all tool calls to this server"})]}),l.length>0&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Tool-Specific Costs ($)",(0,t.jsx)(d.Z,{title:"Override the default cost for specific tools. Leave blank to use the default rate.",children:(0,t.jsx)(f.Z,{className:"ml-1 text-gray-400"})})]}),(0,t.jsx)(C.default,{items:[{key:"1",label:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(P.Z,{className:"mr-2 text-blue-500"}),(0,t.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,t.jsx)(S.Z,{count:l.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,t.jsx)("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:l.map((e,r)=>{var l;return(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(T.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,t.jsx)(T.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]}),(0,t.jsx)("div",{className:"ml-4",children:(0,t.jsx)(Z.Z,{min:0,step:1e-4,precision:4,placeholder:"Use default",value:null===(l=s.tool_name_to_cost_per_query)||void 0===l?void 0:l[e.name],onChange:s=>n(e.name,s),disabled:a,style:{width:"120px"},addonBefore:"$"})})]},r)})})}]})]})]}),(s.default_cost_per_query||s.tool_name_to_cost_per_query&&Object.keys(s.tool_name_to_cost_per_query).length>0)&&(0,t.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,t.jsx)(T.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[s.default_cost_per_query&&(0,t.jsxs)(T.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),s.tool_name_to_cost_per_query&&Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,r]=e;return null!=r&&(0,t.jsxs)(T.Z,{className:"text-blue-700",children:["• ",s,": $",r.toFixed(4)," per query"]},s)})]})]})]})})},O=r(10353),L=r(51653),E=r(5545),z=r(83669),q=r(29271),U=r(89245);let R=e=>{var s,r;let{accessToken:t,oauthAccessToken:l,formValues:a,enabled:n=!0}=e,[i,o]=(0,x.useState)([]),[c,d]=(0,x.useState)(!1),[m,u]=(0,x.useState)(null),[h,g]=(0,x.useState)(null),[j,v]=(0,x.useState)(!1),f=a.auth_type===y.OAUTH2,b=!!(a.url&&a.transport&&a.auth_type&&t&&(!f||l)),N=JSON.stringify(null!==(s=a.static_headers)&&void 0!==s?s:{}),_=JSON.stringify(null!==(r=a.credentials)&&void 0!==r?r:{}),w=async()=>{if(t&&a.url&&(!f||l)){d(!0),u(null);try{let e=Array.isArray(a.static_headers)?a.static_headers.reduce((e,s)=>{var r;let t=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return t&&(e[t]=(null==s?void 0:s.value)!=null?String(s.value):""),e},{}):!Array.isArray(a.static_headers)&&a.static_headers&&"object"==typeof a.static_headers?Object.entries(a.static_headers).reduce((e,s)=>{let[r,t]=s;return r&&(e[r]=null!=t?String(t):""),e},{}):{},s=a.credentials&&"object"==typeof a.credentials?Object.entries(a.credentials).reduce((e,s)=>{let[r,t]=s;if(null==t||""===t)return e;if("scopes"===r){if(Array.isArray(t)){let s=t.filter(e=>null!=e&&""!==e);s.length>0&&(e[r]=s)}}else e[r]=t;return e},{}):void 0,r={server_id:a.server_id||"",server_name:a.server_name||"",url:a.url,transport:a.transport,auth_type:a.auth_type,mcp_info:a.mcp_info,static_headers:e};s&&Object.keys(s).length>0&&(r.credentials=s);let n=await (0,p.testMCPToolsListRequest)(t,r,l);if(n.tools&&!n.error)o(n.tools),u(null),g(null),n.tools.length>0&&!j&&v(!0);else{let e=n.message||"Failed to retrieve tools list";u(e),g(n.stack_trace||null),o([]),v(!1)}}catch(e){console.error("Tools fetch error:",e),u(e instanceof Error?e.message:String(e)),g(null),o([]),v(!1)}finally{d(!1)}}},Z=()=>{o([]),u(null),g(null),v(!1)};return(0,x.useEffect)(()=>{n&&(b?w():Z())},[a.url,a.transport,a.auth_type,t,n,l,b,N,_]),{tools:i,isLoadingTools:c,toolsError:m,toolsErrorStackTrace:h,hasShownSuccessMessage:j,canFetchTools:b,fetchTools:w,clearTools:Z}};var F=e=>{let{accessToken:s,oauthAccessToken:r,formValues:l,onToolsLoaded:a}=e,{tools:n,isLoadingTools:i,toolsError:o,toolsErrorStackTrace:c,canFetchTools:d,fetchTools:m}=R({accessToken:s,oauthAccessToken:r,formValues:l,enabled:!0});return((0,x.useEffect)(()=>{null==a||a(n)},[n,a]),d||l.url)?(0,t.jsx)(A.Z,{children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(z.Z,{className:"text-blue-600"}),(0,t.jsx)(M.Z,{children:"Connection Status"})]}),!d&&l.url&&(0,t.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,t.jsx)(P.Z,{className:"text-2xl mb-2"}),(0,t.jsx)(T.Z,{children:"Complete required fields to test connection"}),(0,t.jsx)("br",{}),(0,t.jsx)(T.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to test MCP server connection"})]}),d&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"text-gray-700 font-medium",children:i?"Testing connection to MCP server...":n.length>0?"Connection successful":o?"Connection failed":"Ready to test connection"}),(0,t.jsx)("br",{}),(0,t.jsxs)(T.Z,{className:"text-gray-500 text-sm",children:["Server: ",l.url]})]}),i&&(0,t.jsxs)("div",{className:"flex items-center text-blue-600",children:[(0,t.jsx)(O.Z,{size:"small",className:"mr-2"}),(0,t.jsx)(T.Z,{className:"text-blue-600",children:"Connecting..."})]}),!i&&!o&&n.length>0&&(0,t.jsxs)("div",{className:"flex items-center text-green-600",children:[(0,t.jsx)(z.Z,{className:"mr-1"}),(0,t.jsx)(T.Z,{className:"text-green-600 font-medium",children:"Connected"})]}),o&&(0,t.jsxs)("div",{className:"flex items-center text-red-600",children:[(0,t.jsx)(q.Z,{className:"mr-1"}),(0,t.jsx)(T.Z,{className:"text-red-600 font-medium",children:"Failed"})]})]}),i&&(0,t.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,t.jsx)(O.Z,{size:"large"}),(0,t.jsx)(T.Z,{className:"ml-3",children:"Testing connection and loading tools..."})]}),o&&(0,t.jsx)(L.Z,{message:"Connection Failed",description:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{children:o}),c&&(0,t.jsx)(C.default,{items:[{key:"stack-trace",label:"Stack Trace",children:(0,t.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"12px",fontFamily:"monospace",margin:0,padding:"8px",backgroundColor:"#f5f5f5",borderRadius:"4px",maxHeight:"400px",overflow:"auto"},children:c})}],style:{marginTop:"12px"}})]}),type:"error",showIcon:!0,action:(0,t.jsx)(E.ZP,{icon:(0,t.jsx)(U.Z,{}),onClick:m,size:"small",children:"Retry"})}),!i&&0===n.length&&!o&&(0,t.jsxs)("div",{className:"text-center py-6 text-gray-500 border rounded-lg border-dashed",children:[(0,t.jsx)(z.Z,{className:"text-2xl mb-2 text-green-500"}),(0,t.jsx)(T.Z,{className:"text-green-600 font-medium",children:"Connection successful!"}),(0,t.jsx)("br",{}),(0,t.jsx)(T.Z,{className:"text-gray-500",children:"No tools found for this MCP server"})]})]})]})}):null},V=r(4156),B=e=>{let{accessToken:s,oauthAccessToken:r,formValues:l,allowedTools:a,existingAllowedTools:n,onAllowedToolsChange:i}=e,o=(0,x.useRef)(0),{tools:c,isLoadingTools:d,toolsError:m,canFetchTools:u}=R({accessToken:s,oauthAccessToken:r,formValues:l,enabled:!0});(0,x.useEffect)(()=>{if(c.length>0&&c.length!==o.current&&0===a.length){if(n&&n.length>0){let e=c.map(e=>e.name);i(n.filter(s=>e.includes(s)))}else i(c.map(e=>e.name))}o.current=c.length},[c,a.length,n,i]);let h=e=>{a.includes(e)?i(a.filter(s=>s!==e)):i([...a,e])};return u||l.url?(0,t.jsx)(A.Z,{children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(P.Z,{className:"text-blue-600"}),(0,t.jsx)(M.Z,{children:"Tool Configuration"}),c.length>0&&(0,t.jsx)(S.Z,{count:c.length,style:{backgroundColor:"#52c41a"}})]})}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(T.Z,{className:"text-blue-800 text-sm",children:[(0,t.jsx)("strong",{children:"Select which tools users can call:"})," Only checked tools will be available for users to invoke. Unchecked tools will be blocked from execution."]})}),d&&(0,t.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,t.jsx)(O.Z,{size:"large"}),(0,t.jsx)(T.Z,{className:"ml-3",children:"Loading tools..."})]}),m&&!d&&(0,t.jsxs)("div",{className:"text-center py-6 text-red-500 border rounded-lg border-dashed border-red-300 bg-red-50",children:[(0,t.jsx)(P.Z,{className:"text-2xl mb-2"}),(0,t.jsx)(T.Z,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,t.jsx)("br",{}),(0,t.jsx)(T.Z,{className:"text-sm text-red-500",children:m})]}),!d&&!m&&0===c.length&&u&&(0,t.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,t.jsx)(P.Z,{className:"text-2xl mb-2"}),(0,t.jsx)(T.Z,{children:"No tools available for configuration"}),(0,t.jsx)("br",{}),(0,t.jsx)(T.Z,{className:"text-sm",children:"Connect to an MCP server with tools to configure them"})]}),!u&&l.url&&(0,t.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,t.jsx)(P.Z,{className:"text-2xl mb-2"}),(0,t.jsx)(T.Z,{children:"Complete required fields to configure tools"}),(0,t.jsx)("br",{}),(0,t.jsx)(T.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to load available tools"})]}),!d&&!m&&c.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-green-50 rounded-lg border border-green-200 flex-1",children:[(0,t.jsx)(z.Z,{className:"text-green-600"}),(0,t.jsxs)(T.Z,{className:"text-green-700 font-medium",children:[a.length," of ",c.length," ",1===c.length?"tool":"tools"," enabled for user access"]})]}),(0,t.jsxs)("div",{className:"flex gap-2 ml-3",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{i(c.map(e=>e.name))},className:"px-3 py-1.5 text-sm text-blue-600 hover:text-blue-700 hover:bg-blue-50 rounded-md transition-colors",children:"Enable All"}),(0,t.jsx)("button",{type:"button",onClick:()=>{i([])},className:"px-3 py-1.5 text-sm text-gray-600 hover:text-gray-700 hover:bg-gray-100 rounded-md transition-colors",children:"Disable All"})]})]}),(0,t.jsx)("div",{className:"space-y-2",children:c.map((e,s)=>(0,t.jsx)("div",{className:"p-4 rounded-lg border transition-colors cursor-pointer ".concat(a.includes(e.name)?"bg-blue-50 border-blue-300 hover:border-blue-400":"bg-gray-50 border-gray-200 hover:border-gray-300"),onClick:()=>h(e.name),children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(V.Z,{checked:a.includes(e.name),onChange:()=>h(e.name)}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(T.Z,{className:"font-medium text-gray-900",children:e.name}),(0,t.jsx)("span",{className:"px-2 py-0.5 text-xs rounded-full font-medium ".concat(a.includes(e.name)?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:a.includes(e.name)?"Enabled":"Disabled"})]}),e.description&&(0,t.jsx)(T.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description}),(0,t.jsx)(T.Z,{className:"text-gray-400 text-xs block mt-1",children:a.includes(e.name)?"✓ Users can call this tool":"✗ Users cannot call this tool"})]})]})},s))})]})]})}):null},K=e=>{let{isVisible:s}=e;return s?(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Stdio Configuration (JSON)",(0,t.jsx)(d.Z,{title:"Paste your stdio MCP server configuration in JSON format. You can use the full mcpServers structure from config.yaml or just the inner server configuration.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"stdio_config",rules:[{required:!0,message:"Please enter stdio configuration"},{validator:(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}}}],children:(0,t.jsx)(v.default.TextArea,{placeholder:'{\n "mcpServers": {\n "circleci-mcp-server": {\n "command": "npx",\n "args": ["-y", "@circleci/mcp-server-circleci"],\n "env": {\n "CIRCLECI_TOKEN": "your-circleci-token",\n "CIRCLECI_BASE_URL": "https://circleci.com"\n }\n }\n }\n}',rows:12,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm"})}):null},H=r(58760),D=r(45246),J=r(96473);let{Panel:G}=C.default;var Y=e=>{let{availableAccessGroups:s,mcpServer:r,searchValue:l,setSearchValue:a,getAccessGroupOptions:n}=e,i=j.Z.useFormInstance();return(0,x.useEffect)(()=>{if(r&&(r.extra_headers&&i.setFieldValue("extra_headers",r.extra_headers),r.static_headers)){let e=Object.entries(r.static_headers).map(e=>{let[s,r]=e;return{header:s,value:null!=r?String(r):""}});i.setFieldValue("static_headers",e)}},[r,i]),(0,t.jsx)(C.default,{className:"bg-gray-50 border border-gray-200 rounded-lg",expandIconPosition:"end",ghost:!1,children:(0,t.jsx)(G,{header:(0,t.jsxs)("div",{className:"flex items-center",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)("h3",{className:"text-lg font-semibold text-gray-900",children:"Permission Management / Access Control"})]}),(0,t.jsx)("p",{className:"text-sm text-gray-600 ml-4",children:"Configure access permissions and security settings (Optional)"})]}),className:"border-0",children:(0,t.jsxs)("div",{className:"space-y-6 pt-4",children:[(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,t.jsx)(d.Z,{title:"Specify access groups for this MCP server. Users must be in at least one of these groups to access the server.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",className:"mb-4",children:(0,t.jsx)(c.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"value",filterOption:(e,s)=>{var r;return(null!==(r=null==s?void 0:s.value)&&void 0!==r?r:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>a(e),tokenSeparators:[","],options:n(),maxTagCount:"responsive",allowClear:!0})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Extra Headers",(0,t.jsx)(d.Z,{title:"Forward custom headers from incoming requests to this MCP server (e.g., Authorization, X-Custom-Header, User-Agent)",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})}),(null==r?void 0:r.extra_headers)&&r.extra_headers.length>0&&(0,t.jsxs)("span",{className:"ml-2 text-xs bg-blue-100 text-blue-700 px-2 py-1 rounded-full",children:[r.extra_headers.length," configured"]})]}),name:"extra_headers",children:(0,t.jsx)(c.default,{mode:"tags",placeholder:(null==r?void 0:r.extra_headers)&&r.extra_headers.length>0?"Currently: ".concat(r.extra_headers.join(", ")):"Enter header names (e.g., Authorization, X-Custom-Header)",className:"rounded-lg",size:"large",tokenSeparators:[","],allowClear:!0})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Static Headers",(0,t.jsx)(d.Z,{title:"Send these key-value headers with every request to this MCP server.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),required:!1,children:(0,t.jsx)(j.Z.List,{name:"static_headers",children:(e,s)=>{let{add:r,remove:l}=s;return(0,t.jsxs)("div",{className:"space-y-3",children:[e.map(e=>{let{key:s,name:r,...a}=e;return(0,t.jsxs)(H.Z,{className:"flex w-full",align:"baseline",size:"middle",children:[(0,t.jsx)(j.Z.Item,{...a,name:[r,"header"],className:"flex-1",rules:[{required:!0,message:"Header name is required"}],children:(0,t.jsx)(v.default,{size:"large",allowClear:!0,className:"rounded-lg",placeholder:"Header name (e.g., X-API-Key)"})}),(0,t.jsx)(j.Z.Item,{...a,name:[r,"value"],className:"flex-1",rules:[{required:!0,message:"Header value is required"}],children:(0,t.jsx)(v.default,{size:"large",allowClear:!0,className:"rounded-lg",placeholder:"Header value"})}),(0,t.jsx)(D.Z,{onClick:()=>l(r),className:"text-gray-500 hover:text-red-500 cursor-pointer"})]},s)}),(0,t.jsx)(E.ZP,{type:"dashed",onClick:()=>r(),icon:(0,t.jsx)(J.Z,{}),block:!0,children:"Add Static Header"})]})}})})]})},"permissions")})};let $=e=>{try{let s=e.indexOf("/mcp/");if(-1===s)return{token:null,baseUrl:e};let r=e.split("/mcp/");if(2!==r.length)return{token:null,baseUrl:e};let t=r[0]+"/mcp/",l=r[1];if(!l)return{token:null,baseUrl:e};return{token:l,baseUrl:t}}catch(s){return console.error("Error parsing MCP URL:",s),{token:null,baseUrl:e}}},W=e=>{let{token:s,baseUrl:r}=$(e);return s?r+"...":e},Q=e=>{let{token:s}=$(e);return{maskedUrl:W(e),hasToken:!!s}},X=e=>e?/^https?:\/\/[^\s/$.?#].[^\s]*$/i.test(e)?Promise.resolve():Promise.reject("Please enter a valid URL (e.g., http://service-name.domain:1234/path or https://example.com)"):Promise.resolve(),ee=e=>e&&e.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve(),es=e=>{let s=new Uint8Array(e),r="";return s.forEach(e=>r+=String.fromCharCode(e)),btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},er=()=>{let e=new Uint8Array(32);return window.crypto.getRandomValues(e),es(e.buffer)},et=async e=>{let s=new TextEncoder().encode(e);return es(await window.crypto.subtle.digest("SHA-256",s))},el=e=>{let{accessToken:s,getCredentials:r,getTemporaryPayload:t,onTokenReceived:l,onBeforeRedirect:a}=e,[n,i]=(0,x.useState)("idle"),[o,c]=(0,x.useState)(null),[d,m]=(0,x.useState)(null),u="litellm-mcp-oauth-flow-state",g="litellm-mcp-oauth-result",j="litellm-mcp-oauth-return-url",v=()=>{try{window.sessionStorage.removeItem(u),window.sessionStorage.removeItem(g),window.sessionStorage.removeItem(j)}catch(e){console.warn("Failed to clear OAuth storage",e)}},f=()=>{{let e=window.location.pathname||"",s=e.indexOf("/ui"),r=(s>=0?e.slice(0,s+3):"").replace(/\/+$/,"");return"".concat(window.location.origin).concat(r,"/mcp/oauth/callback")}},b=()=>f(),y=(0,x.useCallback)(async()=>{let e=r()||{};if(!s){c("Missing admin token"),h.Z.error("Access token missing. Please re-authenticate and try again.");return}let l=t();if(!l||!l.url||!l.transport){let e="Please complete server URL and transport before starting OAuth.";c(e),h.Z.error(e);return}try{var n,o,d;i("authorizing"),c(null);let r=await (0,p.cacheTemporaryMcpServer)(s,l),t=null==r?void 0:null===(n=r.server_id)||void 0===n?void 0:n.trim();if(!t)throw Error("Temporary MCP server identifier missing. Please retry.");let m={};if(!((null===(o=l.credentials)||void 0===o?void 0:o.client_id)&&(null===(d=l.credentials)||void 0===d?void 0:d.client_secret))){let e=await (0,p.registerMcpOAuthClient)(s,t,{client_name:l.alias||l.server_name||t,grant_types:["authorization_code"],response_types:["code"],token_endpoint_auth_method:l.credentials&&l.credentials.client_secret?"client_secret_post":"none"});m={clientId:null==e?void 0:e.client_id,clientSecret:null==e?void 0:e.client_secret}}let x=er(),h=await et(x),g=crypto.randomUUID(),v=m.clientId||e.client_id,f=Array.isArray(e.scopes)?e.scopes.filter(e=>e&&e.trim().length>0).join(" "):void 0,y=(0,p.buildMcpOAuthAuthorizeUrl)({serverId:t,clientId:v,redirectUri:b(),state:g,codeChallenge:h,scope:f}),N={state:g,codeVerifier:x,clientId:v,clientSecret:m.clientSecret||e.client_secret,serverId:t,redirectUri:b()};if(a)try{a()}catch(e){console.error("Failed to prepare for OAuth redirect",e)}try{window.sessionStorage.setItem(u,JSON.stringify(N)),window.sessionStorage.setItem(j,window.location.href)}catch(e){throw console.error("Unable to persist OAuth state",e),Error("Unable to access browser storage for OAuth. Please enable storage and retry.")}window.location.href=y}catch(s){console.error("Failed to start OAuth flow",s),i("error");let e=s instanceof Error?s.message:String(s);c(e),h.Z.error(e)}},[s,r,t,a]),N=(0,x.useCallback)(async()=>{let e=null,s=null;try{let r=window.sessionStorage.getItem(g);if(!r)return;e=JSON.parse(r),s=JSON.parse(window.sessionStorage.getItem(u)||"null")}catch(e){console.error("Failed to read OAuth session state",e),v(),c("Failed to resume OAuth flow. Please retry."),i("error"),h.Z.error("Failed to resume OAuth flow. Please retry.");return}if(e){window.sessionStorage.removeItem(g);try{if(!s||!s.state||!s.codeVerifier||!s.serverId)throw Error("Missing OAuth session state. Please retry.");if(!e.state||e.state!==s.state)throw Error("OAuth state mismatch. Please retry.");if(e.error)throw Error(e.error_description||e.error);if(!e.code)throw Error("Authorization code missing in callback.");i("exchanging");let r=await (0,p.exchangeMcpOAuthToken)({serverId:s.serverId,code:e.code,clientId:s.clientId,clientSecret:s.clientSecret,codeVerifier:s.codeVerifier,redirectUri:s.redirectUri});l(r),m(r),i("success"),c(null),h.Z.success("OAuth token retrieved successfully")}catch(s){console.error("OAuth flow failed",s);let e=s instanceof Error?s.message:String(s);c(e),i("error"),h.Z.error(e)}finally{v()}}},[l]);return(0,x.useEffect)(()=>{let e=!1;return(async()=>{e||await N()})(),()=>{e=!0}},[N]),{startOAuthFlow:y,status:n,error:o,tokenResponse:d}},ea="".concat("../ui/assets/logos/","mcp_logo.png"),en=[y.API_KEY,y.BEARER_TOKEN,y.BASIC],ei=[...en,y.OAUTH2],eo="litellm-mcp-oauth-create-state";var ec=e=>{var s;let{userRole:r,accessToken:a,onCreateSuccess:n,isModalVisible:i,setModalVisible:o,availableAccessGroups:u}=e,[g]=j.Z.useForm(),[N,_]=(0,x.useState)(!1),[w,Z]=(0,x.useState)({}),[C,S]=(0,x.useState)({}),[k,P]=(0,x.useState)(null),[A,T]=(0,x.useState)(!1),[M,O]=(0,x.useState)([]),[L,E]=(0,x.useState)([]),[z,q]=(0,x.useState)(""),[U,R]=(0,x.useState)(""),[V,H]=(0,x.useState)(null),D=C.auth_type,J=!!D&&en.includes(D),G=D===y.OAUTH2,{startOAuthFlow:$,status:W,error:Q,tokenResponse:es}=el({accessToken:a,getCredentials:()=>g.getFieldValue("credentials"),getTemporaryPayload:()=>{let e=g.getFieldsValue(!0),s=e.url,r=e.transport||z;if(!s||!r)return null;let t=Array.isArray(e.static_headers)?e.static_headers.reduce((e,s)=>{var r,t;let l=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return l&&(e[l]=null!==(t=null==s?void 0:s.value)&&void 0!==t?t:""),e},{}):{};return{server_id:void 0,server_name:e.server_name,alias:e.alias,description:e.description,url:s,transport:r,auth_type:y.OAUTH2,credentials:e.credentials,mcp_access_groups:e.mcp_access_groups,static_headers:t,command:e.command,args:e.args,env:e.env}},onTokenReceived:e=>{var s;H(null!==(s=null==e?void 0:e.access_token)&&void 0!==s?s:null)},onBeforeRedirect:()=>{try{let e=g.getFieldsValue(!0);window.sessionStorage.setItem(eo,JSON.stringify({modalVisible:i,formValues:e,transportType:z,costConfig:w,allowedTools:L,searchValue:U,aliasManuallyEdited:A}))}catch(e){console.warn("Failed to persist MCP create state",e)}}});x.useEffect(()=>{let e=window.sessionStorage.getItem(eo);if(e)try{var s;let r=JSON.parse(e);r.modalVisible&&o(!0);let t=(null===(s=r.formValues)||void 0===s?void 0:s.transport)||r.transportType||"";t&&q(t),r.formValues&&P({values:r.formValues,transport:t}),r.costConfig&&Z(r.costConfig),r.allowedTools&&E(r.allowedTools),r.searchValue&&R(r.searchValue),"boolean"==typeof r.aliasManuallyEdited&&T(r.aliasManuallyEdited)}catch(e){console.error("Failed to restore MCP create state",e)}finally{window.sessionStorage.removeItem(eo)}},[g,o]),x.useEffect(()=>{k&&(z||k.transport,(!k.transport||z)&&(g.setFieldsValue(k.values),S(k.values),P(null)))},[k,g,z]);let er=async e=>{_(!0);try{let{static_headers:s,stdio_config:r,credentials:t,...l}=e,i=l.mcp_access_groups,c=Array.isArray(s)?s.reduce((e,s)=>{var r,t;let l=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return l&&(e[l]=null!==(t=null==s?void 0:s.value)&&void 0!==t?t:""),e},{}):{},d=t&&"object"==typeof t?Object.entries(t).reduce((e,s)=>{let[r,t]=s;if(null==t||""===t)return e;if("scopes"===r){if(Array.isArray(t)){let s=t.filter(e=>null!=e&&""!==e);s.length>0&&(e[r]=s)}}else e[r]=t;return e},{}):void 0,m={};if(r&&"stdio"===z)try{let e=JSON.parse(r),s=e;if(e.mcpServers&&"object"==typeof e.mcpServers){let r=Object.keys(e.mcpServers);if(r.length>0){let t=r[0];s=e.mcpServers[t],l.server_name||(l.server_name=t.replace(/-/g,"_"))}}m={command:s.command,args:s.args,env:s.env},console.log("Parsed stdio config:",m)}catch(e){h.Z.fromBackend("Invalid JSON in stdio configuration");return}let u={...l,...m,stdio_config:void 0,mcp_info:{server_name:l.server_name||l.url,description:l.description,mcp_server_cost_info:Object.keys(w).length>0?w:null},mcp_access_groups:i,alias:l.alias,allowed_tools:L.length>0?L:null,static_headers:c};if(u.static_headers=c,l.auth_type&&ei.includes(l.auth_type)&&d&&Object.keys(d).length>0&&(u.credentials=d),console.log("Payload: ".concat(JSON.stringify(u))),null!=a){let e=await (0,p.createMCPServer)(a,u);h.Z.success("MCP Server created successfully"),g.resetFields(),Z({}),O([]),E([]),T(!1),o(!1),n(e)}}catch(e){h.Z.fromBackend("Error creating MCP Server: "+e)}finally{_(!1)}},et=()=>{g.resetFields(),Z({}),O([]),E([]),T(!1),o(!1)};return(x.useEffect(()=>{if(!A&&C.server_name){let e=C.server_name.replace(/\s+/g,"_");g.setFieldsValue({alias:e}),S(s=>({...s,alias:e}))}},[C.server_name]),x.useEffect(()=>{i||S({})},[i]),(0,l.tY)(r))?(0,t.jsx)(m.Z,{title:(0,t.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,t.jsx)("img",{src:ea,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"}}),(0,t.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add New MCP Server"})]}),open:i,width:1e3,onCancel:et,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsxs)(j.Z,{form:g,onFinish:er,onValuesChange:(e,s)=>S(s),layout:"vertical",className:"space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Server Name",(0,t.jsx)(d.Z,{title:"Best practice: Use a descriptive name that indicates the server's purpose (e.g., 'GitHub_MCP', 'Email_Service'). Hyphens '-' are not allowed; use underscores '_' instead.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"server_name",rules:[{required:!1,message:"Please enter a server name"},{validator:(e,s)=>ee(s)}],children:(0,t.jsx)(b.o,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Alias",(0,t.jsx)(d.Z,{title:"A short, unique identifier for this server. Defaults to the server name with spaces replaced by underscores.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"alias",rules:[{required:!1},{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Alias cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,t.jsx)(b.o,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:()=>T(!0)})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description"}),name:"description",rules:[{required:!1,message:"Please enter a server description!!!!!!!!!"}],children:(0,t.jsx)(b.o,{placeholder:"Brief description of what this server does",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Transport Type"}),name:"transport",rules:[{required:!0,message:"Please select a transport type"}],children:(0,t.jsxs)(c.default,{placeholder:"Select transport",className:"rounded-lg",size:"large",onChange:e=>{q(e),"stdio"===e?g.setFieldsValue({url:void 0,auth_type:void 0,credentials:void 0}):g.setFieldsValue({command:void 0,args:void 0,env:void 0})},value:z,children:[(0,t.jsx)(c.default.Option,{value:"http",children:"HTTP"}),(0,t.jsx)(c.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,t.jsx)(c.default.Option,{value:"stdio",children:"Standard Input/Output (stdio)"})]})}),"stdio"!==z&&(0,t.jsx)(j.Z.Item,{label:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"MCP Server URL"}),name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,s)=>X(s)}],children:(0,t.jsx)(v.default,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),"stdio"!==z&&(0,t.jsx)(j.Z.Item,{label:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Authentication"}),name:"auth_type",rules:[{required:!0,message:"Please select an auth type"}],children:(0,t.jsxs)(c.default,{placeholder:"Select auth type",className:"rounded-lg",size:"large",children:[(0,t.jsx)(c.default.Option,{value:"none",children:"None"}),(0,t.jsx)(c.default.Option,{value:"api_key",children:"API Key"}),(0,t.jsx)(c.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,t.jsx)(c.default.Option,{value:"basic",children:"Basic Auth"}),(0,t.jsx)(c.default.Option,{value:"oauth2",children:"OAuth"})]})}),"stdio"!==z&&J&&(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Value",(0,t.jsx)(d.Z,{title:"Token, password, or header value to send with each request for the selected auth type.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","auth_value"],rules:[{required:!0,message:"Please enter the authentication value"}],children:(0,t.jsx)(b.o,{type:"password",placeholder:"Enter token or secret",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),"stdio"!==z&&G&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client ID (optional)",(0,t.jsx)(d.Z,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_id"],children:(0,t.jsx)(b.o,{type:"password",placeholder:"Enter OAuth client ID",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client Secret (optional)",(0,t.jsx)(d.Z,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_secret"],children:(0,t.jsx)(b.o,{type:"password",placeholder:"Enter OAuth client secret",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Scopes (optional)",(0,t.jsx)(d.Z,{title:"Optional scopes requested during token exchange. Separate multiple scopes with enter or commas.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","scopes"],children:(0,t.jsx)(c.default,{mode:"tags",tokenSeparators:[","],placeholder:"Add scopes",className:"rounded-lg",size:"large"})}),(0,t.jsxs)("div",{className:"rounded-lg border border-dashed border-gray-300 p-4 space-y-2",children:[(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Complete the OAuth authorization flow to fetch an access token and store it as the authentication value."}),(0,t.jsx)(b.z,{variant:"secondary",onClick:$,disabled:"authorizing"===W||"exchanging"===W,children:"authorizing"===W?"Waiting for authorization...":"exchanging"===W?"Exchanging authorization code...":"Authorize & Fetch Token"}),Q&&(0,t.jsx)("p",{className:"text-sm text-red-500",children:Q}),"success"===W&&(null==es?void 0:es.access_token)&&(0,t.jsxs)("p",{className:"text-sm text-green-600",children:["Token fetched. Expires in ",null!==(s=es.expires_in)&&void 0!==s?s:"?"," seconds."]})]})]}),(0,t.jsx)(K,{isVisible:"stdio"===z})]}),(0,t.jsx)("div",{className:"mt-8",children:(0,t.jsx)(Y,{availableAccessGroups:u,mcpServer:null,searchValue:U,setSearchValue:R,getAccessGroupOptions:()=>{let e=u.map(e=>({value:e,label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:e})]})}));return U&&!u.some(e=>e.toLowerCase().includes(U.toLowerCase()))&&e.push({value:U,label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:U}),(0,t.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,t.jsx)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:(0,t.jsx)(F,{accessToken:a,oauthAccessToken:V,formValues:C,onToolsLoaded:O})}),(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(B,{accessToken:a,oauthAccessToken:V,formValues:C,allowedTools:L,existingAllowedTools:null,onAllowedToolsChange:E})}),(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(I,{value:w,onChange:Z,tools:M.filter(e=>L.includes(e.name)),disabled:!1})}),(0,t.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,t.jsx)(b.z,{variant:"secondary",onClick:et,children:"Cancel"}),(0,t.jsx)(b.z,{variant:"primary",loading:N,children:N?"Creating...":"Add MCP Server"})]})]})})}):null},ed=r(5945),em=r(63709),eu=r(12485),ex=r(18135),eh=r(35242),ep=r(29706),eg=r(77991),ej=r(64935),ev=r(30401),ef=r(78867),eb=r(11239),ey=r(54001),eN=r(96137),e_=r(96362),ew=r(80221),eZ=r(29202),eC=r(59872);let{Title:eS,Text:ek}=o.default,{Panel:eP}=C.default,eA=e=>{let{icon:s,title:r,description:l,children:a,serverName:n,accessGroups:i=["dev"]}=e,[o,c]=(0,x.useState)(!1),d=()=>{let e={"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"};if(o&&n){let s=[n.replace(/\s+/g,"_"),...i].join(",");e["x-mcp-servers"]=[s]}return e};return(0,t.jsxs)(ed.Z,{className:"border border-gray-200",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)("span",{className:"p-2 rounded-lg bg-gray-50",children:s}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eS,{level:5,className:"mb-0",children:r}),(0,t.jsx)(ek,{className:"text-gray-600",children:l})]})]}),n&&("Implementation Example"===r||"Configuration"===r)&&(0,t.jsxs)(j.Z.Item,{className:"mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(em.Z,{size:"small",checked:o,onChange:c}),(0,t.jsxs)(ek,{className:"text-sm",children:["Limit tools to specific MCP servers or MCP groups by passing the ",(0,t.jsx)("code",{children:"x-mcp-servers"})," header"]})]}),o&&(0,t.jsx)(L.Z,{className:"mt-2",type:"info",showIcon:!0,message:"Two Options",description:(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Option 1:"})," Get a specific server: ",(0,t.jsxs)("code",{children:['["',n.replace(/\s+/g,"_"),'"]']})]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Option 2:"})," Get a group of MCPs: ",(0,t.jsx)("code",{children:'["dev-group"]'})]}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:["You can also mix both: ",(0,t.jsx)("code",{children:'["Server1,dev-group"]'})]})]})})]}),x.Children.map(a,e=>{if(x.isValidElement(e)&&e.props.hasOwnProperty("code")&&e.props.hasOwnProperty("copyKey")){let s=e.props.code;if(s&&s.includes('"headers":'))return x.cloneElement(e,{code:s.replace(/"headers":\s*{[^}]*}/,'"headers": '.concat(JSON.stringify(d(),null,8)))})}return e})]})};var eT=e=>{let{currentServerAccessGroups:s=[]}=e,r=(0,p.getProxyBaseUrl)(),[l,a]=(0,x.useState)({}),[n,i]=(0,x.useState)({openai:[],litellm:[],cursor:[],http:[]}),[o]=(0,x.useState)("Zapier_MCP"),c=async(e,s)=>{await (0,eC.vQ)(e)&&(a(e=>({...e,[s]:!0})),setTimeout(()=>{a(e=>({...e,[s]:!1}))},2e3))},d=e=>{let{code:s,copyKey:r,title:a,className:n=""}=e;return(0,t.jsxs)("div",{className:"relative group",children:[a&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(ej.Z,{size:16,className:"text-blue-600"}),(0,t.jsx)(ek,{strong:!0,className:"text-gray-700",children:a})]}),(0,t.jsxs)(ed.Z,{className:"bg-gray-50 border border-gray-200 relative ".concat(n),children:[(0,t.jsx)(E.ZP,{type:"text",size:"small",icon:l[r]?(0,t.jsx)(ev.Z,{size:12}):(0,t.jsx)(ef.Z,{size:12}),onClick:()=>c(s,r),className:"absolute top-2 right-2 z-10 transition-all duration-200 ".concat(l[r]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),(0,t.jsx)("pre",{className:"text-sm overflow-x-auto pr-10 text-gray-800 font-mono leading-relaxed",children:s})]})]})},m=e=>{let{step:s,title:r,children:l}=e;return(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("div",{className:"w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-semibold",children:s})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(ek,{strong:!0,className:"text-gray-800 block mb-2",children:r}),l]})]})};return(0,t.jsx)("div",{children:(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(M.Z,{className:"text-3xl font-bold text-gray-900 mb-3",children:"Connect to your MCP client"}),(0,t.jsx)(T.Z,{className:"text-lg text-gray-600",children:"Use tools directly from any MCP client with LiteLLM MCP. Enable your AI assistant to perform real-world tasks through a simple, secure connection."})]}),(0,t.jsxs)(ex.Z,{className:"w-full",children:[(0,t.jsx)(eh.Z,{className:"flex justify-start mt-8 mb-6",children:(0,t.jsxs)("div",{className:"flex bg-gray-100 p-1 rounded-lg",children:[(0,t.jsx)(eu.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(ej.Z,{size:18}),"OpenAI API"]})}),(0,t.jsx)(eu.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(eb.Z,{size:18}),"LiteLLM Proxy"]})}),(0,t.jsx)(eu.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(ew.Z,{size:18}),"Cursor"]})}),(0,t.jsx)(eu.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(eZ.Z,{size:18}),"Streamable HTTP"]})})]})}),(0,t.jsxs)(eg.Z,{children:[(0,t.jsx)(ep.Z,{className:"mt-6",children:(0,t.jsx)(()=>(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-lg border border-blue-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)(ej.Z,{className:"text-blue-600",size:24}),(0,t.jsx)(eS,{level:4,className:"mb-0 text-blue-900",children:"OpenAI Responses API Integration"})]}),(0,t.jsx)(ek,{className:"text-blue-700",children:"Connect OpenAI Responses API to your LiteLLM MCP server for seamless tool integration"})]}),(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsx)(eA,{icon:(0,t.jsx)(ey.Z,{className:"text-blue-600",size:16}),title:"API Key Setup",description:"Configure your OpenAI API key for authentication",children:(0,t.jsxs)(H.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,t.jsx)("div",{children:(0,t.jsxs)(ek,{children:["Get your API key from the"," ",(0,t.jsxs)("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 inline-flex items-center gap-1",children:["OpenAI platform ",(0,t.jsx)(e_.Z,{size:12})]})]})}),(0,t.jsx)(d,{title:"Environment Variable",code:'export OPENAI_API_KEY="sk-..."',copyKey:"openai-env"})]})}),(0,t.jsx)(eA,{icon:(0,t.jsx)(eN.Z,{className:"text-blue-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,t.jsx)(d,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"openai-server-url"})}),(0,t.jsx)(eA,{icon:(0,t.jsx)(ej.Z,{className:"text-blue-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the Responses API",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,t.jsx)(d,{code:'curl --location \'https://api.openai.com/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $OPENAI_API_KEY" \\\n--data \'{\n "model": "gpt-4.1",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "'.concat(r,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"openai-curl",className:"text-xs"})})]})]}),{})}),(0,t.jsx)(ep.Z,{className:"mt-6",children:(0,t.jsx)(()=>(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-green-50 p-6 rounded-lg border border-emerald-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)(eb.Z,{className:"text-emerald-600",size:24}),(0,t.jsx)(eS,{level:4,className:"mb-0 text-emerald-900",children:"LiteLLM Proxy API Integration"})]}),(0,t.jsx)(ek,{className:"text-emerald-700",children:"Connect to LiteLLM Proxy Responses API for seamless tool integration with multiple model providers"})]}),(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsx)(eA,{icon:(0,t.jsx)(ey.Z,{className:"text-emerald-600",size:16}),title:"Virtual Key Setup",description:"Configure your LiteLLM Proxy Virtual Key for authentication",children:(0,t.jsxs)(H.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,t.jsx)("div",{children:(0,t.jsx)(ek,{children:"Get your Virtual Key from your LiteLLM Proxy dashboard or contact your administrator"})}),(0,t.jsx)(d,{title:"Environment Variable",code:'export LITELLM_API_KEY="sk-..."',copyKey:"litellm-env"})]})}),(0,t.jsx)(eA,{icon:(0,t.jsx)(eN.Z,{className:"text-emerald-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,t.jsx)(d,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"litellm-server-url"})}),(0,t.jsx)(eA,{icon:(0,t.jsx)(ej.Z,{className:"text-emerald-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the LiteLLM Proxy Responses API",serverName:o,accessGroups:["dev"],children:(0,t.jsx)(d,{code:"curl --location '".concat(r,'/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $LITELLM_VIRTUAL_KEY" \\\n--data \'{\n "model": "gpt-4",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "').concat(r,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_VIRTUAL_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"litellm-curl",className:"text-xs"})})]})]}),{})}),(0,t.jsx)(ep.Z,{className:"mt-6",children:(0,t.jsx)(()=>(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 p-6 rounded-lg border border-purple-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)(ew.Z,{className:"text-purple-600",size:24}),(0,t.jsx)(eS,{level:4,className:"mb-0 text-purple-900",children:"Cursor IDE Integration"})]}),(0,t.jsx)(ek,{className:"text-purple-700",children:"Use tools directly from Cursor IDE with LiteLLM MCP. Enable your AI assistant to perform real-world tasks without leaving your coding environment."})]}),(0,t.jsxs)(ed.Z,{className:"border border-gray-200",children:[(0,t.jsx)(eS,{level:5,className:"mb-4 text-gray-800",children:"Setup Instructions"}),(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsx)(m,{step:1,title:"Open Cursor Settings",children:(0,t.jsxs)(ek,{className:"text-gray-600",children:["Use the keyboard shortcut ",(0,t.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"⇧+⌘+J"})," (Mac) or"," ",(0,t.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+Shift+J"})," (Windows/Linux)"]})}),(0,t.jsx)(m,{step:2,title:"Navigate to MCP Tools",children:(0,t.jsx)(ek,{className:"text-gray-600",children:'Go to the "MCP Tools" tab and click "New MCP Server"'})}),(0,t.jsxs)(m,{step:3,title:"Add Configuration",children:[(0,t.jsxs)(ek,{className:"text-gray-600 mb-3",children:["Copy the JSON configuration below and paste it into Cursor, then save with"," ",(0,t.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Cmd+S"})," or"," ",(0,t.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+S"})]}),(0,t.jsx)(eA,{icon:(0,t.jsx)(ej.Z,{className:"text-purple-600",size:16}),title:"Configuration",description:"Cursor MCP configuration",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,t.jsx)(d,{code:'{\n "mcpServers": {\n "Zapier_MCP": {\n "url": "'.concat(r,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n }\n}'),copyKey:"cursor-config",className:"text-xs"})})]})]})]})]}),{})}),(0,t.jsx)(ep.Z,{className:"mt-6",children:(0,t.jsx)(()=>(0,t.jsxs)(H.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-teal-50 p-6 rounded-lg border border-green-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)(eZ.Z,{className:"text-green-600",size:24}),(0,t.jsx)(eS,{level:4,className:"mb-0 text-green-900",children:"Streamable HTTP Transport"})]}),(0,t.jsx)(ek,{className:"text-green-700",children:"Connect to LiteLLM MCP using HTTP transport. Compatible with any MCP client that supports HTTP streaming."})]}),(0,t.jsx)(eA,{icon:(0,t.jsx)(eZ.Z,{className:"text-green-600",size:16}),title:"Universal MCP Connection",description:"Use this URL with any MCP client that supports HTTP transport",children:(0,t.jsxs)(H.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,t.jsx)("div",{children:(0,t.jsx)(ek,{children:"Each MCP client supports different transports. Refer to your client documentation to determine the appropriate transport method."})}),(0,t.jsx)(d,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"http-server-url"}),(0,t.jsx)(d,{title:"Headers Configuration",code:JSON.stringify({"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"},null,2),copyKey:"http-headers"}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(E.ZP,{type:"link",className:"p-0 h-auto text-blue-600 hover:text-blue-700",href:"https://modelcontextprotocol.io/docs/concepts/transports",icon:(0,t.jsx)(e_.Z,{size:14}),children:"Learn more about MCP transports"})})]})})]}),{})})]})]})]})})},eM=r(58927),eI=r(53410),eO=r(74998);let eL=(e,s,r,l)=>[{accessorKey:"server_id",header:"Server ID",cell:e=>{let{row:r}=e;return(0,t.jsxs)("button",{onClick:()=>s(r.original.server_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:[r.original.server_id.slice(0,7),"..."]})}},{accessorKey:"server_name",header:"Name"},{accessorKey:"alias",header:"Alias"},{id:"url",header:"URL",cell:e=>{let{row:s}=e,{maskedUrl:r}=Q(s.original.url);return(0,t.jsx)("span",{className:"font-mono text-sm",children:r})}},{accessorKey:"transport",header:"Transport",cell:e=>{let{getValue:s}=e;return(0,t.jsx)("span",{children:(s()||"http").toUpperCase()})}},{accessorKey:"auth_type",header:"Auth Type",cell:e=>{let{getValue:s}=e;return(0,t.jsx)("span",{children:s()||"none"})}},{id:"health_status",header:"Health Status",cell:e=>{let{row:s}=e,r=s.original,l=r.status||"unknown",a=r.last_health_check,n=r.health_check_error,i=(0,t.jsxs)("div",{className:"max-w-xs",children:[(0,t.jsxs)("div",{className:"font-semibold mb-1",children:["Health Status: ",l]}),a&&(0,t.jsxs)("div",{className:"text-xs mb-1",children:["Last Check: ",new Date(a).toLocaleString()]}),n&&(0,t.jsxs)("div",{className:"text-xs",children:[(0,t.jsx)("div",{className:"font-medium text-red-400 mb-1",children:"Error:"}),(0,t.jsx)("div",{className:"break-words",children:n})]}),!a&&!n&&(0,t.jsx)("div",{className:"text-xs text-gray-400",children:"No health check data available"})]});return(0,t.jsx)(d.Z,{title:i,placement:"top",children:(0,t.jsxs)("button",{className:"font-mono text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[10ch] ".concat((e=>{switch(e){case"healthy":return"text-green-500 bg-green-50 hover:bg-green-100";case"unhealthy":return"text-red-500 bg-red-50 hover:bg-red-100";default:return"text-gray-500 bg-gray-50 hover:bg-gray-100"}})(l)),children:[(0,t.jsx)("span",{className:"mr-1",children:"●"}),l.charAt(0).toUpperCase()+l.slice(1)]})})}},{id:"mcp_access_groups",header:"Access Groups",cell:e=>{let{row:s}=e,r=s.original.mcp_access_groups;if(Array.isArray(r)&&r.length>0&&"string"==typeof r[0]){let e=r.join(", ");return(0,t.jsx)(d.Z,{title:e,children:(0,t.jsx)("span",{className:"max-w-[200px] truncate block",children:e.length>30?"".concat(e.slice(0,30),"..."):e})})}return(0,t.jsx)("span",{className:"text-gray-400 italic",children:"None"})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,r=s.original;return(0,t.jsx)("span",{className:"text-xs",children:r.created_at?new Date(r.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,r=s.original;return(0,t.jsx)("span",{className:"text-xs",children:r.updated_at?new Date(r.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"Actions",cell:e=>{let{row:s}=e;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Z,{title:"Edit MCP Server",children:(0,t.jsx)(eM.J,{icon:eI.Z,size:"sm",onClick:()=>r(s.original.server_id),className:"cursor-pointer hover:text-blue-600"})}),(0,t.jsx)(d.Z,{title:"Delete MCP Server",children:(0,t.jsx)(eM.J,{icon:eO.Z,size:"sm",onClick:()=>l(s.original.server_id),className:"cursor-pointer hover:text-red-600"})})]})}}];var eE=r(10900),ez=r(82376),eq=r(71437),eU=r(78489),eR=r(67101),eF=r(47323),eV=r(49566);let eB=[y.API_KEY,y.BEARER_TOKEN,y.BASIC],eK=[...eB,y.OAUTH2],eH="litellm-mcp-oauth-edit-state";var eD=e=>{var s;let{mcpServer:r,accessToken:l,onCancel:a,onSuccess:n,availableAccessGroups:i}=e,[o]=j.Z.useForm(),[m,u]=(0,x.useState)({}),[g,v]=(0,x.useState)([]),[b,N]=(0,x.useState)(!1),[_,w]=(0,x.useState)(""),[Z,C]=(0,x.useState)(!1),[S,k]=(0,x.useState)([]),[P,A]=(0,x.useState)(null),T=j.Z.useWatch("auth_type",o),M=!!T&&eB.includes(T),O=T===y.OAUTH2,[L,z]=(0,x.useState)(null),{startOAuthFlow:q,status:U,error:R,tokenResponse:F}=el({accessToken:l,getCredentials:()=>o.getFieldValue("credentials"),getTemporaryPayload:()=>{let e=o.getFieldsValue(!0),s=e.url||r.url,t=e.transport||r.transport;if(!s||!t)return null;let l=Array.isArray(e.static_headers)?e.static_headers.reduce((e,s)=>{var r,t;let l=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return l&&(e[l]=null!==(t=null==s?void 0:s.value)&&void 0!==t?t:""),e},{}):{};return{server_id:r.server_id,server_name:e.server_name||r.server_name||r.alias,alias:e.alias||r.alias,description:e.description||r.description,url:s,transport:t,auth_type:y.OAUTH2,credentials:e.credentials,mcp_access_groups:e.mcp_access_groups||r.mcp_access_groups,static_headers:l,command:e.command,args:e.args,env:e.env}},onTokenReceived:e=>{var s;z(null!==(s=null==e?void 0:e.access_token)&&void 0!==s?s:null)},onBeforeRedirect:()=>{try{let e=o.getFieldsValue(!0);window.sessionStorage.setItem(eH,JSON.stringify({serverId:r.server_id,formValues:e,costConfig:m,allowedTools:S,searchValue:_,aliasManuallyEdited:Z}))}catch(e){console.warn("Failed to persist MCP edit state",e)}}}),V=x.useMemo(()=>r.static_headers?Object.entries(r.static_headers).map(e=>{let[s,r]=e;return{header:s,value:null!=r?String(r):""}}):[],[r.static_headers]),K=x.useMemo(()=>({...r,static_headers:V}),[r,V]);(0,x.useEffect)(()=>{var e;(null===(e=r.mcp_info)||void 0===e?void 0:e.mcp_server_cost_info)&&u(r.mcp_info.mcp_server_cost_info)},[r]),(0,x.useEffect)(()=>{r.allowed_tools&&k(r.allowed_tools)},[r]),(0,x.useEffect)(()=>{let e=window.sessionStorage.getItem(eH);if(e)try{let s=JSON.parse(e);if(!s||s.serverId!==r.server_id)return;s.formValues&&A({...r,...s.formValues}),s.costConfig&&u(s.costConfig),s.allowedTools&&k(s.allowedTools),s.searchValue&&w(s.searchValue),"boolean"==typeof s.aliasManuallyEdited&&C(s.aliasManuallyEdited)}catch(e){console.error("Failed to restore MCP edit state",e)}finally{window.sessionStorage.removeItem(eH)}},[o,r]),(0,x.useEffect)(()=>{if(!P)return;let e=P.transport||r.transport;if(e&&e!==o.getFieldValue("transport")){o.setFieldsValue({transport:e});return}o.setFieldsValue(P),A(null)},[P,o,r.transport]),(0,x.useEffect)(()=>{if(r.mcp_access_groups){let e=r.mcp_access_groups.map(e=>"string"==typeof e?e:e.name||String(e));o.setFieldValue("mcp_access_groups",e)}},[r]),(0,x.useEffect)(()=>{H()},[r,l,L]);let H=async()=>{if(l&&r.url&&(r.auth_type!==y.OAUTH2||L)){N(!0);try{let e={server_id:r.server_id,server_name:r.server_name,url:r.url,transport:r.transport,auth_type:r.auth_type,mcp_info:r.mcp_info},s=await (0,p.testMCPToolsListRequest)(l,e,L);s.tools&&!s.error?v(s.tools):(console.error("Failed to fetch tools:",s.message),v([]))}catch(e){console.error("Tools fetch error:",e),v([])}finally{N(!1)}}},D=async e=>{if(l)try{let{static_headers:s,credentials:t,...a}=e,i=(a.mcp_access_groups||[]).map(e=>"string"==typeof e?e:e.name||String(e)),o=Array.isArray(s)?s.reduce((e,s)=>{var r,t;let l=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return l&&(e[l]=null!==(t=null==s?void 0:s.value)&&void 0!==t?t:""),e},{}):{},c=t&&"object"==typeof t?Object.entries(t).reduce((e,s)=>{let[r,t]=s;if(null==t||""===t)return e;if("scopes"===r){if(Array.isArray(t)){let s=t.filter(e=>null!=e&&""!==e);s.length>0&&(e[r]=s)}}else e[r]=t;return e},{}):void 0,d={...a,server_id:r.server_id,mcp_info:{server_name:a.server_name||a.url,description:a.description,mcp_server_cost_info:Object.keys(m).length>0?m:null},mcp_access_groups:i,alias:a.alias,extra_headers:a.extra_headers||[],allowed_tools:S.length>0?S:null,disallowed_tools:a.disallowed_tools||[],static_headers:o};a.auth_type&&eK.includes(a.auth_type)&&c&&Object.keys(c).length>0&&(d.credentials=c);let u=await (0,p.updateMCPServer)(l,d);h.Z.success("MCP Server updated successfully"),n(u)}catch(e){h.Z.fromBackend("Failed to update MCP Server"+((null==e?void 0:e.message)?": ".concat(e.message):""))}};return(0,t.jsxs)(ex.Z,{children:[(0,t.jsxs)(eh.Z,{className:"grid w-full grid-cols-2",children:[(0,t.jsx)(eu.Z,{children:"Server Configuration"}),(0,t.jsx)(eu.Z,{children:"Cost Configuration"})]}),(0,t.jsxs)(eg.Z,{className:"mt-6",children:[(0,t.jsx)(ep.Z,{children:(0,t.jsxs)(j.Z,{form:o,onFinish:D,initialValues:K,layout:"vertical",children:[(0,t.jsx)(j.Z.Item,{label:"MCP Server Name",name:"server_name",rules:[{validator:(e,s)=>ee(s)}],children:(0,t.jsx)(eV.Z,{})}),(0,t.jsx)(j.Z.Item,{label:"Alias",name:"alias",rules:[{validator:(e,s)=>ee(s)}],children:(0,t.jsx)(eV.Z,{onChange:()=>C(!0)})}),(0,t.jsx)(j.Z.Item,{label:"Description",name:"description",children:(0,t.jsx)(eV.Z,{})}),(0,t.jsx)(j.Z.Item,{label:"MCP Server URL",name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,s)=>X(s)}],children:(0,t.jsx)(eV.Z,{})}),(0,t.jsx)(j.Z.Item,{label:"Transport Type",name:"transport",rules:[{required:!0}],children:(0,t.jsxs)(c.default,{children:[(0,t.jsx)(c.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,t.jsx)(c.default.Option,{value:"http",children:"HTTP"})]})}),(0,t.jsx)(j.Z.Item,{label:"Authentication",name:"auth_type",rules:[{required:!0}],children:(0,t.jsxs)(c.default,{children:[(0,t.jsx)(c.default.Option,{value:"none",children:"None"}),(0,t.jsx)(c.default.Option,{value:"api_key",children:"API Key"}),(0,t.jsx)(c.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,t.jsx)(c.default.Option,{value:"basic",children:"Basic Auth"}),(0,t.jsx)(c.default.Option,{value:"oauth2",children:"OAuth"})]})}),M&&(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Value",(0,t.jsx)(d.Z,{title:"Token, password, or header value to send with each request for the selected auth type.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","auth_value"],rules:[{validator:(e,s)=>s&&"string"==typeof s&&""===s.trim()?Promise.reject(Error("Authentication value cannot be empty")):Promise.resolve()}],children:(0,t.jsx)(eV.Z,{type:"password",placeholder:"Enter token or secret (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),O&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client ID (optional)",(0,t.jsx)(d.Z,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_id"],children:(0,t.jsx)(eV.Z,{type:"password",placeholder:"Enter OAuth client ID (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client Secret (optional)",(0,t.jsx)(d.Z,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_secret"],children:(0,t.jsx)(eV.Z,{type:"password",placeholder:"Enter OAuth client secret (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Scopes (optional)",(0,t.jsx)(d.Z,{title:"Add scopes to override the default scope list used for this MCP server.",children:(0,t.jsx)(f.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","scopes"],children:(0,t.jsx)(c.default,{mode:"tags",tokenSeparators:[","],placeholder:"Add scopes",className:"rounded-lg",size:"large"})}),(0,t.jsxs)("div",{className:"rounded-lg border border-dashed border-gray-300 p-4 space-y-2",children:[(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Use OAuth to fetch a fresh access token and save it as the authentication value."}),(0,t.jsx)(eU.Z,{variant:"secondary",onClick:q,disabled:"authorizing"===U||"exchanging"===U,children:"authorizing"===U?"Waiting for authorization...":"exchanging"===U?"Exchanging authorization code...":"Authorize & Fetch Token"}),R&&(0,t.jsx)("p",{className:"text-sm text-red-500",children:R}),"success"===U&&(null==F?void 0:F.access_token)&&(0,t.jsxs)("p",{className:"text-sm text-green-600",children:["Token fetched. Expires in ",null!==(s=F.expires_in)&&void 0!==s?s:"?"," seconds."]})]})]}),(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(Y,{availableAccessGroups:i,mcpServer:r,searchValue:_,setSearchValue:w,getAccessGroupOptions:()=>{let e=i.map(e=>({value:e,label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:e})]})}));return _&&!i.some(e=>e.toLowerCase().includes(_.toLowerCase()))&&e.push({value:_,label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:_}),(0,t.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(B,{accessToken:l,oauthAccessToken:L,formValues:{server_id:r.server_id,server_name:r.server_name,url:r.url,transport:r.transport,auth_type:r.auth_type,mcp_info:r.mcp_info},allowedTools:S,existingAllowedTools:r.allowed_tools||null,onAllowedToolsChange:k})}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(E.ZP,{onClick:a,children:"Cancel"}),(0,t.jsx)(eU.Z,{type:"submit",children:"Save Changes"})]})]})}),(0,t.jsx)(ep.Z,{children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(I,{value:m,onChange:u,tools:g,disabled:b}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(E.ZP,{onClick:a,children:"Cancel"}),(0,t.jsx)(eU.Z,{onClick:()=>o.submit(),children:"Save Changes"})]})]})})]})]})},eJ=r(92280),eG=e=>{let{costConfig:s}=e,r=(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null,l=(null==s?void 0:s.tool_name_to_cost_per_query)&&Object.keys(s.tool_name_to_cost_per_query).length>0;return r||l?(0,t.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,t.jsxs)("div",{className:"space-y-4",children:[r&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,t.jsxs)("div",{children:[(0,t.jsx)(eJ.x,{className:"font-medium",children:"Default Cost per Query"}),(0,t.jsxs)("div",{className:"text-green-600 font-mono",children:["$",s.default_cost_per_query.toFixed(4)]})]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,t.jsxs)("div",{children:[(0,t.jsx)(eJ.x,{className:"font-medium",children:"Tool-Specific Costs"}),(0,t.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,r]=e;return null!=r&&(0,t.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,t.jsx)(eJ.x,{className:"font-medium",children:s}),(0,t.jsxs)(eJ.x,{className:"text-green-600 font-mono",children:["$",r.toFixed(4)," per query"]})]},s)})})]}),(0,t.jsxs)("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,t.jsx)(eJ.x,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[r&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,t.jsxs)(eJ.x,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,t.jsxs)(eJ.x,{className:"text-blue-700",children:["• ",Object.keys(s.tool_name_to_cost_per_query).length," tool(s) with custom pricing"]})]})]})]})}):(0,t.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,t.jsx)("div",{className:"space-y-4",children:(0,t.jsx)("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-lg",children:(0,t.jsx)(eJ.x,{className:"text-gray-600",children:"No cost configuration set for this server. Tool calls will be charged at $0.00 per tool call."})})})})};let eY=e=>{var s,r,l,a,n;let{mcpServer:i,onBack:o,isEditing:c,isProxyAdmin:d,accessToken:m,userRole:u,userID:h,availableAccessGroups:p}=e,[g,j]=(0,x.useState)(c),[v,f]=(0,x.useState)(!1),[b,y]=(0,x.useState)({}),{maskedUrl:N,hasToken:Z}=Q(i.url),C=(e,s)=>Z?s?e:N:e,S=async(e,s)=>{await (0,eC.vQ)(e)&&(y(e=>({...e,[s]:!0})),setTimeout(()=>{y(e=>({...e,[s]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4 max-w-full",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(eU.Z,{icon:eE.Z,variant:"light",className:"mb-4",onClick:o,children:"Back to All Servers"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(M.Z,{children:i.server_name}),(0,t.jsx)(E.ZP,{type:"text",size:"small",icon:b["mcp-server_name"]?(0,t.jsx)(ev.Z,{size:12}):(0,t.jsx)(ef.Z,{size:12}),onClick:()=>S(i.server_name,"mcp-server_name"),className:"left-2 z-10 transition-all duration-200 ".concat(b["mcp-server_name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),i.alias&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"ml-4 text-gray-500",children:"Alias:"}),(0,t.jsx)("span",{className:"ml-1 font-mono text-blue-600",children:i.alias}),(0,t.jsx)(E.ZP,{type:"text",size:"small",icon:b["mcp-alias"]?(0,t.jsx)(ev.Z,{size:12}):(0,t.jsx)(ef.Z,{size:12}),onClick:()=>S(i.alias,"mcp-alias"),className:"left-2 z-10 transition-all duration-200 ".concat(b["mcp-alias"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(T.Z,{className:"text-gray-500 font-mono",children:i.server_id}),(0,t.jsx)(E.ZP,{type:"text",size:"small",icon:b["mcp-server-id"]?(0,t.jsx)(ev.Z,{size:12}):(0,t.jsx)(ef.Z,{size:12}),onClick:()=>S(i.server_id,"mcp-server-id"),className:"left-2 z-10 transition-all duration-200 ".concat(b["mcp-server-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,t.jsxs)(ex.Z,{defaultIndex:g?2:0,children:[(0,t.jsx)(eh.Z,{className:"mb-4",children:[(0,t.jsx)(eu.Z,{children:"Overview"},"overview"),(0,t.jsx)(eu.Z,{children:"MCP Tools"},"tools"),...d?[(0,t.jsx)(eu.Z,{children:"Settings"},"settings")]:[]]}),(0,t.jsxs)(eg.Z,{children:[(0,t.jsxs)(ep.Z,{children:[(0,t.jsxs)(eR.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(A.Z,{children:[(0,t.jsx)(T.Z,{children:"Transport"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(M.Z,{children:_(null!==(a=i.transport)&&void 0!==a?a:void 0)})})]}),(0,t.jsxs)(A.Z,{children:[(0,t.jsx)(T.Z,{children:"Auth Type"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(T.Z,{children:w(null!==(n=i.auth_type)&&void 0!==n?n:void 0)})})]}),(0,t.jsxs)(A.Z,{children:[(0,t.jsx)(T.Z,{children:"Host Url"}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsx)(T.Z,{className:"break-all overflow-wrap-anywhere",children:C(i.url,v)}),Z&&(0,t.jsx)("button",{onClick:()=>f(!v),className:"p-1 hover:bg-gray-100 rounded",children:(0,t.jsx)(eF.Z,{icon:v?ez.Z:eq.Z,size:"sm",className:"text-gray-500"})})]})]})]}),(0,t.jsxs)(A.Z,{className:"mt-2",children:[(0,t.jsx)(M.Z,{children:"Cost Configuration"}),(0,t.jsx)(eG,{costConfig:null===(s=i.mcp_info)||void 0===s?void 0:s.mcp_server_cost_info})]})]}),(0,t.jsx)(ep.Z,{children:(0,t.jsx)(e4,{serverId:i.server_id,accessToken:m,auth_type:i.auth_type,userRole:u,userID:h,serverAlias:i.alias})}),(0,t.jsx)(ep.Z,{children:(0,t.jsxs)(A.Z,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(M.Z,{children:"MCP Server Settings"}),g?null:(0,t.jsx)(eU.Z,{variant:"light",onClick:()=>j(!0),children:"Edit Settings"})]}),g?(0,t.jsx)(eD,{mcpServer:i,accessToken:m,onCancel:()=>j(!1),onSuccess:e=>{j(!1),o()},availableAccessGroups:p}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Server Name"}),(0,t.jsx)("div",{children:i.server_name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Alias"}),(0,t.jsx)("div",{children:i.alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Description"}),(0,t.jsx)("div",{children:i.description})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"URL"}),(0,t.jsxs)("div",{className:"font-mono break-all overflow-wrap-anywhere max-w-full flex items-center gap-2",children:[C(i.url,v),Z&&(0,t.jsx)("button",{onClick:()=>f(!v),className:"p-1 hover:bg-gray-100 rounded",children:(0,t.jsx)(eF.Z,{icon:v?ez.Z:eq.Z,size:"sm",className:"text-gray-500"})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Transport"}),(0,t.jsx)("div",{children:_(i.transport)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Extra Headers"}),(0,t.jsx)("div",{children:null===(r=i.extra_headers)||void 0===r?void 0:r.join(", ")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Auth Type"}),(0,t.jsx)("div",{children:w(i.auth_type)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Access Groups"}),(0,t.jsx)("div",{children:i.mcp_access_groups&&i.mcp_access_groups.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:i.mcp_access_groups.map((e,s)=>{var r;return(0,t.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded-md text-sm",children:"string"==typeof e?e:null!==(r=null==e?void 0:e.name)&&void 0!==r?r:""},s)})}):(0,t.jsx)(T.Z,{className:"text-gray-500",children:"No access groups defined"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Allowed Tools"}),(0,t.jsx)("div",{children:i.allowed_tools&&i.allowed_tools.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:i.allowed_tools.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-50 border border-blue-200 rounded-md text-sm",children:e},s))}):(0,t.jsx)(T.Z,{className:"text-gray-500",children:"All tools enabled"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(T.Z,{className:"font-medium",children:"Cost Configuration"}),(0,t.jsx)(eG,{costConfig:null===(l=i.mcp_info)||void 0===l?void 0:l.mcp_server_cost_info})]})]})]})})]})]})]})},{Text:e$,Title:eW}=o.default,{Option:eQ}=c.default;var eX=e=>{let{accessToken:s,userRole:r,userID:o}=e,{data:j,isLoading:v,refetch:f,dataUpdatedAt:b}=(0,n.a)({queryKey:["mcpServers"],queryFn:()=>{if(!s)throw Error("Access Token required");return(0,p.fetchMCPServers)(s)},enabled:!!s});x.useEffect(()=>{j&&(console.log("MCP Servers fetched:",j),j.forEach(e=>{console.log("Server: ".concat(e.server_name||e.server_id)),console.log(" allowed_tools:",e.allowed_tools)}))},[j]);let[y,N]=(0,x.useState)(null),[_,w]=(0,x.useState)(!1),[Z,C]=(0,x.useState)(null),[S,k]=(0,x.useState)(!1),[P,A]=(0,x.useState)("all"),[T,M]=(0,x.useState)("all"),[I,O]=(0,x.useState)([]),[L,E]=(0,x.useState)(!1),[z,q]=(0,x.useState)(!1),U="Internal User"===r;(0,x.useEffect)(()=>{try{let e=window.sessionStorage.getItem("litellm-mcp-oauth-edit-state");if(!e)return;let s=JSON.parse(e);(null==s?void 0:s.serverId)&&(C(s.serverId),k(!0))}catch(e){console.error("Failed to restore MCP edit view state",e)}},[]);let R=x.useMemo(()=>{if(!j)return[];let e=new Set,s=[];return j.forEach(r=>{r.teams&&r.teams.forEach(r=>{let t=r.team_id;e.has(t)||(e.add(t),s.push(r))})}),s},[j]),F=x.useMemo(()=>j?Array.from(new Set(j.flatMap(e=>e.mcp_access_groups).filter(e=>null!=e))):[],[j]),V=e=>{A(e),K(e,T)},B=e=>{M(e),K(P,e)},K=(e,s)=>{if(!j)return O([]);let r=j;if("personal"===e){O([]);return}"all"!==e&&(r=r.filter(s=>{var r;return null===(r=s.teams)||void 0===r?void 0:r.some(s=>s.team_id===e)})),"all"!==s&&(r=r.filter(e=>{var r;return null===(r=e.mcp_access_groups)||void 0===r?void 0:r.some(e=>"string"==typeof e?e===s:e&&e.name===s)})),O(r)};(0,x.useEffect)(()=>{K(P,T)},[b]);let H=x.useMemo(()=>eL(null!=r?r:"",e=>{C(e),k(!1)},e=>{C(e),k(!0)},D),[r]);function D(e){N(e),w(!0)}let J=async()=>{if(null!=y&&null!=s)try{q(!0),await (0,p.deleteMCPServer)(s,y),h.Z.success("Deleted MCP Server successfully"),f()}catch(e){console.error("Error deleting the mcp server:",e)}finally{q(!1),w(!1),N(null)}},G=y?(j||[]).find(e=>e.server_id===y):null;return s&&r&&o?(0,t.jsxs)("div",{className:"w-full h-full p-6",children:[(0,t.jsx)(m.Z,{open:_,title:"Delete MCP Server?",onOk:J,okText:z?"Deleting...":"Delete",onCancel:()=>{w(!1),N(null)},cancelText:"Cancel",cancelButtonProps:{disabled:z},okButtonProps:{danger:!0},confirmLoading:z,children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(e$,{children:"Are you sure you want to delete this MCP Server? This action cannot be undone."}),G&&(0,t.jsxs)("div",{className:"mt-4 p-4 bg-red-50 rounded-lg border border-red-200",children:[(0,t.jsx)(eW,{level:5,className:"mb-3 text-gray-900",children:"Server Information"}),(0,t.jsxs)(u.Z,{column:1,size:"small",children:[G.server_name&&(0,t.jsx)(u.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:"Server Name"}),children:(0,t.jsx)(e$,{className:"text-sm",children:G.server_name})}),G.alias&&(0,t.jsx)(u.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:"Alias"}),children:(0,t.jsx)(e$,{className:"text-sm",children:G.alias})}),(0,t.jsx)(u.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:"Server ID"}),children:(0,t.jsx)(e$,{code:!0,className:"text-sm",children:G.server_id})}),(0,t.jsx)(u.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:"URL"}),children:(0,t.jsx)(e$,{code:!0,className:"text-sm",children:G.url})})]})]})]})}),(0,t.jsx)(ec,{userRole:r,accessToken:s,onCreateSuccess:e=>{O(s=>[...s,e]),E(!1)},isModalVisible:L,setModalVisible:E,availableAccessGroups:F}),(0,t.jsx)(i.Dx,{children:"MCP Servers"}),(0,t.jsx)(i.xv,{className:"text-tremor-content mt-2",children:"Configure and manage your MCP servers"}),(0,l.tY)(r)&&(0,t.jsx)(i.zx,{className:"mt-4 mb-4",onClick:()=>E(!0),children:"+ Add New MCP Server"}),(0,t.jsxs)(i.v0,{className:"w-full h-full",children:[(0,t.jsx)(i.td,{className:"flex justify-between mt-2 w-full items-center",children:(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)(i.OK,{children:"All Servers"}),(0,t.jsx)(i.OK,{children:"Connect"})]})}),(0,t.jsxs)(i.nP,{children:[(0,t.jsx)(i.x4,{children:(0,t.jsx)(()=>Z?(0,t.jsx)(eY,{mcpServer:I.find(e=>e.server_id===Z)||{server_id:"",server_name:"",alias:"",url:"",transport:"",auth_type:"",created_at:"",created_by:"",updated_at:"",updated_by:""},onBack:()=>{k(!1),C(null),f()},isProxyAdmin:(0,l.tY)(r),isEditing:S,accessToken:s,userID:o,userRole:r,availableAccessGroups:F}):(0,t.jsxs)("div",{className:"w-full h-full",children:[(0,t.jsx)("div",{className:"w-full px-6",children:(0,t.jsx)("div",{className:"flex flex-col space-y-4",children:(0,t.jsx)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(i.xv,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,t.jsxs)(c.default,{value:P,onChange:V,style:{width:300},children:[(0,t.jsx)(eQ,{value:"all",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:U?"All Available Servers":"All Servers"})]})}),(0,t.jsx)(eQ,{value:"personal",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:"Personal"})]})}),R.map(e=>(0,t.jsx)(eQ,{value:e.team_id,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:e.team_alias||e.team_id})]})},e.team_id))]}),(0,t.jsxs)(i.xv,{className:"text-lg font-semibold text-gray-900 ml-6",children:["Access Group:",(0,t.jsx)(d.Z,{title:"An MCP Access Group is a set of users or teams that have permission to access specific MCP servers. Use access groups to control and organize who can connect to which servers.",children:(0,t.jsx)(a.Z,{style:{marginLeft:4,color:"#888"}})})]}),(0,t.jsxs)(c.default,{value:T,onChange:B,style:{width:300},children:[(0,t.jsx)(eQ,{value:"all",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:"All Access Groups"})]})}),F.map(e=>(0,t.jsx)(eQ,{value:e,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:e})]})},e))]})]})})})}),(0,t.jsx)("div",{className:"w-full px-6 mt-6",children:(0,t.jsx)(g.w,{data:I,columns:H,renderSubComponent:()=>(0,t.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:v,noDataMessage:"No MCP servers configured",loadingMessage:"\uD83D\uDE85 Loading MCP servers..."})})]}),{})}),(0,t.jsx)(i.x4,{children:(0,t.jsx)(eT,{})})]})]})]}):(console.log("Missing required authentication parameters",{accessToken:s,userRole:r,userID:o}),(0,t.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))},e0=r(21770);function e2(e){let{tool:s,onSubmit:r,isLoading:l,result:a,error:n,onClose:i}=e,[o]=j.Z.useForm(),[c,m]=x.useState("formatted"),[u,p]=x.useState(null),[g,v]=x.useState(null),y=x.useMemo(()=>"string"==typeof s.inputSchema?{type:"object",properties:{input:{type:"string",description:"Input for this tool"}},required:["input"]}:s.inputSchema,[s.inputSchema]),N=x.useMemo(()=>y.properties&&y.properties.params&&"object"===y.properties.params.type&&y.properties.params.properties?{type:"object",properties:y.properties.params.properties,required:y.properties.params.required||[]}:y,[y]);x.useEffect(()=>{u&&(a||n)&&v(Date.now()-u)},[a,n,u]);let _=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let r=document.execCommand("copy");if(document.body.removeChild(s),!r)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},w=async()=>{await _(JSON.stringify(a,null,2))?h.Z.success("Result copied to clipboard"):h.Z.fromBackend("Failed to copy result")},Z=async()=>{await _(s.name)?h.Z.success("Tool name copied to clipboard"):h.Z.fromBackend("Failed to copy tool name")};return(0,t.jsxs)("div",{className:"space-y-4 h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[s.mcp_info.logo_url&&(0,t.jsx)("img",{src:s.mcp_info.logo_url,alt:"".concat(s.mcp_info.server_name," logo"),className:"w-6 h-6 object-contain"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Tool:"}),(0,t.jsxs)("div",{className:"group inline-flex items-center space-x-1 bg-slate-50 hover:bg-slate-100 px-3 py-1 rounded-md cursor-pointer transition-colors border border-slate-200",onClick:Z,title:"Click to copy tool name",children:[(0,t.jsx)("span",{className:"font-mono text-slate-700 font-medium text-sm",children:s.name}),(0,t.jsx)("svg",{className:"w-3 h-3 text-slate-400 group-hover:text-slate-600 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]}),(0,t.jsx)("p",{className:"text-xs text-gray-600",children:s.description}),(0,t.jsxs)("p",{className:"text-xs text-gray-500",children:["Provider: ",s.mcp_info.server_name]})]})]}),(0,t.jsx)(b.z,{onClick:i,variant:"light",size:"sm",className:"text-gray-500 hover:text-gray-700",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:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 h-full",children:[(0,t.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,t.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Input Parameters"}),(0,t.jsx)(d.Z,{title:"Configure the input parameters for this tool call",children:(0,t.jsx)(f.Z,{className:"text-gray-400 hover:text-gray-600"})})]})}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsxs)(j.Z,{form:o,onFinish:e=>{p(Date.now()),v(null);let s={};Object.entries(e).forEach(e=>{var r;let[t,l]=e,a=null===(r=N.properties)||void 0===r?void 0:r[t];if(a&&null!=l&&""!==l)switch(a.type){case"boolean":s[t]="true"===l||!0===l;break;case"number":s[t]=Number(l);break;case"string":s[t]=String(l);break;default:s[t]=l}else null!=l&&""!==l&&(s[t]=l)}),r(y.properties&&y.properties.params&&"object"===y.properties.params.type&&y.properties.params.properties?{params:s}:s)},layout:"vertical",className:"space-y-3",children:["string"==typeof s.inputSchema?(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsx)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Input ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"input",rules:[{required:!0,message:"Please enter input for this tool"}],className:"mb-3",children:(0,t.jsx)(b.o,{placeholder:"Enter input for this tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})}):void 0===N.properties?(0,t.jsx)("div",{className:"text-center py-6 bg-gray-50 rounded-lg border border-gray-200",children:(0,t.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No Parameters Required"}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"This tool can be called without any input parameters."})]})}):(0,t.jsx)("div",{className:"space-y-3",children:Object.entries(N.properties).map(e=>{var s,r,l,a,n;let[i,o]=e;return(0,t.jsxs)(j.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[i," ",(null===(s=N.required)||void 0===s?void 0:s.includes(i))&&(0,t.jsx)("span",{className:"text-red-500",children:"*"}),o.description&&(0,t.jsx)(d.Z,{title:o.description,children:(0,t.jsx)(f.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:i,rules:[{required:null===(r=N.required)||void 0===r?void 0:r.includes(i),message:"Please enter ".concat(i)}],className:"mb-3",children:["string"===o.type&&o.enum&&(0,t.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:o.default,children:[!(null===(l=N.required)||void 0===l?void 0:l.includes(i))&&(0,t.jsxs)("option",{value:"",children:["Select ",i]}),o.enum.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]}),"string"===o.type&&!o.enum&&(0,t.jsx)(b.o,{placeholder:o.description||"Enter ".concat(i),className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"}),"number"===o.type&&(0,t.jsx)("input",{type:"number",placeholder:o.description||"Enter ".concat(i),className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"}),"boolean"===o.type&&(0,t.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:(null===(a=o.default)||void 0===a?void 0:a.toString())||"",children:[!(null===(n=N.required)||void 0===n?void 0:n.includes(i))&&(0,t.jsxs)("option",{value:"",children:["Select ",i]}),(0,t.jsx)("option",{value:"true",children:"True"}),(0,t.jsx)("option",{value:"false",children:"False"})]})]},i)})}),(0,t.jsx)("div",{className:"pt-3 border-t border-gray-100",children:(0,t.jsx)(b.z,{onClick:()=>o.submit(),disabled:l,variant:"primary",className:"w-full",loading:l,children:l?"Calling Tool...":a||n?"Call Again":"Call Tool"})})]})})]}),(0,t.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,t.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Tool Result"})}),(0,t.jsx)("div",{className:"p-4",children:a||n||l?(0,t.jsxs)("div",{className:"space-y-3",children:[a&&!l&&!n&&(0,t.jsx)("div",{className:"p-2 bg-green-50 border border-green-200 rounded-lg",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("svg",{className:"h-4 w-4 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,t.jsx)("h4",{className:"text-xs font-medium text-green-900",children:"Tool executed successfully"}),null!==g&&(0,t.jsxs)("span",{className:"text-xs text-green-600 ml-1",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,t.jsxs)("div",{className:"flex bg-white rounded border border-green-300 p-0.5",children:[(0,t.jsx)("button",{onClick:()=>m("formatted"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("formatted"===c?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"Formatted"}),(0,t.jsx)("button",{onClick:()=>m("json"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("json"===c?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"JSON"})]}),(0,t.jsx)("button",{onClick:w,className:"p-1 hover:bg-green-100 rounded text-green-700",title:"Copy response",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})}),(0,t.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[l&&(0,t.jsxs)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-gray-200"}),(0,t.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,t.jsx)("p",{className:"text-sm font-medium mt-3",children:"Calling tool..."}),(0,t.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Please wait while we process your request"})]}),n&&(0,t.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,t.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("svg",{className:"h-4 w-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-red-900",children:"Tool Call Failed"}),null!==g&&(0,t.jsxs)("span",{className:"text-xs text-red-600",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,t.jsx)("div",{className:"bg-white border border-red-200 rounded p-2 max-h-48 overflow-y-auto",children:(0,t.jsx)("pre",{className:"text-xs whitespace-pre-wrap text-red-700 font-mono",children:n.message})})]})]})}),a&&!l&&!n&&(0,t.jsx)("div",{className:"space-y-3",children:"formatted"===c?a.map((e,s)=>(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:["text"===e.type&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Text Response"})}),(0,t.jsx)("div",{className:"p-3",children:(0,t.jsx)("div",{className:"bg-white rounded border border-gray-200 max-h-64 overflow-y-auto",children:(0,t.jsx)("div",{className:"p-3 space-y-2",children:e.text.split("\n\n").map((e,s)=>{if(""===e.trim())return null;if(e.startsWith("##")){let r=e.replace(/^#+\s/,"");return(0,t.jsx)("div",{className:"border-b border-gray-200 pb-1 mb-2",children:(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:r})},s)}let r=/(https?:\/\/[^\s\)]+)/g;if(r.test(e)){let l=e.split(r);return(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded p-2",children:(0,t.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap",children:l.map((e,s)=>r.test(e)?(0,t.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline break-all",children:e},s):e)})},s)}return e.includes("Score:")?(0,t.jsx)("div",{className:"bg-green-50 border-l-4 border-green-400 p-2 rounded-r",children:(0,t.jsx)("p",{className:"text-xs text-green-800 font-medium whitespace-pre-wrap",children:e})},s):(0,t.jsx)("div",{className:"bg-gray-50 rounded p-2 border border-gray-200",children:(0,t.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap font-mono",children:e})},s)}).filter(Boolean)})})})]}),"image"===e.type&&e.url&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Image Response"})}),(0,t.jsx)("div",{className:"p-3",children:(0,t.jsx)("div",{className:"bg-gray-50 rounded p-3 border border-gray-200",children:(0,t.jsx)("img",{src:e.url,alt:"Tool result",className:"max-w-full h-auto rounded shadow-sm"})})})]}),"embedded_resource"===e.type&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Embedded Resource"})}),(0,t.jsx)("div",{className:"p-3",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2 p-3 bg-blue-50 border border-blue-200 rounded",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("svg",{className:"h-5 w-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("p",{className:"text-xs font-medium text-blue-900",children:["Resource Type: ",e.resource_type]}),e.url&&(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-xs text-blue-600 hover:text-blue-800 hover:underline mt-1 transition-colors",children:["View Resource",(0,t.jsxs)("svg",{className:"ml-1 h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:[(0,t.jsx)("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),(0,t.jsx)("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})]})]})})]})]},s)):(0,t.jsx)("div",{className:"bg-white rounded border border-gray-200",children:(0,t.jsx)("div",{className:"p-3 overflow-auto max-h-80 bg-gray-50",children:(0,t.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all text-gray-800",children:JSON.stringify(a,null,2)})})})})]})]}):(0,t.jsx)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:(0,t.jsxs)("div",{className:"text-center max-w-sm",children:[(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"Ready to Call Tool"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 leading-relaxed",children:'Configure the input parameters and click "Call Tool" to see the results here.'})]})})})]})]})]})}var e1=r(69993),e4=e=>{let{serverId:s,accessToken:r,auth_type:l,userRole:a,userID:i,serverAlias:o}=e,[c,d]=(0,x.useState)(null),[m,u]=(0,x.useState)(null),[h,g]=(0,x.useState)(null),{data:j,isLoading:v,error:f}=(0,n.a)({queryKey:["mcpTools",s],queryFn:()=>{if(!r)throw Error("Access Token required");return(0,p.listMCPTools)(r,s)},enabled:!!r,staleTime:3e4}),{mutate:b,isPending:y}=(0,e0.D)({mutationFn:async e=>{if(!r)throw Error("Access Token required");try{return await (0,p.callMCPTool)(r,e.tool.name,e.arguments)}catch(e){throw e}},onSuccess:e=>{u(e.content),g(null)},onError:e=>{g(e),u(null)}}),N=(null==j?void 0:j.tools)||[];return(0,t.jsx)("div",{className:"w-full h-screen p-4 bg-white",children:(0,t.jsx)(A.Z,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,t.jsxs)("div",{className:"flex h-auto w-full gap-4",children:[(0,t.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 flex flex-col",children:[(0,t.jsx)(M.Z,{className:"text-xl font-semibold mb-6 mt-2",children:"MCP Tools"}),(0,t.jsx)("div",{className:"flex flex-col flex-1",children:(0,t.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,t.jsxs)(T.Z,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,t.jsx)(P.Z,{className:"mr-2"})," Available Tools",N.length>0&&(0,t.jsx)("span",{className:"ml-2 bg-blue-100 text-blue-800 text-xs font-medium px-2 py-0.5 rounded-full",children:N.length})]}),v&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 bg-white border border-gray-200 rounded-lg",children:[(0,t.jsxs)("div",{className:"relative mb-3",children:[(0,t.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-gray-200"}),(0,t.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,t.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Loading tools..."})]}),(null==j?void 0:j.error)&&!v&&!N.length&&(0,t.jsx)("div",{className:"p-3 text-xs text-red-800 rounded-lg bg-red-50 border border-red-200",children:(0,t.jsxs)("p",{className:"font-medium",children:["Error: ",j.message]})}),!v&&!(null==j?void 0:j.error)&&(!N||0===N.length)&&(0,t.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,t.jsx)("div",{className:"mx-auto w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center mb-2",children:(0,t.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 8.172V5L8 4z"})})}),(0,t.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools available"}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"No tools found for this server"})]}),!v&&!(null==j?void 0:j.error)&&N.length>0&&(0,t.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto min-h-0 mcp-tools-scrollable",style:{maxHeight:"400px",scrollbarWidth:"auto",scrollbarColor:"#cbd5e0 #f7fafc"},children:N.map(e=>(0,t.jsxs)("div",{className:"border rounded-lg p-3 cursor-pointer transition-all hover:shadow-sm ".concat((null==c?void 0:c.name)===e.name?"border-blue-500 bg-blue-50 ring-1 ring-blue-200":"border-gray-200 bg-white hover:border-gray-300"),onClick:()=>{d(e),u(null),g(null)},children:[(0,t.jsxs)("div",{className:"flex items-start space-x-2",children:[e.mcp_info.logo_url&&(0,t.jsx)("img",{src:e.mcp_info.logo_url,alt:"".concat(e.mcp_info.server_name," logo"),className:"w-4 h-4 object-contain flex-shrink-0 mt-0.5"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h4",{className:"font-mono text-xs font-medium text-gray-900 truncate",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.mcp_info.server_name}),(0,t.jsx)("p",{className:"text-xs text-gray-600 mt-1 line-clamp-2 leading-relaxed",children:e.description})]})]}),(null==c?void 0:c.name)===e.name&&(0,t.jsx)("div",{className:"mt-2 pt-2 border-t border-blue-200",children:(0,t.jsxs)("div",{className:"flex items-center text-xs font-medium text-blue-700",children:[(0,t.jsx)("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Selected"]})})]},e.name))})]})})]}),(0,t.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,t.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,t.jsx)(M.Z,{className:"text-xl font-semibold mb-0",children:"Tool Testing Playground"})}),(0,t.jsx)("div",{className:"flex-1 overflow-auto p-4",children:c?(0,t.jsx)("div",{className:"h-full",children:(0,t.jsx)(e2,{tool:c,onSubmit:e=>{b({tool:c,arguments:e})},result:m,error:h,isLoading:y,onClose:()=>d(null)})}):(0,t.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,t.jsx)(e1.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,t.jsx)(T.Z,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select a Tool to Test"}),(0,t.jsx)(T.Z,{className:"text-center text-gray-500 max-w-md",children:"Choose a tool from the left sidebar to start testing its functionality with custom inputs."})]})})]})]})})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/766-baf0336e8ba5c686.js b/litellm/proxy/_experimental/out/_next/static/chunks/766-baf0336e8ba5c686.js deleted file mode 100644 index e6a2a3bcce3..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/766-baf0336e8ba5c686.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[766],{12660:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var o=n(1119),r=n(2265),i={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"},a=n(55015),c=r.forwardRef(function(e,t){return r.createElement(a.Z,(0,o.Z)({},e,{ref:t,icon:i}))})},44851:function(e,t,n){"use strict";n.d(t,{default:function(){return X}});var o=n(2265),r=n(77565),i=n(36760),a=n.n(i),c=n(1119),s=n(83145),l=n(26365),d=n(41154),u=n(50506),p=n(32559),h=n(6989),f=n(45287),m=n(31686),v=n(11993),y=n(66632),b=n(95814),g=o.forwardRef(function(e,t){var n=e.prefixCls,r=e.forceRender,i=e.className,c=e.style,s=e.children,d=e.isActive,u=e.role,p=e.classNames,h=e.styles,f=o.useState(d||r),m=(0,l.Z)(f,2),y=m[0],b=m[1];return(o.useEffect(function(){(r||d)&&b(!0)},[r,d]),y)?o.createElement("div",{ref:t,className:a()("".concat(n,"-content"),(0,v.Z)((0,v.Z)({},"".concat(n,"-content-active"),d),"".concat(n,"-content-inactive"),!d),i),style:c,role:u},o.createElement("div",{className:a()("".concat(n,"-content-box"),null==p?void 0:p.body),style:null==h?void 0:h.body},s)):null});g.displayName="PanelContent";var _=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],S=o.forwardRef(function(e,t){var n=e.showArrow,r=e.headerClass,i=e.isActive,s=e.onItemClick,l=e.forceRender,d=e.className,u=e.classNames,p=void 0===u?{}:u,f=e.styles,S=void 0===f?{}:f,x=e.prefixCls,C=e.collapsible,w=e.accordion,R=e.panelKey,I=e.extra,k=e.header,j=e.expandIcon,E=e.openMotion,N=e.destroyInactivePanel,Z=e.children,z=(0,h.Z)(e,_),F="disabled"===C,A=(0,v.Z)((0,v.Z)((0,v.Z)({onClick:function(){null==s||s(R)},onKeyDown:function(e){("Enter"===e.key||e.keyCode===b.Z.ENTER||e.which===b.Z.ENTER)&&(null==s||s(R))},role:w?"tab":"button"},"aria-expanded",i),"aria-disabled",F),"tabIndex",F?-1:0),O="function"==typeof j?j(e):o.createElement("i",{className:"arrow"}),P=O&&o.createElement("div",(0,c.Z)({className:"".concat(x,"-expand-icon")},["header","icon"].includes(C)?A:{}),O),T=a()("".concat(x,"-item"),(0,v.Z)((0,v.Z)({},"".concat(x,"-item-active"),i),"".concat(x,"-item-disabled"),F),d),M=a()(r,"".concat(x,"-header"),(0,v.Z)({},"".concat(x,"-collapsible-").concat(C),!!C),p.header),B=(0,m.Z)({className:M,style:S.header},["header","icon"].includes(C)?{}:A);return o.createElement("div",(0,c.Z)({},z,{ref:t,className:T}),o.createElement("div",B,(void 0===n||n)&&P,o.createElement("span",(0,c.Z)({className:"".concat(x,"-header-text")},"header"===C?A:{}),k),null!=I&&"boolean"!=typeof I&&o.createElement("div",{className:"".concat(x,"-extra")},I)),o.createElement(y.ZP,(0,c.Z)({visible:i,leavedClassName:"".concat(x,"-content-hidden")},E,{forceRender:l,removeOnLeave:N}),function(e,t){var n=e.className,r=e.style;return o.createElement(g,{ref:t,prefixCls:x,className:n,classNames:p,style:r,styles:S,isActive:i,forceRender:l,role:w?"tabpanel":void 0},Z)}))}),x=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],C=function(e,t){var n=t.prefixCls,r=t.accordion,i=t.collapsible,a=t.destroyInactivePanel,s=t.onItemClick,l=t.activeKey,d=t.openMotion,u=t.expandIcon;return e.map(function(e,t){var p=e.children,f=e.label,m=e.key,v=e.collapsible,y=e.onItemClick,b=e.destroyInactivePanel,g=(0,h.Z)(e,x),_=String(null!=m?m:t),C=null!=v?v:i,w=!1;return w=r?l[0]===_:l.indexOf(_)>-1,o.createElement(S,(0,c.Z)({},g,{prefixCls:n,key:_,panelKey:_,isActive:w,accordion:r,openMotion:d,expandIcon:u,header:f,collapsible:C,onItemClick:function(e){"disabled"!==C&&(s(e),null==y||y(e))},destroyInactivePanel:null!=b?b:a}),p)})},w=function(e,t,n){if(!e)return null;var r=n.prefixCls,i=n.accordion,a=n.collapsible,c=n.destroyInactivePanel,s=n.onItemClick,l=n.activeKey,d=n.openMotion,u=n.expandIcon,p=e.key||String(t),h=e.props,f=h.header,m=h.headerClass,v=h.destroyInactivePanel,y=h.collapsible,b=h.onItemClick,g=!1;g=i?l[0]===p:l.indexOf(p)>-1;var _=null!=y?y:a,S={key:p,panelKey:p,header:f,headerClass:m,isActive:g,prefixCls:r,destroyInactivePanel:null!=v?v:c,openMotion:d,accordion:i,children:e.props.children,onItemClick:function(e){"disabled"!==_&&(s(e),null==b||b(e))},expandIcon:u,collapsible:_};return"string"==typeof e.type?e:(Object.keys(S).forEach(function(e){void 0===S[e]&&delete S[e]}),o.cloneElement(e,S))},R=n(18242);function I(e){var t=e;if(!Array.isArray(t)){var n=(0,d.Z)(t);t="number"===n||"string"===n?[t]:[]}return t.map(function(e){return String(e)})}var k=Object.assign(o.forwardRef(function(e,t){var n,r=e.prefixCls,i=void 0===r?"rc-collapse":r,d=e.destroyInactivePanel,h=e.style,m=e.accordion,v=e.className,y=e.children,b=e.collapsible,g=e.openMotion,_=e.expandIcon,S=e.activeKey,x=e.defaultActiveKey,k=e.onChange,j=e.items,E=a()(i,v),N=(0,u.Z)([],{value:S,onChange:function(e){return null==k?void 0:k(e)},defaultValue:x,postState:I}),Z=(0,l.Z)(N,2),z=Z[0],F=Z[1];(0,p.ZP)(!y,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var A=(n={prefixCls:i,accordion:m,openMotion:g,expandIcon:_,collapsible:b,destroyInactivePanel:void 0!==d&&d,onItemClick:function(e){return F(function(){return m?z[0]===e?[]:[e]:z.indexOf(e)>-1?z.filter(function(t){return t!==e}):[].concat((0,s.Z)(z),[e])})},activeKey:z},Array.isArray(j)?C(j,n):(0,f.Z)(y).map(function(e,t){return w(e,t,n)}));return o.createElement("div",(0,c.Z)({ref:t,className:E,style:h,role:m?"tablist":void 0},(0,R.Z)(e,{aria:!0,data:!0})),A)}),{Panel:S});k.Panel;var j=n(18694),E=n(68710),N=n(19722),Z=n(71744),z=n(33759);let F=o.forwardRef((e,t)=>{let{getPrefixCls:n}=o.useContext(Z.E_),{prefixCls:r,className:i,showArrow:c=!0}=e,s=n("collapse",r),l=a()({["".concat(s,"-no-arrow")]:!c},i);return o.createElement(k.Panel,Object.assign({ref:t},e,{prefixCls:s,className:l}))});var A=n(93463),O=n(12918),P=n(63074),T=n(99320),M=n(71140);let B=e=>{let{componentCls:t,contentBg:n,padding:o,headerBg:r,headerPadding:i,collapseHeaderPaddingSM:a,collapseHeaderPaddingLG:c,collapsePanelBorderRadius:s,lineWidth:l,lineType:d,colorBorder:u,colorText:p,colorTextHeading:h,colorTextDisabled:f,fontSizeLG:m,lineHeight:v,lineHeightLG:y,marginSM:b,paddingSM:g,paddingLG:_,paddingXS:S,motionDurationSlow:x,fontSizeIcon:C,contentPadding:w,fontHeight:R,fontHeightLG:I}=e,k="".concat((0,A.bf)(l)," ").concat(d," ").concat(u);return{[t]:Object.assign(Object.assign({},(0,O.Wf)(e)),{backgroundColor:r,border:k,borderRadius:s,"&-rtl":{direction:"rtl"},["& > ".concat(t,"-item")]:{borderBottom:k,"&:first-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"".concat((0,A.bf)(s)," ").concat((0,A.bf)(s)," 0 0")}},"&:last-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"0 0 ".concat((0,A.bf)(s)," ").concat((0,A.bf)(s))}},["> ".concat(t,"-header")]:Object.assign(Object.assign({position:"relative",display:"flex",flexWrap:"nowrap",alignItems:"flex-start",padding:i,color:h,lineHeight:v,cursor:"pointer",transition:"all ".concat(x,", visibility 0s")},(0,O.Qy)(e)),{["> ".concat(t,"-header-text")]:{flex:"auto"},["".concat(t,"-expand-icon")]:{height:R,display:"flex",alignItems:"center",paddingInlineEnd:b},["".concat(t,"-arrow")]:Object.assign(Object.assign({},(0,O.Ro)()),{fontSize:C,transition:"transform ".concat(x),svg:{transition:"transform ".concat(x)}}),["".concat(t,"-header-text")]:{marginInlineEnd:"auto"}}),["".concat(t,"-collapsible-header")]:{cursor:"default",["".concat(t,"-header-text")]:{flex:"none",cursor:"pointer"},["".concat(t,"-expand-icon")]:{cursor:"pointer"}},["".concat(t,"-collapsible-icon")]:{cursor:"unset",["".concat(t,"-expand-icon")]:{cursor:"pointer"}}},["".concat(t,"-content")]:{color:p,backgroundColor:n,borderTop:k,["& > ".concat(t,"-content-box")]:{padding:w},"&-hidden":{display:"none"}},"&-small":{["> ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{padding:a,paddingInlineStart:S,["> ".concat(t,"-expand-icon")]:{marginInlineStart:e.calc(g).sub(S).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:g}}},"&-large":{["> ".concat(t,"-item")]:{fontSize:m,lineHeight:y,["> ".concat(t,"-header")]:{padding:c,paddingInlineStart:o,["> ".concat(t,"-expand-icon")]:{height:I,marginInlineStart:e.calc(_).sub(o).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:_}}},["".concat(t,"-item:last-child")]:{borderBottom:0,["> ".concat(t,"-content")]:{borderRadius:"0 0 ".concat((0,A.bf)(s)," ").concat((0,A.bf)(s))}},["& ".concat(t,"-item-disabled > ").concat(t,"-header")]:{"\n &,\n & > .arrow\n ":{color:f,cursor:"not-allowed"}},["&".concat(t,"-icon-position-end")]:{["& > ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{["".concat(t,"-expand-icon")]:{order:1,paddingInlineEnd:0,paddingInlineStart:b}}}}})}},L=e=>{let{componentCls:t}=e,n="> ".concat(t,"-item > ").concat(t,"-header ").concat(t,"-arrow");return{["".concat(t,"-rtl")]:{[n]:{transform:"rotate(180deg)"}}}},K=e=>{let{componentCls:t,headerBg:n,borderlessContentPadding:o,borderlessContentBg:r,colorBorder:i}=e;return{["".concat(t,"-borderless")]:{backgroundColor:n,border:0,["> ".concat(t,"-item")]:{borderBottom:"1px solid ".concat(i)},["\n > ".concat(t,"-item:last-child,\n > ").concat(t,"-item:last-child ").concat(t,"-header\n ")]:{borderRadius:0},["> ".concat(t,"-item:last-child")]:{borderBottom:0},["> ".concat(t,"-item > ").concat(t,"-content")]:{backgroundColor:r,borderTop:0},["> ".concat(t,"-item > ").concat(t,"-content > ").concat(t,"-content-box")]:{padding:o}}}},q=e=>{let{componentCls:t,paddingSM:n}=e;return{["".concat(t,"-ghost")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-item")]:{borderBottom:0,["> ".concat(t,"-content")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-content-box")]:{paddingBlock:n}}}}}};var H=(0,T.I$)("Collapse",e=>{let t=(0,M.IX)(e,{collapseHeaderPaddingSM:"".concat((0,A.bf)(e.paddingXS)," ").concat((0,A.bf)(e.paddingSM)),collapseHeaderPaddingLG:"".concat((0,A.bf)(e.padding)," ").concat((0,A.bf)(e.paddingLG)),collapsePanelBorderRadius:e.borderRadiusLG});return[B(t),K(t),q(t),L(t),(0,P.Z)(t)]},e=>({headerPadding:"".concat(e.paddingSM,"px ").concat(e.padding,"px"),headerBg:e.colorFillAlter,contentPadding:"".concat(e.padding,"px 16px"),contentBg:e.colorBgContainer,borderlessContentPadding:"".concat(e.paddingXXS,"px 16px ").concat(e.padding,"px"),borderlessContentBg:"transparent"})),X=Object.assign(o.forwardRef((e,t)=>{let{getPrefixCls:n,direction:i,expandIcon:c,className:s,style:l}=(0,Z.dj)("collapse"),{prefixCls:d,className:u,rootClassName:p,style:h,bordered:m=!0,ghost:v,size:y,expandIconPosition:b="start",children:g,destroyInactivePanel:_,destroyOnHidden:S,expandIcon:x}=e,C=(0,z.Z)(e=>{var t;return null!==(t=null!=y?y:e)&&void 0!==t?t:"middle"}),w=n("collapse",d),R=n(),[I,F,A]=H(w),O=o.useMemo(()=>"left"===b?"start":"right"===b?"end":b,[b]),P=null!=x?x:c,T=o.useCallback(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="function"==typeof P?P(e):o.createElement(r.Z,{rotate:e.isActive?"rtl"===i?-90:90:void 0,"aria-label":e.isActive?"expanded":"collapsed"});return(0,N.Tm)(t,()=>{var e;return{className:a()(null===(e=t.props)||void 0===e?void 0:e.className,"".concat(w,"-arrow"))}})},[P,w,i]),M=a()("".concat(w,"-icon-position-").concat(O),{["".concat(w,"-borderless")]:!m,["".concat(w,"-rtl")]:"rtl"===i,["".concat(w,"-ghost")]:!!v,["".concat(w,"-").concat(C)]:"middle"!==C},s,u,p,F,A),B=o.useMemo(()=>Object.assign(Object.assign({},(0,E.Z)(R)),{motionAppear:!1,leavedClassName:"".concat(w,"-content-hidden")}),[R,w]),L=o.useMemo(()=>g?(0,f.Z)(g).map((e,t)=>{var n,o;let r=e.props;if(null==r?void 0:r.disabled){let i=null!==(n=e.key)&&void 0!==n?n:String(t),a=Object.assign(Object.assign({},(0,j.Z)(e.props,["disabled"])),{key:i,collapsible:null!==(o=r.collapsible)&&void 0!==o?o:"disabled"});return(0,N.Tm)(e,a)}return e}):null,[g]);return I(o.createElement(k,Object.assign({ref:t,openMotion:B},(0,j.Z)(e,["rootClassName"]),{expandIcon:T,prefixCls:w,className:M,style:Object.assign(Object.assign({},l),h),destroyInactivePanel:null!=S?S:_}),L))}),{Panel:F})},24601:function(){},18975:function(e,t,n){"use strict";var o=n(40257);n(24601);var r=n(2265),i=r&&"object"==typeof r&&"default"in r?r:{default:r},a=void 0!==o&&o.env&&!0,c=function(e){return"[object String]"===Object.prototype.toString.call(e)},s=function(){function e(e){var t=void 0===e?{}:e,n=t.name,o=void 0===n?"stylesheet":n,r=t.optimizeForSpeed,i=void 0===r?a:r;l(c(o),"`name` must be a string"),this._name=o,this._deletedRulePlaceholder="#"+o+"-deleted-rule____{}",l("boolean"==typeof i,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=i,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var s="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=s?s.getAttribute("content"):null}var t=e.prototype;return t.setOptimizeForSpeed=function(e){l("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),l(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(l(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(a||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t>>0},u={};function p(e,t){if(!t)return"jsx-"+e;var n=String(t),o=e+n;return u[o]||(u[o]="jsx-"+d(e+"-"+n)),u[o]}function h(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var n=e+t;return u[n]||(u[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[n]}var f=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,o=void 0===n?null:n,r=t.optimizeForSpeed,i=void 0!==r&&r;this._sheet=o||new s({name:"styled-jsx",optimizeForSpeed:i}),this._sheet.inject(),o&&"boolean"==typeof i&&(this._sheet.setOptimizeForSpeed(i),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),o=n.styleId,r=n.rules;if(o in this._instancesCounts){this._instancesCounts[o]+=1;return}var i=r.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[o]=i,this._instancesCounts[o]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var o=this._fromServer&&this._fromServer[n];o?(o.parentNode.removeChild(o),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},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]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],o=e[1];return i.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:o}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,o=e.id;if(n){var r=p(o,n);return{styleId:r,rules:Array.isArray(t)?t.map(function(e){return h(r,e)}):[h(r,t)]}}return{styleId:p(o),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}(),m=r.createContext(null);m.displayName="StyleSheetContext";var v=i.default.useInsertionEffect||i.default.useLayoutEffect,y="undefined"!=typeof window?new f:void 0;function b(e){var t=y||r.useContext(m);return t&&("undefined"==typeof window?t.add(e):v(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}b.dynamic=function(e){return e.map(function(e){return p(e[0],e[1])}).join(" ")},t.style=b},29:function(e,t,n){"use strict";e.exports=n(18975).style}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/773-6be099faf8de2466.js b/litellm/proxy/_experimental/out/_next/static/chunks/773-6be099faf8de2466.js deleted file mode 100644 index 7df9c2a2ed9..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/773-6be099faf8de2466.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[773],{90773:function(e,s,l){l.d(s,{Z:function(){return W}});var t=l(57437),i=l(2265),n=l(57840),r=l(99376),o=l(10032),a=l(4260),c=l(5545),d=l(22116);l(25512);var u=l(78489),m=l(94789),_=l(12514),h=l(12485),g=l(18135),x=l(35242),p=l(29706),f=l(77991),j=l(21626),y=l(97214),S=l(28241),C=l(58834),I=l(69552),v=l(71876),b=l(37592),Z=l(56522),w=l(19250),k=l(9114),N=l(85968);let O={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:""},E={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"}]}};var T=e=>{let{isAddSSOModalVisible:s,isInstructionsModalVisible:l,handleAddSSOOk:n,handleAddSSOCancel:r,handleShowInstructions:u,handleInstructionsOk:m,handleInstructionsCancel:_,form:h,accessToken:g,ssoConfigured:x=!1}=e,[p,f]=(0,i.useState)(!1);(0,i.useEffect)(()=>{(async()=>{if(s&&g)try{let s=await (0,w.getSSOSettings)(g);if(console.log("Raw SSO data received:",s),s&&s.values){console.log("SSO values:",s.values),console.log("user_email from API:",s.values.user_email);let t=null;if(s.values.google_client_id)t="google";else if(s.values.microsoft_client_id)t="microsoft";else if(s.values.generic_client_id){var e,l;t=(null===(e=s.values.generic_authorization_endpoint)||void 0===e?void 0:e.includes("okta"))||(null===(l=s.values.generic_authorization_endpoint)||void 0===l?void 0:l.includes("auth0"))?"okta":"generic"}let i={sso_provider:t,proxy_base_url:s.values.proxy_base_url,user_email:s.values.user_email,...s.values};console.log("Setting form values:",i),h.resetFields(),setTimeout(()=>{h.setFieldsValue(i),console.log("Form values set, current form values:",h.getFieldsValue())},100)}}catch(e){console.error("Failed to load SSO settings:",e)}})()},[s,g,h]);let j=async e=>{if(!g){k.Z.fromBackend("No access token available");return}try{await (0,w.updateSSOSettings)(g,e),u(e)}catch(e){k.Z.fromBackend("Failed to save SSO settings: "+(0,N.O)(e))}},y=async()=>{if(!g){k.Z.fromBackend("No access token available");return}try{await (0,w.updateSSOSettings)(g,{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}),h.resetFields(),f(!1),n(),k.Z.success("SSO settings cleared successfully")}catch(e){console.error("Failed to clear SSO settings:",e),k.Z.fromBackend("Failed to clear SSO settings")}},S=e=>{let s=E[e];return s?s.fields.map(e=>(0,t.jsx)(o.Z.Item,{label:e.label,name:e.name,rules:[{required:!0,message:"Please enter the ".concat(e.label.toLowerCase())}],children:e.name.includes("client")?(0,t.jsx)(a.default.Password,{}):(0,t.jsx)(Z.o,{placeholder:e.placeholder})},e.name)):null};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.Z,{title:x?"Edit SSO Settings":"Add SSO",visible:s,width:800,footer:null,onOk:n,onCancel:r,children:(0,t.jsxs)(o.Z,{form:h,onFinish:j,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Z.Item,{label:"SSO Provider",name:"sso_provider",rules:[{required:!0,message:"Please select an SSO provider"}],children:(0,t.jsx)(b.default,{children:Object.entries(O).map(e=>{let[s,l]=e;return(0,t.jsx)(b.default.Option,{value:s,children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0"},children:[l&&(0,t.jsx)("img",{src:l,alt:s,style:{height:24,width:24,marginRight:12,objectFit:"contain"}}),(0,t.jsxs)("span",{children:["okta"===s.toLowerCase()?"Okta / Auth0":s.charAt(0).toUpperCase()+s.slice(1)," ","SSO"]})]})},s)})})}),(0,t.jsx)(o.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.sso_provider!==s.sso_provider,children:e=>{let{getFieldValue:s}=e,l=s("sso_provider");return l?S(l):null}}),(0,t.jsx)(o.Z.Item,{label:"Proxy Admin Email",name:"user_email",rules:[{required:!0,message:"Please enter the email of the proxy admin"}],children:(0,t.jsx)(Z.o,{})}),(0,t.jsx)(o.Z.Item,{label:"Proxy Base URL",name:"proxy_base_url",normalize:e=>null==e?void 0:e.trim(),rules:[{required:!0,message:"Please enter the proxy base url"},{pattern:/^https?:\/\/.+/,message:"URL must start with http:// or https://"},{validator:(e,s)=>s&&/^https?:\/\/.+/.test(s)&&s.endsWith("/")?Promise.reject("URL must not end with a trailing slash"):Promise.resolve()}],children:(0,t.jsx)(Z.o,{placeholder:"https://example.com"})})]}),(0,t.jsxs)("div",{style:{textAlign:"right",marginTop:"10px",display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px"},children:[x&&(0,t.jsx)(c.ZP,{onClick:()=>f(!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)(c.ZP,{htmlType:"submit",children:"Save"})]})]})}),(0,t.jsxs)(d.Z,{title:"Confirm Clear SSO Settings",visible:p,onOk:y,onCancel:()=>f(!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)(d.Z,{title:"SSO Setup Instructions",visible:l,width:800,footer:null,onOk:m,onCancel:_,children:[(0,t.jsx)("p",{children:"Follow these steps to complete the SSO setup:"}),(0,t.jsx)(Z.x,{className:"mt-2",children:"1. DO NOT Exit this TAB"}),(0,t.jsx)(Z.x,{className:"mt-2",children:"2. Open a new tab, visit your proxy base url"}),(0,t.jsx)(Z.x,{className:"mt-2",children:"3. Confirm your SSO is configured correctly and you can login on the new Tab"}),(0,t.jsx)(Z.x,{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)(c.ZP,{onClick:m,children:"Done"})})]})]})},A=l(67982),P=l(67101),R=l(84264),U=l(49566),M=l(96761),F=l(29233),L=l(62272),G=l(23639),B=l(92403),D=l(29271),z=l(34419),V=e=>{let{accessToken:s,userID:l,proxySettings:n}=e,[r]=o.Z.useForm(),[a,c]=(0,i.useState)(!1),[d,h]=(0,i.useState)(null),[g,x]=(0,i.useState)("");(0,i.useEffect)(()=>{let e="";x(n&&n.PROXY_BASE_URL&&void 0!==n.PROXY_BASE_URL?n.PROXY_BASE_URL:window.location.origin)},[n]);let p="".concat(g,"/scim/v2"),f=async e=>{if(!s||!l){k.Z.fromBackend("You need to be logged in to create a SCIM token");return}try{c(!0);let t={key_alias:e.key_alias||"SCIM Access Token",team_id:null,models:[],allowed_routes:["/scim/*"]},i=await (0,w.keyCreateCall)(s,l,t);h(i),k.Z.success("SCIM token created successfully")}catch(e){console.error("Error creating SCIM token:",e),k.Z.fromBackend("Failed to create SCIM token: "+(0,N.O)(e))}finally{c(!1)}};return(0,t.jsx)(P.Z,{numItems:1,children:(0,t.jsxs)(_.Z,{children:[(0,t.jsx)("div",{className:"flex items-center mb-4",children:(0,t.jsx)(M.Z,{children:"SCIM Configuration"})}),(0,t.jsx)(R.Z,{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)(A.Z,{}),(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)(M.Z,{className:"text-lg flex items-center",children:[(0,t.jsx)(L.Z,{className:"h-5 w-5 mr-2"}),"SCIM Tenant URL"]})]}),(0,t.jsx)(R.Z,{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)(U.Z,{value:p,disabled:!0,className:"flex-grow"}),(0,t.jsx)(F.CopyToClipboard,{text:p,onCopy:()=>k.Z.success("URL copied to clipboard"),children:(0,t.jsxs)(u.Z,{variant:"primary",className:"ml-2 flex items-center",children:[(0,t.jsx)(G.Z,{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)(M.Z,{className:"text-lg flex items-center",children:[(0,t.jsx)(B.Z,{className:"h-5 w-5 mr-2"}),"Authentication Token"]})]}),(0,t.jsx)(m.Z,{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)(_.Z,{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)(D.Z,{className:"h-5 w-5 mr-2"}),(0,t.jsx)(M.Z,{className:"text-lg text-yellow-800",children:"Your SCIM Token"})]}),(0,t.jsx)(R.Z,{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)(U.Z,{value:d.key,className:"flex-grow mr-2 bg-white",type:"password",disabled:!0}),(0,t.jsx)(F.CopyToClipboard,{text:d.key,onCopy:()=>k.Z.success("Token copied to clipboard"),children:(0,t.jsxs)(u.Z,{variant:"primary",className:"flex items-center",children:[(0,t.jsx)(G.Z,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),(0,t.jsxs)(u.Z,{className:"mt-4 flex items-center",variant:"secondary",onClick:()=>h(null),children:[(0,t.jsx)(z.Z,{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)(o.Z,{form:r,onFinish:f,layout:"vertical",children:[(0,t.jsx)(o.Z.Item,{name:"key_alias",label:"Token Name",rules:[{required:!0,message:"Please enter a name for your token"}],children:(0,t.jsx)(U.Z,{placeholder:"SCIM Access Token"})}),(0,t.jsx)(o.Z.Item,{children:(0,t.jsxs)(u.Z,{variant:"primary",type:"submit",loading:a,className:"flex items-center",children:[(0,t.jsx)(B.Z,{className:"h-4 w-4 mr-1"}),"Create SCIM Token"]})})]})})]})]})]})})},Y=e=>{let{accessToken:s,onSuccess:l}=e,[n]=o.Z.useForm(),[r,a]=(0,i.useState)(!1);(0,i.useEffect)(()=>{(async()=>{if(s)try{let e=await (0,w.getSSOSettings)(s);if(e&&e.values){let s=e.values.ui_access_mode,l={};s&&"object"==typeof s?l={ui_access_mode_type:s.type,restricted_sso_group:s.restricted_sso_group,sso_group_jwt_field:s.sso_group_jwt_field}:"string"==typeof s&&(l={ui_access_mode_type:s,restricted_sso_group:e.values.restricted_sso_group,sso_group_jwt_field:e.values.team_ids_jwt_field||e.values.sso_group_jwt_field}),n.setFieldsValue(l)}}catch(e){console.error("Failed to load UI access settings:",e)}})()},[s,n]);let d=async e=>{if(!s){k.Z.fromBackend("No access token available");return}a(!0);try{let t;t="all_authenticated_users"===e.ui_access_mode_type?{ui_access_mode:"none"}:{ui_access_mode:{type:e.ui_access_mode_type,restricted_sso_group:e.restricted_sso_group,sso_group_jwt_field:e.sso_group_jwt_field}},await (0,w.updateSSOSettings)(s,t),l()}catch(e){console.error("Failed to save UI access settings:",e),k.Z.fromBackend("Failed to save UI access settings")}finally{a(!1)}};return(0,t.jsxs)("div",{style:{padding:"16px"},children:[(0,t.jsx)("div",{style:{marginBottom:"16px"},children:(0,t.jsx)(Z.x,{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)(o.Z,{form:n,onFinish:d,layout:"vertical",children:[(0,t.jsx)(o.Z.Item,{label:"UI Access Mode",name:"ui_access_mode_type",tooltip:"Controls who can access the UI interface",children:(0,t.jsxs)(b.default,{placeholder:"Select access mode",children:[(0,t.jsx)(b.default.Option,{value:"all_authenticated_users",children:"All Authenticated Users"}),(0,t.jsx)(b.default.Option,{value:"restricted_sso_group",children:"Restricted SSO Group"})]})}),(0,t.jsx)(o.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.ui_access_mode_type!==s.ui_access_mode_type,children:e=>{let{getFieldValue:s}=e;return"restricted_sso_group"===s("ui_access_mode_type")?(0,t.jsx)(o.Z.Item,{label:"Restricted SSO Group",name:"restricted_sso_group",rules:[{required:!0,message:"Please enter the restricted SSO group"}],children:(0,t.jsx)(Z.o,{placeholder:"ui-access-group"})}):null}}),(0,t.jsx)(o.Z.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)(Z.o,{placeholder:"groups"})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"16px"},children:(0,t.jsx)(c.ZP,{type:"primary",htmlType:"submit",loading:r,style:{backgroundColor:"#6366f1",borderColor:"#6366f1"},children:"Update UI Access Control"})})]})]})},q=l(12363),W=e=>{let{searchParams:s,accessToken:l,userID:b,showSSOBanner:Z,premiumUser:N,proxySettings:O,userRole:E}=e,[A]=o.Z.useForm(),[P]=o.Z.useForm(),{Title:R,Paragraph:U}=n.default,[M,F]=(0,i.useState)(""),[L,G]=(0,i.useState)(null),[B,D]=(0,i.useState)(null),[z,W]=(0,i.useState)(!1),[J,X]=(0,i.useState)(!1),[H,K]=(0,i.useState)(!1),[Q,$]=(0,i.useState)(!1),[ee,es]=(0,i.useState)(!1),[el,et]=(0,i.useState)(!1),[ei,en]=(0,i.useState)(!1),[er,eo]=(0,i.useState)(!1),[ea,ec]=(0,i.useState)(!1),[ed,eu]=(0,i.useState)(!1),[em,e_]=(0,i.useState)([]),[eh,eg]=(0,i.useState)(null),[ex,ep]=(0,i.useState)(!1);(0,r.useRouter)();let[ef,ej]=(0,i.useState)(null);console.log=function(){};let ey=(0,q.n)(),eS="All IP Addresses Allowed",eC=ey;eC+="/fallback/login";let eI=async()=>{if(l)try{let e=await (0,w.getSSOSettings)(l);if(console.log("SSO data:",e),e&&e.values){let s=e.values.google_client_id&&e.values.google_client_secret,l=e.values.microsoft_client_id&&e.values.microsoft_client_secret,t=e.values.generic_client_id&&e.values.generic_client_secret;ep(s||l||t)}else ep(!1)}catch(e){console.error("Error checking SSO configuration:",e),ep(!1)}},ev=async()=>{try{if(!0!==N){k.Z.fromBackend("This feature is only available for premium users. Please upgrade your account.");return}if(l){let e=await (0,w.getAllowedIPs)(l);e_(e&&e.length>0?e:[eS])}else e_([eS])}catch(e){console.error("Error fetching allowed IPs:",e),k.Z.fromBackend("Failed to fetch allowed IPs ".concat(e)),e_([eS])}finally{!0===N&&en(!0)}},eb=async e=>{try{if(l){await (0,w.addAllowedIP)(l,e.ip);let s=await (0,w.getAllowedIPs)(l);e_(s),k.Z.success("IP address added successfully")}}catch(e){console.error("Error adding IP:",e),k.Z.fromBackend("Failed to add IP address ".concat(e))}finally{eo(!1)}},eZ=async e=>{eg(e),ec(!0)},ew=async()=>{if(eh&&l)try{await (0,w.deleteAllowedIP)(l,eh);let e=await (0,w.getAllowedIPs)(l);e_(e.length>0?e:[eS]),k.Z.success("IP address deleted successfully")}catch(e){console.error("Error deleting IP:",e),k.Z.fromBackend("Failed to delete IP address ".concat(e))}finally{ec(!1),eg(null)}};(0,i.useEffect)(()=>{(async()=>{if(null!=l){let e=[],s=await (0,w.userGetAllUsersCall)(l,"proxy_admin_viewer");console.log("proxy admin viewer response: ",s);let t=s.users;console.log("proxy viewers response: ".concat(t)),t.forEach(s=>{e.push({user_role:s.user_role,user_id:s.user_id,user_email:s.user_email})}),console.log("proxy viewers: ".concat(t));let i=(await (0,w.userGetAllUsersCall)(l,"proxy_admin")).users;i.forEach(s=>{e.push({user_role:s.user_role,user_id:s.user_id,user_email:s.user_email})}),console.log("proxy admins: ".concat(i)),console.log("combinedList: ".concat(e)),G(e),ej(await (0,w.getPossibleUserRoles)(l))}})()},[l]),(0,i.useEffect)(()=>{eI()},[l,N]);let ek=()=>{eu(!1)};return console.log("admins: ".concat(null==L?void 0:L.length)),(0,t.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,t.jsx)(R,{level:4,children:"Admin Access "}),(0,t.jsx)(U,{children:"Go to 'Internal Users' page to add other admins."}),(0,t.jsxs)(g.Z,{children:[(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(h.Z,{children:"Security Settings"}),(0,t.jsx)(h.Z,{children:"SCIM"})]}),(0,t.jsxs)(f.Z,{children:[(0,t.jsxs)(p.Z,{children:[(0,t.jsxs)(_.Z,{children:[(0,t.jsx)(R,{level:4,children:" ✨ Security Settings"}),(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)(u.Z,{style:{width:"150px"},onClick:()=>es(!0),children:ex?"Edit SSO Settings":"Add SSO"})}),(0,t.jsx)("div",{children:(0,t.jsx)(u.Z,{style:{width:"150px"},onClick:ev,children:"Allowed IPs"})}),(0,t.jsx)("div",{children:(0,t.jsx)(u.Z,{style:{width:"150px"},onClick:()=>!0===N?eu(!0):k.Z.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)(T,{isAddSSOModalVisible:ee,isInstructionsModalVisible:el,handleAddSSOOk:()=>{es(!1),A.resetFields(),l&&N&&eI()},handleAddSSOCancel:()=>{es(!1),A.resetFields()},handleShowInstructions:e=>{es(!1),et(!0)},handleInstructionsOk:()=>{et(!1),l&&N&&eI()},handleInstructionsCancel:()=>{et(!1),l&&N&&eI()},form:A,accessToken:l,ssoConfigured:ex}),(0,t.jsx)(d.Z,{title:"Manage Allowed IP Addresses",width:800,visible:ei,onCancel:()=>en(!1),footer:[(0,t.jsx)(u.Z,{className:"mx-1",onClick:()=>eo(!0),children:"Add IP Address"},"add"),(0,t.jsx)(u.Z,{onClick:()=>en(!1),children:"Close"},"close")],children:(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(C.Z,{children:(0,t.jsxs)(v.Z,{children:[(0,t.jsx)(I.Z,{children:"IP Address"}),(0,t.jsx)(I.Z,{className:"text-right",children:"Action"})]})}),(0,t.jsx)(y.Z,{children:em.map((e,s)=>(0,t.jsxs)(v.Z,{children:[(0,t.jsx)(S.Z,{children:e}),(0,t.jsx)(S.Z,{className:"text-right",children:e!==eS&&(0,t.jsx)(u.Z,{onClick:()=>eZ(e),color:"red",size:"xs",children:"Delete"})})]},s))})]})}),(0,t.jsx)(d.Z,{title:"Add Allowed IP Address",visible:er,onCancel:()=>eo(!1),footer:null,children:(0,t.jsxs)(o.Z,{onFinish:eb,children:[(0,t.jsx)(o.Z.Item,{name:"ip",rules:[{required:!0,message:"Please enter an IP address"}],children:(0,t.jsx)(a.default,{placeholder:"Enter IP address"})}),(0,t.jsx)(o.Z.Item,{children:(0,t.jsx)(c.ZP,{htmlType:"submit",children:"Add IP Address"})})]})}),(0,t.jsx)(d.Z,{title:"Confirm Delete",visible:ea,onCancel:()=>ec(!1),onOk:ew,footer:[(0,t.jsx)(u.Z,{className:"mx-1",onClick:()=>ew(),children:"Yes"},"delete"),(0,t.jsx)(u.Z,{onClick:()=>ec(!1),children:"Close"},"close")],children:(0,t.jsxs)("p",{children:["Are you sure you want to delete the IP address: ",eh,"?"]})}),(0,t.jsx)(d.Z,{title:"UI Access Control Settings",visible:ed,width:600,footer:null,onOk:ek,onCancel:()=>{eu(!1)},children:(0,t.jsx)(Y,{accessToken:l,onSuccess:()=>{ek(),k.Z.success("UI Access Control settings updated successfully")}})})]}),(0,t.jsxs)(m.Z,{title:"Login without SSO",color:"teal",children:["If you need to login without sso, you can access"," ",(0,t.jsxs)("a",{href:eC,target:"_blank",children:[(0,t.jsx)("b",{children:eC})," "]})]})]}),(0,t.jsx)(p.Z,{children:(0,t.jsx)(V,{accessToken:l,userID:b,proxySettings:O})})]})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7975-6b7ed6bc642c25a1.js b/litellm/proxy/_experimental/out/_next/static/chunks/7975-f6508849159a94d1.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/7975-6b7ed6bc642c25a1.js rename to litellm/proxy/_experimental/out/_next/static/chunks/7975-f6508849159a94d1.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7996-dc0963f1c599e551.js b/litellm/proxy/_experimental/out/_next/static/chunks/7996-0d49a395a24908e2.js similarity index 98% rename from litellm/proxy/_experimental/out/_next/static/chunks/7996-dc0963f1c599e551.js rename to litellm/proxy/_experimental/out/_next/static/chunks/7996-0d49a395a24908e2.js index c5ee883a22a..c71cf724cdc 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/7996-dc0963f1c599e551.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/7996-0d49a395a24908e2.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7996],{30150:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(5853),o=n(2265);let l=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M12 4v16m8-8H4"}))},a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M20 12H4"}))};var u=n(13241),s=n(1153),c=n(69262);let i="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",d="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",p=o.forwardRef((e,t)=>{let{onSubmit:n,enableStepper:p=!0,disabled:f,onValueChange:m,onChange:v}=e,b=(0,r._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),g=(0,o.useRef)(null),[y,E]=o.useState(!1),h=o.useCallback(()=>{E(!0)},[]),x=o.useCallback(()=>{E(!1)},[]),[w,S]=o.useState(!1),k=o.useCallback(()=>{S(!0)},[]),C=o.useCallback(()=>{S(!1)},[]);return o.createElement(c.Z,Object.assign({type:"number",ref:(0,s.lq)([g,t]),disabled:f,makeInputClassName:(0,s.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=g.current)||void 0===t?void 0:t.value;null==n||n(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&h(),"ArrowUp"===e.key&&k()},onKeyUp:e=>{"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&C()},onChange:e=>{f||(null==m||m(parseFloat(e.target.value)),null==v||v(e))},stepper:p?o.createElement("div",{className:(0,u.q)("flex justify-center align-middle")},o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;f||(null===(e=g.current)||void 0===e||e.stepDown(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,u.q)(!f&&d,i,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(a,{"data-testid":"step-down",className:(y?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;f||(null===(e=g.current)||void 0===e||e.stepUp(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,u.q)(!f&&d,i,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(l,{"data-testid":"step-up",className:(w?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},b))});p.displayName="NumberInput"},87452:function(e,t,n){"use strict";n.d(t,{Z:function(){return d},r:function(){return i}});var r=n(5853),o=n(91054);n(42698),n(64016);var l=n(8710);n(33232);var a=n(13241),u=n(1153),s=n(2265);let c=(0,u.fn)("Accordion"),i=(0,s.createContext)({isOpen:!1}),d=s.forwardRef((e,t)=>{var n;let{defaultOpen:u=!1,children:d,className:p}=e,f=(0,r._T)(e,["defaultOpen","children","className"]),m=null!==(n=(0,s.useContext)(l.Z))&&void 0!==n?n:(0,a.q)("rounded-tremor-default border");return s.createElement(o.pJ,Object.assign({as:"div",ref:t,className:(0,a.q)(c("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",m,p),defaultOpen:u},f),e=>{let{open:t}=e;return s.createElement(i.Provider,{value:{isOpen:t}},d)})});d.displayName="Accordion"},88829:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265),l=n(91054),a=n(13241);let u=(0,n(1153).fn)("AccordionBody"),s=o.forwardRef((e,t)=>{let{children:n,className:s}=e,c=(0,r._T)(e,["children","className"]);return o.createElement(l.pJ.Panel,Object.assign({ref:t,className:(0,a.q)(u("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",s)},c),n)});s.displayName="AccordionBody"},72208:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(5853),o=n(2265),l=n(91054);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var u=n(87452),s=n(13241);let c=(0,n(1153).fn)("AccordionHeader"),i=o.forwardRef((e,t)=>{let{children:n,className:i}=e,d=(0,r._T)(e,["children","className"]),{isOpen:p}=(0,o.useContext)(u.r);return o.createElement(l.pJ.Button,Object.assign({ref:t,className:(0,s.q)(c("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",i)},d),o.createElement("div",{className:(0,s.q)(c("children"),"flex flex-1 text-inherit mr-4")},n),o.createElement("div",null,o.createElement(a,{className:(0,s.q)(c("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",p?"transition-all":"transition-all -rotate-180")})))});i.displayName="AccordionHeader"},49804:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(13241),l=n(1153),a=n(2265),u=n(9496);let s=(0,l.fn)("Col"),c=a.forwardRef((e,t)=>{let{numColSpan:n=1,numColSpanSm:l,numColSpanMd:c,numColSpanLg:i,children:d,className:p}=e,f=(0,r._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),m=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return a.createElement("div",Object.assign({ref:t,className:(0,o.q)(s("root"),(()=>{let e=m(n,u.PT),t=m(l,u.SP),r=m(c,u.VS),a=m(i,u._w);return(0,o.q)(e,t,r,a)})(),p)},f),d)});c.displayName="Col"},23910:function(e,t,n){var r=n(74288).Symbol;e.exports=r},54506:function(e,t,n){var r=n(23910),o=n(4479),l=n(80910),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):l(e)}},41087:function(e,t,n){var r=n(5035),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},17071:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},4479:function(e,t,n){var r=n(23910),o=Object.prototype,l=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=l.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[u]=n:delete e[u]),o}},80910:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},74288:function(e,t,n){var r=n(17071),o="object"==typeof self&&self&&self.Object===Object&&self,l=r||o||Function("return this")();e.exports=l},5035:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},7310:function(e,t,n){var r=n(28302),o=n(11121),l=n(6660),a=Math.max,u=Math.min;e.exports=function(e,t,n){var s,c,i,d,p,f,m=0,v=!1,b=!1,g=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=s,r=c;return s=c=void 0,m=t,d=e.apply(r,n)}function E(e){var n=e-f,r=e-m;return void 0===f||n>=t||n<0||b&&r>=i}function h(){var e,n,r,l=o();if(E(l))return x(l);p=setTimeout(h,(e=l-f,n=l-m,r=t-e,b?u(r,i-n):r))}function x(e){return(p=void 0,g&&s)?y(e):(s=c=void 0,d)}function w(){var e,n=o(),r=E(n);if(s=arguments,c=this,f=n,r){if(void 0===p)return m=e=f,p=setTimeout(h,t),v?y(e):d;if(b)return clearTimeout(p),p=setTimeout(h,t),y(f)}return void 0===p&&(p=setTimeout(h,t)),d}return t=l(t)||0,r(n)&&(v=!!n.leading,i=(b="maxWait"in n)?a(l(n.maxWait)||0,t):i,g="trailing"in n?!!n.trailing:g),w.cancel=function(){void 0!==p&&clearTimeout(p),m=0,s=f=c=p=void 0},w.flush=function(){return void 0===p?d:x(o())},w}},28302:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},10303:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},78371:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},11121:function(e,t,n){var r=n(74288);e.exports=function(){return r.Date.now()}},6660:function(e,t,n){var r=n(41087),o=n(28302),l=n(78371),a=0/0,u=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,i=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(l(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?i(e.slice(2),n?2:8):u.test(e)?a:+e}},23628:function(e,t,n){"use strict";var r=n(2265);let o=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 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"}))});t.Z=o},91054:function(e,t,n){"use strict";let r,o;n.d(t,{pJ:function(){return j}});var l,a=n(71049),u=n(11323),s=n(2265),c=n(66797),i=n(93980),d=n(65573),p=n(67561),f=n(98218),m=n(33443),v=n(28294),b=n(31370),g=n(72468),y=n(5664),E=n(38929);let h=null!=(l=s.startTransition)?l:function(e){e()};var x=n(52724),w=((r=w||{})[r.Open=0]="Open",r[r.Closed=1]="Closed",r),S=((o=S||{})[o.ToggleDisclosure=0]="ToggleDisclosure",o[o.CloseDisclosure=1]="CloseDisclosure",o[o.SetButtonId=2]="SetButtonId",o[o.SetPanelId=3]="SetPanelId",o[o.SetButtonElement=4]="SetButtonElement",o[o.SetPanelElement=5]="SetPanelElement",o);let k={0:e=>({...e,disclosureState:(0,g.E)(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}},C=(0,s.createContext)(null);function T(e){let t=(0,s.useContext)(C);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,T),t}return t}C.displayName="DisclosureContext";let N=(0,s.createContext)(null);N.displayName="DisclosureAPIContext";let D=(0,s.createContext)(null);function I(e,t){return(0,g.E)(t.type,k,e,t)}D.displayName="DisclosurePanelContext";let O=s.Fragment,P=E.VN.RenderStrategy|E.VN.Static,j=Object.assign((0,E.yV)(function(e,t){let{defaultOpen:n=!1,...r}=e,o=(0,s.useRef)(null),l=(0,p.T)(t,(0,p.h)(e=>{o.current=e},void 0===e.as||e.as===s.Fragment)),a=(0,s.useReducer)(I,{disclosureState:n?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:u,buttonId:c},d]=a,f=(0,i.z)(e=>{d({type:1});let t=(0,y.r)(o);if(!t||!c)return;let n=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(c):t.getElementById(c);null==n||n.focus()}),b=(0,s.useMemo)(()=>({close:f}),[f]),h=(0,s.useMemo)(()=>({open:0===u,close:f}),[u,f]),x=(0,E.L6)();return s.createElement(C.Provider,{value:a},s.createElement(N.Provider,{value:b},s.createElement(m.Z,{value:f},s.createElement(v.up,{value:(0,g.E)(u,{0:v.ZM.Open,1:v.ZM.Closed})},x({ourProps:{ref:l},theirProps:r,slot:h,defaultTag:O,name:"Disclosure"})))))}),{Button:(0,E.yV)(function(e,t){let n=(0,s.useId)(),{id:r="headlessui-disclosure-button-".concat(n),disabled:o=!1,autoFocus:l=!1,...f}=e,[m,v]=T("Disclosure.Button"),g=(0,s.useContext)(D),y=null!==g&&g===m.panelId,h=(0,s.useRef)(null),w=(0,p.T)(h,t,(0,i.z)(e=>{if(!y)return v({type:4,element:e})}));(0,s.useEffect)(()=>{if(!y)return v({type:2,buttonId:r}),()=>{v({type:2,buttonId:null})}},[r,v,y]);let S=(0,i.z)(e=>{var t;if(y){if(1===m.disclosureState)return;switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),v({type:0}),null==(t=m.buttonElement)||t.focus()}}else switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),v({type:0})}}),k=(0,i.z)(e=>{e.key===x.R.Space&&e.preventDefault()}),C=(0,i.z)(e=>{var t;(0,b.P)(e.currentTarget)||o||(y?(v({type:0}),null==(t=m.buttonElement)||t.focus()):v({type:0}))}),{isFocusVisible:N,focusProps:I}=(0,a.F)({autoFocus:l}),{isHovered:O,hoverProps:P}=(0,u.X)({isDisabled:o}),{pressed:j,pressProps:M}=(0,c.x)({disabled:o}),B=(0,s.useMemo)(()=>({open:0===m.disclosureState,hover:O,active:j,disabled:o,focus:N,autofocus:l}),[m,O,j,N,o,l]),R=(0,d.f)(e,m.buttonElement),L=y?(0,E.dG)({ref:w,type:R,disabled:o||void 0,autoFocus:l,onKeyDown:S,onClick:C},I,P,M):(0,E.dG)({ref:w,id:r,type:R,"aria-expanded":0===m.disclosureState,"aria-controls":m.panelElement?m.panelId:void 0,disabled:o||void 0,autoFocus:l,onKeyDown:S,onKeyUp:k,onClick:C},I,P,M);return(0,E.L6)()({ourProps:L,theirProps:f,slot:B,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,E.yV)(function(e,t){let n=(0,s.useId)(),{id:r="headlessui-disclosure-panel-".concat(n),transition:o=!1,...l}=e,[a,u]=T("Disclosure.Panel"),{close:c}=function e(t){let n=(0,s.useContext)(N);if(null===n){let n=Error("<".concat(t," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(n,e),n}return n}("Disclosure.Panel"),[d,m]=(0,s.useState)(null),b=(0,p.T)(t,(0,i.z)(e=>{h(()=>u({type:5,element:e}))}),m);(0,s.useEffect)(()=>(u({type:3,panelId:r}),()=>{u({type:3,panelId:null})}),[r,u]);let g=(0,v.oJ)(),[y,x]=(0,f.Y)(o,d,null!==g?(g&v.ZM.Open)===v.ZM.Open:0===a.disclosureState),w=(0,s.useMemo)(()=>({open:0===a.disclosureState,close:c}),[a.disclosureState,c]),S={ref:b,id:r,...(0,f.X)(x)},k=(0,E.L6)();return s.createElement(v.uu,null,s.createElement(D.Provider,{value:a.panelId},k({ourProps:S,theirProps:l,slot:w,defaultTag:"div",features:P,visible:y,name:"Disclosure.Panel"})))})})},33443:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(2265);let o=(0,r.createContext)(()=>{});function l(e){let{value:t,children:n}=e;return r.createElement(o.Provider,{value:t},n)}}}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7996],{30150:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(5853),o=n(2265);let l=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M12 4v16m8-8H4"}))},a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M20 12H4"}))};var u=n(13241),s=n(1153),c=n(69262);let i="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",d="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",p=o.forwardRef((e,t)=>{let{onSubmit:n,enableStepper:p=!0,disabled:f,onValueChange:m,onChange:v}=e,b=(0,r._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),g=(0,o.useRef)(null),[y,E]=o.useState(!1),h=o.useCallback(()=>{E(!0)},[]),x=o.useCallback(()=>{E(!1)},[]),[w,S]=o.useState(!1),k=o.useCallback(()=>{S(!0)},[]),C=o.useCallback(()=>{S(!1)},[]);return o.createElement(c.Z,Object.assign({type:"number",ref:(0,s.lq)([g,t]),disabled:f,makeInputClassName:(0,s.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=g.current)||void 0===t?void 0:t.value;null==n||n(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&h(),"ArrowUp"===e.key&&k()},onKeyUp:e=>{"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&C()},onChange:e=>{f||(null==m||m(parseFloat(e.target.value)),null==v||v(e))},stepper:p?o.createElement("div",{className:(0,u.q)("flex justify-center align-middle")},o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;f||(null===(e=g.current)||void 0===e||e.stepDown(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,u.q)(!f&&d,i,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(a,{"data-testid":"step-down",className:(y?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;f||(null===(e=g.current)||void 0===e||e.stepUp(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,u.q)(!f&&d,i,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(l,{"data-testid":"step-up",className:(w?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},b))});p.displayName="NumberInput"},87452:function(e,t,n){"use strict";n.d(t,{Z:function(){return d},r:function(){return i}});var r=n(5853),o=n(91054);n(42698),n(64016);var l=n(8710);n(33232);var a=n(13241),u=n(1153),s=n(2265);let c=(0,u.fn)("Accordion"),i=(0,s.createContext)({isOpen:!1}),d=s.forwardRef((e,t)=>{var n;let{defaultOpen:u=!1,children:d,className:p}=e,f=(0,r._T)(e,["defaultOpen","children","className"]),m=null!==(n=(0,s.useContext)(l.Z))&&void 0!==n?n:(0,a.q)("rounded-tremor-default border");return s.createElement(o.pJ,Object.assign({as:"div",ref:t,className:(0,a.q)(c("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",m,p),defaultOpen:u},f),e=>{let{open:t}=e;return s.createElement(i.Provider,{value:{isOpen:t}},d)})});d.displayName="Accordion"},88829:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265),l=n(91054),a=n(13241);let u=(0,n(1153).fn)("AccordionBody"),s=o.forwardRef((e,t)=>{let{children:n,className:s}=e,c=(0,r._T)(e,["children","className"]);return o.createElement(l.pJ.Panel,Object.assign({ref:t,className:(0,a.q)(u("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",s)},c),n)});s.displayName="AccordionBody"},72208:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(5853),o=n(2265),l=n(91054);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var u=n(87452),s=n(13241);let c=(0,n(1153).fn)("AccordionHeader"),i=o.forwardRef((e,t)=>{let{children:n,className:i}=e,d=(0,r._T)(e,["children","className"]),{isOpen:p}=(0,o.useContext)(u.r);return o.createElement(l.pJ.Button,Object.assign({ref:t,className:(0,s.q)(c("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",i)},d),o.createElement("div",{className:(0,s.q)(c("children"),"flex flex-1 text-inherit mr-4")},n),o.createElement("div",null,o.createElement(a,{className:(0,s.q)(c("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",p?"transition-all":"transition-all -rotate-180")})))});i.displayName="AccordionHeader"},49804:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(13241),l=n(1153),a=n(2265),u=n(9496);let s=(0,l.fn)("Col"),c=a.forwardRef((e,t)=>{let{numColSpan:n=1,numColSpanSm:l,numColSpanMd:c,numColSpanLg:i,children:d,className:p}=e,f=(0,r._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),m=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return a.createElement("div",Object.assign({ref:t,className:(0,o.q)(s("root"),(()=>{let e=m(n,u.PT),t=m(l,u.SP),r=m(c,u.VS),a=m(i,u._w);return(0,o.q)(e,t,r,a)})(),p)},f),d)});c.displayName="Col"},23910:function(e,t,n){var r=n(74288).Symbol;e.exports=r},54506:function(e,t,n){var r=n(23910),o=n(4479),l=n(80910),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):l(e)}},55041:function(e,t,n){var r=n(5035),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},17071:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},4479:function(e,t,n){var r=n(23910),o=Object.prototype,l=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=l.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[u]=n:delete e[u]),o}},80910:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},74288:function(e,t,n){var r=n(17071),o="object"==typeof self&&self&&self.Object===Object&&self,l=r||o||Function("return this")();e.exports=l},5035:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},7310:function(e,t,n){var r=n(28302),o=n(11121),l=n(6660),a=Math.max,u=Math.min;e.exports=function(e,t,n){var s,c,i,d,p,f,m=0,v=!1,b=!1,g=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=s,r=c;return s=c=void 0,m=t,d=e.apply(r,n)}function E(e){var n=e-f,r=e-m;return void 0===f||n>=t||n<0||b&&r>=i}function h(){var e,n,r,l=o();if(E(l))return x(l);p=setTimeout(h,(e=l-f,n=l-m,r=t-e,b?u(r,i-n):r))}function x(e){return(p=void 0,g&&s)?y(e):(s=c=void 0,d)}function w(){var e,n=o(),r=E(n);if(s=arguments,c=this,f=n,r){if(void 0===p)return m=e=f,p=setTimeout(h,t),v?y(e):d;if(b)return clearTimeout(p),p=setTimeout(h,t),y(f)}return void 0===p&&(p=setTimeout(h,t)),d}return t=l(t)||0,r(n)&&(v=!!n.leading,i=(b="maxWait"in n)?a(l(n.maxWait)||0,t):i,g="trailing"in n?!!n.trailing:g),w.cancel=function(){void 0!==p&&clearTimeout(p),m=0,s=f=c=p=void 0},w.flush=function(){return void 0===p?d:x(o())},w}},28302:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},10303:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},78371:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},11121:function(e,t,n){var r=n(74288);e.exports=function(){return r.Date.now()}},6660:function(e,t,n){var r=n(55041),o=n(28302),l=n(78371),a=0/0,u=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,i=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(l(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?i(e.slice(2),n?2:8):u.test(e)?a:+e}},23628:function(e,t,n){"use strict";var r=n(2265);let o=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 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"}))});t.Z=o},91054:function(e,t,n){"use strict";let r,o;n.d(t,{pJ:function(){return j}});var l,a=n(71049),u=n(11323),s=n(2265),c=n(66797),i=n(93980),d=n(65573),p=n(67561),f=n(98218),m=n(33443),v=n(28294),b=n(31370),g=n(72468),y=n(5664),E=n(38929);let h=null!=(l=s.startTransition)?l:function(e){e()};var x=n(52724),w=((r=w||{})[r.Open=0]="Open",r[r.Closed=1]="Closed",r),S=((o=S||{})[o.ToggleDisclosure=0]="ToggleDisclosure",o[o.CloseDisclosure=1]="CloseDisclosure",o[o.SetButtonId=2]="SetButtonId",o[o.SetPanelId=3]="SetPanelId",o[o.SetButtonElement=4]="SetButtonElement",o[o.SetPanelElement=5]="SetPanelElement",o);let k={0:e=>({...e,disclosureState:(0,g.E)(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}},C=(0,s.createContext)(null);function T(e){let t=(0,s.useContext)(C);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,T),t}return t}C.displayName="DisclosureContext";let N=(0,s.createContext)(null);N.displayName="DisclosureAPIContext";let D=(0,s.createContext)(null);function I(e,t){return(0,g.E)(t.type,k,e,t)}D.displayName="DisclosurePanelContext";let O=s.Fragment,P=E.VN.RenderStrategy|E.VN.Static,j=Object.assign((0,E.yV)(function(e,t){let{defaultOpen:n=!1,...r}=e,o=(0,s.useRef)(null),l=(0,p.T)(t,(0,p.h)(e=>{o.current=e},void 0===e.as||e.as===s.Fragment)),a=(0,s.useReducer)(I,{disclosureState:n?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:u,buttonId:c},d]=a,f=(0,i.z)(e=>{d({type:1});let t=(0,y.r)(o);if(!t||!c)return;let n=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(c):t.getElementById(c);null==n||n.focus()}),b=(0,s.useMemo)(()=>({close:f}),[f]),h=(0,s.useMemo)(()=>({open:0===u,close:f}),[u,f]),x=(0,E.L6)();return s.createElement(C.Provider,{value:a},s.createElement(N.Provider,{value:b},s.createElement(m.Z,{value:f},s.createElement(v.up,{value:(0,g.E)(u,{0:v.ZM.Open,1:v.ZM.Closed})},x({ourProps:{ref:l},theirProps:r,slot:h,defaultTag:O,name:"Disclosure"})))))}),{Button:(0,E.yV)(function(e,t){let n=(0,s.useId)(),{id:r="headlessui-disclosure-button-".concat(n),disabled:o=!1,autoFocus:l=!1,...f}=e,[m,v]=T("Disclosure.Button"),g=(0,s.useContext)(D),y=null!==g&&g===m.panelId,h=(0,s.useRef)(null),w=(0,p.T)(h,t,(0,i.z)(e=>{if(!y)return v({type:4,element:e})}));(0,s.useEffect)(()=>{if(!y)return v({type:2,buttonId:r}),()=>{v({type:2,buttonId:null})}},[r,v,y]);let S=(0,i.z)(e=>{var t;if(y){if(1===m.disclosureState)return;switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),v({type:0}),null==(t=m.buttonElement)||t.focus()}}else switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),v({type:0})}}),k=(0,i.z)(e=>{e.key===x.R.Space&&e.preventDefault()}),C=(0,i.z)(e=>{var t;(0,b.P)(e.currentTarget)||o||(y?(v({type:0}),null==(t=m.buttonElement)||t.focus()):v({type:0}))}),{isFocusVisible:N,focusProps:I}=(0,a.F)({autoFocus:l}),{isHovered:O,hoverProps:P}=(0,u.X)({isDisabled:o}),{pressed:j,pressProps:M}=(0,c.x)({disabled:o}),B=(0,s.useMemo)(()=>({open:0===m.disclosureState,hover:O,active:j,disabled:o,focus:N,autofocus:l}),[m,O,j,N,o,l]),R=(0,d.f)(e,m.buttonElement),L=y?(0,E.dG)({ref:w,type:R,disabled:o||void 0,autoFocus:l,onKeyDown:S,onClick:C},I,P,M):(0,E.dG)({ref:w,id:r,type:R,"aria-expanded":0===m.disclosureState,"aria-controls":m.panelElement?m.panelId:void 0,disabled:o||void 0,autoFocus:l,onKeyDown:S,onKeyUp:k,onClick:C},I,P,M);return(0,E.L6)()({ourProps:L,theirProps:f,slot:B,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,E.yV)(function(e,t){let n=(0,s.useId)(),{id:r="headlessui-disclosure-panel-".concat(n),transition:o=!1,...l}=e,[a,u]=T("Disclosure.Panel"),{close:c}=function e(t){let n=(0,s.useContext)(N);if(null===n){let n=Error("<".concat(t," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(n,e),n}return n}("Disclosure.Panel"),[d,m]=(0,s.useState)(null),b=(0,p.T)(t,(0,i.z)(e=>{h(()=>u({type:5,element:e}))}),m);(0,s.useEffect)(()=>(u({type:3,panelId:r}),()=>{u({type:3,panelId:null})}),[r,u]);let g=(0,v.oJ)(),[y,x]=(0,f.Y)(o,d,null!==g?(g&v.ZM.Open)===v.ZM.Open:0===a.disclosureState),w=(0,s.useMemo)(()=>({open:0===a.disclosureState,close:c}),[a.disclosureState,c]),S={ref:b,id:r,...(0,f.X)(x)},k=(0,E.L6)();return s.createElement(v.uu,null,s.createElement(D.Provider,{value:a.panelId},k({ourProps:S,theirProps:l,slot:w,defaultTag:"div",features:P,visible:y,name:"Disclosure.Panel"})))})})},33443:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(2265);let o=(0,r.createContext)(()=>{});function l(e){let{value:t,children:n}=e;return r.createElement(o.Provider,{value:t},n)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8049-8ef1e898a3048691.js b/litellm/proxy/_experimental/out/_next/static/chunks/8049-8ef1e898a3048691.js deleted file mode 100644 index 72a5ca765a7..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/8049-8ef1e898a3048691.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8049],{31283:function(e,t,o){o.d(t,{o:function(){return a.Z}});var a=o(49566)},63610:function(e,t,o){o.d(t,{d:function(){return g}});var a=o(57437),r=o(2265),n=o(4260),c=o(37592),l=o(19015),i=o(10032),s=o(31283),d=o(15424),u=o(99981),h=o(19250),p=o(9309);let g=["metadata","config","enforced_params","aliases"],f=(e,t)=>g.includes(e)||"json"===t.format,m=e=>{if(!e)return!0;try{return JSON.parse(e),!0}catch(e){return!1}},w=(e,t,o)=>{let a={max_budget:"Enter maximum budget in USD (e.g., 100.50)",budget_duration:"Select a time period for budget reset",tpm_limit:"Enter maximum tokens per minute (whole number)",rpm_limit:"Enter maximum requests per minute (whole number)",duration:"Enter duration (e.g., 30s, 24h, 7d)",metadata:'Enter JSON object with key-value pairs\nExample: {"team": "research", "project": "nlp"}',config:'Enter configuration as JSON object\nExample: {"setting": "value"}',permissions:"Enter comma-separated permission strings",enforced_params:'Enter parameters as JSON object\nExample: {"param": "value"}',blocked:"Enter true/false or specific block conditions",aliases:'Enter aliases as JSON object\nExample: {"alias1": "value1", "alias2": "value2"}',models:"Select one or more model names",key_alias:"Enter a unique identifier for this key",tags:"Enter comma-separated tag strings"}[e]||({string:"Text input",number:"Numeric input",integer:"Whole number input",boolean:"True/False value"})[o]||"Text input";return f(e,t)?"".concat(a,"\nMust be valid JSON format"):t.enum?"Select from available options\nAllowed values: ".concat(t.enum.join(", ")):a};t.Z=e=>{let{schemaComponent:t,excludedFields:o=[],form:g,overrideLabels:y={},overrideTooltips:j={},customValidation:_={},defaultValues:v={}}=e,[C,k]=(0,r.useState)(null),[T,E]=(0,r.useState)(null);(0,r.useEffect)(()=>{(async()=>{try{let e=(await (0,h.getOpenAPISchema)()).components.schemas[t];if(!e)throw Error('Schema component "'.concat(t,'" not found'));k(e);let a={};Object.keys(e.properties).filter(e=>!o.includes(e)&&void 0!==v[e]).forEach(e=>{a[e]=v[e]}),g.setFieldsValue(a)}catch(e){console.error("Schema fetch error:",e),E(e instanceof Error?e.message:"Failed to fetch schema")}})()},[t,g,o]);let S=e=>{if(e.type)return e.type;if(e.anyOf){let t=e.anyOf.map(e=>e.type);if(t.includes("number")||t.includes("integer"))return"number";t.includes("string")}return"string"},b=(e,t)=>{var o;let r;let h=S(t),g=null==C?void 0:null===(o=C.required)||void 0===o?void 0:o.includes(e),k=y[e]||t.title||(0,p.N4)(e),T=j[e]||t.description,E=[];g&&E.push({required:!0,message:"".concat(k," is required")}),_[e]&&E.push({validator:_[e]}),f(e,t)&&E.push({validator:async(e,t)=>{if(t&&!m(t))throw Error("Please enter valid JSON")}});let b=T?(0,a.jsxs)("span",{children:[k," ",(0,a.jsx)(u.Z,{title:T,children:(0,a.jsx)(d.Z,{style:{marginLeft:"4px"}})})]}):k;return r=f(e,t)?(0,a.jsx)(n.default.TextArea,{rows:4,placeholder:"Enter as JSON",className:"font-mono"}):t.enum?(0,a.jsx)(c.default,{children:t.enum.map(e=>(0,a.jsx)(c.default.Option,{value:e,children:e},e))}):"number"===h||"integer"===h?(0,a.jsx)(l.Z,{style:{width:"100%"},precision:"integer"===h?0:void 0}):"duration"===e?(0,a.jsx)(s.o,{placeholder:"eg: 30s, 30h, 30d"}):(0,a.jsx)(s.o,{placeholder:T||""}),(0,a.jsx)(i.Z.Item,{label:b,name:e,className:"mt-8",rules:E,initialValue:v[e],help:(0,a.jsx)("div",{className:"text-xs text-gray-500",children:w(e,t,h)}),children:r},e)};return T?(0,a.jsxs)("div",{className:"text-red-500",children:["Error: ",T]}):(null==C?void 0:C.properties)?(0,a.jsx)("div",{children:Object.entries(C.properties).filter(e=>{let[t]=e;return!o.includes(t)}).map(e=>{let[t,o]=e;return b(t,o)})}):null}},9114:function(e,t,o){var a=o(2265),r=o(57271),n=o(85968);function c(){return"topRight"}function l(e,t){var o;return"string"==typeof e?{message:t,description:e}:{message:null!==(o=e.message)&&void 0!==o?o:t,...e}}function i(e){return"number"==typeof e?e:"string"==typeof e&&/^\d+$/.test(e)?parseInt(e,10):void 0}let s=["invalid api key","invalid authorization header format","authentication error","invalid proxy server token","invalid jwt token","invalid jwt submitted","unauthorized access to metrics endpoint"],d=["admin-only endpoint","not allowed to access model","user does not have permission","access forbidden","invalid credentials used to access ui","user not allowed to access proxy"],u=["db not connected","database not initialized","no db connected","prisma client not initialized","service unhealthy"],h=["no models configured on proxy","llm router not initialized","no deployments available","no healthy deployment available","not allowed to access model due to tags configuration","invalid model name passed in"],p=["deployment over user-defined ratelimit","crossed tpm / rpm / max parallel request limit","max parallel request limit"],g=["budget exceeded","crossed budget","provider budget"],f=["must be a litellm enterprise user","only be available for liteLLM enterprise users","missing litellm-enterprise package","only available on the docker image","enterprise feature","premium user"],m=["invalid json payload","invalid request type","invalid key format","invalid hash key","invalid sort column","invalid sort order","invalid limit","invalid file type","invalid field","invalid date format"],w=["model not found","model with id","credential not found","user not found","team not found","organization not found","mcp server with id","tool '"],y=["already exists","team member is already in team","user already exists"],j=["violated openai moderation policy","violated jailbreak threshold","violated prompt_injection threshold","violated content safety policy","violated lasso guardrail policy","blocked by pillar security guardrail","violated azure prompt shield guardrail policy","content blocked by model armor","response blocked by model armor","streaming response blocked by model armor","guardrail","moderation"],_=["invalid purpose","service must be specified","invalid response - response.response is none"],v=["cloudzero settings not configured","failed to decrypt cloudzero api key","cloudzero settings not found"],C=["created successfully","updated successfully","deleted successfully","credential created successfully","model added successfully","team created successfully","user created successfully","organization created successfully","cloudzero settings initialized successfully","cloudzero settings updated successfully","cloudzero export completed successfully","mock llm request made","mock slack alert sent","mock email alert sent","spend for all api keys and teams reset successfully","monthlyglobalspend view refreshed","cache cleared successfully","cache set successfully","ip ","deleted successfully"],k=["rate limit reached for deployment","deployment cooldown period active"],T=["this feature is only available for litellm enterprise users","enterprise features are not available","regenerating virtual keys is an enterprise feature","trying to set allowed_routes. this is an enterprise feature"],E=["invalid maximum_spend_logs_retention_interval value","error has invalid or non-convertible code","failed to save health check to database"];t.Z={error(e){var t,o;let a=l(e,"Error");r.ZP.error({...a,placement:null!==(t=a.placement)&&void 0!==t?t:c(),duration:null!==(o=a.duration)&&void 0!==o?o:6})},warning(e){var t,o;let a=l(e,"Warning");r.ZP.warning({...a,placement:null!==(t=a.placement)&&void 0!==t?t:c(),duration:null!==(o=a.duration)&&void 0!==o?o:5})},info(e){var t,o;let a=l(e,"Info");r.ZP.info({...a,placement:null!==(t=a.placement)&&void 0!==t?t:c(),duration:null!==(o=a.duration)&&void 0!==o?o:4})},success(e){var t,o;if(a.isValidElement(e)){r.ZP.success({message:"Success",description:e,placement:c(),duration:3.5});return}let n=l(e,"Success");r.ZP.success({...n,placement:null!==(t=n.placement)&&void 0!==t?t:c(),duration:null!==(o=n.duration)&&void 0!==o?o:3.5})},fromBackend(e,t){var o,a,l,S,b,F,P,O,B,N,x,A;let J=null!==(A=null!==(x=i(null==e?void 0:null===(N=e.response)||void 0===N?void 0:N.status))&&void 0!==x?x:i(null==e?void 0:e.status_code))&&void 0!==A?A:i(null==e?void 0:e.code),G=function(e){var t,o,a,r,c,l,i,s,d,u,h,p;if("string"==typeof e)return e;let g=null!==(p=null!==(h=null!==(u=null!==(d=null!==(s=null==e?void 0:null===(a=e.response)||void 0===a?void 0:null===(o=a.data)||void 0===o?void 0:null===(t=o.error)||void 0===t?void 0:t.message)&&void 0!==s?s:null==e?void 0:null===(c=e.response)||void 0===c?void 0:null===(r=c.data)||void 0===r?void 0:r.message)&&void 0!==d?d:null==e?void 0:null===(i=e.response)||void 0===i?void 0:null===(l=i.data)||void 0===l?void 0:l.error)&&void 0!==u?u:null==e?void 0:e.detail)&&void 0!==h?h:null==e?void 0:e.message)&&void 0!==p?p:e;return(0,n.O)(g)}(e),U={...null!=t?t:{},description:G,placement:null!==(o=null==t?void 0:t.placement)&&void 0!==o?o:c()};if(void 0!==J||e instanceof Error||"string"==typeof e||e&&"object"==typeof e&&("error"in e||"detail"in e)){let e=function(e,t){var o,a,r,n,c;let l=(t||"").toLowerCase();return s.some(e=>l.includes(e))?"Authentication Error":d.some(e=>l.includes(e))?"Access Denied":(null==u?void 0:null===(o=u.some)||void 0===o?void 0:o.call(u,e=>l.includes(e)))||503===e?"Service Unavailable":(null==g?void 0:null===(a=g.some)||void 0===a?void 0:a.call(g,e=>l.includes(e)))?"Budget Exceeded":(null==f?void 0:null===(r=f.some)||void 0===r?void 0:r.call(f,e=>l.includes(e)))?"Feature Unavailable":(null==h?void 0:null===(n=h.some)||void 0===n?void 0:n.call(h,e=>l.includes(e)))?"Routing Error":y.some(e=>l.includes(e))?"Already Exists":j.some(e=>l.includes(e))?"Content Blocked":_.some(e=>l.includes(e))?"Validation Error":v.some(e=>l.includes(e))?"Integration Error":m.some(e=>l.includes(e))?"Validation Error":404===e||l.includes("not found")||w.some(e=>l.includes(e))?"Not Found":429===e||l.includes("rate limit")||l.includes("tpm")||l.includes("rpm")||(null==p?void 0:null===(c=p.some)||void 0===c?void 0:c.call(p,e=>l.includes(e)))?"Rate Limit Exceeded":e&&e>=500?"Server Error":401===e?"Authentication Error":403===e?"Access Denied":l.includes("enterprise")||l.includes("premium")?"Info":e&&e>=400?"Request Error":"Error"}(J,G),o={...U,message:e};if("Rate Limit Exceeded"===e||"Info"===e||"Budget Exceeded"===e||"Feature Unavailable"===e||"Content Blocked"===e||"Integration Error"===e){r.ZP.warning({...o,duration:null!==(a=null==t?void 0:t.duration)&&void 0!==a?a:7});return}if("Server Error"===e){r.ZP.error({...o,duration:null!==(l=null==t?void 0:t.duration)&&void 0!==l?l:8});return}if("Request Error"===e||"Authentication Error"===e||"Access Denied"===e||"Not Found"===e||"Error"===e||"Already Exists"===e){r.ZP.error({...o,duration:null!==(S=null==t?void 0:t.duration)&&void 0!==S?S:6});return}r.ZP.info({...o,duration:null!==(b=null==t?void 0:t.duration)&&void 0!==b?b:4});return}let I=function(e){let t=(e||"").toLowerCase();return C.some(e=>t.includes(e))?{kind:"success",title:"Success"}:T.some(e=>t.includes(e))?{kind:"warning",title:"Feature Notice"}:E.some(e=>t.includes(e))?{kind:"warning",title:"Configuration Warning"}:k.some(e=>t.includes(e))?{kind:"warning",title:"Rate Limit"}:null}(G),R={...U,message:null!==(F=null==I?void 0:I.title)&&void 0!==F?F:"Info"};if((null==I?void 0:I.kind)==="success"){r.ZP.success({...R,duration:null!==(P=null==t?void 0:t.duration)&&void 0!==P?P:3.5});return}if((null==I?void 0:I.kind)==="warning"){r.ZP.warning({...R,duration:null!==(O=null==t?void 0:t.duration)&&void 0!==O?O:6});return}r.ZP.info({...R,duration:null!==(B=null==t?void 0:t.duration)&&void 0!==B?B:4})},clear(){r.ZP.destroy()}}},19250:function(e,t,o){o.r(t),o.d(t,{DEFAULT_ORGANIZATION:function(){return m},PredictedSpendLogsCall:function(){return tw},addAllowedIP:function(){return eE},adminGlobalActivity:function(){return eq},adminGlobalActivityExceptions:function(){return eW},adminGlobalActivityExceptionsPerDeployment:function(){return eY},adminGlobalActivityPerModel:function(){return eH},adminGlobalCacheActivity:function(){return eZ},adminSpendLogsCall:function(){return ez},adminTopEndUsersCall:function(){return eD},adminTopKeysCall:function(){return eL},adminTopModelsCall:function(){return eQ},adminspendByProvider:function(){return eV},agentHubPublicModelsCall:function(){return ev},alertingSettingsCall:function(){return R},allEndUsersCall:function(){return eU},allTagNamesCall:function(){return eG},applyGuardrail:function(){return oG},availableTeamListCall:function(){return K},budgetCreateCall:function(){return J},budgetDeleteCall:function(){return A},budgetUpdateCall:function(){return G},buildMcpOAuthAuthorizeUrl:function(){return oQ},cacheTemporaryMcpServer:function(){return oW},cachingHealthCheckCall:function(){return tI},callMCPTool:function(){return on},cancelModelCostMapReload:function(){return P},claimOnboardingToken:function(){return eg},convertPromptFileToJson:function(){return tY},createAgentCall:function(){return tK},createGuardrailCall:function(){return t$},createMCPServer:function(){return t2},createPassThroughEndpoint:function(){return tB},createPromptCall:function(){return tZ},createSearchTool:function(){return t7},credentialCreateCall:function(){return e7},credentialDeleteCall:function(){return to},credentialGetCall:function(){return tt},credentialListCall:function(){return te},credentialUpdateCall:function(){return ta},customerDailyActivityCall:function(){return eu},defaultProxyBaseUrl:function(){return s},deleteAgentCall:function(){return oT},deleteAllowedIP:function(){return eS},deleteCallback:function(){return oV},deleteConfigFieldSetting:function(){return tx},deleteGuardrailCall:function(){return oF},deleteMCPServer:function(){return t9},deletePassThroughEndpointsCall:function(){return tA},deletePromptCall:function(){return tW},deleteSearchTool:function(){return ot},exchangeMcpOAuthToken:function(){return oK},fetchAvailableSearchProviders:function(){return oo},fetchMCPAccessGroups:function(){return t3},fetchMCPServers:function(){return t4},fetchSearchToolById:function(){return t8},fetchSearchTools:function(){return t6},formatDate:function(){return l},getAgentInfo:function(){return oN},getAgentsList:function(){return oB},getAllowedIPs:function(){return eT},getBudgetList:function(){return t_},getBudgetSettings:function(){return tv},getCacheSettingsCall:function(){return tE},getCallbackConfigsCall:function(){return i},getCallbacksCall:function(){return tC},getConfigFieldSetting:function(){return tP},getDefaultTeamSettings:function(){return ou},getEmailEventSettings:function(){return ov},getGeneralSettingsCall:function(){return tk},getGuardrailInfo:function(){return ox},getGuardrailProviderSpecificParams:function(){return oO},getGuardrailUISettings:function(){return oP},getGuardrailsList:function(){return tL},getInternalUserSettings:function(){return t0},getModelCostMapReloadStatus:function(){return O},getOnboardingCredentials:function(){return ep},getOpenAPISchema:function(){return E},getPassThroughEndpointInfo:function(){return oD},getPassThroughEndpointsCall:function(){return tF},getPossibleUserRoles:function(){return e6},getPromptInfo:function(){return tV},getPromptVersions:function(){return tq},getPromptsList:function(){return tD},getProviderCreateMetadata:function(){return j},getProxyBaseUrl:function(){return g},getProxyUISettings:function(){return tz},getPublicModelHubInfo:function(){return T},getRemainingUsers:function(){return oz},getRouterSettingsCall:function(){return tT},getSSOSettings:function(){return oI},getTeamPermissionsCall:function(){return op},getTotalSpendCall:function(){return eh},getUiConfig:function(){return k},healthCheckCall:function(){return tG},healthCheckHistoryCall:function(){return tR},individualModelHealthCheckCall:function(){return tU},invitationClaimCall:function(){return I},invitationCreateCall:function(){return U},keyAliasesCall:function(){return e1},keyCreateCall:function(){return z},keyCreateServiceAccountCall:function(){return M},keyDeleteCall:function(){return D},keyInfoCall:function(){return eK},keyInfoV1Call:function(){return eX},keyListCall:function(){return e0},keySpendLogsCall:function(){return ex},keyUpdateCall:function(){return tr},latestHealthChecksCall:function(){return tM},listMCPTools:function(){return or},loginCall:function(){return o8},makeAgentPublicCall:function(){return oE},makeAgentsPublicCall:function(){return oS},makeMCPPublicCall:function(){return ob},makeModelGroupPublic:function(){return C},mcpHubPublicServersCall:function(){return eC},mcpToolsCall:function(){return oq},modelAvailableCall:function(){return eN},modelCostMap:function(){return S},modelCreateCall:function(){return B},modelDeleteCall:function(){return x},modelExceptionsCall:function(){return eO},modelHubCall:function(){return ek},modelHubPublicModelsCall:function(){return e_},modelInfoCall:function(){return ey},modelInfoV1Call:function(){return ej},modelMetricsCall:function(){return eb},modelMetricsSlowResponsesCall:function(){return eP},modelPatchUpdateCall:function(){return tc},modelSettingsCall:function(){return N},modelUpdateCall:function(){return tl},organizationCreateCall:function(){return ee},organizationDailyActivityCall:function(){return ed},organizationDeleteCall:function(){return eo},organizationInfoCall:function(){return X},organizationListCall:function(){return $},organizationMemberAddCall:function(){return th},organizationMemberDeleteCall:function(){return tp},organizationMemberUpdateCall:function(){return tg},organizationUpdateCall:function(){return et},patchAgentCall:function(){return oA},patchPromptCall:function(){return tQ},perUserAnalyticsCall:function(){return o9},proxyBaseUrl:function(){return u},regenerateKeyCall:function(){return ef},registerMcpOAuthClient:function(){return oY},reloadModelCostMap:function(){return b},resetEmailEventSettings:function(){return ok},scheduleModelCostMapReload:function(){return F},searchToolQueryCall:function(){return oX},serverRootPath:function(){return d},serviceHealthCheck:function(){return tj},sessionSpendLogsCall:function(){return of},setCallbacksCall:function(){return tJ},setGlobalLitellmHeaderName:function(){return v},slackBudgetAlertsHealthCheck:function(){return ty},spendUsersCall:function(){return e4},streamingModelMetricsCall:function(){return eF},tagCreateCall:function(){return oc},tagDailyActivityCall:function(){return ei},tagDauCall:function(){return o1},tagDeleteCall:function(){return od},tagDistinctCall:function(){return o2},tagInfoCall:function(){return oi},tagListCall:function(){return os},tagMauCall:function(){return o3},tagUpdateCall:function(){return ol},tagWauCall:function(){return o4},tagsSpendLogsCall:function(){return eJ},teamBulkMemberAddCall:function(){return ts},teamCreateCall:function(){return e8},teamDailyActivityCall:function(){return es},teamDeleteCall:function(){return q},teamInfoCall:function(){return W},teamListCall:function(){return Q},teamMemberAddCall:function(){return ti},teamMemberDeleteCall:function(){return tu},teamMemberUpdateCall:function(){return td},teamPermissionsUpdateCall:function(){return og},teamSpendLogsCall:function(){return eA},teamUpdateCall:function(){return tn},testCacheConnectionCall:function(){return tS},testConnectionRequest:function(){return e$},testMCPConnectionRequest:function(){return oZ},testMCPToolsListRequest:function(){return oH},testSearchToolConnection:function(){return oa},transformRequestCall:function(){return ea},uiAuditLogsCall:function(){return oM},uiSpendLogDetailsCall:function(){return tX},uiSpendLogsCall:function(){return eM},updateCacheSettingsCall:function(){return tb},updateConfigFieldSetting:function(){return tN},updateDefaultTeamSettings:function(){return oh},updateEmailEventSettings:function(){return oC},updateGuardrailCall:function(){return oJ},updateInternalUserSettings:function(){return t1},updateMCPServer:function(){return t5},updatePassThroughEndpoint:function(){return oL},updatePassThroughFieldSetting:function(){return tO},updatePromptCall:function(){return tH},updateSSOSettings:function(){return oR},updateSearchTool:function(){return oe},updateUsefulLinksCall:function(){return eB},userAgentAnalyticsCall:function(){return o0},userAgentSummaryCall:function(){return o5},userBulkUpdateUserCall:function(){return tm},userCreateCall:function(){return L},userDailyActivityAggregatedCall:function(){return e5},userDailyActivityCall:function(){return el},userDeleteCall:function(){return V},userFilterUICall:function(){return eI},userGetAllUsersCall:function(){return e9},userGetRequesedtModelsCall:function(){return e2},userInfoCall:function(){return H},userListCall:function(){return Z},userRequestModelCall:function(){return e3},userSpendLogsCall:function(){return eR},userUpdateUserCall:function(){return tf},v2TeamListCall:function(){return Y},validateBlockedWordsFile:function(){return oU},vectorStoreCreateCall:function(){return om},vectorStoreDeleteCall:function(){return oy},vectorStoreInfoCall:function(){return oj},vectorStoreListCall:function(){return ow},vectorStoreSearchCall:function(){return o$},vectorStoreUpdateCall:function(){return o_}});var a=o(42264),r=o(3914),n=o(63610),c=o(9114);let l=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)},i=async e=>{try{let t=u?"".concat(u,"/callbacks/configs"):"/callbacks/configs",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},s=null,d="/",u=null;console.log=function(){};let h=()=>window.location,p=function(e){var t;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=h(),r=null!==(t=null==a?void 0:a.origin)&&void 0!==t?t:null,n=o||r;if(console.log("proxyBaseUrl:",u),console.log("serverRootPath:",e),!n){console.log("Updated proxyBaseUrl:",u=null!=u?u:null);return}e.length>0&&!n.endsWith(e)&&"/"!=e&&(n+=e),console.log("Updated proxyBaseUrl:",u=n)},g=()=>{var e;if(u)return u;let t=h();return null!==(e=null==t?void 0:t.origin)&&void 0!==e?e:""},f={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE"},m="default_organization",w=0,y=async e=>{let t=Date.now();if(t-w>6e4){if(("string"==typeof e?e:JSON.stringify(e)).includes("Authentication Error - Expired Key")){c.Z.info("UI Session Expired. Logging out."),w=t,(0,r.b)();let e=h();e&&(window.location.href=e.pathname)}w=t}else console.log("Error suppressed to prevent spam:",e)},j=async()=>{let e=u?"".concat(u,"/public/providers/fields"):"/public/providers/fields",t=await fetch(e,{method:"GET"});if(!t.ok){let e=await t.text();throw console.error("Failed to fetch provider create metadata:",t.status,e),Error("Failed to load provider configuration")}return await t.json()},_="Authorization";function v(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Authorization";console.log("setGlobalLitellmHeaderName: ".concat(e)),_=e}let C=async(e,t)=>{let o=u?"".concat(u,"/model_group/make_public"):"/model_group/make_public";return(await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({model_groups:t})})).json()},k=async()=>{console.log("Getting UI config");let e=await fetch(s?"".concat(s,"/litellm/.well-known/litellm-ui-config"):"/litellm/.well-known/litellm-ui-config"),t=await e.json();return console.log("jsonData in getUiConfig:",t),p(t.server_root_path,t.proxy_base_url),t},T=async()=>{let e=u?"".concat(u,"/public/model_hub/info"):"/public/model_hub/info",t=await fetch(e);return await t.json()},E=async()=>{let e=u?"".concat(u,"/openapi.json"):"/openapi.json",t=await fetch(e);return await t.json()},S=async e=>{try{let t=u?"".concat(u,"/get/litellm_model_cost_map"):"/get/litellm_model_cost_map",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}}),a=await o.json();return console.log("received litellm model cost data: ".concat(a)),a}catch(e){throw console.error("Failed to get model cost map:",e),e}},b=async e=>{try{let t=u?"".concat(u,"/reload/model_cost_map"):"/reload/model_cost_map",o=await fetch(t,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}}),a=await o.json();return console.log("Model cost map reload response: ".concat(a)),a}catch(e){throw console.error("Failed to reload model cost map:",e),e}},F=async(e,t)=>{try{let o=u?"".concat(u,"/schedule/model_cost_map_reload?hours=").concat(t):"/schedule/model_cost_map_reload?hours=".concat(t),a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}}),r=await a.json();return console.log("Schedule model cost map reload response: ".concat(r)),r}catch(e){throw console.error("Failed to schedule model cost map reload:",e),e}},P=async e=>{try{let t=u?"".concat(u,"/schedule/model_cost_map_reload"):"/schedule/model_cost_map_reload",o=await fetch(t,{method:"DELETE",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}}),a=await o.json();return console.log("Cancel model cost map reload response: ".concat(a)),a}catch(e){throw console.error("Failed to cancel model cost map reload:",e),e}},O=async e=>{try{let t=u?"".concat(u,"/schedule/model_cost_map_reload/status"):"/schedule/model_cost_map_reload/status";console.log("Fetching status from URL:",t);let o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){console.error("Status request failed with status: ".concat(o.status));let e=await o.text();throw console.error("Error response:",e),Error("HTTP ".concat(o.status,": ").concat(e))}let a=await o.json();return console.log("Model cost map reload status:",a),a}catch(e){throw console.error("Failed to get model cost map reload status:",e),e}},B=async(e,t)=>{try{let o=u?"".concat(u,"/model/new"):"/model/new",r=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),a.ZP.destroy(),c.Z.success("Model ".concat(t.model_name," created successfully")),n}catch(e){throw console.error("Failed to create key:",e),e}},N=async e=>{try{let t=u?"".concat(u,"/model/settings"):"/model/settings",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){console.error("Failed to get model settings:",e)}},x=async(e,t)=>{console.log("model_id in model delete call: ".concat(t));try{let o=u?"".concat(u,"/model/delete"):"/model/delete",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},A=async(e,t)=>{if(console.log("budget_id in budget delete call: ".concat(t)),null!=e)try{let o=u?"".concat(u,"/budget/delete"):"/budget/delete",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},J=async(e,t)=>{try{console.log("Form Values in budgetCreateCall:",t),console.log("Form Values after check:",t);let o=u?"".concat(u,"/budget/new"):"/budget/new",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},G=async(e,t)=>{try{console.log("Form Values in budgetUpdateCall:",t),console.log("Form Values after check:",t);let o=u?"".concat(u,"/budget/update"):"/budget/update",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},U=async(e,t)=>{try{let o=u?"".concat(u,"/invitation/new"):"/invitation/new",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},I=async(e,t)=>{try{console.log("Form Values in invitationCreateCall:",t),console.log("Form Values after check:",t);let o=u?"".concat(u,"/invitation/claim"):"/invitation/claim",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},R=async e=>{try{let t=u?"".concat(u,"/alerting/settings"):"/alerting/settings",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},M=async(e,t)=>{try{for(let e of(console.log("Form Values in keyCreateServiceAccountCall:",t),t.description&&(t.metadata||(t.metadata={}),t.metadata.description=t.description,delete t.description,t.metadata=JSON.stringify(t.metadata)),n.d))if(t[e]){console.log("formValues.".concat(e,":"),t[e]);try{t[e]=JSON.parse(t[e])}catch(t){throw Error("Failed to parse ".concat(e,": ")+t)}}console.log("Form Values after check:",t);let o=u?"".concat(u,"/key/service-account/generate"):"/key/service-account/generate",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},z=async(e,t,o)=>{try{for(let e of(console.log("Form Values in keyCreateCall:",o),o.description&&(o.metadata||(o.metadata={}),o.metadata.description=o.description,delete o.description,o.metadata=JSON.stringify(o.metadata)),n.d))if(o[e]){console.log("formValues.".concat(e,":"),o[e]);try{o[e]=JSON.parse(o[e])}catch(t){throw Error("Failed to parse ".concat(e,": ")+t)}}console.log("Form Values after check:",o);let a=u?"".concat(u,"/key/generate"):"/key/generate",r=await fetch(a,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let c=await r.json();return console.log("API Response:",c),c}catch(e){throw console.error("Failed to create key:",e),e}},L=async(e,t,o)=>{try{if(console.log("Form Values in keyCreateCall:",o),o.description&&(o.metadata||(o.metadata={}),o.metadata.description=o.description,delete o.description,o.metadata=JSON.stringify(o.metadata)),o.auto_create_key=!1,o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=u?"".concat(u,"/user/new"):"/user/new",r=await fetch(a,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},D=async(e,t)=>{try{let o=u?"".concat(u,"/key/delete"):"/key/delete";console.log("in keyDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:[t]})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},V=async(e,t)=>{try{let o=u?"".concat(u,"/user/delete"):"/user/delete";console.log("in userDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_ids:t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete user(s):",e),e}},q=async(e,t)=>{try{let o=u?"".concat(u,"/team/delete"):"/team/delete";console.log("in teamDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_ids:[t]})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},Z=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,s=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let d=u?"".concat(u,"/user/list"):"/user/list";console.log("in userListCall");let h=new URLSearchParams;if(t&&t.length>0){let e=t.join(",");h.append("user_ids",e)}o&&h.append("page",o.toString()),a&&h.append("page_size",a.toString()),r&&h.append("user_email",r),n&&h.append("role",n),c&&h.append("team",c),l&&h.append("sso_user_ids",l),i&&h.append("sort_by",i),s&&h.append("sort_order",s);let p=h.toString();p&&(d+="?".concat(p));let g=await fetch(d,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!g.ok){let e=await g.json(),t=o6(e);throw y(t),Error(t)}let f=await g.json();return console.log("/user/list API Response:",f),f}catch(e){throw console.error("Failed to create key:",e),e}},H=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0,n=arguments.length>5?arguments[5]:void 0,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];console.log("userInfoCall: ".concat(t,", ").concat(o,", ").concat(a,", ").concat(r,", ").concat(n,", ").concat(c));try{let l;if(a){l=u?"".concat(u,"/user/list"):"/user/list";let e=new URLSearchParams;null!=r&&e.append("page",r.toString()),null!=n&&e.append("page_size",n.toString()),l+="?".concat(e.toString())}else l=u?"".concat(u,"/user/info"):"/user/info",("Admin"!==o&&"Admin Viewer"!==o||c)&&t&&(l+="?user_id=".concat(t));console.log("Requesting user data from:",l);let i=await fetch(l,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=o6(e);throw y(t),Error(t)}let s=await i.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to fetch user data:",e),e}},W=async(e,t)=>{try{let o=u?"".concat(u,"/team/info"):"/team/info";t&&(o="".concat(o,"?team_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},Y=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6],arguments.length>7&&void 0!==arguments[7]&&arguments[7],arguments.length>8&&void 0!==arguments[8]&&arguments[8];try{let n=u?"".concat(u,"/v2/team/list"):"/v2/team/list";console.log("in teamInfoCall");let c=new URLSearchParams;o&&c.append("user_id",o.toString()),t&&c.append("organization_id",t.toString()),a&&c.append("team_id",a.toString()),r&&c.append("team_alias",r.toString());let l=c.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=o6(e);throw y(t),Error(t)}let s=await i.json();return console.log("/v2/team/list API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},Q=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=u?"".concat(u,"/team/list"):"/team/list";console.log("in teamInfoCall");let c=new URLSearchParams;o&&c.append("user_id",o.toString()),t&&c.append("organization_id",t.toString()),a&&c.append("team_id",a.toString()),r&&c.append("team_alias",r.toString());let l=c.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=o6(e);throw y(t),Error(t)}let s=await i.json();return console.log("/team/list API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},K=async e=>{try{let t=u?"".concat(u,"/team/available"):"/team/available";console.log("in availableTeamListCall");let o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log("/team/available_teams API Response:",a),a}catch(e){throw e}},$=async e=>{try{let t=u?"".concat(u,"/organization/list"):"/organization/list",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},X=async(e,t)=>{try{let o=u?"".concat(u,"/organization/info"):"/organization/info";t&&(o="".concat(o,"?organization_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},ee=async(e,t)=>{try{if(console.log("Form Values in organizationCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw console.error("Failed to parse metadata:",e),Error("Failed to parse metadata: "+e)}}let o=u?"".concat(u,"/organization/new"):"/organization/new",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},et=async(e,t)=>{try{console.log("Form Values in organizationUpdateCall:",t);let o=u?"".concat(u,"/organization/update"):"/organization/update",a=await fetch(o,{method:"PATCH",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("Update Team Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eo=async(e,t)=>{try{let o=u?"".concat(u,"/organization/delete"):"/organization/delete",a=await fetch(o,{method:"DELETE",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_ids:[t]})});if(!a.ok){let e=await a.text();throw y(e),Error("Error deleting organization: ".concat(e))}return await a.json()}catch(e){throw console.error("Failed to delete organization:",e),e}},ea=async(e,t)=>{try{let o=u?"".concat(u,"/utils/transform_request"):"/utils/transform_request",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},er=(e,t,o)=>{if(null!=o){if(Array.isArray(o)){o.length>0&&e.append(t,o.join(","));return}e.append(t,"".concat(o))}},en=(e,t,o,a,r)=>{let n=e.startsWith("/")?e:"/".concat(e),c=u?"".concat(u).concat(n):n,i=new URLSearchParams;i.append("start_date",l(t)),i.append("end_date",l(o)),i.append("page_size","1000"),i.append("page",a.toString()),r&&Object.entries(r).forEach(e=>{let[t,o]=e;er(i,t,o)});let s=i.toString();return s?"".concat(c,"?").concat(s):c},ec=async e=>{let{accessToken:t,endpoint:o,startTime:a,endTime:r,page:n=1,extraQueryParams:c}=e;try{let e=en(o,a,r,n,c),l=await fetch(e,{method:"GET",headers:{[_]:"Bearer ".concat(t),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=o6(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch daily activity (".concat(o,"):"),e),e}},el=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return ec({accessToken:e,endpoint:"/user/daily/activity",startTime:t,endTime:o,page:a})},ei=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return ec({accessToken:e,endpoint:"/tag/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{tags:r}})},es=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return ec({accessToken:e,endpoint:"/team/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{team_ids:r,exclude_team_ids:"litellm-dashboard"}})},ed=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return ec({accessToken:e,endpoint:"/organization/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{organization_ids:r}})},eu=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return ec({accessToken:e,endpoint:"/customer/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{end_user_ids:r}})},eh=async e=>{try{let t=u?"".concat(u,"/global/spend"):"/global/spend",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ep=async e=>{try{let t=u?"".concat(u,"/onboarding/get_token"):"/onboarding/get_token";t+="?invite_link=".concat(e);let o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},eg=async(e,t,o,a)=>{let r=u?"".concat(u,"/onboarding/claim_token"):"/onboarding/claim_token";try{let n=await fetch(r,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({invitation_link:t,user_id:o,password:a})});if(!n.ok){let e=await n.json(),t=o6(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to delete key:",e),e}},ef=async(e,t,o)=>{try{let a=u?"".concat(u,"/key/").concat(t,"/regenerate"):"/key/".concat(t,"/regenerate"),r=await fetch(a,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}let n=await r.json();return console.log("Regenerate key Response:",n),n}catch(e){throw console.error("Failed to regenerate key:",e),e}},em=!1,ew=null,ey=async(e,t,o)=>{try{console.log("modelInfoCall:",e,t,o);let a=u?"".concat(u,"/v2/model/info"):"/v2/model/info",r=new URLSearchParams;r.append("include_team_models","true"),r.toString()&&(a+="?".concat(r.toString()));let n=await fetch(a,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw e+="error shown=".concat(em),em||(e.includes("No model list passed")&&(e="No Models Exist. Click Add Model to get started."),c.Z.info(e),em=!0,ew&&clearTimeout(ew),ew=setTimeout(()=>{em=!1},1e4)),Error("Network response was not ok")}let l=await n.json();return console.log("modelInfoCall:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},ej=async(e,t)=>{try{let o=u?"".concat(u,"/v1/model/info"):"/v1/model/info";o+="?litellm_model_id=".concat(t);let a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("modelInfoV1Call:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},e_=async()=>{let e=u?"".concat(u,"/public/model_hub"):"/public/model_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},ev=async()=>{let e=u?"".concat(u,"/public/agent_hub"):"/public/agent_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},eC=async()=>{let e=u?"".concat(u,"/public/mcp_hub"):"/public/mcp_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},ek=async e=>{try{let t=u?"".concat(u,"/model_group/info"):"/model_group/info",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log("modelHubCall:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},eT=async e=>{try{let t=u?"".concat(u,"/get/allowed_ips"):"/get/allowed_ips",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log("getAllowedIPs:",a),a.data}catch(e){throw console.error("Failed to get allowed IPs:",e),e}},eE=async(e,t)=>{try{let o=u?"".concat(u,"/add/allowed_ip"):"/add/allowed_ip",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("addAllowedIP:",r),r}catch(e){throw console.error("Failed to add allowed IP:",e),e}},eS=async(e,t)=>{try{let o=u?"".concat(u,"/delete/allowed_ip"):"/delete/allowed_ip",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("deleteAllowedIP:",r),r}catch(e){throw console.error("Failed to delete allowed IP:",e),e}},eb=async(e,t,o,a,r,n,c,l)=>{try{let t=u?"".concat(u,"/model/metrics"):"/model/metrics";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(c,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},eF=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/model/streaming_metrics"):"/model/streaming_metrics";t&&(r="".concat(r,"?_selected_model_group=").concat(t,"&startTime=").concat(o,"&endTime=").concat(a));let n=await fetch(r,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=o6(e);throw y(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to create key:",e),e}},eP=async(e,t,o,a,r,n,c,l)=>{try{let t=u?"".concat(u,"/model/metrics/slow_responses"):"/model/metrics/slow_responses";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(c,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},eO=async(e,t,o,a,r,n,c,l)=>{try{let t=u?"".concat(u,"/model/metrics/exceptions"):"/model/metrics/exceptions";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(c,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},eB=async(e,t)=>{try{let o=u?"".concat(u,"/model_hub/update_useful_links"):"/model_hub/update_useful_links",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({useful_links:t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},eN=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=(arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6]);console.log("in /models calls, globalLitellmHeaderName",_);try{let t=u?"".concat(u,"/models"):"/models",o=new URLSearchParams;o.append("include_model_access_groups","True"),!0===a&&o.append("return_wildcard_routes","True"),!0===n&&o.append("only_model_access_groups","True"),r&&o.append("team_id",r.toString()),o.toString()&&(t+="?".concat(o.toString()));let c=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.json(),t=o6(e);throw y(t),Error(t)}return await c.json()}catch(e){throw console.error("Failed to create key:",e),e}},ex=async(e,t)=>{try{let o=u?"".concat(u,"/global/spend/logs"):"/global/spend/logs";console.log("in keySpendLogsCall:",o);let a=await fetch("".concat(o,"?api_key=").concat(t),{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},eA=async e=>{try{let t=u?"".concat(u,"/global/spend/teams"):"/global/spend/teams";console.log("in teamSpendLogsCall:",t);let o=await fetch("".concat(t),{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eJ=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/spend/tags"):"/global/spend/tags";t&&o&&(r="".concat(r,"?start_date=").concat(t,"&end_date=").concat(o)),a&&(r+="".concat(r,"&tags=").concat(a.join(","))),console.log("in tagsSpendLogsCall:",r);let n=await fetch("".concat(r),{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=o6(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to create key:",e),e}},eG=async e=>{try{let t=u?"".concat(u,"/global/spend/all_tag_names"):"/global/spend/all_tag_names";console.log("in global/spend/all_tag_names call",t);let o=await fetch("".concat(t),{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eU=async e=>{try{let t=u?"".concat(u,"/customer/list"):"/customer/list";console.log("in customer/list",t);let o=await fetch("".concat(t),{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to fetch end users:",e),e}},eI=async(e,t)=>{try{let o=u?"".concat(u,"/user/filter/ui"):"/user/filter/ui";t.get("user_email")&&(o+="?user_email=".concat(t.get("user_email"))),t.get("user_id")&&(o+="?user_id=".concat(t.get("user_id")));let a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},eR=async(e,t,o,a,r,n)=>{try{console.log("user role in spend logs call: ".concat(o));let t=u?"".concat(u,"/spend/logs"):"/spend/logs";t="App Owner"==o?"".concat(t,"?user_id=").concat(a,"&start_date=").concat(r,"&end_date=").concat(n):"".concat(t,"?start_date=").concat(r,"&end_date=").concat(n);let c=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.json(),t=o6(e);throw y(t),Error(t)}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},eM=async(e,t,o,a,r,n,c,l,i,s,d,h,p)=>{try{let g=u?"".concat(u,"/spend/logs/ui"):"/spend/logs/ui",f=new URLSearchParams;t&&f.append("api_key",t),o&&f.append("team_id",o),a&&f.append("request_id",a),r&&f.append("start_date",r),n&&f.append("end_date",n),c&&f.append("page",c.toString()),l&&f.append("page_size",l.toString()),i&&f.append("user_id",i),s&&f.append("end_user",s),d&&f.append("status_filter",d),h&&f.append("model",h),p&&f.append("key_alias",p);let m=f.toString();m&&(g+="?".concat(m));let w=await fetch(g,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!w.ok){let e=await w.json(),t=o6(e);throw y(t),Error(t)}let j=await w.json();return console.log("Spend Logs Response:",j),j}catch(e){throw console.error("Failed to fetch spend logs:",e),e}},ez=async e=>{try{let t=u?"".concat(u,"/global/spend/logs"):"/global/spend/logs",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eL=async e=>{try{let t=u?"".concat(u,"/global/spend/keys?limit=5"):"/global/spend/keys?limit=5",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eD=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/spend/end_users"):"/global/spend/end_users",n="";n=t?JSON.stringify({api_key:t,startTime:o,endTime:a}):JSON.stringify({startTime:o,endTime:a});let c={method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:n},l=await fetch(r,c);if(!l.ok){let e=await l.json(),t=o6(e);throw y(t),Error(t)}let i=await l.json();return console.log(i),i}catch(e){throw console.error("Failed to create key:",e),e}},eV=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/spend/provider"):"/global/spend/provider";o&&a&&(r+="?start_date=".concat(o,"&end_date=").concat(a)),t&&(r+="&api_key=".concat(t));let n={method:"GET",headers:{[_]:"Bearer ".concat(e)}},c=await fetch(r,n);if(!c.ok){let e=await c.json(),t=o6(e);throw y(t),Error(t)}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eq=async(e,t,o)=>{try{let a=u?"".concat(u,"/global/activity"):"/global/activity";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[_]:"Bearer ".concat(e)}},n=await fetch(a,r);if(!n.ok){let e=await n.json(),t=o6(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eZ=async(e,t,o)=>{try{let a=u?"".concat(u,"/global/activity/cache_hits"):"/global/activity/cache_hits";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[_]:"Bearer ".concat(e)}},n=await fetch(a,r);if(!n.ok){let e=await n.json(),t=o6(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eH=async(e,t,o)=>{try{let a=u?"".concat(u,"/global/activity/model"):"/global/activity/model";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[_]:"Bearer ".concat(e)}},n=await fetch(a,r);if(!n.ok){let e=await n.json(),t=o6(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eW=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/activity/exceptions"):"/global/activity/exceptions";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[_]:"Bearer ".concat(e)}},c=await fetch(r,n);if(!c.ok){let e=await c.json(),t=o6(e);throw y(t),Error(t)}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eY=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/activity/exceptions/deployment"):"/global/activity/exceptions/deployment";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[_]:"Bearer ".concat(e)}},c=await fetch(r,n);if(!c.ok){let e=await c.json(),t=o6(e);throw y(t),Error(t)}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eQ=async e=>{try{let t=u?"".concat(u,"/global/spend/models?limit=5"):"/global/spend/models?limit=5",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eK=async(e,t)=>{try{let o=u?"".concat(u,"/v2/key/info"):"/v2/key/info",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!a.ok){let e=await a.text();if(e.includes("Invalid proxy server token passed"))throw Error("Invalid proxy server token passed");throw y(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},e$=async(e,t,o,a)=>{try{console.log("Sending model connection test request:",JSON.stringify(t));let n=u?"".concat(u,"/health/test_connection"):"/health/test_connection",c=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",[_]:"Bearer ".concat(e)},body:JSON.stringify({litellm_params:t,model_info:o,mode:a})}),l=c.headers.get("content-type");if(!l||!l.includes("application/json")){let e=await c.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(c.status,": ").concat(c.statusText,"). Check network tab for details."))}let i=await c.json();if(!c.ok||"error"===i.status){if("error"===i.status);else{var r;return{status:"error",message:(null===(r=i.error)||void 0===r?void 0:r.message)||"Connection test failed: ".concat(c.status," ").concat(c.statusText)}}}return i}catch(e){throw console.error("Model connection test error:",e),e}},eX=async(e,t)=>{try{console.log("entering keyInfoV1Call");let o=u?"".concat(u,"/key/info"):"/key/info";o="".concat(o,"?key=").concat(t);let a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(console.log("response",a),!a.ok){let e=await a.text();y(e),c.Z.fromBackend("Failed to fetch key info - "+e)}let r=await a.json();return console.log("data",r),r}catch(e){throw console.error("Failed to fetch key info:",e),e}},e0=async function(e,t,o,a,r,n,c,l){let i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,s=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let d=u?"".concat(u,"/key/list"):"/key/list";console.log("in keyListCall");let h=new URLSearchParams;o&&h.append("team_id",o.toString()),t&&h.append("organization_id",t.toString()),a&&h.append("key_alias",a),n&&h.append("key_hash",n),r&&h.append("user_id",r.toString()),c&&h.append("page",c.toString()),l&&h.append("size",l.toString()),i&&h.append("sort_by",i),s&&h.append("sort_order",s),h.append("return_full_object","true"),h.append("include_team_keys","true"),h.append("include_created_by_keys","true");let p=h.toString();p&&(d+="?".concat(p));let g=await fetch(d,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!g.ok){let e=await g.json(),t=o6(e);throw y(t),Error(t)}let f=await g.json();return console.log("/team/list API Response:",f),f}catch(e){throw console.error("Failed to create key:",e),e}},e1=async e=>{try{let t=u?"".concat(u,"/key/aliases"):"/key/aliases";console.log("in keyAliasesCall");let o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log("/key/aliases API Response:",a),a}catch(e){throw console.error("Failed to fetch key aliases:",e),e}},e4=async(e,t)=>{try{let o=u?"".concat(u,"/spend/users"):"/spend/users";console.log("in spendUsersCall:",o);let a=await fetch("".concat(o,"?user_id=").concat(t),{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get spend for user",e),e}},e3=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/user/request_model"):"/user/request_model",n=await fetch(r,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({models:[t],user_id:o,justification:a})});if(!n.ok){let e=await n.json(),t=o6(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to create key:",e),e}},e2=async e=>{try{let t=u?"".concat(u,"/user/get_requests"):"/user/get_requests";console.log("in userGetRequesedtModelsCall:",t);let o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to get requested models:",e),e}},e5=async(e,t,o)=>{try{let a=u?"".concat(u,"/user/daily/activity/aggregated"):"/user/daily/activity/aggregated",r=new URLSearchParams,n=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};r.append("start_date",n(t)),r.append("end_date",n(o));let c=r.toString();c&&(a+="?".concat(c));let l=await fetch(a,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=o6(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch aggregated user daily activity:",e),e}},e9=async(e,t)=>{try{let o=u?"".concat(u,"/user/get_users?role=").concat(t):"/user/get_users?role=".concat(t);console.log("in userGetAllUsersCall:",o);let a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get requested models:",e),e}},e6=async e=>{try{let t=u?"".concat(u,"/user/available_roles"):"/user/available_roles",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log("response from user/available_role",a),a}catch(e){throw e}},e8=async(e,t)=>{try{if(console.log("Form Values in teamCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=u?"".concat(u,"/team/new"):"/team/new",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},e7=async(e,t)=>{try{if(console.log("Form Values in credentialCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=u?"".concat(u,"/credentials"):"/credentials",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},te=async e=>{try{let t=u?"".concat(u,"/credentials"):"/credentials";console.log("in credentialListCall");let o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log("/credentials API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},tt=async(e,t,o)=>{try{let a=u?"".concat(u,"/credentials"):"/credentials";t?a+="/by_name/".concat(t):o&&(a+="/by_model/".concat(o)),console.log("in credentialListCall");let r=await fetch(a,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}let n=await r.json();return console.log("/credentials API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},to=async(e,t)=>{try{let o=u?"".concat(u,"/credentials/").concat(t):"/credentials/".concat(t);console.log("in credentialDeleteCall:",t);let a=await fetch(o,{method:"DELETE",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},ta=async(e,t,o)=>{try{if(console.log("Form Values in credentialUpdateCall:",o),o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let a=u?"".concat(u,"/credentials/").concat(t):"/credentials/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...o})});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},tr=async(e,t)=>{try{if(console.log("Form Values in keyUpdateCall:",t),t.model_tpm_limit){console.log("formValues.model_tpm_limit:",t.model_tpm_limit);try{t.model_tpm_limit=JSON.parse(t.model_tpm_limit)}catch(e){throw Error("Failed to parse model_tpm_limit: "+e)}}if(t.model_rpm_limit){console.log("formValues.model_rpm_limit:",t.model_rpm_limit);try{t.model_rpm_limit=JSON.parse(t.model_rpm_limit)}catch(e){throw Error("Failed to parse model_rpm_limit: "+e)}}let o=u?"".concat(u,"/key/update"):"/key/update",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let r=await a.json();return console.log("Update key Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},tn=async(e,t)=>{try{console.log("Form Values in teamUpateCall:",t);let o=u?"".concat(u,"/team/update"):"/team/update",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),console.error("Error response from the server:",e),c.Z.fromBackend("Failed to update team settings: "+e),Error(e)}let r=await a.json();return console.log("Update Team Response:",r),r}catch(e){throw console.error("Failed to update team:",e),e}},tc=async(e,t,o)=>{try{console.log("Form Values in modelUpateCall:",t);let a=u?"".concat(u,"/model/").concat(o,"/update"):"/model/".concat(o,"/update"),r=await fetch(a,{method:"PATCH",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text();throw y(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("Update model Response:",n),n}catch(e){throw console.error("Failed to update model:",e),e}},tl=async(e,t)=>{try{console.log("Form Values in modelUpateCall:",t);let o=u?"".concat(u,"/model/update"):"/model/update",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update model Response:",r),r}catch(e){throw console.error("Failed to update model:",e),e}},ti=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let r=u?"".concat(u,"/team/member_add"):"/team/member_add",n=await fetch(r,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,member:o})});if(!n.ok){var a;let e=await n.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let c=await n.json();return console.log("API Response:",c),c}catch(e){throw console.error("Failed to create key:",e),e}},ts=async(e,t,o,a,r)=>{try{console.log("Bulk add team members:",{teamId:t,members:o,maxBudgetInTeam:a});let c=u?"".concat(u,"/team/bulk_member_add"):"/team/bulk_member_add",l={team_id:t};r?l.all_users=!0:l.members=o,null!=a&&(l.max_budget_in_team=a);let i=await fetch(c,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(l)});if(!i.ok){var n;let e=await i.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(n=t.detail)||void 0===n?void 0:n.error)||"Failed to bulk add team members",a=Error(o);throw a.raw=t,a}let s=await i.json();return console.log("Bulk team member add API Response:",s),s}catch(e){throw console.error("Failed to bulk add team members:",e),e}},td=async(e,t,o)=>{try{console.log("Form Values in teamMemberUpdateCall:",o),console.log("Budget value:",o.max_budget_in_team),console.log("TPM limit:",o.tpm_limit),console.log("RPM limit:",o.rpm_limit);let r=u?"".concat(u,"/team/member_update"):"/team/member_update",n={team_id:t,role:o.role,user_id:o.user_id};void 0!==o.user_email&&(n.user_email=o.user_email),void 0!==o.max_budget_in_team&&null!==o.max_budget_in_team&&(n.max_budget_in_team=o.max_budget_in_team),void 0!==o.tpm_limit&&null!==o.tpm_limit&&(n.tpm_limit=o.tpm_limit),void 0!==o.rpm_limit&&null!==o.rpm_limit&&(n.rpm_limit=o.rpm_limit),console.log("Final request body:",n);let c=await fetch(r,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(n)});if(!c.ok){var a;let e=await c.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let l=await c.json();return console.log("API Response:",l),l}catch(e){throw console.error("Failed to update team member:",e),e}},tu=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=u?"".concat(u,"/team/member_delete"):"/team/member_delete",r=await fetch(a,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,...void 0!==o.user_email&&{user_email:o.user_email},...void 0!==o.user_id&&{user_id:o.user_id}})});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},th=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=u?"".concat(u,"/organization/member_add"):"/organization/member_add",r=await fetch(a,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,member:o})});if(!r.ok){let e=await r.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create organization member:",e),e}},tp=async(e,t,o)=>{try{console.log("Form Values in organizationMemberDeleteCall:",o);let a=u?"".concat(u,"/organization/member_delete"):"/organization/member_delete",r=await fetch(a,{method:"DELETE",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,user_id:o})});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to delete organization member:",e),e}},tg=async(e,t,o)=>{try{console.log("Form Values in organizationMemberUpdateCall:",o);let a=u?"".concat(u,"/organization/member_update"):"/organization/member_update",r=await fetch(a,{method:"PATCH",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,...o})});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to update organization member:",e),e}},tf=async(e,t,o)=>{try{console.log("Form Values in userUpdateUserCall:",t);let a=u?"".concat(u,"/user/update"):"/user/update",r={...t};null!==o&&(r.user_role=o),r=JSON.stringify(r);let n=await fetch(a,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!n.ok){let e=await n.json(),t=o6(e);throw y(t),Error(t)}let c=await n.json();return console.log("API Response:",c),c}catch(e){throw console.error("Failed to create key:",e),e}},tm=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{let r;console.log("Form Values in userUpdateUserCall:",t);let n=u?"".concat(u,"/user/bulk_update"):"/user/bulk_update";if(a)r=JSON.stringify({all_users:!0,user_updates:t});else if(o&&o.length>0){let e=[];for(let a of o)e.push({user_id:a,...t});r=JSON.stringify({users:e})}else throw Error("Must provide either userIds or set allUsers=true");let c=await fetch(n,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!c.ok){let e=await c.json(),t=o6(e);throw y(t),Error(t)}let l=await c.json();return console.log("API Response:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},tw=async(e,t)=>{try{let o=u?"".concat(u,"/global/predict/spend/logs"):"/global/predict/spend/logs",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({data:t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},ty=async e=>{try{let t=u?"".concat(u,"/health/services?service=slack_budget_alerts"):"/health/services?service=slack_budget_alerts";console.log("Checking Slack Budget Alerts service health");let o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error(e)}let a=await o.json();return c.Z.success("Test Slack Alert worked - check your Slack!"),console.log("Service Health Response:",a),a}catch(e){throw console.error("Failed to perform health check:",e),e}},tj=async(e,t)=>{try{let o=u?"".concat(u,"/health/services?service=").concat(t):"/health/services?service=".concat(t);console.log("Checking Slack Budget Alerts service health");let a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error(e)}return await a.json()}catch(e){throw console.error("Failed to perform health check:",e),e}},t_=async e=>{try{let t=u?"".concat(u,"/budget/list"):"/budget/list",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tv=async e=>{try{let t=u?"".concat(u,"/budget/settings"):"/budget/settings",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tC=async(e,t,o)=>{try{let t=u?"".concat(u,"/get/config/callbacks"):"/get/config/callbacks",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tk=async e=>{try{let t=u?"".concat(u,"/config/list?config_type=general_settings"):"/config/list?config_type=general_settings",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tT=async e=>{try{let t=u?"".concat(u,"/router/settings"):"/router/settings",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get router settings:",e),e}},tE=async e=>{try{let t=u?"".concat(u,"/cache/settings"):"/cache/settings",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get cache settings:",e),e}},tS=async(e,t)=>{try{let o=u?"".concat(u,"/cache/settings/test"):"/cache/settings/test",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({cache_settings:t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to test cache connection:",e),e}},tb=async(e,t)=>{try{let o=u?"".concat(u,"/cache/settings"):"/cache/settings",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({cache_settings:t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to update cache settings:",e),e}},tF=async(e,t)=>{try{let o=u?"".concat(u,"/config/pass_through_endpoint"):"/config/pass_through_endpoint";t&&(o+="/team/".concat(t));let a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tP=async(e,t)=>{try{let o=u?"".concat(u,"/config/field/info?field_name=").concat(t):"/config/field/info?field_name=".concat(t),a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tO=async(e,t,o)=>{try{let a=u?"".concat(u,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",r=await fetch(a,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o})});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}let n=await r.json();return c.Z.success("Successfully updated value!"),n}catch(e){throw console.error("Failed to set callbacks:",e),e}},tB=async(e,t)=>{try{let o=u?"".concat(u,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tN=async(e,t,o)=>{try{let a=u?"".concat(u,"/config/field/update"):"/config/field/update",r=await fetch(a,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o,config_type:"general_settings"})});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}let n=await r.json();return c.Z.success("Successfully updated value!"),n}catch(e){throw console.error("Failed to set callbacks:",e),e}},tx=async(e,t)=>{try{let o=u?"".concat(u,"/config/field/delete"):"/config/field/delete",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,config_type:"general_settings"})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return c.Z.success("Field reset on proxy"),r}catch(e){throw console.error("Failed to get callbacks:",e),e}},tA=async(e,t)=>{try{let o=u?"".concat(u,"/config/pass_through_endpoint?endpoint_id=").concat(t):"/config/pass_through_endpoint?endpoint_id=".concat(t),a=await fetch(o,{method:"DELETE",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tJ=async(e,t)=>{try{let o=u?"".concat(u,"/config/update"):"/config/update",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tG=async e=>{try{let t=u?"".concat(u,"/health"):"/health",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to call /health:",e),e}},tU=async(e,t)=>{try{let o=u?"".concat(u,"/health?model=").concat(encodeURIComponent(t)):"/health?model=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to call /health for model ".concat(t,":"),e),e}},tI=async e=>{try{let t=u?"".concat(u,"/cache/ping"):"/cache/ping",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /cache/ping:",e),e}},tR=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;try{let n=u?"".concat(u,"/health/history"):"/health/history",c=new URLSearchParams;t&&c.append("model",t),o&&c.append("status_filter",o),c.append("limit",a.toString()),c.append("offset",r.toString()),c.toString()&&(n+="?".concat(c.toString()));let l=await fetch(n,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw y(e),Error(e)}return await l.json()}catch(e){throw console.error("Failed to call /health/history:",e),e}},tM=async e=>{try{let t=u?"".concat(u,"/health/latest"):"/health/latest",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /health/latest:",e),e}},tz=async e=>{try{console.log("Getting proxy UI settings"),console.log("proxyBaseUrl in getProxyUISettings:",u);let t=u?"".concat(u,"/sso/get/ui_settings"):"/sso/get/ui_settings",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tL=async e=>{try{let t=u?"".concat(u,"/v2/guardrails/list"):"/v2/guardrails/list",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get guardrails list:",e),e}},tD=async e=>{try{let t=u?"".concat(u,"/prompts/list"):"/prompts/list",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get prompts list:",e),e}},tV=async(e,t)=>{try{let o=u?"".concat(u,"/prompts/").concat(t,"/info"):"/prompts/".concat(t,"/info"),a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to get prompt info:",e),e}},tq=async(e,t)=>{try{let o=u?"".concat(u,"/prompts/").concat(t,"/versions"):"/prompts/".concat(t,"/versions"),a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw 404!==a.status&&y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to get prompt versions:",e),e}},tZ=async(e,t)=>{try{let o=u?"".concat(u,"/prompts"):"/prompts",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create prompt:",e),e}},tH=async(e,t,o)=>{try{let a=u?"".concat(u,"/prompts/").concat(t):"/prompts/".concat(t),r=await fetch(a,{method:"PUT",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to update prompt:",e),e}},tW=async(e,t)=>{try{let o=u?"".concat(u,"/prompts/").concat(t):"/prompts/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to delete prompt:",e),e}},tY=async(e,t)=>{try{let o=new FormData;o.append("file",t);let a=u?"".concat(u,"/utils/dotprompt_json_converter"):"/utils/dotprompt_json_converter",r=await fetch(a,{method:"POST",headers:{[_]:"Bearer ".concat(e)},body:o});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to convert prompt file:",e),e}},tQ=async(e,t,o)=>{try{let a=u?"".concat(u,"/prompts/").concat(t):"/prompts/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to patch prompt:",e),e}},tK=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents"):"/v1/agents",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Create agent response:",r),r}catch(e){throw console.error("Failed to create agent:",e),e}},t$=async(e,t)=>{try{let o=u?"".concat(u,"/guardrails"):"/guardrails",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({guardrail:t})});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Create guardrail response:",r),r}catch(e){throw console.error("Failed to create guardrail:",e),e}},tX=async(e,t,o)=>{try{let a=u?"".concat(u,"/spend/logs/ui/").concat(t,"?start_date=").concat(encodeURIComponent(o)):"/spend/logs/ui/".concat(t,"?start_date=").concat(encodeURIComponent(o));console.log("Fetching log details from:",a);let r=await fetch(a,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}let n=await r.json();return console.log("Fetched log details:",n),n}catch(e){throw console.error("Failed to fetch log details:",e),e}},t0=async e=>{try{let t=u?"".concat(u,"/get/internal_user_settings"):"/get/internal_user_settings";console.log("Fetching SSO settings from:",t);let o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched SSO settings:",a),a}catch(e){throw console.error("Failed to fetch SSO settings:",e),e}},t1=async(e,t)=>{try{let o=u?"".concat(u,"/update/internal_user_settings"):"/update/internal_user_settings";console.log("Updating internal user settings:",t);let a=await fetch(o,{method:"PATCH",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Updated internal user settings:",r),c.Z.success("Internal user settings updated successfully"),r}catch(e){throw console.error("Failed to update internal user settings:",e),e}},t4=async e=>{try{let t=u?"".concat(u,"/v1/mcp/server"):"/v1/mcp/server";console.log("Fetching MCP servers from:",t);let o=await fetch(t,{method:f.GET,headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched MCP servers:",a),a}catch(e){throw console.error("Failed to fetch MCP servers:",e),e}},t3=async e=>{try{let t=u?"".concat(u,"/v1/mcp/access_groups"):"/v1/mcp/access_groups";console.log("Fetching MCP access groups from:",t);let o=await fetch(t,{method:f.GET,headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched MCP access groups:",a),a.access_groups||[]}catch(e){throw console.error("Failed to fetch MCP access groups:",e),e}},t2=async(e,t)=>{try{console.log("Form Values in createMCPServer:",t);let o=u?"".concat(u,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},t5=async(e,t)=>{try{let o=u?"".concat(u,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"PUT",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to update MCP server:",e),e}},t9=async(e,t)=>{try{let o=(u?"".concat(u):"")+"/v1/mcp/server/".concat(t);console.log("in deleteMCPServer:",t);let a=await fetch(o,{method:f.DELETE,headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}}catch(e){throw console.error("Failed to delete key:",e),e}},t6=async e=>{try{let t=u?"".concat(u,"/search_tools/list"):"/search_tools/list";console.log("Fetching search tools from:",t);let o=await fetch(t,{method:f.GET,headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched search tools:",a),a}catch(e){throw console.error("Failed to fetch search tools:",e),e}},t8=async(e,t)=>{try{let o=u?"".concat(u,"/search_tools/").concat(t):"/search_tools/".concat(t);console.log("Fetching search tool by ID from:",o);let a=await fetch(o,{method:f.GET,headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("Fetched search tool:",r),r}catch(e){throw console.error("Failed to fetch search tool:",e),e}},t7=async(e,t)=>{try{console.log("Creating search tool with values:",t);let o=u?"".concat(u,"/search_tools"):"/search_tools",a=await fetch(o,{method:f.POST,headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({search_tool:t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("Created search tool:",r),r}catch(e){throw console.error("Failed to create search tool:",e),e}},oe=async(e,t,o)=>{try{console.log("Updating search tool with ID:",t,"values:",o);let a=u?"".concat(u,"/search_tools/").concat(t):"/search_tools/".concat(t),r=await fetch(a,{method:f.PUT,headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({search_tool:o})});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}let n=await r.json();return console.log("Updated search tool:",n),n}catch(e){throw console.error("Failed to update search tool:",e),e}},ot=async(e,t)=>{try{let o=(u?"".concat(u):"")+"/search_tools/".concat(t);console.log("Deleting search tool:",t);let a=await fetch(o,{method:f.DELETE,headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("Deleted search tool:",r),r}catch(e){throw console.error("Failed to delete search tool:",e),e}},oo=async e=>{try{let t=u?"".concat(u,"/search_tools/ui/available_providers"):"/search_tools/ui/available_providers";console.log("Fetching available search providers from:",t);let o=await fetch(t,{method:f.GET,headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched available search providers:",a),a}catch(e){throw console.error("Failed to fetch available search providers:",e),e}},oa=async(e,t)=>{try{let o=u?"".concat(u,"/search_tools/test_connection"):"/search_tools/test_connection";console.log("Testing search tool connection:",o);let a=await fetch(o,{method:f.POST,headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({litellm_params:t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("Test connection response:",r),r}catch(e){throw console.error("Failed to test search tool connection:",e),e}},or=async(e,t)=>{try{let o=u?"".concat(u,"/mcp-rest/tools/list?server_id=").concat(t):"/mcp-rest/tools/list?server_id=".concat(t);console.log("Fetching MCP tools from:",o);let a={[_]:"Bearer ".concat(e),"Content-Type":"application/json"},r=await fetch(o,{method:"GET",headers:a}),n=await r.json();if(console.log("Fetched MCP tools response:",n),!r.ok){if(n.error&&n.message)throw Error(n.message);throw Error("Failed to fetch MCP tools")}return n}catch(e){return console.error("Failed to fetch MCP tools:",e),{tools:[],error:"network_error",message:e instanceof Error?e.message:"Failed to fetch MCP tools",stack_trace:null}}},on=async(e,t,o)=>{try{let a=u?"".concat(u,"/mcp-rest/tools/call"):"/mcp-rest/tools/call";console.log("Calling MCP tool:",t,"with arguments:",o);let r={[_]:"Bearer ".concat(e),"Content-Type":"application/json"},n=await fetch(a,{method:"POST",headers:r,body:JSON.stringify({name:t,arguments:o})});if(!n.ok){let e="Network response was not ok",t=null,o=await n.text();try{let a=JSON.parse(o);a.detail?"string"==typeof a.detail?e=a.detail:"object"==typeof a.detail&&(e=a.detail.message||a.detail.error||"An error occurred",t=a.detail):e=a.message||a.error||e}catch(t){console.error("Failed to parse JSON error response:",t),o&&(e=o)}let a=Error(e);throw a.status=n.status,a.statusText=n.statusText,a.details=t,y(e),a}let c=await n.json();return console.log("MCP tool call response:",c),c}catch(e){throw console.error("Failed to call MCP tool:",e),console.error("Error type:",typeof e),e instanceof Error&&(console.error("Error message:",e.message),console.error("Error stack:",e.stack)),e}},oc=async(e,t)=>{try{let o=u?"".concat(u,"/tag/new"):"/tag/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await y(e);return}return await a.json()}catch(e){throw console.error("Error creating tag:",e),e}},ol=async(e,t)=>{try{let o=u?"".concat(u,"/tag/update"):"/tag/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await y(e);return}return await a.json()}catch(e){throw console.error("Error updating tag:",e),e}},oi=async(e,t)=>{try{let o=u?"".concat(u,"/tag/info"):"/tag/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({names:t})});if(!a.ok){let e=await a.text();return await y(e),{}}return await a.json()}catch(e){throw console.error("Error getting tag info:",e),e}},os=async e=>{try{let t=u?"".concat(u,"/tag/list"):"/tag/list",o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.text();return await y(e),{}}return await o.json()}catch(e){throw console.error("Error listing tags:",e),e}},od=async(e,t)=>{try{let o=u?"".concat(u,"/tag/delete"):"/tag/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({name:t})});if(!a.ok){let e=await a.text();await y(e);return}return await a.json()}catch(e){throw console.error("Error deleting tag:",e),e}},ou=async e=>{try{let t=u?"".concat(u,"/get/default_team_settings"):"/get/default_team_settings";console.log("Fetching default team settings from:",t);let o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched default team settings:",a),a}catch(e){throw console.error("Failed to fetch default team settings:",e),e}},oh=async(e,t)=>{try{let o=u?"".concat(u,"/update/default_team_settings"):"/update/default_team_settings";console.log("Updating default team settings:",t);let a=await fetch(o,{method:"PATCH",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("Updated default team settings:",r),c.Z.success("Default team settings updated successfully"),r}catch(e){throw console.error("Failed to update default team settings:",e),e}},op=async(e,t)=>{try{let o=u?"".concat(u,"/team/permissions_list?team_id=").concat(t):"/team/permissions_list?team_id=".concat(t),a=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=await a.json();return console.log("Team permissions response:",r),r}catch(e){throw console.error("Failed to get team permissions:",e),e}},og=async(e,t,o)=>{try{let a=u?"".concat(u,"/team/permissions_update"):"/team/permissions_update",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({team_id:t,team_member_permissions:o})});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}let n=await r.json();return console.log("Team permissions response:",n),n}catch(e){throw console.error("Failed to update team permissions:",e),e}},of=async(e,t)=>{try{let o=u?"".concat(u,"/spend/logs/session/ui?session_id=").concat(encodeURIComponent(t)):"/spend/logs/session/ui?session_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to fetch session logs:",e),e}},om=async(e,t)=>{try{let o=u?"".concat(u,"/vector_store/new"):"/vector_store/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to create vector store")}return await a.json()}catch(e){throw console.error("Error creating vector store:",e),e}},ow=async function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let t=u?"".concat(u,"/vector_store/list"):"/vector_store/list",o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.json();throw Error(e.detail||"Failed to list vector stores")}return await o.json()}catch(e){throw console.error("Error listing vector stores:",e),e}},oy=async(e,t)=>{try{let o=u?"".concat(u,"/vector_store/delete"):"/vector_store/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to delete vector store")}return await a.json()}catch(e){throw console.error("Error deleting vector store:",e),e}},oj=async(e,t)=>{try{let o=u?"".concat(u,"/vector_store/info"):"/vector_store/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to get vector store info")}return await a.json()}catch(e){throw console.error("Error getting vector store info:",e),e}},o_=async(e,t)=>{try{let o=u?"".concat(u,"/vector_store/update"):"/vector_store/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to update vector store")}return await a.json()}catch(e){throw console.error("Error updating vector store:",e),e}},ov=async e=>{try{let t=u?"".concat(u,"/email/event_settings"):"/email/event_settings",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to get email event settings")}let a=await o.json();return console.log("Email event settings response:",a),a}catch(e){throw console.error("Failed to get email event settings:",e),e}},oC=async(e,t)=>{try{let o=u?"".concat(u,"/email/event_settings"):"/email/event_settings",a=await fetch(o,{method:"PATCH",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw y(e),Error("Failed to update email event settings")}let r=await a.json();return console.log("Update email event settings response:",r),r}catch(e){throw console.error("Failed to update email event settings:",e),e}},ok=async e=>{try{let t=u?"".concat(u,"/email/event_settings/reset"):"/email/event_settings/reset",o=await fetch(t,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to reset email event settings")}let a=await o.json();return console.log("Reset email event settings response:",a),a}catch(e){throw console.error("Failed to reset email event settings:",e),e}},oT=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents/").concat(t):"/v1/agents/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Delete agent response:",r),r}catch(e){throw console.error("Failed to delete agent:",e),e}},oE=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents/").concat(t,"/make_public"):"/v1/agents/".concat(t,"/make_public"),a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Make agent public response:",r),r}catch(e){throw console.error("Failed to make agent public:",e),e}},oS=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents/make_public"):"/v1/agents/make_public",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({agent_ids:t})});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Make agents public response:",r),r}catch(e){throw console.error("Failed to make agents public:",e),e}},ob=async(e,t)=>{try{let o=u?"".concat(u,"/v1/mcp/make_public"):"/v1/mcp/make_public",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({mcp_server_ids:t})});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Make agents public response:",r),r}catch(e){throw console.error("Failed to make agents public:",e),e}},oF=async(e,t)=>{try{let o=u?"".concat(u,"/guardrails/").concat(t):"/guardrails/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Delete guardrail response:",r),r}catch(e){throw console.error("Failed to delete guardrail:",e),e}},oP=async e=>{try{let t=u?"".concat(u,"/guardrails/ui/add_guardrail_settings"):"/guardrails/ui/add_guardrail_settings",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to get guardrail UI settings")}let a=await o.json();return console.log("Guardrail UI settings response:",a),a}catch(e){throw console.error("Failed to get guardrail UI settings:",e),e}},oO=async e=>{try{let t=u?"".concat(u,"/guardrails/ui/provider_specific_params"):"/guardrails/ui/provider_specific_params",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to get guardrail provider specific parameters")}let a=await o.json();return console.log("Guardrail provider specific params response:",a),a}catch(e){throw console.error("Failed to get guardrail provider specific parameters:",e),e}},oB=async e=>{try{let t=u?"".concat(u,"/v1/agents"):"/v1/agents",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to get agents list")}let a=await o.json();return console.log("Agents list response:",a),{agents:a}}catch(e){throw console.error("Failed to get agents list:",e),e}},oN=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents/").concat(t):"/v1/agents/".concat(t),a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error("Failed to get agent info")}let r=await a.json();return console.log("Agent info response:",r),r}catch(e){throw console.error("Failed to get agent info:",e),e}},ox=async(e,t)=>{try{let o=u?"".concat(u,"/guardrails/").concat(t,"/info"):"/guardrails/".concat(t,"/info"),a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error("Failed to get guardrail info")}let r=await a.json();return console.log("Guardrail info response:",r),r}catch(e){throw console.error("Failed to get guardrail info:",e),e}},oA=async(e,t,o)=>{try{let a=u?"".concat(u,"/v1/agents/").concat(t):"/v1/agents/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw y(e),Error("Failed to patch agent")}let n=await r.json();return console.log("Patch agent response:",n),n}catch(e){throw console.error("Failed to update guardrail:",e),e}},oJ=async(e,t,o)=>{try{let a=u?"".concat(u,"/guardrails/").concat(t):"/guardrails/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw y(e),Error("Failed to update guardrail")}let n=await r.json();return console.log("Update guardrail response:",n),n}catch(e){throw console.error("Failed to update guardrail:",e),e}},oG=async(e,t,o,a,r)=>{try{let c=u?"".concat(u,"/guardrails/apply_guardrail"):"/guardrails/apply_guardrail",l={guardrail_name:t,text:o};a&&(l.language=a),r&&r.length>0&&(l.entities=r);let i=await fetch(c,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(l)});if(!i.ok){let e=await i.text(),t="Failed to apply guardrail";try{var n;let o=JSON.parse(e);(null===(n=o.error)||void 0===n?void 0:n.message)?t=o.error.message:o.detail?t=o.detail:o.message&&(t=o.message)}catch(o){t=e||t}throw y(e),Error(t)}let s=await i.json();return console.log("Apply guardrail response:",s),s}catch(e){throw console.error("Failed to apply guardrail:",e),e}},oU=async(e,t)=>{try{let o=u?"".concat(u,"/guardrails/validate_blocked_words_file"):"/guardrails/validate_blocked_words_file",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({file_content:t})});if(!a.ok){let e=await a.text();throw y(e),Error("Failed to validate blocked words file")}let r=await a.json();return console.log("Validate blocked words file response:",r),r}catch(e){throw console.error("Failed to validate blocked words file:",e),e}},oI=async e=>{try{let t=u?"".concat(u,"/get/sso_settings"):"/get/sso_settings";console.log("Fetching SSO configuration from:",t);let o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched SSO configuration:",a),a}catch(e){throw console.error("Failed to fetch SSO configuration:",e),e}},oR=async(e,t)=>{try{let r=u?"".concat(u,"/update/sso_settings"):"/update/sso_settings";console.log("Updating SSO configuration:",t);let n=await fetch(r,{method:"PATCH",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){var o,a;let e=await n.json(),t="object"==typeof(null==e?void 0:e.detail)?(null===(o=e.detail)||void 0===o?void 0:o.error)||(null===(a=e.detail)||void 0===a?void 0:a.message):null==e?void 0:e.detail,r="string"==typeof t&&t.length>0?t:o6(e);y(r);let c=Error(r);throw(null==e?void 0:e.detail)!==void 0&&(c.detail=e.detail),c.rawError=e,c}let c=await n.json();return console.log("Updated SSO configuration:",c),c}catch(e){throw console.error("Failed to update SSO configuration:",e),e}},oM=async(e,t,o,a,r)=>{try{let t=u?"".concat(u,"/audit"):"/audit",o=new URLSearchParams;a&&o.append("page",a.toString()),r&&o.append("page_size",r.toString());let n=o.toString();n&&(t+="?".concat(n));let c=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.json(),t=o6(e);throw y(t),Error(t)}return await c.json()}catch(e){throw console.error("Failed to fetch audit logs:",e),e}},oz=async e=>{try{let t=u?"".concat(u,"/user/available_users"):"/user/available_users",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e)}});if(!o.ok){if(404===o.status)return null;let e=await o.text();throw y(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to fetch remaining users:",e),e}},oL=async(e,t,o)=>{try{let a=u?"".concat(u,"/config/pass_through_endpoint/").concat(encodeURIComponent(t)):"/config/pass_through_endpoint/".concat(encodeURIComponent(t)),r=await fetch(a,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.json(),t=o6(e);throw y(t),Error(t)}let n=await r.json();return c.Z.success("Pass through endpoint updated successfully"),n}catch(e){throw console.error("Failed to update pass through endpoint:",e),e}},oD=async(e,t)=>{try{let o=u?"".concat(u,"/config/pass_through_endpoint?endpoint_id=").concat(encodeURIComponent(t)):"/config/pass_through_endpoint?endpoint_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}let r=(await a.json()).endpoints;if(!r||0===r.length)throw Error("Pass through endpoint not found");return r[0]}catch(e){throw console.error("Failed to get pass through endpoint info:",e),e}},oV=async(e,t)=>{try{let o=u?"".concat(u,"/config/callback/delete"):"/config/callback/delete",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({callback_name:t})});if(!a.ok){let e=await a.json(),t=o6(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to delete specific callback:",e),e}},oq=async e=>{let t=g(),o=await fetch("".concat(t,"/v1/mcp/tools"),{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw Error("HTTP error! status: ".concat(o.status));return await o.json()},oZ=async(e,t)=>{try{console.log("Testing MCP connection with config:",JSON.stringify(t));let a=u?"".concat(u,"/mcp-rest/test/connection"):"/mcp-rest/test/connection",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",[_]:"Bearer ".concat(e)},body:JSON.stringify(t)}),n=r.headers.get("content-type");if(!n||!n.includes("application/json")){let e=await r.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(r.status,": ").concat(r.statusText,"). Check network tab for details."))}let c=await r.json();if(!r.ok||"error"===c.status){if("error"===c.status);else{var o;return{status:"error",message:(null===(o=c.error)||void 0===o?void 0:o.message)||"MCP connection test failed: ".concat(r.status," ").concat(r.statusText)}}}return c}catch(e){throw console.error("MCP connection test error:",e),e}},oH=async(e,t,o)=>{try{console.log("Testing MCP tools list with config:",JSON.stringify(t));let a=u?"".concat(u,"/mcp-rest/test/tools/list"):"/mcp-rest/test/tools/list",r={"Content-Type":"application/json"};e&&(r["x-litellm-api-key"]=e),o?r.Authorization="Bearer ".concat(o):e&&(r[_]="Bearer ".concat(e));let n=await fetch(a,{method:"POST",headers:r,body:JSON.stringify(t)}),c=n.headers.get("content-type");if(!c||!c.includes("application/json")){let e=await n.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(n.status,": ").concat(n.statusText,"). Check network tab for details."))}let l=await n.json();if((!n.ok||l.error)&&!l.error)return{tools:[],error:"request_failed",message:l.message||"MCP tools list failed: ".concat(n.status," ").concat(n.statusText)};return l}catch(e){throw console.error("MCP tools list test error:",e),e}},oW=async(e,t)=>{let o=u?"".concat(u,"/v1/mcp/server/oauth/session"):"/v1/mcp/server/oauth/session",a=await fetch(o,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await a.json();if(!a.ok)throw Error(o6(r)||(null==r?void 0:r.error)||"Failed to cache MCP server");return r},oY=async(e,t,o)=>{let a=g(),r=encodeURIComponent(t.trim()),n="".concat(a,"/v1/mcp/server/oauth/").concat(r,"/register"),c=await fetch(n,{method:"POST",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json",Accept:"application/json, text/event-stream"},body:JSON.stringify(o)}),l=await c.json();if(!c.ok)throw Error(o6(l)||(null==l?void 0:l.detail)||"Failed to register OAuth client");return l},oQ=e=>{let{serverId:t,clientId:o,redirectUri:a,state:r,codeChallenge:n,scope:c}=e,l=g(),i=encodeURIComponent(t.trim()),s="".concat(l,"/v1/mcp/server/oauth/").concat(i,"/authorize"),d=new URLSearchParams({redirect_uri:a,state:r,response_type:"code",code_challenge:n,code_challenge_method:"S256"});return o&&o.trim().length>0&&d.set("client_id",o),c&&c.trim().length>0&&d.set("scope",c),"".concat(s,"?").concat(d.toString())},oK=async e=>{let{serverId:t,code:o,clientId:a,clientSecret:r,codeVerifier:n,redirectUri:c}=e,l=g(),i=encodeURIComponent(t.trim()),s="".concat(l,"/v1/mcp/server/oauth/").concat(i,"/token"),d=new URLSearchParams;d.set("grant_type","authorization_code"),d.set("code",o),a&&a.trim().length>0&&d.set("client_id",a),r&&r.trim().length>0&&d.set("client_secret",r),d.set("code_verifier",n),d.set("redirect_uri",c);let u=await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:d.toString()}),h=await u.json();if(!u.ok)throw Error(o6(h)||(null==h?void 0:h.detail)||"OAuth token exchange failed");return h},o$=async(e,t,o)=>{try{let a="".concat(g(),"/v1/vector_stores/").concat(t,"/search"),r=await fetch(a,{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({query:o})});if(!r.ok){let e=await r.text();return await y(e),null}return await r.json()}catch(e){throw console.error("Error testing vector store search:",e),e}},oX=async(e,t,o,a)=>{try{let r="".concat(g(),"/v1/search/").concat(t),n=await fetch(r,{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({query:o,max_results:a||5})});if(!n.ok){let e=await n.text();return await y(e),null}return await n.json()}catch(e){throw console.error("Error querying search tool:",e),e}},o0=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:50,n=arguments.length>5?arguments[5]:void 0;try{let c=u?"".concat(u,"/tag/user-agent/analytics"):"/tag/user-agent/analytics",l=new URLSearchParams,i=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};l.append("start_date",i(t)),l.append("end_date",i(o)),l.append("page",a.toString()),l.append("page_size",r.toString()),n&&l.append("user_agent_filter",n);let s=l.toString();s&&(c+="?".concat(s));let d=await fetch(c,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!d.ok){let e=await d.json(),t=o6(e);throw y(t),Error(t)}return await d.json()}catch(e){throw console.error("Failed to fetch user agent analytics:",e),e}},o1=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/tag/dau"):"/tag/dau",n=new URLSearchParams;n.append("end_date",(e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)})(t)),a&&a.length>0?a.forEach(e=>{n.append("tag_filters",e)}):o&&n.append("tag_filter",o);let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=o6(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch DAU:",e),e}},o4=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/tag/wau"):"/tag/wau",n=new URLSearchParams;n.append("end_date",(e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)})(t)),a&&a.length>0?a.forEach(e=>{n.append("tag_filters",e)}):o&&n.append("tag_filter",o);let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=o6(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch WAU:",e),e}},o3=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/tag/mau"):"/tag/mau",n=new URLSearchParams;n.append("end_date",(e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)})(t)),a&&a.length>0?a.forEach(e=>{n.append("tag_filters",e)}):o&&n.append("tag_filter",o);let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=o6(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch MAU:",e),e}},o2=async e=>{try{let t=u?"".concat(u,"/tag/distinct"):"/tag/distinct",o=await fetch(t,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o6(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to fetch distinct tags:",e),e}},o5=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/tag/summary"):"/tag/summary",n=new URLSearchParams,c=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};n.append("start_date",c(t)),n.append("end_date",c(o)),a&&a.length>0&&a.forEach(e=>{n.append("tag_filters",e)});let l=n.toString();l&&(r+="?".concat(l));let i=await fetch(r,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=o6(e);throw y(t),Error(t)}return await i.json()}catch(e){throw console.error("Failed to fetch user agent summary:",e),e}},o9=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,a=arguments.length>3?arguments[3]:void 0;try{let r=u?"".concat(u,"/tag/user-agent/per-user-analytics"):"/tag/user-agent/per-user-analytics",n=new URLSearchParams;n.append("page",t.toString()),n.append("page_size",o.toString()),a&&a.length>0&&a.forEach(e=>{n.append("tag_filters",e)});let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[_]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=o6(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch per-user analytics:",e),e}},o6=e=>(null==e?void 0:e.error)&&(e.error.message||e.error)||(null==e?void 0:e.message)||(null==e?void 0:e.detail)||(null==e?void 0:e.error)||JSON.stringify(e),o8=async(e,t)=>{let o=g(),a=JSON.stringify({username:e,password:t}),r=await fetch(o?"".concat(o,"/v2/login"):"/v2/login",{method:"POST",body:a,credentials:"include",headers:{"Content-Type":"application/json"}});if(!r.ok)throw Error(o6(await r.json()));return await r.json()}},85968:function(e,t,o){o.d(t,{O:function(){return a}});let a=e=>{if(!e)return"An unknown error occurred";if("string"==typeof e)return e;if(e.message)try{let t=JSON.parse(e.message);if(t.error&&t.error.message)return t.error.message;return"string"==typeof t?t:JSON.stringify(t,null,2)}catch(t){return e.message}if(e.response&&e.response.data){if("string"==typeof e.response.data)return e.response.data;if(e.response.data.message)return e.response.data.message;if(e.response.data.error)return"string"==typeof e.response.data.error?e.response.data.error:e.response.data.error.message||JSON.stringify(e.response.data.error)}return String(e)}},3914:function(e,t,o){function a(){if("undefined"==typeof document)return;let e=window.location.hostname,t=window.location.pathname,o=["/","/ui"];if(t&&"/"!==t&&!t.startsWith("/ui")){let e=t.substring(0,t.lastIndexOf("/")+1);e&&!o.includes(e)&&o.push(e)}let a=["Lax","Strict","None"];o.forEach(t=>{document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(t,";"),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(t,"; domain=").concat(e,";"),a.forEach(o=>{let a="None"===o?" Secure;":"";document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(t,"; SameSite=").concat(o,";").concat(a),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(t,"; domain=").concat(e,"; SameSite=").concat(o,";").concat(a)})}),console.log("After clearing cookies:",document.cookie)}function r(e){if("undefined"==typeof document)return null;let t=document.cookie.split("; ").find(t=>t.startsWith(e+"="));return t?t.split("=")[1]:null}o.d(t,{b:function(){return a},e:function(){return r}})},9309:function(e,t,o){o.d(t,{Ac:function(){return n},N4:function(){return a},aS:function(){return r}});let a=e=>e?e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()):e;function r(e,t){return e.length>t?e.substring(0,t)+"...":e}let n=(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8049-da88d6900e039152.js b/litellm/proxy/_experimental/out/_next/static/chunks/8049-da88d6900e039152.js new file mode 100644 index 00000000000..db2e4c7ba2c --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/8049-da88d6900e039152.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8049],{31283:function(e,t,o){o.d(t,{o:function(){return a.Z}});var a=o(49566)},63610:function(e,t,o){o.d(t,{d:function(){return g}});var a=o(57437),r=o(2265),n=o(4260),c=o(37592),l=o(19015),i=o(10032),s=o(31283),d=o(15424),u=o(99981),h=o(19250),p=o(9309);let g=["metadata","config","enforced_params","aliases"],f=(e,t)=>g.includes(e)||"json"===t.format,m=e=>{if(!e)return!0;try{return JSON.parse(e),!0}catch(e){return!1}},w=(e,t,o)=>{let a={max_budget:"Enter maximum budget in USD (e.g., 100.50)",budget_duration:"Select a time period for budget reset",tpm_limit:"Enter maximum tokens per minute (whole number)",rpm_limit:"Enter maximum requests per minute (whole number)",duration:"Enter duration (e.g., 30s, 24h, 7d)",metadata:'Enter JSON object with key-value pairs\nExample: {"team": "research", "project": "nlp"}',config:'Enter configuration as JSON object\nExample: {"setting": "value"}',permissions:"Enter comma-separated permission strings",enforced_params:'Enter parameters as JSON object\nExample: {"param": "value"}',blocked:"Enter true/false or specific block conditions",aliases:'Enter aliases as JSON object\nExample: {"alias1": "value1", "alias2": "value2"}',models:"Select one or more model names",key_alias:"Enter a unique identifier for this key",tags:"Enter comma-separated tag strings"}[e]||({string:"Text input",number:"Numeric input",integer:"Whole number input",boolean:"True/False value"})[o]||"Text input";return f(e,t)?"".concat(a,"\nMust be valid JSON format"):t.enum?"Select from available options\nAllowed values: ".concat(t.enum.join(", ")):a};t.Z=e=>{let{schemaComponent:t,excludedFields:o=[],form:g,overrideLabels:y={},overrideTooltips:j={},customValidation:_={},defaultValues:v={}}=e,[C,k]=(0,r.useState)(null),[T,E]=(0,r.useState)(null);(0,r.useEffect)(()=>{(async()=>{try{let e=(await (0,h.getOpenAPISchema)()).components.schemas[t];if(!e)throw Error('Schema component "'.concat(t,'" not found'));k(e);let a={};Object.keys(e.properties).filter(e=>!o.includes(e)&&void 0!==v[e]).forEach(e=>{a[e]=v[e]}),g.setFieldsValue(a)}catch(e){console.error("Schema fetch error:",e),E(e instanceof Error?e.message:"Failed to fetch schema")}})()},[t,g,o]);let S=e=>{if(e.type)return e.type;if(e.anyOf){let t=e.anyOf.map(e=>e.type);if(t.includes("number")||t.includes("integer"))return"number";t.includes("string")}return"string"},b=(e,t)=>{var o;let r;let h=S(t),g=null==C?void 0:null===(o=C.required)||void 0===o?void 0:o.includes(e),k=y[e]||t.title||(0,p.N4)(e),T=j[e]||t.description,E=[];g&&E.push({required:!0,message:"".concat(k," is required")}),_[e]&&E.push({validator:_[e]}),f(e,t)&&E.push({validator:async(e,t)=>{if(t&&!m(t))throw Error("Please enter valid JSON")}});let b=T?(0,a.jsxs)("span",{children:[k," ",(0,a.jsx)(u.Z,{title:T,children:(0,a.jsx)(d.Z,{style:{marginLeft:"4px"}})})]}):k;return r=f(e,t)?(0,a.jsx)(n.default.TextArea,{rows:4,placeholder:"Enter as JSON",className:"font-mono"}):t.enum?(0,a.jsx)(c.default,{children:t.enum.map(e=>(0,a.jsx)(c.default.Option,{value:e,children:e},e))}):"number"===h||"integer"===h?(0,a.jsx)(l.Z,{style:{width:"100%"},precision:"integer"===h?0:void 0}):"duration"===e?(0,a.jsx)(s.o,{placeholder:"eg: 30s, 30h, 30d"}):(0,a.jsx)(s.o,{placeholder:T||""}),(0,a.jsx)(i.Z.Item,{label:b,name:e,className:"mt-8",rules:E,initialValue:v[e],help:(0,a.jsx)("div",{className:"text-xs text-gray-500",children:w(e,t,h)}),children:r},e)};return T?(0,a.jsxs)("div",{className:"text-red-500",children:["Error: ",T]}):(null==C?void 0:C.properties)?(0,a.jsx)("div",{children:Object.entries(C.properties).filter(e=>{let[t]=e;return!o.includes(t)}).map(e=>{let[t,o]=e;return b(t,o)})}):null}},9114:function(e,t,o){var a=o(2265),r=o(57271),n=o(85968);function c(){return"topRight"}function l(e,t){var o;return"string"==typeof e?{message:t,description:e}:{message:null!==(o=e.message)&&void 0!==o?o:t,...e}}function i(e){return"number"==typeof e?e:"string"==typeof e&&/^\d+$/.test(e)?parseInt(e,10):void 0}let s=["invalid api key","invalid authorization header format","authentication error","invalid proxy server token","invalid jwt token","invalid jwt submitted","unauthorized access to metrics endpoint"],d=["admin-only endpoint","not allowed to access model","user does not have permission","access forbidden","invalid credentials used to access ui","user not allowed to access proxy"],u=["db not connected","database not initialized","no db connected","prisma client not initialized","service unhealthy"],h=["no models configured on proxy","llm router not initialized","no deployments available","no healthy deployment available","not allowed to access model due to tags configuration","invalid model name passed in"],p=["deployment over user-defined ratelimit","crossed tpm / rpm / max parallel request limit","max parallel request limit"],g=["budget exceeded","crossed budget","provider budget"],f=["must be a litellm enterprise user","only be available for liteLLM enterprise users","missing litellm-enterprise package","only available on the docker image","enterprise feature","premium user"],m=["invalid json payload","invalid request type","invalid key format","invalid hash key","invalid sort column","invalid sort order","invalid limit","invalid file type","invalid field","invalid date format"],w=["model not found","model with id","credential not found","user not found","team not found","organization not found","mcp server with id","tool '"],y=["already exists","team member is already in team","user already exists"],j=["violated openai moderation policy","violated jailbreak threshold","violated prompt_injection threshold","violated content safety policy","violated lasso guardrail policy","blocked by pillar security guardrail","violated azure prompt shield guardrail policy","content blocked by model armor","response blocked by model armor","streaming response blocked by model armor","guardrail","moderation"],_=["invalid purpose","service must be specified","invalid response - response.response is none"],v=["cloudzero settings not configured","failed to decrypt cloudzero api key","cloudzero settings not found"],C=["created successfully","updated successfully","deleted successfully","credential created successfully","model added successfully","team created successfully","user created successfully","organization created successfully","cloudzero settings initialized successfully","cloudzero settings updated successfully","cloudzero export completed successfully","mock llm request made","mock slack alert sent","mock email alert sent","spend for all api keys and teams reset successfully","monthlyglobalspend view refreshed","cache cleared successfully","cache set successfully","ip ","deleted successfully"],k=["rate limit reached for deployment","deployment cooldown period active"],T=["this feature is only available for litellm enterprise users","enterprise features are not available","regenerating virtual keys is an enterprise feature","trying to set allowed_routes. this is an enterprise feature"],E=["invalid maximum_spend_logs_retention_interval value","error has invalid or non-convertible code","failed to save health check to database"];t.Z={error(e){var t,o;let a=l(e,"Error");r.ZP.error({...a,placement:null!==(t=a.placement)&&void 0!==t?t:c(),duration:null!==(o=a.duration)&&void 0!==o?o:6})},warning(e){var t,o;let a=l(e,"Warning");r.ZP.warning({...a,placement:null!==(t=a.placement)&&void 0!==t?t:c(),duration:null!==(o=a.duration)&&void 0!==o?o:5})},info(e){var t,o;let a=l(e,"Info");r.ZP.info({...a,placement:null!==(t=a.placement)&&void 0!==t?t:c(),duration:null!==(o=a.duration)&&void 0!==o?o:4})},success(e){var t,o;if(a.isValidElement(e)){r.ZP.success({message:"Success",description:e,placement:c(),duration:3.5});return}let n=l(e,"Success");r.ZP.success({...n,placement:null!==(t=n.placement)&&void 0!==t?t:c(),duration:null!==(o=n.duration)&&void 0!==o?o:3.5})},fromBackend(e,t){var o,a,l,S,b,F,P,O,B,N,x,A;let J=null!==(A=null!==(x=i(null==e?void 0:null===(N=e.response)||void 0===N?void 0:N.status))&&void 0!==x?x:i(null==e?void 0:e.status_code))&&void 0!==A?A:i(null==e?void 0:e.code),G=function(e){var t,o,a,r,c,l,i,s,d,u,h,p;if("string"==typeof e)return e;let g=null!==(p=null!==(h=null!==(u=null!==(d=null!==(s=null==e?void 0:null===(a=e.response)||void 0===a?void 0:null===(o=a.data)||void 0===o?void 0:null===(t=o.error)||void 0===t?void 0:t.message)&&void 0!==s?s:null==e?void 0:null===(c=e.response)||void 0===c?void 0:null===(r=c.data)||void 0===r?void 0:r.message)&&void 0!==d?d:null==e?void 0:null===(i=e.response)||void 0===i?void 0:null===(l=i.data)||void 0===l?void 0:l.error)&&void 0!==u?u:null==e?void 0:e.detail)&&void 0!==h?h:null==e?void 0:e.message)&&void 0!==p?p:e;return(0,n.O)(g)}(e),U={...null!=t?t:{},description:G,placement:null!==(o=null==t?void 0:t.placement)&&void 0!==o?o:c()};if(void 0!==J||e instanceof Error||"string"==typeof e||e&&"object"==typeof e&&("error"in e||"detail"in e)){let e=function(e,t){var o,a,r,n,c;let l=(t||"").toLowerCase();return s.some(e=>l.includes(e))?"Authentication Error":d.some(e=>l.includes(e))?"Access Denied":(null==u?void 0:null===(o=u.some)||void 0===o?void 0:o.call(u,e=>l.includes(e)))||503===e?"Service Unavailable":(null==g?void 0:null===(a=g.some)||void 0===a?void 0:a.call(g,e=>l.includes(e)))?"Budget Exceeded":(null==f?void 0:null===(r=f.some)||void 0===r?void 0:r.call(f,e=>l.includes(e)))?"Feature Unavailable":(null==h?void 0:null===(n=h.some)||void 0===n?void 0:n.call(h,e=>l.includes(e)))?"Routing Error":y.some(e=>l.includes(e))?"Already Exists":j.some(e=>l.includes(e))?"Content Blocked":_.some(e=>l.includes(e))?"Validation Error":v.some(e=>l.includes(e))?"Integration Error":m.some(e=>l.includes(e))?"Validation Error":404===e||l.includes("not found")||w.some(e=>l.includes(e))?"Not Found":429===e||l.includes("rate limit")||l.includes("tpm")||l.includes("rpm")||(null==p?void 0:null===(c=p.some)||void 0===c?void 0:c.call(p,e=>l.includes(e)))?"Rate Limit Exceeded":e&&e>=500?"Server Error":401===e?"Authentication Error":403===e?"Access Denied":l.includes("enterprise")||l.includes("premium")?"Info":e&&e>=400?"Request Error":"Error"}(J,G),o={...U,message:e};if("Rate Limit Exceeded"===e||"Info"===e||"Budget Exceeded"===e||"Feature Unavailable"===e||"Content Blocked"===e||"Integration Error"===e){r.ZP.warning({...o,duration:null!==(a=null==t?void 0:t.duration)&&void 0!==a?a:7});return}if("Server Error"===e){r.ZP.error({...o,duration:null!==(l=null==t?void 0:t.duration)&&void 0!==l?l:8});return}if("Request Error"===e||"Authentication Error"===e||"Access Denied"===e||"Not Found"===e||"Error"===e||"Already Exists"===e){r.ZP.error({...o,duration:null!==(S=null==t?void 0:t.duration)&&void 0!==S?S:6});return}r.ZP.info({...o,duration:null!==(b=null==t?void 0:t.duration)&&void 0!==b?b:4});return}let I=function(e){let t=(e||"").toLowerCase();return C.some(e=>t.includes(e))?{kind:"success",title:"Success"}:T.some(e=>t.includes(e))?{kind:"warning",title:"Feature Notice"}:E.some(e=>t.includes(e))?{kind:"warning",title:"Configuration Warning"}:k.some(e=>t.includes(e))?{kind:"warning",title:"Rate Limit"}:null}(G),R={...U,message:null!==(F=null==I?void 0:I.title)&&void 0!==F?F:"Info"};if((null==I?void 0:I.kind)==="success"){r.ZP.success({...R,duration:null!==(P=null==t?void 0:t.duration)&&void 0!==P?P:3.5});return}if((null==I?void 0:I.kind)==="warning"){r.ZP.warning({...R,duration:null!==(O=null==t?void 0:t.duration)&&void 0!==O?O:6});return}r.ZP.info({...R,duration:null!==(B=null==t?void 0:t.duration)&&void 0!==B?B:4})},clear(){r.ZP.destroy()}}},19250:function(e,t,o){o.r(t),o.d(t,{DEFAULT_ORGANIZATION:function(){return m},PredictedSpendLogsCall:function(){return tj},addAllowedIP:function(){return eb},adminGlobalActivity:function(){return eH},adminGlobalActivityExceptions:function(){return eQ},adminGlobalActivityExceptionsPerDeployment:function(){return eK},adminGlobalActivityPerModel:function(){return eY},adminGlobalCacheActivity:function(){return eW},adminSpendLogsCall:function(){return eD},adminTopEndUsersCall:function(){return eq},adminTopKeysCall:function(){return eV},adminTopModelsCall:function(){return e$},adminspendByProvider:function(){return eZ},agentDailyActivityCall:function(){return ep},agentHubPublicModelsCall:function(){return ek},alertingSettingsCall:function(){return M},allEndUsersCall:function(){return eR},allTagNamesCall:function(){return eI},applyGuardrail:function(){return oI},availableTeamListCall:function(){return $},budgetCreateCall:function(){return G},budgetDeleteCall:function(){return J},budgetUpdateCall:function(){return U},buildMcpOAuthAuthorizeUrl:function(){return o$},cacheTemporaryMcpServer:function(){return oQ},cachingHealthCheckCall:function(){return tM},callMCPTool:function(){return ol},cancelModelCostMapReload:function(){return O},claimOnboardingToken:function(){return em},convertPromptFileToJson:function(){return tK},createAgentCall:function(){return tX},createGuardrailCall:function(){return t0},createMCPServer:function(){return t9},createPassThroughEndpoint:function(){return tx},createPromptCall:function(){return tW},createSearchTool:function(){return ot},credentialCreateCall:function(){return tt},credentialDeleteCall:function(){return tr},credentialGetCall:function(){return ta},credentialListCall:function(){return to},credentialUpdateCall:function(){return tn},customerDailyActivityCall:function(){return eh},defaultProxyBaseUrl:function(){return s},deleteAgentCall:function(){return oS},deleteAllowedIP:function(){return eF},deleteCallback:function(){return oZ},deleteConfigFieldSetting:function(){return tJ},deleteGuardrailCall:function(){return oO},deleteMCPServer:function(){return t8},deletePassThroughEndpointsCall:function(){return tG},deletePromptCall:function(){return tQ},deleteSearchTool:function(){return oa},exchangeMcpOAuthToken:function(){return oX},fetchAvailableSearchProviders:function(){return or},fetchMCPAccessGroups:function(){return t5},fetchMCPServers:function(){return t2},fetchSearchToolById:function(){return oe},fetchSearchTools:function(){return t7},formatDate:function(){return l},getAgentCreateMetadata:function(){return _},getAgentInfo:function(){return oA},getAgentsList:function(){return ox},getAllowedIPs:function(){return eS},getBudgetList:function(){return tC},getBudgetSettings:function(){return tk},getCacheSettingsCall:function(){return tb},getCallbackConfigsCall:function(){return i},getCallbacksCall:function(){return tT},getConfigFieldSetting:function(){return tB},getDefaultTeamSettings:function(){return op},getEmailEventSettings:function(){return ok},getGeneralSettingsCall:function(){return tE},getGuardrailInfo:function(){return oJ},getGuardrailProviderSpecificParams:function(){return oN},getGuardrailUISettings:function(){return oB},getGuardrailsList:function(){return tV},getInternalUserSettings:function(){return t4},getModelCostMapReloadStatus:function(){return B},getOnboardingCredentials:function(){return ef},getOpenAPISchema:function(){return S},getPassThroughEndpointInfo:function(){return oq},getPassThroughEndpointsCall:function(){return tO},getPossibleUserRoles:function(){return e7},getPromptInfo:function(){return tZ},getPromptVersions:function(){return tH},getPromptsList:function(){return tq},getProviderCreateMetadata:function(){return j},getProxyBaseUrl:function(){return g},getProxyUISettings:function(){return tD},getPublicModelHubInfo:function(){return E},getRemainingUsers:function(){return oD},getRouterSettingsCall:function(){return tS},getSSOSettings:function(){return oM},getTeamPermissionsCall:function(){return of},getTotalSpendCall:function(){return eg},getUiConfig:function(){return T},getUiSettings:function(){return at},healthCheckCall:function(){return tI},healthCheckHistoryCall:function(){return tz},individualModelHealthCheckCall:function(){return tR},invitationClaimCall:function(){return R},invitationCreateCall:function(){return I},keyAliasesCall:function(){return e3},keyCreateCall:function(){return L},keyCreateServiceAccountCall:function(){return z},keyDeleteCall:function(){return V},keyInfoCall:function(){return eX},keyInfoV1Call:function(){return e1},keyListCall:function(){return e4},keySpendLogsCall:function(){return eJ},keyUpdateCall:function(){return tc},latestHealthChecksCall:function(){return tL},listMCPTools:function(){return oc},loginCall:function(){return ae},makeAgentPublicCall:function(){return ob},makeAgentsPublicCall:function(){return oF},makeMCPPublicCall:function(){return oP},makeModelGroupPublic:function(){return k},mcpHubPublicServersCall:function(){return eT},mcpToolsCall:function(){return oH},modelAvailableCall:function(){return eA},modelCostMap:function(){return b},modelCreateCall:function(){return N},modelDeleteCall:function(){return A},modelExceptionsCall:function(){return eN},modelHubCall:function(){return eE},modelHubPublicModelsCall:function(){return eC},modelInfoCall:function(){return e_},modelInfoV1Call:function(){return ev},modelMetricsCall:function(){return eP},modelMetricsSlowResponsesCall:function(){return eB},modelPatchUpdateCall:function(){return ti},modelSettingsCall:function(){return x},modelUpdateCall:function(){return ts},organizationCreateCall:function(){return et},organizationDailyActivityCall:function(){return eu},organizationDeleteCall:function(){return ea},organizationInfoCall:function(){return ee},organizationListCall:function(){return X},organizationMemberAddCall:function(){return tg},organizationMemberDeleteCall:function(){return tf},organizationMemberUpdateCall:function(){return tm},organizationUpdateCall:function(){return eo},patchAgentCall:function(){return oG},patchPromptCall:function(){return t$},perUserAnalyticsCall:function(){return o8},proxyBaseUrl:function(){return u},regenerateKeyCall:function(){return ew},registerMcpOAuthClient:function(){return oK},reloadModelCostMap:function(){return F},resetEmailEventSettings:function(){return oE},scheduleModelCostMapReload:function(){return P},searchToolQueryCall:function(){return o1},serverRootPath:function(){return d},serviceHealthCheck:function(){return tv},sessionSpendLogsCall:function(){return ow},setCallbacksCall:function(){return tU},setGlobalLitellmHeaderName:function(){return C},slackBudgetAlertsHealthCheck:function(){return t_},spendUsersCall:function(){return e2},streamingModelMetricsCall:function(){return eO},tagCreateCall:function(){return oi},tagDailyActivityCall:function(){return es},tagDauCall:function(){return o3},tagDeleteCall:function(){return oh},tagDistinctCall:function(){return o9},tagInfoCall:function(){return od},tagListCall:function(){return ou},tagMauCall:function(){return o5},tagUpdateCall:function(){return os},tagWauCall:function(){return o2},tagsSpendLogsCall:function(){return eU},teamBulkMemberAddCall:function(){return tu},teamCreateCall:function(){return te},teamDailyActivityCall:function(){return ed},teamDeleteCall:function(){return Z},teamInfoCall:function(){return Y},teamListCall:function(){return K},teamMemberAddCall:function(){return td},teamMemberDeleteCall:function(){return tp},teamMemberUpdateCall:function(){return th},teamPermissionsUpdateCall:function(){return om},teamSpendLogsCall:function(){return eG},teamUpdateCall:function(){return tl},testCacheConnectionCall:function(){return tF},testConnectionRequest:function(){return e0},testMCPConnectionRequest:function(){return oW},testMCPToolsListRequest:function(){return oY},testSearchToolConnection:function(){return on},transformRequestCall:function(){return er},uiAuditLogsCall:function(){return oL},uiSpendLogDetailsCall:function(){return t1},uiSpendLogsCall:function(){return eL},updateCacheSettingsCall:function(){return tP},updateConfigFieldSetting:function(){return tA},updateDefaultTeamSettings:function(){return og},updateEmailEventSettings:function(){return oT},updateGuardrailCall:function(){return oU},updateInternalUserSettings:function(){return t3},updateMCPServer:function(){return t6},updatePassThroughEndpoint:function(){return oV},updatePassThroughFieldSetting:function(){return tN},updatePromptCall:function(){return tY},updateSSOSettings:function(){return oz},updateSearchTool:function(){return oo},updateUiSettings:function(){return ao},updateUsefulLinksCall:function(){return ex},userAgentAnalyticsCall:function(){return o4},userAgentSummaryCall:function(){return o6},userBulkUpdateUserCall:function(){return ty},userCreateCall:function(){return D},userDailyActivityAggregatedCall:function(){return e6},userDailyActivityCall:function(){return ei},userDeleteCall:function(){return q},userFilterUICall:function(){return eM},userGetAllUsersCall:function(){return e8},userGetRequesedtModelsCall:function(){return e9},userInfoCall:function(){return W},userListCall:function(){return H},userRequestModelCall:function(){return e5},userSpendLogsCall:function(){return ez},userUpdateUserCall:function(){return tw},v2TeamListCall:function(){return Q},validateBlockedWordsFile:function(){return oR},vectorStoreCreateCall:function(){return oy},vectorStoreDeleteCall:function(){return o_},vectorStoreInfoCall:function(){return ov},vectorStoreListCall:function(){return oj},vectorStoreSearchCall:function(){return o0},vectorStoreUpdateCall:function(){return oC}});var a=o(42264),r=o(3914),n=o(63610),c=o(9114);let l=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)},i=async e=>{try{let t=u?"".concat(u,"/callbacks/configs"):"/callbacks/configs",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},s=null,d="/",u=null;console.log=function(){};let h=()=>window.location,p=function(e){var t;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=h(),r=null!==(t=null==a?void 0:a.origin)&&void 0!==t?t:null,n=o||r;if(console.log("proxyBaseUrl:",u),console.log("serverRootPath:",e),!n){console.log("Updated proxyBaseUrl:",u=null!=u?u:null);return}e.length>0&&!n.endsWith(e)&&"/"!=e&&(n+=e),console.log("Updated proxyBaseUrl:",u=n)},g=()=>{var e;if(u)return u;let t=h();return null!==(e=null==t?void 0:t.origin)&&void 0!==e?e:""},f={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE"},m="default_organization",w=0,y=async e=>{let t=Date.now();if(t-w>6e4){if(("string"==typeof e?e:JSON.stringify(e)).includes("Authentication Error - Expired Key")){c.Z.info("UI Session Expired. Logging out."),w=t,(0,r.b)();let e=h();e&&(window.location.href=e.pathname)}w=t}else console.log("Error suppressed to prevent spam:",e)},j=async()=>{let e=u?"".concat(u,"/public/providers/fields"):"/public/providers/fields",t=await fetch(e,{method:"GET"});if(!t.ok){let e=await t.text();throw console.error("Failed to fetch provider create metadata:",t.status,e),Error("Failed to load provider configuration")}return await t.json()},_=async()=>{let e=u?"".concat(u,"/public/agents/fields"):"/public/agents/fields",t=await fetch(e,{method:"GET"});if(!t.ok){let e=await t.text();throw console.error("Failed to fetch agent create metadata:",t.status,e),Error("Failed to load agent configuration")}return await t.json()},v="Authorization";function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Authorization";console.log("setGlobalLitellmHeaderName: ".concat(e)),v=e}let k=async(e,t)=>{let o=u?"".concat(u,"/model_group/make_public"):"/model_group/make_public";return(await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({model_groups:t})})).json()},T=async()=>{console.log("Getting UI config");let e=await fetch(s?"".concat(s,"/litellm/.well-known/litellm-ui-config"):"/litellm/.well-known/litellm-ui-config"),t=await e.json();return console.log("jsonData in getUiConfig:",t),p(t.server_root_path,t.proxy_base_url),t},E=async()=>{let e=u?"".concat(u,"/public/model_hub/info"):"/public/model_hub/info",t=await fetch(e);return await t.json()},S=async()=>{let e=u?"".concat(u,"/openapi.json"):"/openapi.json",t=await fetch(e);return await t.json()},b=async()=>{try{let e=u?"".concat(u,"/public/litellm_model_cost_map"):"/public/litellm_model_cost_map",t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}}),o=await t.json();return console.log("received litellm model cost data: ".concat(o)),o}catch(e){throw console.error("Failed to get model cost map:",e),e}},F=async e=>{try{let t=u?"".concat(u,"/reload/model_cost_map"):"/reload/model_cost_map",o=await fetch(t,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}}),a=await o.json();return console.log("Model cost map reload response: ".concat(a)),a}catch(e){throw console.error("Failed to reload model cost map:",e),e}},P=async(e,t)=>{try{let o=u?"".concat(u,"/schedule/model_cost_map_reload?hours=").concat(t):"/schedule/model_cost_map_reload?hours=".concat(t),a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}}),r=await a.json();return console.log("Schedule model cost map reload response: ".concat(r)),r}catch(e){throw console.error("Failed to schedule model cost map reload:",e),e}},O=async e=>{try{let t=u?"".concat(u,"/schedule/model_cost_map_reload"):"/schedule/model_cost_map_reload",o=await fetch(t,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}}),a=await o.json();return console.log("Cancel model cost map reload response: ".concat(a)),a}catch(e){throw console.error("Failed to cancel model cost map reload:",e),e}},B=async e=>{try{let t=u?"".concat(u,"/schedule/model_cost_map_reload/status"):"/schedule/model_cost_map_reload/status";console.log("Fetching status from URL:",t);let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){console.error("Status request failed with status: ".concat(o.status));let e=await o.text();throw console.error("Error response:",e),Error("HTTP ".concat(o.status,": ").concat(e))}let a=await o.json();return console.log("Model cost map reload status:",a),a}catch(e){throw console.error("Failed to get model cost map reload status:",e),e}},N=async(e,t)=>{try{let o=u?"".concat(u,"/model/new"):"/model/new",r=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),a.ZP.destroy(),c.Z.success("Model ".concat(t.model_name," created successfully")),n}catch(e){throw console.error("Failed to create key:",e),e}},x=async e=>{try{let t=u?"".concat(u,"/model/settings"):"/model/settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){console.error("Failed to get model settings:",e)}},A=async(e,t)=>{console.log("model_id in model delete call: ".concat(t));try{let o=u?"".concat(u,"/model/delete"):"/model/delete",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},J=async(e,t)=>{if(console.log("budget_id in budget delete call: ".concat(t)),null!=e)try{let o=u?"".concat(u,"/budget/delete"):"/budget/delete",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},G=async(e,t)=>{try{console.log("Form Values in budgetCreateCall:",t),console.log("Form Values after check:",t);let o=u?"".concat(u,"/budget/new"):"/budget/new",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},U=async(e,t)=>{try{console.log("Form Values in budgetUpdateCall:",t),console.log("Form Values after check:",t);let o=u?"".concat(u,"/budget/update"):"/budget/update",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},I=async(e,t)=>{try{let o=u?"".concat(u,"/invitation/new"):"/invitation/new",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},R=async(e,t)=>{try{console.log("Form Values in invitationCreateCall:",t),console.log("Form Values after check:",t);let o=u?"".concat(u,"/invitation/claim"):"/invitation/claim",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},M=async e=>{try{let t=u?"".concat(u,"/alerting/settings"):"/alerting/settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},z=async(e,t)=>{try{for(let e of(console.log("Form Values in keyCreateServiceAccountCall:",t),t.description&&(t.metadata||(t.metadata={}),t.metadata.description=t.description,delete t.description,t.metadata=JSON.stringify(t.metadata)),n.d))if(t[e]){console.log("formValues.".concat(e,":"),t[e]);try{t[e]=JSON.parse(t[e])}catch(t){throw Error("Failed to parse ".concat(e,": ")+t)}}console.log("Form Values after check:",t);let o=u?"".concat(u,"/key/service-account/generate"):"/key/service-account/generate",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},L=async(e,t,o)=>{try{for(let e of(console.log("Form Values in keyCreateCall:",o),o.description&&(o.metadata||(o.metadata={}),o.metadata.description=o.description,delete o.description,o.metadata=JSON.stringify(o.metadata)),n.d))if(o[e]){console.log("formValues.".concat(e,":"),o[e]);try{o[e]=JSON.parse(o[e])}catch(t){throw Error("Failed to parse ".concat(e,": ")+t)}}console.log("Form Values after check:",o);let a=u?"".concat(u,"/key/generate"):"/key/generate",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let c=await r.json();return console.log("API Response:",c),c}catch(e){throw console.error("Failed to create key:",e),e}},D=async(e,t,o)=>{try{if(console.log("Form Values in keyCreateCall:",o),o.description&&(o.metadata||(o.metadata={}),o.metadata.description=o.description,delete o.description,o.metadata=JSON.stringify(o.metadata)),o.auto_create_key=!1,o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=u?"".concat(u,"/user/new"):"/user/new",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},V=async(e,t)=>{try{let o=u?"".concat(u,"/key/delete"):"/key/delete";console.log("in keyDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:[t]})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},q=async(e,t)=>{try{let o=u?"".concat(u,"/user/delete"):"/user/delete";console.log("in userDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_ids:t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete user(s):",e),e}},Z=async(e,t)=>{try{let o=u?"".concat(u,"/team/delete"):"/team/delete";console.log("in teamDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_ids:[t]})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},H=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,s=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let d=u?"".concat(u,"/user/list"):"/user/list";console.log("in userListCall");let h=new URLSearchParams;if(t&&t.length>0){let e=t.join(",");h.append("user_ids",e)}o&&h.append("page",o.toString()),a&&h.append("page_size",a.toString()),r&&h.append("user_email",r),n&&h.append("role",n),c&&h.append("team",c),l&&h.append("sso_user_ids",l),i&&h.append("sort_by",i),s&&h.append("sort_order",s);let p=h.toString();p&&(d+="?".concat(p));let g=await fetch(d,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!g.ok){let e=await g.json(),t=o7(e);throw y(t),Error(t)}let f=await g.json();return console.log("/user/list API Response:",f),f}catch(e){throw console.error("Failed to create key:",e),e}},W=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0,n=arguments.length>5?arguments[5]:void 0,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];console.log("userInfoCall: ".concat(t,", ").concat(o,", ").concat(a,", ").concat(r,", ").concat(n,", ").concat(c));try{let l;if(a){l=u?"".concat(u,"/user/list"):"/user/list";let e=new URLSearchParams;null!=r&&e.append("page",r.toString()),null!=n&&e.append("page_size",n.toString()),l+="?".concat(e.toString())}else l=u?"".concat(u,"/user/info"):"/user/info",("Admin"!==o&&"Admin Viewer"!==o||c)&&t&&(l+="?user_id=".concat(t));console.log("Requesting user data from:",l);let i=await fetch(l,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=o7(e);throw y(t),Error(t)}let s=await i.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to fetch user data:",e),e}},Y=async(e,t)=>{try{let o=u?"".concat(u,"/team/info"):"/team/info";t&&(o="".concat(o,"?team_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},Q=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6],arguments.length>7&&void 0!==arguments[7]&&arguments[7],arguments.length>8&&void 0!==arguments[8]&&arguments[8];try{let n=u?"".concat(u,"/v2/team/list"):"/v2/team/list";console.log("in teamInfoCall");let c=new URLSearchParams;o&&c.append("user_id",o.toString()),t&&c.append("organization_id",t.toString()),a&&c.append("team_id",a.toString()),r&&c.append("team_alias",r.toString());let l=c.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=o7(e);throw y(t),Error(t)}let s=await i.json();return console.log("/v2/team/list API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},K=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=u?"".concat(u,"/team/list"):"/team/list";console.log("in teamInfoCall");let c=new URLSearchParams;o&&c.append("user_id",o.toString()),t&&c.append("organization_id",t.toString()),a&&c.append("team_id",a.toString()),r&&c.append("team_alias",r.toString());let l=c.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=o7(e);throw y(t),Error(t)}let s=await i.json();return console.log("/team/list API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},$=async e=>{try{let t=u?"".concat(u,"/team/available"):"/team/available";console.log("in availableTeamListCall");let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log("/team/available_teams API Response:",a),a}catch(e){throw e}},X=async e=>{try{let t=u?"".concat(u,"/organization/list"):"/organization/list",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ee=async(e,t)=>{try{let o=u?"".concat(u,"/organization/info"):"/organization/info";t&&(o="".concat(o,"?organization_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},et=async(e,t)=>{try{if(console.log("Form Values in organizationCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw console.error("Failed to parse metadata:",e),Error("Failed to parse metadata: "+e)}}let o=u?"".concat(u,"/organization/new"):"/organization/new",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eo=async(e,t)=>{try{console.log("Form Values in organizationUpdateCall:",t);let o=u?"".concat(u,"/organization/update"):"/organization/update",a=await fetch(o,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("Update Team Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},ea=async(e,t)=>{try{let o=u?"".concat(u,"/organization/delete"):"/organization/delete",a=await fetch(o,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_ids:[t]})});if(!a.ok){let e=await a.text();throw y(e),Error("Error deleting organization: ".concat(e))}return await a.json()}catch(e){throw console.error("Failed to delete organization:",e),e}},er=async(e,t)=>{try{let o=u?"".concat(u,"/utils/transform_request"):"/utils/transform_request",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},en=(e,t,o)=>{if(null!=o){if(Array.isArray(o)){o.length>0&&e.append(t,o.join(","));return}e.append(t,"".concat(o))}},ec=(e,t,o,a,r)=>{let n=e.startsWith("/")?e:"/".concat(e),c=u?"".concat(u).concat(n):n,i=new URLSearchParams;i.append("start_date",l(t)),i.append("end_date",l(o)),i.append("page_size","1000"),i.append("page",a.toString()),r&&Object.entries(r).forEach(e=>{let[t,o]=e;en(i,t,o)});let s=i.toString();return s?"".concat(c,"?").concat(s):c},el=async e=>{let{accessToken:t,endpoint:o,startTime:a,endTime:r,page:n=1,extraQueryParams:c}=e;try{let e=ec(o,a,r,n,c),l=await fetch(e,{method:"GET",headers:{[v]:"Bearer ".concat(t),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=o7(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch daily activity (".concat(o,"):"),e),e}},ei=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return el({accessToken:e,endpoint:"/user/daily/activity",startTime:t,endTime:o,page:a})},es=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return el({accessToken:e,endpoint:"/tag/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{tags:r}})},ed=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return el({accessToken:e,endpoint:"/team/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{team_ids:r,exclude_team_ids:"litellm-dashboard"}})},eu=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return el({accessToken:e,endpoint:"/organization/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{organization_ids:r}})},eh=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return el({accessToken:e,endpoint:"/customer/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{end_user_ids:r}})},ep=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return el({accessToken:e,endpoint:"/agent/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{agent_ids:r}})},eg=async e=>{try{let t=u?"".concat(u,"/global/spend"):"/global/spend",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ef=async e=>{try{let t=u?"".concat(u,"/onboarding/get_token"):"/onboarding/get_token";t+="?invite_link=".concat(e);let o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},em=async(e,t,o,a)=>{let r=u?"".concat(u,"/onboarding/claim_token"):"/onboarding/claim_token";try{let n=await fetch(r,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({invitation_link:t,user_id:o,password:a})});if(!n.ok){let e=await n.json(),t=o7(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to delete key:",e),e}},ew=async(e,t,o)=>{try{let a=u?"".concat(u,"/key/").concat(t,"/regenerate"):"/key/".concat(t,"/regenerate"),r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}let n=await r.json();return console.log("Regenerate key Response:",n),n}catch(e){throw console.error("Failed to regenerate key:",e),e}},ey=!1,ej=null,e_=async(e,t,o)=>{try{console.log("modelInfoCall:",e,t,o);let a=u?"".concat(u,"/v2/model/info"):"/v2/model/info",r=new URLSearchParams;r.append("include_team_models","true"),r.toString()&&(a+="?".concat(r.toString()));let n=await fetch(a,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw e+="error shown=".concat(ey),ey||(e.includes("No model list passed")&&(e="No Models Exist. Click Add Model to get started."),c.Z.info(e),ey=!0,ej&&clearTimeout(ej),ej=setTimeout(()=>{ey=!1},1e4)),Error("Network response was not ok")}let l=await n.json();return console.log("modelInfoCall:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},ev=async(e,t)=>{try{let o=u?"".concat(u,"/v1/model/info"):"/v1/model/info";o+="?litellm_model_id=".concat(t);let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("modelInfoV1Call:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eC=async()=>{let e=u?"".concat(u,"/public/model_hub"):"/public/model_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},ek=async()=>{let e=u?"".concat(u,"/public/agent_hub"):"/public/agent_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},eT=async()=>{let e=u?"".concat(u,"/public/mcp_hub"):"/public/mcp_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},eE=async e=>{try{let t=u?"".concat(u,"/model_group/info"):"/model_group/info",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log("modelHubCall:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},eS=async e=>{try{let t=u?"".concat(u,"/get/allowed_ips"):"/get/allowed_ips",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log("getAllowedIPs:",a),a.data}catch(e){throw console.error("Failed to get allowed IPs:",e),e}},eb=async(e,t)=>{try{let o=u?"".concat(u,"/add/allowed_ip"):"/add/allowed_ip",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("addAllowedIP:",r),r}catch(e){throw console.error("Failed to add allowed IP:",e),e}},eF=async(e,t)=>{try{let o=u?"".concat(u,"/delete/allowed_ip"):"/delete/allowed_ip",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("deleteAllowedIP:",r),r}catch(e){throw console.error("Failed to delete allowed IP:",e),e}},eP=async(e,t,o,a,r,n,c,l)=>{try{let t=u?"".concat(u,"/model/metrics"):"/model/metrics";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(c,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},eO=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/model/streaming_metrics"):"/model/streaming_metrics";t&&(r="".concat(r,"?_selected_model_group=").concat(t,"&startTime=").concat(o,"&endTime=").concat(a));let n=await fetch(r,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=o7(e);throw y(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to create key:",e),e}},eB=async(e,t,o,a,r,n,c,l)=>{try{let t=u?"".concat(u,"/model/metrics/slow_responses"):"/model/metrics/slow_responses";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(c,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},eN=async(e,t,o,a,r,n,c,l)=>{try{let t=u?"".concat(u,"/model/metrics/exceptions"):"/model/metrics/exceptions";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(c,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ex=async(e,t)=>{try{let o=u?"".concat(u,"/model_hub/update_useful_links"):"/model_hub/update_useful_links",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({useful_links:t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},eA=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=(arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6]);console.log("in /models calls, globalLitellmHeaderName",v);try{let t=u?"".concat(u,"/models"):"/models",o=new URLSearchParams;o.append("include_model_access_groups","True"),!0===a&&o.append("return_wildcard_routes","True"),!0===n&&o.append("only_model_access_groups","True"),r&&o.append("team_id",r.toString()),o.toString()&&(t+="?".concat(o.toString()));let c=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.json(),t=o7(e);throw y(t),Error(t)}return await c.json()}catch(e){throw console.error("Failed to create key:",e),e}},eJ=async(e,t)=>{try{let o=u?"".concat(u,"/global/spend/logs"):"/global/spend/logs";console.log("in keySpendLogsCall:",o);let a=await fetch("".concat(o,"?api_key=").concat(t),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},eG=async e=>{try{let t=u?"".concat(u,"/global/spend/teams"):"/global/spend/teams";console.log("in teamSpendLogsCall:",t);let o=await fetch("".concat(t),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eU=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/spend/tags"):"/global/spend/tags";t&&o&&(r="".concat(r,"?start_date=").concat(t,"&end_date=").concat(o)),a&&(r+="".concat(r,"&tags=").concat(a.join(","))),console.log("in tagsSpendLogsCall:",r);let n=await fetch("".concat(r),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=o7(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to create key:",e),e}},eI=async e=>{try{let t=u?"".concat(u,"/global/spend/all_tag_names"):"/global/spend/all_tag_names";console.log("in global/spend/all_tag_names call",t);let o=await fetch("".concat(t),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eR=async e=>{try{let t=u?"".concat(u,"/customer/list"):"/customer/list";console.log("in customer/list",t);let o=await fetch("".concat(t),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to fetch end users:",e),e}},eM=async(e,t)=>{try{let o=u?"".concat(u,"/user/filter/ui"):"/user/filter/ui";t.get("user_email")&&(o+="?user_email=".concat(t.get("user_email"))),t.get("user_id")&&(o+="?user_id=".concat(t.get("user_id")));let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},ez=async(e,t,o,a,r,n)=>{try{console.log("user role in spend logs call: ".concat(o));let t=u?"".concat(u,"/spend/logs"):"/spend/logs";t="App Owner"==o?"".concat(t,"?user_id=").concat(a,"&start_date=").concat(r,"&end_date=").concat(n):"".concat(t,"?start_date=").concat(r,"&end_date=").concat(n);let c=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.json(),t=o7(e);throw y(t),Error(t)}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},eL=async(e,t,o,a,r,n,c,l,i,s,d,h,p)=>{try{let g=u?"".concat(u,"/spend/logs/ui"):"/spend/logs/ui",f=new URLSearchParams;t&&f.append("api_key",t),o&&f.append("team_id",o),a&&f.append("request_id",a),r&&f.append("start_date",r),n&&f.append("end_date",n),c&&f.append("page",c.toString()),l&&f.append("page_size",l.toString()),i&&f.append("user_id",i),s&&f.append("end_user",s),d&&f.append("status_filter",d),h&&f.append("model",h),p&&f.append("key_alias",p);let m=f.toString();m&&(g+="?".concat(m));let w=await fetch(g,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!w.ok){let e=await w.json(),t=o7(e);throw y(t),Error(t)}let j=await w.json();return console.log("Spend Logs Response:",j),j}catch(e){throw console.error("Failed to fetch spend logs:",e),e}},eD=async e=>{try{let t=u?"".concat(u,"/global/spend/logs"):"/global/spend/logs",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eV=async e=>{try{let t=u?"".concat(u,"/global/spend/keys?limit=5"):"/global/spend/keys?limit=5",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eq=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/spend/end_users"):"/global/spend/end_users",n="";n=t?JSON.stringify({api_key:t,startTime:o,endTime:a}):JSON.stringify({startTime:o,endTime:a});let c={method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:n},l=await fetch(r,c);if(!l.ok){let e=await l.json(),t=o7(e);throw y(t),Error(t)}let i=await l.json();return console.log(i),i}catch(e){throw console.error("Failed to create key:",e),e}},eZ=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/spend/provider"):"/global/spend/provider";o&&a&&(r+="?start_date=".concat(o,"&end_date=").concat(a)),t&&(r+="&api_key=".concat(t));let n={method:"GET",headers:{[v]:"Bearer ".concat(e)}},c=await fetch(r,n);if(!c.ok){let e=await c.json(),t=o7(e);throw y(t),Error(t)}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eH=async(e,t,o)=>{try{let a=u?"".concat(u,"/global/activity"):"/global/activity";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[v]:"Bearer ".concat(e)}},n=await fetch(a,r);if(!n.ok){let e=await n.json(),t=o7(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eW=async(e,t,o)=>{try{let a=u?"".concat(u,"/global/activity/cache_hits"):"/global/activity/cache_hits";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[v]:"Bearer ".concat(e)}},n=await fetch(a,r);if(!n.ok){let e=await n.json(),t=o7(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eY=async(e,t,o)=>{try{let a=u?"".concat(u,"/global/activity/model"):"/global/activity/model";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[v]:"Bearer ".concat(e)}},n=await fetch(a,r);if(!n.ok){let e=await n.json(),t=o7(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eQ=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/activity/exceptions"):"/global/activity/exceptions";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[v]:"Bearer ".concat(e)}},c=await fetch(r,n);if(!c.ok){let e=await c.json(),t=o7(e);throw y(t),Error(t)}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eK=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/activity/exceptions/deployment"):"/global/activity/exceptions/deployment";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[v]:"Bearer ".concat(e)}},c=await fetch(r,n);if(!c.ok){let e=await c.json(),t=o7(e);throw y(t),Error(t)}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},e$=async e=>{try{let t=u?"".concat(u,"/global/spend/models?limit=5"):"/global/spend/models?limit=5",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eX=async(e,t)=>{try{let o=u?"".concat(u,"/v2/key/info"):"/v2/key/info",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!a.ok){let e=await a.text();if(e.includes("Invalid proxy server token passed"))throw Error("Invalid proxy server token passed");throw y(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},e0=async(e,t,o,a)=>{try{console.log("Sending model connection test request:",JSON.stringify(t));let n=u?"".concat(u,"/health/test_connection"):"/health/test_connection",c=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",[v]:"Bearer ".concat(e)},body:JSON.stringify({litellm_params:t,model_info:o,mode:a})}),l=c.headers.get("content-type");if(!l||!l.includes("application/json")){let e=await c.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(c.status,": ").concat(c.statusText,"). Check network tab for details."))}let i=await c.json();if(!c.ok||"error"===i.status){if("error"===i.status);else{var r;return{status:"error",message:(null===(r=i.error)||void 0===r?void 0:r.message)||"Connection test failed: ".concat(c.status," ").concat(c.statusText)}}}return i}catch(e){throw console.error("Model connection test error:",e),e}},e1=async(e,t)=>{try{console.log("entering keyInfoV1Call");let o=u?"".concat(u,"/key/info"):"/key/info";o="".concat(o,"?key=").concat(t);let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(console.log("response",a),!a.ok){let e=await a.text();y(e),c.Z.fromBackend("Failed to fetch key info - "+e)}let r=await a.json();return console.log("data",r),r}catch(e){throw console.error("Failed to fetch key info:",e),e}},e4=async function(e,t,o,a,r,n,c,l){let i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,s=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let d=u?"".concat(u,"/key/list"):"/key/list";console.log("in keyListCall");let h=new URLSearchParams;o&&h.append("team_id",o.toString()),t&&h.append("organization_id",t.toString()),a&&h.append("key_alias",a),n&&h.append("key_hash",n),r&&h.append("user_id",r.toString()),c&&h.append("page",c.toString()),l&&h.append("size",l.toString()),i&&h.append("sort_by",i),s&&h.append("sort_order",s),h.append("return_full_object","true"),h.append("include_team_keys","true"),h.append("include_created_by_keys","true");let p=h.toString();p&&(d+="?".concat(p));let g=await fetch(d,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!g.ok){let e=await g.json(),t=o7(e);throw y(t),Error(t)}let f=await g.json();return console.log("/team/list API Response:",f),f}catch(e){throw console.error("Failed to create key:",e),e}},e3=async e=>{try{let t=u?"".concat(u,"/key/aliases"):"/key/aliases";console.log("in keyAliasesCall");let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log("/key/aliases API Response:",a),a}catch(e){throw console.error("Failed to fetch key aliases:",e),e}},e2=async(e,t)=>{try{let o=u?"".concat(u,"/spend/users"):"/spend/users";console.log("in spendUsersCall:",o);let a=await fetch("".concat(o,"?user_id=").concat(t),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get spend for user",e),e}},e5=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/user/request_model"):"/user/request_model",n=await fetch(r,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({models:[t],user_id:o,justification:a})});if(!n.ok){let e=await n.json(),t=o7(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to create key:",e),e}},e9=async e=>{try{let t=u?"".concat(u,"/user/get_requests"):"/user/get_requests";console.log("in userGetRequesedtModelsCall:",t);let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to get requested models:",e),e}},e6=async(e,t,o)=>{try{let a=u?"".concat(u,"/user/daily/activity/aggregated"):"/user/daily/activity/aggregated",r=new URLSearchParams,n=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};r.append("start_date",n(t)),r.append("end_date",n(o));let c=r.toString();c&&(a+="?".concat(c));let l=await fetch(a,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=o7(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch aggregated user daily activity:",e),e}},e8=async(e,t)=>{try{let o=u?"".concat(u,"/user/get_users?role=").concat(t):"/user/get_users?role=".concat(t);console.log("in userGetAllUsersCall:",o);let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get requested models:",e),e}},e7=async e=>{try{let t=u?"".concat(u,"/user/available_roles"):"/user/available_roles",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log("response from user/available_role",a),a}catch(e){throw e}},te=async(e,t)=>{try{if(console.log("Form Values in teamCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=u?"".concat(u,"/team/new"):"/team/new",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},tt=async(e,t)=>{try{if(console.log("Form Values in credentialCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=u?"".concat(u,"/credentials"):"/credentials",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},to=async e=>{try{let t=u?"".concat(u,"/credentials"):"/credentials";console.log("in credentialListCall");let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log("/credentials API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},ta=async(e,t,o)=>{try{let a=u?"".concat(u,"/credentials"):"/credentials";t?a+="/by_name/".concat(t):o&&(a+="/by_model/".concat(o)),console.log("in credentialListCall");let r=await fetch(a,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}let n=await r.json();return console.log("/credentials API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},tr=async(e,t)=>{try{let o=u?"".concat(u,"/credentials/").concat(t):"/credentials/".concat(t);console.log("in credentialDeleteCall:",t);let a=await fetch(o,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},tn=async(e,t,o)=>{try{if(console.log("Form Values in credentialUpdateCall:",o),o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let a=u?"".concat(u,"/credentials/").concat(t):"/credentials/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...o})});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},tc=async(e,t)=>{try{if(console.log("Form Values in keyUpdateCall:",t),t.model_tpm_limit){console.log("formValues.model_tpm_limit:",t.model_tpm_limit);try{t.model_tpm_limit=JSON.parse(t.model_tpm_limit)}catch(e){throw Error("Failed to parse model_tpm_limit: "+e)}}if(t.model_rpm_limit){console.log("formValues.model_rpm_limit:",t.model_rpm_limit);try{t.model_rpm_limit=JSON.parse(t.model_rpm_limit)}catch(e){throw Error("Failed to parse model_rpm_limit: "+e)}}let o=u?"".concat(u,"/key/update"):"/key/update",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let r=await a.json();return console.log("Update key Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},tl=async(e,t)=>{try{console.log("Form Values in teamUpateCall:",t);let o=u?"".concat(u,"/team/update"):"/team/update",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),console.error("Error response from the server:",e),c.Z.fromBackend("Failed to update team settings: "+e),Error(e)}let r=await a.json();return console.log("Update Team Response:",r),r}catch(e){throw console.error("Failed to update team:",e),e}},ti=async(e,t,o)=>{try{console.log("Form Values in modelUpateCall:",t);let a=u?"".concat(u,"/model/").concat(o,"/update"):"/model/".concat(o,"/update"),r=await fetch(a,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text();throw y(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("Update model Response:",n),n}catch(e){throw console.error("Failed to update model:",e),e}},ts=async(e,t)=>{try{console.log("Form Values in modelUpateCall:",t);let o=u?"".concat(u,"/model/update"):"/model/update",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update model Response:",r),r}catch(e){throw console.error("Failed to update model:",e),e}},td=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let r=u?"".concat(u,"/team/member_add"):"/team/member_add",n=await fetch(r,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,member:o})});if(!n.ok){var a;let e=await n.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let c=await n.json();return console.log("API Response:",c),c}catch(e){throw console.error("Failed to create key:",e),e}},tu=async(e,t,o,a,r)=>{try{console.log("Bulk add team members:",{teamId:t,members:o,maxBudgetInTeam:a});let c=u?"".concat(u,"/team/bulk_member_add"):"/team/bulk_member_add",l={team_id:t};r?l.all_users=!0:l.members=o,null!=a&&(l.max_budget_in_team=a);let i=await fetch(c,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(l)});if(!i.ok){var n;let e=await i.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(n=t.detail)||void 0===n?void 0:n.error)||"Failed to bulk add team members",a=Error(o);throw a.raw=t,a}let s=await i.json();return console.log("Bulk team member add API Response:",s),s}catch(e){throw console.error("Failed to bulk add team members:",e),e}},th=async(e,t,o)=>{try{console.log("Form Values in teamMemberUpdateCall:",o),console.log("Budget value:",o.max_budget_in_team),console.log("TPM limit:",o.tpm_limit),console.log("RPM limit:",o.rpm_limit);let r=u?"".concat(u,"/team/member_update"):"/team/member_update",n={team_id:t,role:o.role,user_id:o.user_id};void 0!==o.user_email&&(n.user_email=o.user_email),void 0!==o.max_budget_in_team&&null!==o.max_budget_in_team&&(n.max_budget_in_team=o.max_budget_in_team),void 0!==o.tpm_limit&&null!==o.tpm_limit&&(n.tpm_limit=o.tpm_limit),void 0!==o.rpm_limit&&null!==o.rpm_limit&&(n.rpm_limit=o.rpm_limit),console.log("Final request body:",n);let c=await fetch(r,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(n)});if(!c.ok){var a;let e=await c.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let l=await c.json();return console.log("API Response:",l),l}catch(e){throw console.error("Failed to update team member:",e),e}},tp=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=u?"".concat(u,"/team/member_delete"):"/team/member_delete",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,...void 0!==o.user_email&&{user_email:o.user_email},...void 0!==o.user_id&&{user_id:o.user_id}})});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},tg=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=u?"".concat(u,"/organization/member_add"):"/organization/member_add",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,member:o})});if(!r.ok){let e=await r.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create organization member:",e),e}},tf=async(e,t,o)=>{try{console.log("Form Values in organizationMemberDeleteCall:",o);let a=u?"".concat(u,"/organization/member_delete"):"/organization/member_delete",r=await fetch(a,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,user_id:o})});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to delete organization member:",e),e}},tm=async(e,t,o)=>{try{console.log("Form Values in organizationMemberUpdateCall:",o);let a=u?"".concat(u,"/organization/member_update"):"/organization/member_update",r=await fetch(a,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,...o})});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to update organization member:",e),e}},tw=async(e,t,o)=>{try{console.log("Form Values in userUpdateUserCall:",t);let a=u?"".concat(u,"/user/update"):"/user/update",r={...t};null!==o&&(r.user_role=o),r=JSON.stringify(r);let n=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!n.ok){let e=await n.json(),t=o7(e);throw y(t),Error(t)}let c=await n.json();return console.log("API Response:",c),c}catch(e){throw console.error("Failed to create key:",e),e}},ty=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{let r;console.log("Form Values in userUpdateUserCall:",t);let n=u?"".concat(u,"/user/bulk_update"):"/user/bulk_update";if(a)r=JSON.stringify({all_users:!0,user_updates:t});else if(o&&o.length>0){let e=[];for(let a of o)e.push({user_id:a,...t});r=JSON.stringify({users:e})}else throw Error("Must provide either userIds or set allUsers=true");let c=await fetch(n,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!c.ok){let e=await c.json(),t=o7(e);throw y(t),Error(t)}let l=await c.json();return console.log("API Response:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},tj=async(e,t)=>{try{let o=u?"".concat(u,"/global/predict/spend/logs"):"/global/predict/spend/logs",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({data:t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},t_=async e=>{try{let t=u?"".concat(u,"/health/services?service=slack_budget_alerts"):"/health/services?service=slack_budget_alerts";console.log("Checking Slack Budget Alerts service health");let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error(e)}let a=await o.json();return c.Z.success("Test Slack Alert worked - check your Slack!"),console.log("Service Health Response:",a),a}catch(e){throw console.error("Failed to perform health check:",e),e}},tv=async(e,t)=>{try{let o=u?"".concat(u,"/health/services?service=").concat(t):"/health/services?service=".concat(t);console.log("Checking Slack Budget Alerts service health");let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error(e)}return await a.json()}catch(e){throw console.error("Failed to perform health check:",e),e}},tC=async e=>{try{let t=u?"".concat(u,"/budget/list"):"/budget/list",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tk=async e=>{try{let t=u?"".concat(u,"/budget/settings"):"/budget/settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tT=async(e,t,o)=>{try{let t=u?"".concat(u,"/get/config/callbacks"):"/get/config/callbacks",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tE=async e=>{try{let t=u?"".concat(u,"/config/list?config_type=general_settings"):"/config/list?config_type=general_settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tS=async e=>{try{let t=u?"".concat(u,"/router/settings"):"/router/settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get router settings:",e),e}},tb=async e=>{try{let t=u?"".concat(u,"/cache/settings"):"/cache/settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get cache settings:",e),e}},tF=async(e,t)=>{try{let o=u?"".concat(u,"/cache/settings/test"):"/cache/settings/test",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({cache_settings:t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to test cache connection:",e),e}},tP=async(e,t)=>{try{let o=u?"".concat(u,"/cache/settings"):"/cache/settings",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({cache_settings:t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to update cache settings:",e),e}},tO=async(e,t)=>{try{let o=u?"".concat(u,"/config/pass_through_endpoint"):"/config/pass_through_endpoint";t&&(o+="/team/".concat(t));let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tB=async(e,t)=>{try{let o=u?"".concat(u,"/config/field/info?field_name=").concat(t):"/config/field/info?field_name=".concat(t),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tN=async(e,t,o)=>{try{let a=u?"".concat(u,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o})});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}let n=await r.json();return c.Z.success("Successfully updated value!"),n}catch(e){throw console.error("Failed to set callbacks:",e),e}},tx=async(e,t)=>{try{let o=u?"".concat(u,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tA=async(e,t,o)=>{try{let a=u?"".concat(u,"/config/field/update"):"/config/field/update",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o,config_type:"general_settings"})});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}let n=await r.json();return c.Z.success("Successfully updated value!"),n}catch(e){throw console.error("Failed to set callbacks:",e),e}},tJ=async(e,t)=>{try{let o=u?"".concat(u,"/config/field/delete"):"/config/field/delete",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,config_type:"general_settings"})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return c.Z.success("Field reset on proxy"),r}catch(e){throw console.error("Failed to get callbacks:",e),e}},tG=async(e,t)=>{try{let o=u?"".concat(u,"/config/pass_through_endpoint?endpoint_id=").concat(t):"/config/pass_through_endpoint?endpoint_id=".concat(t),a=await fetch(o,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tU=async(e,t)=>{try{let o=u?"".concat(u,"/config/update"):"/config/update",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tI=async e=>{try{let t=u?"".concat(u,"/health"):"/health",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to call /health:",e),e}},tR=async(e,t)=>{try{let o=u?"".concat(u,"/health?model=").concat(encodeURIComponent(t)):"/health?model=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to call /health for model ".concat(t,":"),e),e}},tM=async e=>{try{let t=u?"".concat(u,"/cache/ping"):"/cache/ping",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /cache/ping:",e),e}},tz=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;try{let n=u?"".concat(u,"/health/history"):"/health/history",c=new URLSearchParams;t&&c.append("model",t),o&&c.append("status_filter",o),c.append("limit",a.toString()),c.append("offset",r.toString()),c.toString()&&(n+="?".concat(c.toString()));let l=await fetch(n,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw y(e),Error(e)}return await l.json()}catch(e){throw console.error("Failed to call /health/history:",e),e}},tL=async e=>{try{let t=u?"".concat(u,"/health/latest"):"/health/latest",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /health/latest:",e),e}},tD=async e=>{try{console.log("Getting proxy UI settings"),console.log("proxyBaseUrl in getProxyUISettings:",u);let t=u?"".concat(u,"/sso/get/ui_settings"):"/sso/get/ui_settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tV=async e=>{try{let t=u?"".concat(u,"/v2/guardrails/list"):"/v2/guardrails/list",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get guardrails list:",e),e}},tq=async e=>{try{let t=u?"".concat(u,"/prompts/list"):"/prompts/list",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get prompts list:",e),e}},tZ=async(e,t)=>{try{let o=u?"".concat(u,"/prompts/").concat(t,"/info"):"/prompts/".concat(t,"/info"),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to get prompt info:",e),e}},tH=async(e,t)=>{try{let o=u?"".concat(u,"/prompts/").concat(t,"/versions"):"/prompts/".concat(t,"/versions"),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw 404!==a.status&&y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to get prompt versions:",e),e}},tW=async(e,t)=>{try{let o=u?"".concat(u,"/prompts"):"/prompts",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create prompt:",e),e}},tY=async(e,t,o)=>{try{let a=u?"".concat(u,"/prompts/").concat(t):"/prompts/".concat(t),r=await fetch(a,{method:"PUT",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to update prompt:",e),e}},tQ=async(e,t)=>{try{let o=u?"".concat(u,"/prompts/").concat(t):"/prompts/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to delete prompt:",e),e}},tK=async(e,t)=>{try{let o=new FormData;o.append("file",t);let a=u?"".concat(u,"/utils/dotprompt_json_converter"):"/utils/dotprompt_json_converter",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e)},body:o});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to convert prompt file:",e),e}},t$=async(e,t,o)=>{try{let a=u?"".concat(u,"/prompts/").concat(t):"/prompts/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to patch prompt:",e),e}},tX=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents"):"/v1/agents",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Create agent response:",r),r}catch(e){throw console.error("Failed to create agent:",e),e}},t0=async(e,t)=>{try{let o=u?"".concat(u,"/guardrails"):"/guardrails",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({guardrail:t})});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Create guardrail response:",r),r}catch(e){throw console.error("Failed to create guardrail:",e),e}},t1=async(e,t,o)=>{try{let a=u?"".concat(u,"/spend/logs/ui/").concat(t,"?start_date=").concat(encodeURIComponent(o)):"/spend/logs/ui/".concat(t,"?start_date=").concat(encodeURIComponent(o));console.log("Fetching log details from:",a);let r=await fetch(a,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}let n=await r.json();return console.log("Fetched log details:",n),n}catch(e){throw console.error("Failed to fetch log details:",e),e}},t4=async e=>{try{let t=u?"".concat(u,"/get/internal_user_settings"):"/get/internal_user_settings";console.log("Fetching SSO settings from:",t);let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched SSO settings:",a),a}catch(e){throw console.error("Failed to fetch SSO settings:",e),e}},t3=async(e,t)=>{try{let o=u?"".concat(u,"/update/internal_user_settings"):"/update/internal_user_settings";console.log("Updating internal user settings:",t);let a=await fetch(o,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Updated internal user settings:",r),c.Z.success("Internal user settings updated successfully"),r}catch(e){throw console.error("Failed to update internal user settings:",e),e}},t2=async e=>{try{let t=u?"".concat(u,"/v1/mcp/server"):"/v1/mcp/server";console.log("Fetching MCP servers from:",t);let o=await fetch(t,{method:f.GET,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched MCP servers:",a),a}catch(e){throw console.error("Failed to fetch MCP servers:",e),e}},t5=async e=>{try{let t=u?"".concat(u,"/v1/mcp/access_groups"):"/v1/mcp/access_groups";console.log("Fetching MCP access groups from:",t);let o=await fetch(t,{method:f.GET,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched MCP access groups:",a),a.access_groups||[]}catch(e){throw console.error("Failed to fetch MCP access groups:",e),e}},t9=async(e,t)=>{try{console.log("Form Values in createMCPServer:",t);let o=u?"".concat(u,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},t6=async(e,t)=>{try{let o=u?"".concat(u,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"PUT",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to update MCP server:",e),e}},t8=async(e,t)=>{try{let o=(u?"".concat(u):"")+"/v1/mcp/server/".concat(t);console.log("in deleteMCPServer:",t);let a=await fetch(o,{method:f.DELETE,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}}catch(e){throw console.error("Failed to delete key:",e),e}},t7=async e=>{try{let t=u?"".concat(u,"/search_tools/list"):"/search_tools/list";console.log("Fetching search tools from:",t);let o=await fetch(t,{method:f.GET,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched search tools:",a),a}catch(e){throw console.error("Failed to fetch search tools:",e),e}},oe=async(e,t)=>{try{let o=u?"".concat(u,"/search_tools/").concat(t):"/search_tools/".concat(t);console.log("Fetching search tool by ID from:",o);let a=await fetch(o,{method:f.GET,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("Fetched search tool:",r),r}catch(e){throw console.error("Failed to fetch search tool:",e),e}},ot=async(e,t)=>{try{console.log("Creating search tool with values:",t);let o=u?"".concat(u,"/search_tools"):"/search_tools",a=await fetch(o,{method:f.POST,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({search_tool:t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("Created search tool:",r),r}catch(e){throw console.error("Failed to create search tool:",e),e}},oo=async(e,t,o)=>{try{console.log("Updating search tool with ID:",t,"values:",o);let a=u?"".concat(u,"/search_tools/").concat(t):"/search_tools/".concat(t),r=await fetch(a,{method:f.PUT,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({search_tool:o})});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}let n=await r.json();return console.log("Updated search tool:",n),n}catch(e){throw console.error("Failed to update search tool:",e),e}},oa=async(e,t)=>{try{let o=(u?"".concat(u):"")+"/search_tools/".concat(t);console.log("Deleting search tool:",t);let a=await fetch(o,{method:f.DELETE,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("Deleted search tool:",r),r}catch(e){throw console.error("Failed to delete search tool:",e),e}},or=async e=>{try{let t=u?"".concat(u,"/search_tools/ui/available_providers"):"/search_tools/ui/available_providers";console.log("Fetching available search providers from:",t);let o=await fetch(t,{method:f.GET,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched available search providers:",a),a}catch(e){throw console.error("Failed to fetch available search providers:",e),e}},on=async(e,t)=>{try{let o=u?"".concat(u,"/search_tools/test_connection"):"/search_tools/test_connection";console.log("Testing search tool connection:",o);let a=await fetch(o,{method:f.POST,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({litellm_params:t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("Test connection response:",r),r}catch(e){throw console.error("Failed to test search tool connection:",e),e}},oc=async(e,t)=>{try{let o=u?"".concat(u,"/mcp-rest/tools/list?server_id=").concat(t):"/mcp-rest/tools/list?server_id=".concat(t);console.log("Fetching MCP tools from:",o);let a={[v]:"Bearer ".concat(e),"Content-Type":"application/json"},r=await fetch(o,{method:"GET",headers:a}),n=await r.json();if(console.log("Fetched MCP tools response:",n),!r.ok){if(n.error&&n.message)throw Error(n.message);throw Error("Failed to fetch MCP tools")}return n}catch(e){return console.error("Failed to fetch MCP tools:",e),{tools:[],error:"network_error",message:e instanceof Error?e.message:"Failed to fetch MCP tools",stack_trace:null}}},ol=async(e,t,o)=>{try{let a=u?"".concat(u,"/mcp-rest/tools/call"):"/mcp-rest/tools/call";console.log("Calling MCP tool:",t,"with arguments:",o);let r={[v]:"Bearer ".concat(e),"Content-Type":"application/json"},n=await fetch(a,{method:"POST",headers:r,body:JSON.stringify({name:t,arguments:o})});if(!n.ok){let e="Network response was not ok",t=null,o=await n.text();try{let a=JSON.parse(o);a.detail?"string"==typeof a.detail?e=a.detail:"object"==typeof a.detail&&(e=a.detail.message||a.detail.error||"An error occurred",t=a.detail):e=a.message||a.error||e}catch(t){console.error("Failed to parse JSON error response:",t),o&&(e=o)}let a=Error(e);throw a.status=n.status,a.statusText=n.statusText,a.details=t,y(e),a}let c=await n.json();return console.log("MCP tool call response:",c),c}catch(e){throw console.error("Failed to call MCP tool:",e),console.error("Error type:",typeof e),e instanceof Error&&(console.error("Error message:",e.message),console.error("Error stack:",e.stack)),e}},oi=async(e,t)=>{try{let o=u?"".concat(u,"/tag/new"):"/tag/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await y(e);return}return await a.json()}catch(e){throw console.error("Error creating tag:",e),e}},os=async(e,t)=>{try{let o=u?"".concat(u,"/tag/update"):"/tag/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await y(e);return}return await a.json()}catch(e){throw console.error("Error updating tag:",e),e}},od=async(e,t)=>{try{let o=u?"".concat(u,"/tag/info"):"/tag/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({names:t})});if(!a.ok){let e=await a.text();return await y(e),{}}return await a.json()}catch(e){throw console.error("Error getting tag info:",e),e}},ou=async e=>{try{let t=u?"".concat(u,"/tag/list"):"/tag/list",o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.text();return await y(e),{}}return await o.json()}catch(e){throw console.error("Error listing tags:",e),e}},oh=async(e,t)=>{try{let o=u?"".concat(u,"/tag/delete"):"/tag/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({name:t})});if(!a.ok){let e=await a.text();await y(e);return}return await a.json()}catch(e){throw console.error("Error deleting tag:",e),e}},op=async e=>{try{let t=u?"".concat(u,"/get/default_team_settings"):"/get/default_team_settings";console.log("Fetching default team settings from:",t);let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched default team settings:",a),a}catch(e){throw console.error("Failed to fetch default team settings:",e),e}},og=async(e,t)=>{try{let o=u?"".concat(u,"/update/default_team_settings"):"/update/default_team_settings";console.log("Updating default team settings:",t);let a=await fetch(o,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("Updated default team settings:",r),c.Z.success("Default team settings updated successfully"),r}catch(e){throw console.error("Failed to update default team settings:",e),e}},of=async(e,t)=>{try{let o=u?"".concat(u,"/team/permissions_list?team_id=").concat(t):"/team/permissions_list?team_id=".concat(t),a=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=await a.json();return console.log("Team permissions response:",r),r}catch(e){throw console.error("Failed to get team permissions:",e),e}},om=async(e,t,o)=>{try{let a=u?"".concat(u,"/team/permissions_update"):"/team/permissions_update",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({team_id:t,team_member_permissions:o})});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}let n=await r.json();return console.log("Team permissions response:",n),n}catch(e){throw console.error("Failed to update team permissions:",e),e}},ow=async(e,t)=>{try{let o=u?"".concat(u,"/spend/logs/session/ui?session_id=").concat(encodeURIComponent(t)):"/spend/logs/session/ui?session_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to fetch session logs:",e),e}},oy=async(e,t)=>{try{let o=u?"".concat(u,"/vector_store/new"):"/vector_store/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to create vector store")}return await a.json()}catch(e){throw console.error("Error creating vector store:",e),e}},oj=async function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let t=u?"".concat(u,"/vector_store/list"):"/vector_store/list",o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.json();throw Error(e.detail||"Failed to list vector stores")}return await o.json()}catch(e){throw console.error("Error listing vector stores:",e),e}},o_=async(e,t)=>{try{let o=u?"".concat(u,"/vector_store/delete"):"/vector_store/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to delete vector store")}return await a.json()}catch(e){throw console.error("Error deleting vector store:",e),e}},ov=async(e,t)=>{try{let o=u?"".concat(u,"/vector_store/info"):"/vector_store/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to get vector store info")}return await a.json()}catch(e){throw console.error("Error getting vector store info:",e),e}},oC=async(e,t)=>{try{let o=u?"".concat(u,"/vector_store/update"):"/vector_store/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to update vector store")}return await a.json()}catch(e){throw console.error("Error updating vector store:",e),e}},ok=async e=>{try{let t=u?"".concat(u,"/email/event_settings"):"/email/event_settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to get email event settings")}let a=await o.json();return console.log("Email event settings response:",a),a}catch(e){throw console.error("Failed to get email event settings:",e),e}},oT=async(e,t)=>{try{let o=u?"".concat(u,"/email/event_settings"):"/email/event_settings",a=await fetch(o,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw y(e),Error("Failed to update email event settings")}let r=await a.json();return console.log("Update email event settings response:",r),r}catch(e){throw console.error("Failed to update email event settings:",e),e}},oE=async e=>{try{let t=u?"".concat(u,"/email/event_settings/reset"):"/email/event_settings/reset",o=await fetch(t,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to reset email event settings")}let a=await o.json();return console.log("Reset email event settings response:",a),a}catch(e){throw console.error("Failed to reset email event settings:",e),e}},oS=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents/").concat(t):"/v1/agents/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Delete agent response:",r),r}catch(e){throw console.error("Failed to delete agent:",e),e}},ob=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents/").concat(t,"/make_public"):"/v1/agents/".concat(t,"/make_public"),a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Make agent public response:",r),r}catch(e){throw console.error("Failed to make agent public:",e),e}},oF=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents/make_public"):"/v1/agents/make_public",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({agent_ids:t})});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Make agents public response:",r),r}catch(e){throw console.error("Failed to make agents public:",e),e}},oP=async(e,t)=>{try{let o=u?"".concat(u,"/v1/mcp/make_public"):"/v1/mcp/make_public",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({mcp_server_ids:t})});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Make agents public response:",r),r}catch(e){throw console.error("Failed to make agents public:",e),e}},oO=async(e,t)=>{try{let o=u?"".concat(u,"/guardrails/").concat(t):"/guardrails/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Delete guardrail response:",r),r}catch(e){throw console.error("Failed to delete guardrail:",e),e}},oB=async e=>{try{let t=u?"".concat(u,"/guardrails/ui/add_guardrail_settings"):"/guardrails/ui/add_guardrail_settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to get guardrail UI settings")}let a=await o.json();return console.log("Guardrail UI settings response:",a),a}catch(e){throw console.error("Failed to get guardrail UI settings:",e),e}},oN=async e=>{try{let t=u?"".concat(u,"/guardrails/ui/provider_specific_params"):"/guardrails/ui/provider_specific_params",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to get guardrail provider specific parameters")}let a=await o.json();return console.log("Guardrail provider specific params response:",a),a}catch(e){throw console.error("Failed to get guardrail provider specific parameters:",e),e}},ox=async e=>{try{let t=u?"".concat(u,"/v1/agents"):"/v1/agents",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to get agents list")}let a=await o.json();return console.log("Agents list response:",a),{agents:a}}catch(e){throw console.error("Failed to get agents list:",e),e}},oA=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents/").concat(t):"/v1/agents/".concat(t),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error("Failed to get agent info")}let r=await a.json();return console.log("Agent info response:",r),r}catch(e){throw console.error("Failed to get agent info:",e),e}},oJ=async(e,t)=>{try{let o=u?"".concat(u,"/guardrails/").concat(t,"/info"):"/guardrails/".concat(t,"/info"),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error("Failed to get guardrail info")}let r=await a.json();return console.log("Guardrail info response:",r),r}catch(e){throw console.error("Failed to get guardrail info:",e),e}},oG=async(e,t,o)=>{try{let a=u?"".concat(u,"/v1/agents/").concat(t):"/v1/agents/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw y(e),Error("Failed to patch agent")}let n=await r.json();return console.log("Patch agent response:",n),n}catch(e){throw console.error("Failed to update guardrail:",e),e}},oU=async(e,t,o)=>{try{let a=u?"".concat(u,"/guardrails/").concat(t):"/guardrails/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw y(e),Error("Failed to update guardrail")}let n=await r.json();return console.log("Update guardrail response:",n),n}catch(e){throw console.error("Failed to update guardrail:",e),e}},oI=async(e,t,o,a,r)=>{try{let c=u?"".concat(u,"/guardrails/apply_guardrail"):"/guardrails/apply_guardrail",l={guardrail_name:t,text:o};a&&(l.language=a),r&&r.length>0&&(l.entities=r);let i=await fetch(c,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(l)});if(!i.ok){let e=await i.text(),t="Failed to apply guardrail";try{var n;let o=JSON.parse(e);(null===(n=o.error)||void 0===n?void 0:n.message)?t=o.error.message:o.detail?t=o.detail:o.message&&(t=o.message)}catch(o){t=e||t}throw y(e),Error(t)}let s=await i.json();return console.log("Apply guardrail response:",s),s}catch(e){throw console.error("Failed to apply guardrail:",e),e}},oR=async(e,t)=>{try{let o=u?"".concat(u,"/guardrails/validate_blocked_words_file"):"/guardrails/validate_blocked_words_file",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({file_content:t})});if(!a.ok){let e=await a.text();throw y(e),Error("Failed to validate blocked words file")}let r=await a.json();return console.log("Validate blocked words file response:",r),r}catch(e){throw console.error("Failed to validate blocked words file:",e),e}},oM=async e=>{try{let t=u?"".concat(u,"/get/sso_settings"):"/get/sso_settings";console.log("Fetching SSO configuration from:",t);let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched SSO configuration:",a),a}catch(e){throw console.error("Failed to fetch SSO configuration:",e),e}},oz=async(e,t)=>{try{let r=u?"".concat(u,"/update/sso_settings"):"/update/sso_settings";console.log("Updating SSO configuration:",t);let n=await fetch(r,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){var o,a;let e=await n.json(),t="object"==typeof(null==e?void 0:e.detail)?(null===(o=e.detail)||void 0===o?void 0:o.error)||(null===(a=e.detail)||void 0===a?void 0:a.message):null==e?void 0:e.detail,r="string"==typeof t&&t.length>0?t:o7(e);y(r);let c=Error(r);throw(null==e?void 0:e.detail)!==void 0&&(c.detail=e.detail),c.rawError=e,c}let c=await n.json();return console.log("Updated SSO configuration:",c),c}catch(e){throw console.error("Failed to update SSO configuration:",e),e}},oL=async(e,t,o,a,r)=>{try{let t=u?"".concat(u,"/audit"):"/audit",o=new URLSearchParams;a&&o.append("page",a.toString()),r&&o.append("page_size",r.toString());let n=o.toString();n&&(t+="?".concat(n));let c=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.json(),t=o7(e);throw y(t),Error(t)}return await c.json()}catch(e){throw console.error("Failed to fetch audit logs:",e),e}},oD=async e=>{try{let t=u?"".concat(u,"/user/available_users"):"/user/available_users",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e)}});if(!o.ok){if(404===o.status)return null;let e=await o.text();throw y(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to fetch remaining users:",e),e}},oV=async(e,t,o)=>{try{let a=u?"".concat(u,"/config/pass_through_endpoint/").concat(encodeURIComponent(t)):"/config/pass_through_endpoint/".concat(encodeURIComponent(t)),r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.json(),t=o7(e);throw y(t),Error(t)}let n=await r.json();return c.Z.success("Pass through endpoint updated successfully"),n}catch(e){throw console.error("Failed to update pass through endpoint:",e),e}},oq=async(e,t)=>{try{let o=u?"".concat(u,"/config/pass_through_endpoint?endpoint_id=").concat(encodeURIComponent(t)):"/config/pass_through_endpoint?endpoint_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}let r=(await a.json()).endpoints;if(!r||0===r.length)throw Error("Pass through endpoint not found");return r[0]}catch(e){throw console.error("Failed to get pass through endpoint info:",e),e}},oZ=async(e,t)=>{try{let o=u?"".concat(u,"/config/callback/delete"):"/config/callback/delete",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({callback_name:t})});if(!a.ok){let e=await a.json(),t=o7(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to delete specific callback:",e),e}},oH=async e=>{let t=g(),o=await fetch("".concat(t,"/v1/mcp/tools"),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw Error("HTTP error! status: ".concat(o.status));return await o.json()},oW=async(e,t)=>{try{console.log("Testing MCP connection with config:",JSON.stringify(t));let a=u?"".concat(u,"/mcp-rest/test/connection"):"/mcp-rest/test/connection",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",[v]:"Bearer ".concat(e)},body:JSON.stringify(t)}),n=r.headers.get("content-type");if(!n||!n.includes("application/json")){let e=await r.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(r.status,": ").concat(r.statusText,"). Check network tab for details."))}let c=await r.json();if(!r.ok||"error"===c.status){if("error"===c.status);else{var o;return{status:"error",message:(null===(o=c.error)||void 0===o?void 0:o.message)||"MCP connection test failed: ".concat(r.status," ").concat(r.statusText)}}}return c}catch(e){throw console.error("MCP connection test error:",e),e}},oY=async(e,t,o)=>{try{console.log("Testing MCP tools list with config:",JSON.stringify(t));let a=u?"".concat(u,"/mcp-rest/test/tools/list"):"/mcp-rest/test/tools/list",r={"Content-Type":"application/json"};e&&(r["x-litellm-api-key"]=e),o?r.Authorization="Bearer ".concat(o):e&&(r[v]="Bearer ".concat(e));let n=await fetch(a,{method:"POST",headers:r,body:JSON.stringify(t)}),c=n.headers.get("content-type");if(!c||!c.includes("application/json")){let e=await n.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(n.status,": ").concat(n.statusText,"). Check network tab for details."))}let l=await n.json();if((!n.ok||l.error)&&!l.error)return{tools:[],error:"request_failed",message:l.message||"MCP tools list failed: ".concat(n.status," ").concat(n.statusText)};return l}catch(e){throw console.error("MCP tools list test error:",e),e}},oQ=async(e,t)=>{let o=u?"".concat(u,"/v1/mcp/server/oauth/session"):"/v1/mcp/server/oauth/session",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await a.json();if(!a.ok)throw Error(o7(r)||(null==r?void 0:r.error)||"Failed to cache MCP server");return r},oK=async(e,t,o)=>{let a=g(),r=encodeURIComponent(t.trim()),n="".concat(a,"/v1/mcp/server/oauth/").concat(r,"/register"),c=await fetch(n,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json",Accept:"application/json, text/event-stream"},body:JSON.stringify(o)}),l=await c.json();if(!c.ok)throw Error(o7(l)||(null==l?void 0:l.detail)||"Failed to register OAuth client");return l},o$=e=>{let{serverId:t,clientId:o,redirectUri:a,state:r,codeChallenge:n,scope:c}=e,l=g(),i=encodeURIComponent(t.trim()),s="".concat(l,"/v1/mcp/server/oauth/").concat(i,"/authorize"),d=new URLSearchParams({redirect_uri:a,state:r,response_type:"code",code_challenge:n,code_challenge_method:"S256"});return o&&o.trim().length>0&&d.set("client_id",o),c&&c.trim().length>0&&d.set("scope",c),"".concat(s,"?").concat(d.toString())},oX=async e=>{let{serverId:t,code:o,clientId:a,clientSecret:r,codeVerifier:n,redirectUri:c}=e,l=g(),i=encodeURIComponent(t.trim()),s="".concat(l,"/v1/mcp/server/oauth/").concat(i,"/token"),d=new URLSearchParams;d.set("grant_type","authorization_code"),d.set("code",o),a&&a.trim().length>0&&d.set("client_id",a),r&&r.trim().length>0&&d.set("client_secret",r),d.set("code_verifier",n),d.set("redirect_uri",c);let u=await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:d.toString()}),h=await u.json();if(!u.ok)throw Error(o7(h)||(null==h?void 0:h.detail)||"OAuth token exchange failed");return h},o0=async(e,t,o)=>{try{let a="".concat(g(),"/v1/vector_stores/").concat(t,"/search"),r=await fetch(a,{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({query:o})});if(!r.ok){let e=await r.text();return await y(e),null}return await r.json()}catch(e){throw console.error("Error testing vector store search:",e),e}},o1=async(e,t,o,a)=>{try{let r="".concat(g(),"/v1/search/").concat(t),n=await fetch(r,{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({query:o,max_results:a||5})});if(!n.ok){let e=await n.text();return await y(e),null}return await n.json()}catch(e){throw console.error("Error querying search tool:",e),e}},o4=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:50,n=arguments.length>5?arguments[5]:void 0;try{let c=u?"".concat(u,"/tag/user-agent/analytics"):"/tag/user-agent/analytics",l=new URLSearchParams,i=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};l.append("start_date",i(t)),l.append("end_date",i(o)),l.append("page",a.toString()),l.append("page_size",r.toString()),n&&l.append("user_agent_filter",n);let s=l.toString();s&&(c+="?".concat(s));let d=await fetch(c,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!d.ok){let e=await d.json(),t=o7(e);throw y(t),Error(t)}return await d.json()}catch(e){throw console.error("Failed to fetch user agent analytics:",e),e}},o3=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/tag/dau"):"/tag/dau",n=new URLSearchParams;n.append("end_date",(e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)})(t)),a&&a.length>0?a.forEach(e=>{n.append("tag_filters",e)}):o&&n.append("tag_filter",o);let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=o7(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch DAU:",e),e}},o2=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/tag/wau"):"/tag/wau",n=new URLSearchParams;n.append("end_date",(e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)})(t)),a&&a.length>0?a.forEach(e=>{n.append("tag_filters",e)}):o&&n.append("tag_filter",o);let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=o7(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch WAU:",e),e}},o5=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/tag/mau"):"/tag/mau",n=new URLSearchParams;n.append("end_date",(e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)})(t)),a&&a.length>0?a.forEach(e=>{n.append("tag_filters",e)}):o&&n.append("tag_filter",o);let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=o7(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch MAU:",e),e}},o9=async e=>{try{let t=u?"".concat(u,"/tag/distinct"):"/tag/distinct",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=o7(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to fetch distinct tags:",e),e}},o6=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/tag/summary"):"/tag/summary",n=new URLSearchParams,c=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};n.append("start_date",c(t)),n.append("end_date",c(o)),a&&a.length>0&&a.forEach(e=>{n.append("tag_filters",e)});let l=n.toString();l&&(r+="?".concat(l));let i=await fetch(r,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=o7(e);throw y(t),Error(t)}return await i.json()}catch(e){throw console.error("Failed to fetch user agent summary:",e),e}},o8=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,a=arguments.length>3?arguments[3]:void 0;try{let r=u?"".concat(u,"/tag/user-agent/per-user-analytics"):"/tag/user-agent/per-user-analytics",n=new URLSearchParams;n.append("page",t.toString()),n.append("page_size",o.toString()),a&&a.length>0&&a.forEach(e=>{n.append("tag_filters",e)});let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=o7(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch per-user analytics:",e),e}},o7=e=>(null==e?void 0:e.error)&&(e.error.message||e.error)||(null==e?void 0:e.message)||(null==e?void 0:e.detail)||(null==e?void 0:e.error)||JSON.stringify(e),ae=async(e,t)=>{let o=g(),a=JSON.stringify({username:e,password:t}),r=await fetch(o?"".concat(o,"/v2/login"):"/v2/login",{method:"POST",body:a,credentials:"include",headers:{"Content-Type":"application/json"}});if(!r.ok)throw Error(o7(await r.json()));return await r.json()},at=async e=>{let t=g(),o=await fetch(t?"".concat(t,"/get/ui_settings"):"/get/ui_settings",{method:"GET",headers:{[v]:"Bearer ".concat(e)}});if(!o.ok)throw Error(o7(await o.json()));return await o.json()},ao=async(e,t)=>{let o=g(),a=await fetch(o?"".concat(o,"/update/ui_settings"):"/update/ui_settings",{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw Error(o7(await a.json()));return await a.json()}},85968:function(e,t,o){o.d(t,{O:function(){return a}});let a=e=>{if(!e)return"An unknown error occurred";if("string"==typeof e)return e;if(e.message)try{let t=JSON.parse(e.message);if(t.error&&t.error.message)return t.error.message;return"string"==typeof t?t:JSON.stringify(t,null,2)}catch(t){return e.message}if(e.response&&e.response.data){if("string"==typeof e.response.data)return e.response.data;if(e.response.data.message)return e.response.data.message;if(e.response.data.error)return"string"==typeof e.response.data.error?e.response.data.error:e.response.data.error.message||JSON.stringify(e.response.data.error)}return String(e)}},3914:function(e,t,o){function a(){if("undefined"==typeof document)return;let e=window.location.hostname,t=window.location.pathname,o=["/","/ui"];if(t&&"/"!==t&&!t.startsWith("/ui")){let e=t.substring(0,t.lastIndexOf("/")+1);e&&!o.includes(e)&&o.push(e)}let a=["Lax","Strict","None"];o.forEach(t=>{document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(t,";"),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(t,"; domain=").concat(e,";"),a.forEach(o=>{let a="None"===o?" Secure;":"";document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(t,"; SameSite=").concat(o,";").concat(a),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(t,"; domain=").concat(e,"; SameSite=").concat(o,";").concat(a)})}),console.log("After clearing cookies:",document.cookie)}function r(e){if("undefined"==typeof document)return null;let t=document.cookie.split("; ").find(t=>t.startsWith(e+"="));return t?t.split("=")[1]:null}o.d(t,{b:function(){return a},e:function(){return r}})},9309:function(e,t,o){o.d(t,{Ac:function(){return n},N4:function(){return a},aS:function(){return r}});let a=e=>e?e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()):e;function r(e,t){return e.length>t?e.substring(0,t)+"...":e}let n=(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8093-e09634b69e09143b.js b/litellm/proxy/_experimental/out/_next/static/chunks/8093-e09634b69e09143b.js deleted file mode 100644 index c46d30ad04b..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/8093-e09634b69e09143b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8093],{78093:function(e,t,s){s.d(t,{Z:function(){return e1}});var n=s(57437),r=s(2265),a=s(16312),l=s(22116),o=s(19250),i=s(78489),c=s(21626),d=s(97214),m=s(28241),p=s(58834),x=s(69552),u=s(71876),h=s(74998),g=s(44633),v=s(86462),f=s(49084),j=s(99981),b=s(23639),y=s(71594),N=s(24525),w=s(42673);let _=e=>{let t=new Set,s=/\{\{(\w+)\}\}/g;if(e.messages.forEach(e=>{let n;for(;null!==(n=s.exec(e.content));)t.add(n[1])}),e.developerMessage){let n;for(;null!==(n=s.exec(e.developerMessage));)t.add(n[1])}return Array.from(t)},k=e=>{let t=_(e),s="---\nmodel: ".concat(e.model,"\n");return void 0!==e.config.temperature&&(s+="temperature: ".concat(e.config.temperature,"\n")),void 0!==e.config.max_tokens&&(s+="max_tokens: ".concat(e.config.max_tokens,"\n")),void 0!==e.config.top_p&&(s+="top_p: ".concat(e.config.top_p,"\n")),s+="input:\n schema:\n",t.forEach(e=>{s+=" ".concat(e,": string\n")}),s+="output:\n format: text\n",e.tools&&e.tools.length>0&&(s+="tools:\n",e.tools.forEach(e=>{let t=JSON.parse(e.json);s+=" - ".concat(JSON.stringify(t),"\n")})),s+="---\n\n",e.developerMessage&&""!==e.developerMessage.trim()&&(s+="Developer: ".concat(e.developerMessage.trim(),"\n\n")),e.messages.forEach(e=>{let t=e.role.charAt(0).toUpperCase()+e.role.slice(1);s+="".concat(t,": ").concat(e.content,"\n\n")}),s.trim()},C=e=>{var t,s,n;let r=(null==e?void 0:null===(s=e.prompt_spec)||void 0===s?void 0:null===(t=s.litellm_params)||void 0===t?void 0:t.dotprompt_content)||"";if(!r)throw Error("No dotprompt_content found in API response");let a=r.split("---");if(a.length<3)throw Error("Invalid dotprompt format");let l=a[1],o=a.slice(2).join("---").trim(),i={};l.split("\n").forEach(e=>{let t=e.trim();if(t&&!t.startsWith("input:")&&!t.startsWith("output:")&&!t.startsWith("schema:")&&!t.startsWith("format:")){let e=t.indexOf(":");if(e>0){let s=t.substring(0,e).trim(),n=t.substring(e+1).trim();"temperature"===s||"max_tokens"===s||"top_p"===s?i[s]=parseFloat(n):"model"===s&&(i[s]=n)}}});let c="",d=[],m=o.split("\n"),p=null,x="";for(let e of m)e.startsWith("Developer:")?c=e.substring(10).trim():e.startsWith("User:")?(p&&x&&d.push({role:p,content:x.trim()}),p="user",x=e.substring(5).trim()):e.startsWith("Assistant:")?(p&&x&&d.push({role:p,content:x.trim()}),p="assistant",x=e.substring(10).trim()):e.trim()&&p&&(x+="\n"+e.trim());p&&x&&d.push({role:p,content:x.trim()});let u=(null==e?void 0:null===(n=e.prompt_spec)||void 0===n?void 0:n.prompt_id)||"Unnamed Prompt";return{name:Z(u)||u,model:i.model||"gpt-4o",config:{temperature:i.temperature,max_tokens:i.max_tokens,top_p:i.top_p},tools:[],developerMessage:c,messages:d.length>0?d:[{role:"user",content:"Enter task specifics. Use {{template_variables}} for dynamic inputs"}]}},S=e=>{if(!e)return"1";let t=e.match(/[._-]v(\d+)$/);return t?t[1]:"1"},Z=e=>e?e.replace(/[._-]v\d+$/,""):"",P=e=>{let t;if(!e)return{};let s={},n=/\{\{(\w+)\}\}/g;for(;null!==(t=n.exec(e));){let e=t[1];s[e]||(s[e]="example_".concat(e))}return s},T=e=>(null==e?void 0:e.prompt_id)||"",D=e=>{var t;let s=T(e);return(null==e?void 0:null===(t=e.litellm_params)||void 0===t?void 0:t.prompt_id)||s},E=e=>(null==e?void 0:e.version)?String(e.version):S(D(e)),O=e=>{try{var t;let s=e.litellm_params;if(null==s?void 0:s.dotprompt_content){let e=s.dotprompt_content.match(/model:\s*([^\n]+)/);if(e)return e[1].trim()}if(null==s?void 0:null===(t=s.prompt_data)||void 0===t?void 0:t.model)return s.prompt_data.model;if(null==s?void 0:s.model)return s.model;return null}catch(e){return console.error("Error extracting model:",e),null}},z=(e,t)=>{if(!e)return null;let s=t.get(e);return s&&s.providers&&s.providers.length>0?s.providers[0]:null};var A=e=>{let{promptsList:t,isLoading:s,onPromptClick:a,onDeleteClick:l,accessToken:_,isAdmin:k}=e,[C,S]=(0,r.useState)([{id:"created_at",desc:!0}]),[Z,P]=(0,r.useState)(new Map);(0,r.useEffect)(()=>{(async()=>{if(_)try{let e=await (0,o.modelHubCall)(_);if(null==e?void 0:e.data){let t=new Map;e.data.forEach(e=>{t.set(e.model_group,e)}),P(t)}}catch(e){console.error("Error fetching model hub data:",e)}})()},[_]);let T=e=>e?new Date(e).toLocaleString():"-",D=e=>{navigator.clipboard.writeText(e)},E=[{header:"Prompt ID",accessorKey:"prompt_id",cell:e=>{let t=String(e.getValue()||""),s=t.length>25?"".concat(t.slice(0,25),"..."):t;return(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(j.Z,{title:t,children:(0,n.jsx)(i.Z,{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 min-w-[220px] justify-start",onClick:()=>e.getValue()&&(null==a?void 0:a(e.getValue())),children:s})}),(0,n.jsx)(j.Z,{title:"Copy prompt ID",children:(0,n.jsx)(b.Z,{onClick:e=>{e.stopPropagation(),D(t)},className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]})}},{header:"Model",accessorKey:"model",cell:e=>{let{row:t}=e,s=O(t.original);if(!s)return(0,n.jsx)("span",{className:"text-xs text-gray-400",children:"-"});let r=z(s,Z),{logo:a}=(0,w.dr)(r||"");return(0,n.jsx)(j.Z,{title:s,children:(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)("div",{className:"flex-shrink-0",children:r&&a?(0,n.jsx)("img",{src:a,alt:"".concat(r," logo"),className:"w-4 h-4",onError:e=>{let t=e.currentTarget,s=t.parentElement;if(s&&s.contains(t))try{let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null==r?void 0:r.charAt(0))||"-",s.replaceChild(e,t)}catch(e){console.error("Failed to replace provider logo fallback:",e)}}}):(0,n.jsx)("div",{className:"w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:"-"})}),(0,n.jsx)("span",{className:"max-w-[15ch] truncate block",children:s})]})})}},{header:"Created At",accessorKey:"created_at",cell:e=>{let{row:t}=e,s=t.original;return(0,n.jsx)(j.Z,{title:s.created_at,children:(0,n.jsx)("span",{className:"text-xs",children:T(s.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:e=>{let{row:t}=e,s=t.original;return(0,n.jsx)(j.Z,{title:s.updated_at,children:(0,n.jsx)("span",{className:"text-xs",children:T(s.updated_at)})})}},{header:"Type",accessorKey:"prompt_info.prompt_type",cell:e=>{let{row:t}=e,s=t.original;return(0,n.jsx)(j.Z,{title:s.prompt_info.prompt_type,children:(0,n.jsx)("span",{className:"text-xs",children:s.prompt_info.prompt_type})})}},...k?[{header:"Actions",id:"actions",enableSorting:!1,cell:e=>{let{row:t}=e,s=t.original,r=s.prompt_id||"Unknown Prompt";return(0,n.jsx)("div",{className:"flex items-center gap-1",children:(0,n.jsx)(j.Z,{title:"Delete prompt",children:(0,n.jsx)(i.Z,{size:"xs",variant:"light",color:"red",onClick:e=>{e.stopPropagation(),null==l||l(s.prompt_id,r)},icon:h.Z,className:"text-red-500 hover:text-red-700 hover:bg-red-50"})})})}}]:[]],A=(0,y.b7)({data:t,columns:E,state:{sorting:C},onSortingChange:S,getCoreRowModel:(0,N.sC)(),getSortedRowModel:(0,N.tj)(),enableSorting:!0});return(0,n.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)(c.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,n.jsx)(p.Z,{children:A.getHeaderGroups().map(e=>(0,n.jsx)(u.Z,{children:e.headers.map(e=>(0,n.jsx)(x.Z,{className:"py-1 h-8",onClick:e.column.getToggleSortingHandler(),children:(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,y.ie)(e.column.columnDef.header,e.getContext())}),(0,n.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,n.jsx)(g.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,n.jsx)(v.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,n.jsx)(f.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,n.jsx)(d.Z,{children:s?(0,n.jsx)(u.Z,{children:(0,n.jsx)(m.Z,{colSpan:E.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"Loading..."})})})}):t.length>0?A.getRowModel().rows.map(e=>(0,n.jsx)(u.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,n.jsx)(m.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,y.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,n.jsx)(u.Z,{children:(0,n.jsx)(m.Z,{colSpan:E.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"No prompts found"})})})})})]})})})},I=s(84717),L=s(5545),M=s(10900),F=s(93416),B=s(59872),R=s(30401),J=s(78867),U=s(9114),V=s(37592),W=s(65869),K=s(11894),H=s(19431),q=s(17906),G=s(94263),X=e=>{let{promptId:t,model:s,promptVariables:a={},accessToken:o,version:i="1",proxySettings:c}=e,[d,m]=(0,r.useState)(!1),[p,x]=(0,r.useState)("curl"),[u,h]=(0,r.useState)("basic"),[g,v]=(0,r.useState)(""),f=window.location.origin,j=null==c?void 0:c.LITELLM_UI_API_DOC_BASE_URL;j&&j.trim()?f=j:(null==c?void 0:c.PROXY_BASE_URL)&&(f=c.PROXY_BASE_URL);let b=o||"sk-1234",y=()=>{let e=Object.keys(a).length>0;if("curl"===p)return"basic"===u?"curl -X POST '".concat(f,"/chat/completions' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer ").concat(b,'\' \\\n -d \'{\n "model": "').concat(s,'",\n "prompt_id": "').concat(t,'"').concat(e?',\n "prompt_variables": '.concat(JSON.stringify(a,null,6).replace(/\n/g,"\n ")):"","\n }' | jq"):"messages"===u?"curl -X POST '".concat(f,"/chat/completions' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer ").concat(b,'\' \\\n -d \'{\n "model": "').concat(s,'",\n "prompt_id": "').concat(t,'"').concat(e?',\n "prompt_variables": '.concat(JSON.stringify(a,null,6).replace(/\n/g,"\n ")):"",',\n "messages": [\n {\n "role": "user",\n "content": "hi"\n }\n ]\n }\' | jq'):"curl -X POST '".concat(f,"/chat/completions' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer ").concat(b,'\' \\\n -d \'{\n "model": "').concat(s,'",\n "prompt_id": "').concat(t,'",\n "prompt_version": ').concat(i,',\n "messages": [\n {\n "role": "user",\n "content": "Who are u"\n }\n ]\n }\' | jq');if("python"===p){let n='import openai\n\nclient = openai.OpenAI(\n api_key="'.concat(b,'",\n base_url="').concat(f,'"\n)\n');return"basic"===u?"".concat(n,'\nresponse = client.chat.completions.create(\n model="').concat(s,'",\n extra_body={\n "prompt_id": "').concat(t,'"').concat(e?',\n "prompt_variables": '.concat(JSON.stringify(a,null,8).replace(/\n/g,"\n ")):"","\n }\n)\n\nprint(response)"):"messages"===u?"".concat(n,'\nresponse = client.chat.completions.create(\n model="').concat(s,'",\n messages=[\n {"role": "user", "content": "hi"}\n ],\n extra_body={\n "prompt_id": "').concat(t,'"').concat(e?',\n "prompt_variables": '.concat(JSON.stringify(a,null,8).replace(/\n/g,"\n ")):"","\n }\n)\n\nprint(response)"):"".concat(n,'\nresponse = client.chat.completions.create(\n model="').concat(s,'",\n messages=[\n {"role": "user", "content": "Who are u"}\n ],\n extra_body={\n "prompt_id": "').concat(t,'",\n "prompt_version": ').concat(i,"\n }\n)\n\nprint(response)")}{let n="import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: \"".concat(b,'",\n baseURL: "').concat(f,'"\n});\n');return"basic"===u?"".concat(n,'\nasync function main() {\n const response = await client.chat.completions.create({\n model: "').concat(s,'",\n ').concat(e?'prompt_id: "'.concat(t,'",\n prompt_variables: ').concat(JSON.stringify(a,null,8).replace(/\n/g,"\n ")):'prompt_id: "'.concat(t,'"'),"\n });\n \n console.log(response);\n}\n\nmain();"):"messages"===u?"".concat(n,'\nasync function main() {\n const response = await client.chat.completions.create({\n model: "').concat(s,'",\n messages: [\n { role: "user", content: "hi" }\n ],\n ').concat(e?'prompt_id: "'.concat(t,'",\n prompt_variables: ').concat(JSON.stringify(a,null,8).replace(/\n/g,"\n ")):'prompt_id: "'.concat(t,'"'),"\n });\n \n console.log(response);\n}\n\nmain();"):"".concat(n,'\nasync function main() {\n const response = await client.chat.completions.create({\n model: "').concat(s,'",\n messages: [\n { role: "user", content: "Who are u" }\n ],\n prompt_id: "').concat(t,'",\n prompt_version: ').concat(i,"\n });\n \n console.log(response);\n}\n\nmain();")}};return r.useEffect(()=>{d&&v(y())},[d,p,u,t,s,a]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(H.z,{variant:"secondary",icon:K.Z,onClick:()=>{m(!0)},children:"Get Code"}),(0,n.jsxs)(l.Z,{title:"Generated Code",open:d,onCancel:()=>{m(!1)},footer:null,width:800,children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(H.x,{className:"font-medium block mb-1 text-gray-700",children:"Language"}),(0,n.jsx)(V.default,{value:p,onChange:e=>x(e),style:{width:180},options:[{value:"curl",label:"cURL"},{value:"python",label:"Python (OpenAI SDK)"},{value:"javascript",label:"JavaScript (OpenAI SDK)"}]})]}),(0,n.jsx)(L.ZP,{onClick:()=>{navigator.clipboard.writeText(g),U.Z.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,n.jsx)(W.default,{activeKey:u,onChange:h,items:[{label:"Basic",key:"basic"},{label:"With Messages",key:"messages"},{label:"With Version",key:"version"}]}),(0,n.jsx)(q.Z,{language:"curl"===p?"bash":"python"===p?"python":"javascript",style:G.Z,wrapLines:!0,wrapLongLines:!0,className:"rounded-md mt-0",customStyle:{maxHeight:"60vh",overflowY:"auto",marginTop:0,borderTopLeftRadius:0,borderTopRightRadius:0},children:g})]})]})},Y=e=>{var t,s,a;let{promptId:i,onClose:c,accessToken:d,isAdmin:m,onDelete:p,onEdit:x}=e,[u,g]=(0,r.useState)(null),[v,f]=(0,r.useState)(null),[j,b]=(0,r.useState)(null),[y,N]=(0,r.useState)(!0),[w,_]=(0,r.useState)({}),[k,C]=(0,r.useState)(!1),[S,Z]=(0,r.useState)(!1),D=async()=>{try{if(N(!0),!d)return;let e=await (0,o.getPromptInfo)(d,i);g(e.prompt_spec),f(e.raw_prompt_template),b(e)}catch(e){U.Z.fromBackend("Failed to load prompt information"),console.error("Error fetching prompt info:",e)}finally{N(!1)}};if((0,r.useEffect)(()=>{D()},[i,d]),y)return(0,n.jsx)("div",{className:"p-4",children:"Loading..."});if(!u)return(0,n.jsx)("div",{className:"p-4",children:"Prompt not found"});let z=e=>e?new Date(e).toLocaleString():"-",A=async(e,t)=>{await (0,B.vQ)(e)&&(_(e=>({...e,[t]:!0})),setTimeout(()=>{_(e=>({...e,[t]:!1}))},2e3))},V=async()=>{if(d&&u){Z(!0);try{await (0,o.deletePromptCall)(d,K),U.Z.success('Prompt "'.concat(K,'" deleted successfully')),null==p||p(),c()}catch(e){console.error("Error deleting prompt:",e),U.Z.fromBackend("Failed to delete prompt")}finally{Z(!1),C(!1)}}},W=u&&O(u)||"gpt-4o",K=T(u),H=E(u);return(0,n.jsxs)("div",{className:"p-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(I.zx,{icon:M.Z,variant:"light",onClick:c,className:"mb-4",children:"Back to Prompts"}),(0,n.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(I.Dx,{children:"Prompt Details"}),(0,n.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,n.jsx)(I.xv,{className:"text-gray-500 font-mono",children:K}),(0,n.jsx)(L.ZP,{type:"text",size:"small",icon:w["prompt-id"]?(0,n.jsx)(R.Z,{size:12}):(0,n.jsx)(J.Z,{size:12}),onClick:()=>A(K,"prompt-id"),className:"left-2 z-10 transition-all duration-200 ".concat(w["prompt-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(X,{promptId:K,model:W,promptVariables:P(null==v?void 0:v.content),accessToken:d,version:H}),(0,n.jsx)(I.zx,{icon:F.Z,variant:"primary",onClick:()=>null==x?void 0:x(j),className:"flex items-center",children:"Prompt Studio"}),m&&(0,n.jsx)(I.zx,{icon:h.Z,variant:"secondary",onClick:()=>{C(!0)},className:"flex items-center",children:"Delete Prompt"})]})]})]}),(0,n.jsxs)(I.v0,{children:[(0,n.jsxs)(I.td,{className:"mb-4",children:[(0,n.jsx)(I.OK,{children:"Overview"},"overview"),v?(0,n.jsx)(I.OK,{children:"Prompt Template"},"prompt-template"):(0,n.jsx)(n.Fragment,{}),m?(0,n.jsx)(I.OK,{children:"Details"},"details"):(0,n.jsx)(n.Fragment,{}),(0,n.jsx)(I.OK,{children:"Raw JSON"},"raw-json")]}),(0,n.jsxs)(I.nP,{children:[(0,n.jsxs)(I.x4,{children:[(0,n.jsxs)(I.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,n.jsxs)(I.Zb,{children:[(0,n.jsx)(I.xv,{children:"Prompt ID"}),(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)(I.Dx,{className:"font-mono text-sm",children:K})})]}),(0,n.jsxs)(I.Zb,{children:[(0,n.jsx)(I.xv,{children:"Version"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(I.Dx,{children:H}),(0,n.jsxs)(I.Ct,{color:"blue",className:"mt-1",children:["v",H]})]})]}),(0,n.jsxs)(I.Zb,{children:[(0,n.jsx)(I.xv,{children:"Prompt Type"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(I.Dx,{children:(null===(t=u.prompt_info)||void 0===t?void 0:t.prompt_type)||"-"}),(0,n.jsx)(I.Ct,{color:"blue",className:"mt-1",children:(null===(s=u.prompt_info)||void 0===s?void 0:s.prompt_type)||"Unknown"})]})]}),(0,n.jsxs)(I.Zb,{children:[(0,n.jsx)(I.xv,{children:"Created At"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(I.Dx,{children:z(u.created_at)}),(0,n.jsxs)(I.xv,{children:["Last Updated: ",z(u.updated_at)]})]})]})]}),u.litellm_params&&Object.keys(u.litellm_params).length>0&&(0,n.jsxs)(I.Zb,{className:"mt-6",children:[(0,n.jsx)(I.xv,{className:"font-medium",children:"LiteLLM Parameters"}),(0,n.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap",children:JSON.stringify(u.litellm_params,null,2)})})]})]}),v&&(0,n.jsx)(I.x4,{children:(0,n.jsxs)(I.Zb,{children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(I.Dx,{children:"Prompt Template"}),(0,n.jsx)(L.ZP,{type:"text",size:"small",icon:w["prompt-content"]?(0,n.jsx)(R.Z,{size:16}):(0,n.jsx)(J.Z,{size:16}),onClick:()=>A(v.content,"prompt-content"),className:"transition-all duration-200 ".concat(w["prompt-content"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:w["prompt-content"]?"Copied!":"Copy Content"})]}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(I.xv,{className:"font-medium",children:"Template ID"}),(0,n.jsx)("div",{className:"font-mono text-sm bg-gray-50 p-2 rounded",children:v.litellm_prompt_id})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(I.xv,{className:"font-medium",children:"Content"}),(0,n.jsx)("div",{className:"mt-2 p-4 bg-gray-50 rounded-md border overflow-auto max-h-96",children:(0,n.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:v.content})})]}),v.metadata&&Object.keys(v.metadata).length>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)(I.xv,{className:"font-medium",children:"Template Metadata"}),(0,n.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md border",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap overflow-auto max-h-64",children:JSON.stringify(v.metadata,null,2)})})]})]})]})}),m&&(0,n.jsx)(I.x4,{children:(0,n.jsxs)(I.Zb,{children:[(0,n.jsx)(I.Dx,{className:"mb-4",children:"Prompt Details"}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(I.xv,{className:"font-medium",children:"Prompt ID"}),(0,n.jsx)("div",{className:"font-mono text-sm bg-gray-50 p-2 rounded",children:K})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(I.xv,{className:"font-medium",children:"Prompt Type"}),(0,n.jsx)("div",{children:(null===(a=u.prompt_info)||void 0===a?void 0:a.prompt_type)||"-"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(I.xv,{className:"font-medium",children:"Created At"}),(0,n.jsx)("div",{children:z(u.created_at)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(I.xv,{className:"font-medium",children:"Last Updated"}),(0,n.jsx)("div",{children:z(u.updated_at)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(I.xv,{className:"font-medium",children:"LiteLLM Parameters"}),(0,n.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md border",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap overflow-auto max-h-96",children:JSON.stringify(u.litellm_params,null,2)})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(I.xv,{className:"font-medium",children:"Prompt Info"}),(0,n.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md border",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap",children:JSON.stringify(u.prompt_info,null,2)})})]})]})]})}),(0,n.jsx)(I.x4,{children:(0,n.jsxs)(I.Zb,{children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(I.Dx,{children:"Raw API Response"}),(0,n.jsx)(L.ZP,{type:"text",size:"small",icon:w["raw-json"]?(0,n.jsx)(R.Z,{size:16}):(0,n.jsx)(J.Z,{size:16}),onClick:()=>A(JSON.stringify(j,null,2),"raw-json"),className:"transition-all duration-200 ".concat(w["raw-json"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:w["raw-json"]?"Copied!":"Copy JSON"})]}),(0,n.jsx)("div",{className:"p-4 bg-gray-50 rounded-md border overflow-auto",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap",children:JSON.stringify(j,null,2)})})]})})]})]}),(0,n.jsxs)(l.Z,{title:"Delete Prompt",open:k,onOk:V,onCancel:()=>{C(!1)},confirmLoading:S,okText:"Delete",okButtonProps:{danger:!0},children:[(0,n.jsxs)("p",{children:["Are you sure you want to delete prompt: ",(0,n.jsx)("strong",{children:K}),"?"]}),(0,n.jsx)("p",{children:"This action cannot be undone."})]})]})},$=s(10032),Q=s(23496),ee=s(65319),et=s(31283),es=s(3632);let{Option:en}=V.default;var er=e=>{let{visible:t,onClose:s,accessToken:a,onSuccess:i}=e,[c]=$.Z.useForm(),[d,m]=(0,r.useState)(!1),[p,x]=(0,r.useState)([]),[u,h]=(0,r.useState)("dotprompt"),g=()=>{c.resetFields(),x([]),h("dotprompt"),s()},v=async()=>{try{let e=await c.validateFields();if(console.log("values: ",e),!a){U.Z.fromBackend("Access token is required");return}if("dotprompt"===u&&0===p.length){U.Z.fromBackend("Please upload a .prompt file");return}m(!0);let t={};if("dotprompt"===u&&p.length>0){let s=p[0].originFileObj;try{let n=await (0,o.convertPromptFileToJson)(a,s);console.log("Conversion result:",n),t={prompt_id:e.prompt_id,litellm_params:{prompt_integration:"dotprompt",prompt_id:n.prompt_id,prompt_data:n.json_data},prompt_info:{prompt_type:"db"}}}catch(e){console.error("Error converting prompt file:",e),U.Z.fromBackend("Failed to convert prompt file to JSON"),m(!1);return}}try{await (0,o.createPromptCall)(a,t),U.Z.success("Prompt created successfully!"),g(),i()}catch(e){console.error("Error creating prompt:",e),U.Z.fromBackend("Failed to create prompt")}}catch(e){console.error("Form validation error:",e)}finally{m(!1)}};return(0,n.jsx)(l.Z,{title:"Add New Prompt",open:t,onCancel:g,footer:[(0,n.jsx)(L.ZP,{onClick:g,children:"Cancel"},"cancel"),(0,n.jsx)(L.ZP,{loading:d,onClick:v,children:"Create Prompt"},"submit")],width:600,children:(0,n.jsxs)($.Z,{form:c,layout:"vertical",requiredMark:!1,children:[(0,n.jsx)($.Z.Item,{label:"Prompt ID",name:"prompt_id",rules:[{required:!0,message:"Please enter a prompt ID"},{pattern:/^[a-zA-Z0-9_-]+$/,message:"Prompt ID can only contain letters, numbers, underscores, and hyphens"}],children:(0,n.jsx)(et.o,{placeholder:"Enter unique prompt ID (e.g., my_prompt_id)"})}),(0,n.jsx)($.Z.Item,{label:"Prompt Integration",name:"prompt_integration",initialValue:"dotprompt",children:(0,n.jsx)(V.default,{value:u,onChange:h,children:(0,n.jsx)(en,{value:"dotprompt",children:"dotprompt"})})}),"dotprompt"===u&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q.Z,{}),(0,n.jsxs)($.Z.Item,{label:"Prompt File",extra:"Upload a .prompt file that follows the Dotprompt specification",children:[(0,n.jsx)(ee.default,{beforeUpload:e=>(e.name.endsWith(".prompt")||U.Z.fromBackend("Please upload a .prompt file"),!1),fileList:p,onChange:e=>{let{fileList:t}=e;x(t.slice(-1))},onRemove:()=>{x([])},children:(0,n.jsx)(L.ZP,{icon:(0,n.jsx)(es.Z,{}),children:"Select .prompt File"})}),p.length>0&&(0,n.jsxs)("div",{className:"mt-2 text-sm text-gray-600",children:["Selected: ",p[0].name]})]})]})]})})},ea=e=>{let{visible:t,initialJson:s,onSave:a,onClose:o}=e,[i,c]=(0,r.useState)(s||'{\n "type": "function",\n "function": {\n "name": "get_current_weather",\n "description": "Get the current weather in a given location",\n "parameters": {\n "type": "object",\n "properties": {\n "location": {\n "type": "string",\n "description": "The city and state, e.g. San Francisco, CA"\n },\n "unit": {\n "type": "string",\n "enum": ["celsius", "fahrenheit"]\n }\n },\n "required": ["location"]\n }\n }\n}'),[d,m]=(0,r.useState)(null),p=()=>{m(null),o()};return(0,n.jsx)(l.Z,{title:(0,n.jsx)("div",{className:"flex items-center justify-between",children:(0,n.jsx)("span",{className:"text-lg font-medium",children:"Add Tool"})}),open:t,onCancel:p,width:800,footer:[(0,n.jsx)(L.ZP,{onClick:p,children:"Cancel"},"cancel"),(0,n.jsx)(L.ZP,{type:"primary",onClick:()=>{try{JSON.parse(i),m(null),a(i)}catch(e){m("Invalid JSON format. Please check your syntax.")}},children:"Add"},"save")],children:(0,n.jsxs)("div",{className:"space-y-3",children:[d&&(0,n.jsx)("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-red-600 text-sm",children:d}),(0,n.jsx)("textarea",{value:i,onChange:e=>c(e.target.value),className:"w-full min-h-[400px] px-4 py-3 border border-gray-300 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none",placeholder:"Paste your tool JSON here..."})]})})},el=s(4260),eo=s(32660),ei=s(91723),ec=s(83229),ed=e=>{let{promptName:t,onNameChange:s,onBack:r,onSave:l,isSaving:o,editMode:i=!1,onShowHistory:c,version:d,promptModel:m="gpt-4o",promptVariables:p={},accessToken:x,proxySettings:u}=e;return(0,n.jsxs)("div",{className:"bg-white border-b border-gray-200 px-6 py-3 flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,n.jsx)(a.z,{icon:eo.Z,variant:"light",onClick:r,size:"xs",children:"Back"}),(0,n.jsx)(el.default,{value:t,onChange:e=>s(e.target.value),className:"text-base font-medium border-none shadow-none",style:{width:"200px"}}),d&&(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium",children:d}),(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs bg-gray-100 text-gray-600 rounded",children:"Draft"}),(0,n.jsx)("span",{className:"text-xs text-gray-400",children:"Unsaved changes"})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(X,{promptId:t,model:m,promptVariables:p,accessToken:x,version:(null==d?void 0:d.replace("v",""))||"1",proxySettings:u}),i&&c&&(0,n.jsx)(a.z,{icon:ei.Z,variant:"secondary",onClick:c,children:"History"}),(0,n.jsx)(a.z,{icon:ec.Z,onClick:l,loading:o,disabled:o,children:i?"Update":"Save"})]})]})},em=s(92280),ep=s(98728),ex=s(76593),eu=e=>{let{model:t,temperature:s=1,maxTokens:a=1e3,accessToken:l,onModelChange:o,onTemperatureChange:i,onMaxTokensChange:c}=e,[d,m]=(0,r.useState)(!1);return(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"w-[300px]",children:(0,n.jsx)(ex.Z,{accessToken:l||"",value:t,onChange:o,showLabel:!1})}),(0,n.jsxs)("button",{onClick:()=>m(!d),className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50",children:[(0,n.jsx)(ep.Z,{size:16}),(0,n.jsx)("span",{children:"Parameters"})]}),d&&(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-30",children:(0,n.jsxs)("div",{className:"bg-white rounded-lg shadow-xl p-6 w-96",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold",children:"Model Parameters"}),(0,n.jsx)("button",{onClick:()=>m(!1),className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("div",{children:(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsx)(em.x,{className:"text-sm text-gray-700",children:"Temperature"}),(0,n.jsx)(el.default,{type:"number",size:"small",min:0,max:2,step:.1,value:s,onChange:e=>i(parseFloat(e.target.value)||0),className:"w-20"})]})}),(0,n.jsx)("div",{children:(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsx)(em.x,{className:"text-sm text-gray-700",children:"Max Tokens"}),(0,n.jsx)(el.default,{type:"number",size:"small",min:1,max:32768,value:a,onChange:e=>c(parseInt(e.target.value)||1e3),className:"w-24"})]})})]})]})})]})},eh=s(78801),eg=s(99397),ev=s(27413),ef=e=>{let{tools:t,onAddTool:s,onEditTool:r,onRemoveTool:a}=e;return(0,n.jsxs)(eh.Z,{className:"p-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsx)(eh.x,{className:"text-sm font-medium",children:"Tools"}),(0,n.jsxs)("button",{onClick:s,className:"text-xs text-blue-600 hover:text-blue-700 flex items-center",children:[(0,n.jsx)(eg.Z,{size:14,className:"mr-1"}),"Add"]})]}),0===t.length?(0,n.jsx)(eh.x,{className:"text-gray-500 text-xs",children:"No tools added"}):(0,n.jsx)("div",{className:"space-y-2",children:t.map((e,t)=>(0,n.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 border border-gray-200 rounded",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"font-medium text-xs truncate",children:e.name}),(0,n.jsx)("div",{className:"text-xs text-gray-500 truncate",children:e.description})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-1 ml-2",children:[(0,n.jsx)("button",{onClick:()=>r(t),className:"text-xs text-blue-600 hover:text-blue-700",children:"Edit"}),(0,n.jsx)("button",{onClick:()=>a(t),className:"text-gray-400 hover:text-red-500",children:(0,n.jsx)(ev.Z,{size:14})})]})]},t))})]})},ej=s(79326),eb=s(3810),ey=s(13377);let{TextArea:eN}=el.default;var ew=e=>{let{value:t,onChange:s,placeholder:a,rows:l=4,className:o}=e,[i,c]=(0,r.useState)(null),[d,m]=(0,r.useState)(""),p=()=>{d.trim()&&i&&(s(t.substring(0,i.start)+"{{".concat(d,"}}")+t.substring(i.end)),c(null),m(""))},x=(()=>{let e;let s=/\{\{(\w+)\}\}/g,n=[];for(;null!==(e=s.exec(t));)n.push({name:e[1],start:e.index,end:e.index+e[0].length});return n})();return(0,n.jsxs)("div",{className:"variable-textarea-container ".concat(o),children:[(0,n.jsx)("style",{children:"\n .variable-highlight-text {\n color: #f97316;\n background-color: #fff7ed;\n border-radius: 4px;\n padding: 0 2px;\n border: 1px solid #fed7aa;\n font-family: monospace;\n }\n "}),(0,n.jsx)(eN,{value:t,onChange:e=>s(e.target.value),placeholder:a,rows:l,className:"font-sans"}),x.length>0&&(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2 items-center",children:[(0,n.jsx)("span",{className:"text-xs text-gray-500 mr-1",children:"Detected variables:"}),x.map((e,t)=>(0,n.jsx)(ej.Z,{content:(0,n.jsxs)("div",{className:"p-2",style:{minWidth:"200px"},children:[(0,n.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:"Edit variable name"}),(0,n.jsx)(el.default,{size:"small",value:d,onChange:e=>m(e.target.value),onPressEnter:p,placeholder:"Variable name",autoFocus:!0}),(0,n.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,n.jsx)("button",{onClick:p,className:"text-xs px-2 py-1 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Save"}),(0,n.jsx)("button",{onClick:()=>{c(null),m("")},className:"text-xs px-2 py-1 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",children:"Cancel"})]})]}),open:(null==i?void 0:i.start)===e.start,onOpenChange:e=>{e||(c(null),m(""))},trigger:"click",children:(0,n.jsx)(eb.Z,{color:"orange",className:"cursor-pointer hover:opacity-80 transition-all m-0",icon:(0,n.jsx)(ey.Z,{}),onClick:()=>{c({oldName:e.name,start:e.start,end:e.end}),m(e.name)},children:e.name})},"".concat(e.start,"-").concat(t)))]})]})},e_=e=>{let{value:t,onChange:s}=e;return(0,n.jsxs)(eh.Z,{className:"p-3",children:[(0,n.jsx)(eh.x,{className:"block mb-2 text-sm font-medium",children:"Developer message"}),(0,n.jsx)(eh.x,{className:"text-gray-500 text-xs mb-2",children:"Optional system instructions for the model"}),(0,n.jsx)(ew,{value:t,onChange:s,rows:3,placeholder:"e.g., You are a helpful assistant..."})]})},ek=s(41905);let{Option:eC}=V.default;var eS=e=>{let{messages:t,onAddMessage:s,onUpdateMessage:a,onRemoveMessage:l,onMoveMessage:o}=e,[i,c]=(0,r.useState)(null),[d,m]=(0,r.useState)(null),p=e=>{c(e)},x=(e,t)=>{e.preventDefault(),m(t)},u=(e,t)=>{e.preventDefault(),null!==i&&i!==t&&o(i,t),c(null),m(null)},h=()=>{c(null),m(null)};return(0,n.jsxs)(eh.Z,{className:"p-3",children:[(0,n.jsxs)("div",{className:"mb-2",children:[(0,n.jsx)(eh.x,{className:"text-sm font-medium",children:"Prompt messages"}),(0,n.jsxs)(eh.x,{className:"text-gray-500 text-xs mt-1",children:["Use ",(0,n.jsx)("code",{className:"bg-gray-100 px-1 rounded text-xs",children:"{{variable}}"})," syntax for template variables"]})]}),(0,n.jsx)("div",{className:"space-y-2",children:t.map((e,s)=>(0,n.jsxs)("div",{draggable:!0,onDragStart:()=>p(s),onDragOver:e=>x(e,s),onDrop:e=>u(e,s),onDragEnd:h,className:"border border-gray-300 rounded overflow-hidden bg-white transition-all ".concat(i===s?"opacity-50":""," ").concat(d===s&&i!==s?"border-blue-500 border-2":""),children:[(0,n.jsxs)("div",{className:"bg-gray-50 px-2 py-1.5 border-b border-gray-300 flex items-center justify-between",children:[(0,n.jsxs)(V.default,{value:e.role,onChange:e=>a(s,"role",e),style:{width:100},size:"small",bordered:!1,children:[(0,n.jsx)(eC,{value:"user",children:"User"}),(0,n.jsx)(eC,{value:"assistant",children:"Assistant"}),(0,n.jsx)(eC,{value:"system",children:"System"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[t.length>1&&(0,n.jsx)("button",{onClick:()=>l(s),className:"text-gray-400 hover:text-red-500",children:(0,n.jsx)(ev.Z,{size:14})}),(0,n.jsx)("div",{className:"cursor-grab active:cursor-grabbing text-gray-400 hover:text-gray-600",children:(0,n.jsx)(ek.Z,{size:16})})]})]}),(0,n.jsx)("div",{className:"p-2",children:(0,n.jsx)(ew,{value:e.content,onChange:e=>a(s,"content",e),rows:3,placeholder:"Enter prompt content..."})})]},s))}),(0,n.jsxs)("button",{onClick:s,className:"mt-2 text-xs text-blue-600 hover:text-blue-700 flex items-center",children:[(0,n.jsx)(eg.Z,{size:14,className:"mr-1"}),"Add message"]})]})},eZ=s(26430);let eP=(e,t)=>{let[s,n]=(0,r.useState)(!1),[a,l]=(0,r.useState)([]),[i,c]=(0,r.useState)(""),[d,m]=(0,r.useState)({}),[p,x]=(0,r.useState)(!1),[u,h]=(0,r.useState)(null),g=(0,r.useRef)(null),v=_(e),f=v.every(e=>d[e]&&""!==d[e].trim()),j=()=>{g.current&&setTimeout(()=>{var e;null===(e=g.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},100)};(0,r.useEffect)(()=>{j()},[a]);let b=async()=>{let s;if(!t){U.Z.fromBackend("Access token is required");return}if(v.length>0&&!f){U.Z.fromBackend("Please fill in all template variables");return}if(!i.trim())return;!p&&v.length>0&&x(!0);let r={role:"user",content:i};l(e=>[...e,r]),c("");let m=new AbortController;h(m),n(!0);let u=Date.now();try{let n,r;let c=k(e),p=(0,o.getProxyBaseUrl)(),x={dotprompt_content:c};0===a.length?x.prompt_variables=d:x.conversation_history=[...a.map(e=>({role:e.role,content:e.content})),{role:"user",content:i}];let h=await fetch("".concat(p,"/prompts/test"),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},body:JSON.stringify(x),signal:m.signal});if(!h.ok){let e=await h.text();throw Error("HTTP error! status: ".concat(h.status,", ").concat(e))}if(!h.body)throw Error("No response body");let v=h.body.getReader(),f=new TextDecoder,y="";for(l(e=>[...e,{role:"assistant",content:""}]);;){let{done:e,value:t}=await v.read();if(e)break;for(let e of f.decode(t).split("\n"))if(e.startsWith("data: ")){let t=e.slice(6);if("[DONE]"===t)continue;try{var g,j,b;let e=JSON.parse(t);!n&&e.model&&(n=e.model),e.usage&&(r=e.usage);let a=null===(b=e.choices)||void 0===b?void 0:null===(j=b[0])||void 0===j?void 0:null===(g=j.delta)||void 0===g?void 0:g.content;a&&(s||(s=Date.now()-u),y+=a,l(e=>{let t=[...e];return t[t.length-1]={role:"assistant",content:y,model:n,timeToFirstToken:s},t}))}catch(e){console.error("Error parsing chunk:",e)}}}let N=Date.now()-u;l(e=>{let t=[...e];return t[t.length-1]={...t[t.length-1],totalLatency:N,usage:r},t})}catch(e){"AbortError"===e.name?console.log("Request was cancelled"):(console.error("Error testing prompt:",e),l(t=>{let s=t[t.length-1];return s&&"assistant"===s.role&&""===s.content?[...t.slice(0,-1),{role:"assistant",content:"Error: ".concat(e.message)}]:[...t,{role:"assistant",content:"Error: ".concat(e.message)}]}))}finally{n(!1),h(null)}};return{isLoading:s,messages:a,inputMessage:i,variables:d,variablesFilled:p,extractedVariables:v,allVariablesFilled:f,messagesEndRef:g,setInputMessage:c,handleSendMessage:b,handleCancelRequest:()=>{u&&(u.abort(),h(null),n(!1),U.Z.info("Request cancelled"))},handleClearConversation:()=>{l([]),x(!1),U.Z.success("Chat history cleared.")},handleKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),b())},handleVariableChange:(e,t)=>{m({...d,[e]:t})}}};var eT=e=>{let{extractedVariables:t,variables:s,onVariableChange:r}=e;return 0===t.length?null:(0,n.jsxs)("div",{className:"p-4 border-b border-gray-200 bg-blue-50",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Fill in template variables to start testing"}),(0,n.jsx)("div",{className:"space-y-2",children:t.map(e=>(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-xs text-gray-600 mb-1 font-medium",children:["{{",e,"}}"]}),(0,n.jsx)(el.default,{value:s[e]||"",onChange:t=>r(e,t.target.value),placeholder:"Enter value for ".concat(e),size:"small"})]},e))})]})},eD=s(61935),eE=s(10353),eO=s(69993),ez=e=>{let{hasVariables:t}=e;return(0,n.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,n.jsx)(eO.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,n.jsx)("span",{className:"text-base",children:t?"Fill in the variables above, then type a message to start testing":"Type a message below to start testing your prompt"})]})},eA=s(15883),eI=s(62831),eL=s(38398),eM=e=>{let{message:t}=e;return(0,n.jsx)("div",{className:"mb-4 flex ".concat("user"===t.role?"justify-end":"justify-start"),children:(0,n.jsxs)("div",{className:"max-w-[85%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===t.role?"#f0f8ff":"#ffffff",border:"user"===t.role?"1px solid #e6f0fa":"1px solid #f0f0f0"},children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,n.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===t.role?"#e6f0fa":"#f5f5f5"},children:"user"===t.role?(0,n.jsx)(eA.Z,{style:{fontSize:"12px",color:"#2563eb"}}):(0,n.jsx)(eO.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,n.jsx)("strong",{className:"text-sm capitalize",children:t.role}),"assistant"===t.role&&t.model&&(0,n.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:t.model})]}),(0,n.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:["assistant"===t.role?(0,n.jsx)(eI.UG,{components:{code(e){let{node:t,inline:s,className:r,children:a,...l}=e,o=/language-(\w+)/.exec(r||"");return!s&&o?(0,n.jsx)(q.Z,{style:G.Z,language:o[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...l,children:String(a).replace(/\n$/,"")}):(0,n.jsx)("code",{className:"".concat(r," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),style:{wordBreak:"break-word"},...l,children:a})},pre:e=>{let{node:t,...s}=e;return(0,n.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...s})}},children:t.content}):(0,n.jsx)("div",{className:"whitespace-pre-wrap",children:t.content}),"assistant"===t.role&&(t.timeToFirstToken||t.totalLatency||t.usage)&&(0,n.jsx)(eL.Z,{timeToFirstToken:t.timeToFirstToken,totalLatency:t.totalLatency,usage:t.usage})]})]})})},eF=e=>{let{messages:t,isLoading:s,hasVariables:r,messagesEndRef:a}=e,l=(0,n.jsx)(eD.Z,{style:{fontSize:24},spin:!0});return(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 pb-0",children:[0===t.length&&(0,n.jsx)(ez,{hasVariables:r}),t.map((e,t)=>(0,n.jsx)(eM,{message:e},t)),s&&(0,n.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,n.jsx)(eE.Z,{indicator:l})}),(0,n.jsx)("div",{ref:a,style:{height:"1px"}})]})},eB=e=>{let{extractedVariables:t,variables:s}=e,r=t.filter(e=>!s[e]||""===s[e].trim());return 0===r.length?null:(0,n.jsx)("div",{className:"mb-3 p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)("span",{className:"text-yellow-600 text-sm",children:"⚠️"}),(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsx)("p",{className:"text-sm text-yellow-800 font-medium mb-1",children:"Please fill in all template variables above"}),(0,n.jsxs)("p",{className:"text-xs text-yellow-700",children:["Missing: ",r.map(e=>"{{".concat(e,"}}")).join(", ")]})]})]})})},eR=s(79276);let{TextArea:eJ}=el.default;var eU=e=>{let{inputMessage:t,isLoading:s,isDisabled:r,onInputChange:l,onSend:o,onKeyDown:i,onCancel:c}=e;return(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[(0,n.jsx)(eJ,{value:t,onChange:e=>l(e.target.value),onKeyDown:i,placeholder:"Type your message... (Shift+Enter for new line)",disabled:s,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,n.jsx)(a.z,{onClick:o,disabled:r,className:"flex-shrink-0 ml-2 !w-8 !h-8 !min-w-8 !p-0 !rounded-full !bg-blue-600 hover:!bg-blue-700 disabled:!bg-gray-300 !border-none !text-white disabled:!text-gray-500 !flex !items-center !justify-center",children:(0,n.jsx)(eR.Z,{style:{fontSize:"14px"}})})]}),s&&(0,n.jsx)(a.z,{onClick:c,className:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200",children:"Cancel"})]})},eV=e=>{let{prompt:t,accessToken:s}=e,{isLoading:r,messages:l,inputMessage:o,variables:i,variablesFilled:c,extractedVariables:d,allVariablesFilled:m,messagesEndRef:p,setInputMessage:x,handleSendMessage:u,handleCancelRequest:h,handleClearConversation:g,handleKeyDown:v,handleVariableChange:f}=eP(t,s);return(0,n.jsxs)("div",{className:"flex flex-col h-full bg-white",children:[!c&&(0,n.jsx)(eT,{extractedVariables:d,variables:i,onVariableChange:f}),l.length>0&&(0,n.jsx)("div",{className:"p-3 border-b border-gray-200 bg-white flex justify-end",children:(0,n.jsx)(a.z,{onClick:g,className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:eZ.Z,children:"Clear Chat"})}),(0,n.jsx)(eF,{messages:l,isLoading:r,hasVariables:d.length>0,messagesEndRef:p}),(0,n.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[(0,n.jsx)(eB,{extractedVariables:d,variables:i}),(0,n.jsx)(eU,{inputMessage:o,isLoading:r,isDisabled:r||!o.trim()||d.length>0&&!m,onInputChange:x,onSend:u,onKeyDown:v,onCancel:h})]})]})},eW=e=>{let{visible:t,promptName:s,isSaving:r,onNameChange:a,onPublish:o,onCancel:i}=e;return(0,n.jsx)(l.Z,{title:"Publish Prompt",open:t,onCancel:i,footer:[(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(H.z,{variant:"secondary",onClick:i,children:"Cancel"}),(0,n.jsx)(H.z,{onClick:o,loading:r,children:"Publish"})]},"footer")],children:(0,n.jsxs)("div",{className:"py-4",children:[(0,n.jsx)(H.x,{className:"mb-2",children:"Name"}),(0,n.jsx)(el.default,{value:s,onChange:e=>a(e.target.value),placeholder:"Enter prompt name",onPressEnter:o,autoFocus:!0}),(0,n.jsx)(H.x,{className:"text-gray-500 text-xs mt-2",children:"Published prompts can be used in API calls and are versioned for easy tracking."})]})})},eK=e=>{let{prompt:t}=e,s=k(t);return(0,n.jsxs)("div",{className:"p-6",children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:"Generated .prompt file"}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:"This is the dotprompt format that will be saved to the database"})]}),(0,n.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 overflow-auto",children:(0,n.jsx)("pre",{className:"text-sm text-gray-900 font-mono whitespace-pre-wrap",children:s})})]})},eH=s(57840),eq=s(63134),eG=s(50337),eX=s(35631);let{Text:eY}=eH.default;var e$=e=>{let{isOpen:t,onClose:s,accessToken:a,promptId:l,activeVersionId:i,onSelectVersion:c}=e,[d,m]=(0,r.useState)([]),[p,x]=(0,r.useState)(!1);(0,r.useEffect)(()=>{t&&a&&l&&u()},[t,a,l]);let u=async()=>{x(!0);try{let e=l.includes(".v")?l.split(".v")[0]:l,t=await (0,o.getPromptVersions)(a,e);m(t.prompts)}catch(e){console.error("Error fetching prompt versions:",e)}finally{x(!1)}},h=e=>{var t;if(e.version)return"v".concat(e.version);let s=(null===(t=e.litellm_params)||void 0===t?void 0:t.prompt_id)||e.prompt_id;return s.includes(".v")?"v".concat(s.split(".v")[1]):s.includes("_v")?"v".concat(s.split("_v")[1]):"v1"},g=e=>e?new Date(e).toLocaleString():"-";return(0,n.jsx)(eq.Z,{title:"Version History",placement:"right",onClose:s,open:t,width:400,mask:!1,maskClosable:!1,children:p?(0,n.jsx)(eG.Z,{active:!0,paragraph:{rows:4}}):0===d.length?(0,n.jsx)("div",{className:"text-center py-8 text-gray-500",children:"No version history available."}):(0,n.jsx)(eX.Z,{dataSource:d,renderItem:(e,t)=>{var s;let r=e.version||parseInt(h(e).replace("v","")),a=null;i&&(i.includes(".v")?a=parseInt(i.split(".v")[1]):i.includes("_v")&&(a=parseInt(i.split("_v")[1])));let l=a?r===a:0===t;return(0,n.jsxs)("div",{className:"mb-4 p-4 rounded-lg border cursor-pointer transition-all hover:shadow-md ".concat(l?"border-blue-500 bg-blue-50":"border-gray-200 bg-white hover:border-blue-300"),onClick:()=>null==c?void 0:c(e),children:[(0,n.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(eb.Z,{className:"m-0",children:h(e)}),0===t&&(0,n.jsx)(eb.Z,{color:"blue",className:"m-0",children:"Latest"})]}),l&&(0,n.jsx)(eb.Z,{color:"green",className:"m-0",children:"Active"})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)(eY,{className:"text-sm text-gray-600 font-medium",children:g(e.created_at)}),(0,n.jsx)(eY,{type:"secondary",className:"text-xs",children:(null===(s=e.prompt_info)||void 0===s?void 0:s.prompt_type)==="db"?"Saved to Database":"Config Prompt"})]})]},"".concat(e.prompt_id,"-v").concat(e.version||r))}})})},eQ=e=>{var t;let{onClose:s,onSuccess:a,accessToken:l,initialPromptData:i}=e,[c,d]=(0,r.useState)((()=>{if(i)try{return C(i)}catch(e){console.error("Error parsing existing prompt:",e),U.Z.fromBackend("Failed to parse prompt data")}return{name:"New prompt",model:"gpt-4o",config:{temperature:1,max_tokens:1e3},tools:[],developerMessage:"",messages:[{role:"user",content:"Enter task specifics. Use {{template_variables}} for dynamic inputs"}]}})()),[m,p]=(0,r.useState)(!!i),[x,u]=(0,r.useState)(!1),[h,g]=(0,r.useState)((()=>{var e;if(!(null==i?void 0:i.prompt_spec))return;let t=i.prompt_spec.prompt_id,s=i.prompt_spec.version||(null===(e=i.prompt_spec.litellm_params)||void 0===e?void 0:e.prompt_id);return"number"==typeof s?"".concat(t,".v").concat(s):"string"==typeof s&&(s.includes(".v")||s.includes("_v"))?s:t})()),[v,f]=(0,r.useState)(!1),[j,b]=(0,r.useState)(!1),[y,N]=(0,r.useState)(null),[w,_]=(0,r.useState)(!1),[S,Z]=(0,r.useState)("pretty"),P=e=>{void 0!==e?N(e):N(null),f(!0)},T=async()=>{if(!l){U.Z.fromBackend("Access token is required");return}if(!c.name||""===c.name.trim()){U.Z.fromBackend("Please enter a valid prompt name");return}_(!0);try{var e;let t=c.name.replace(/[^a-zA-Z0-9_-]/g,"_").toLowerCase(),n=k(c),r={prompt_id:t,litellm_params:{prompt_integration:"dotprompt",prompt_id:t,dotprompt_content:n},prompt_info:{prompt_type:"db"}};m&&(null==i?void 0:null===(e=i.prompt_spec)||void 0===e?void 0:e.prompt_id)?(await (0,o.updatePromptCall)(l,i.prompt_spec.prompt_id,r),U.Z.success("Prompt updated successfully!")):(await (0,o.createPromptCall)(l,r),U.Z.success("Prompt created successfully!")),a(),s()}catch(e){console.error("Error saving prompt:",e),U.Z.fromBackend(m?"Failed to update prompt":"Failed to save prompt")}finally{_(!1),b(!1)}},D=h&&h.includes(".v")?"v".concat(h.split(".v")[1]):null;return(0,n.jsxs)("div",{className:"flex h-full bg-white",children:[(0,n.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,n.jsx)(ed,{promptName:c.name,onNameChange:e=>d({...c,name:e}),onBack:s,onSave:()=>{c.name&&""!==c.name.trim()&&"New prompt"!==c.name?T():b(!0)},isSaving:w,editMode:m,onShowHistory:()=>u(!0),version:D,promptModel:c.model,promptVariables:(()=>{let e;let t={},s=[c.developerMessage,...c.messages.map(e=>e.content)].join(" "),n=/\{\{(\w+)\}\}/g;for(;null!==(e=n.exec(s));){let s=e[1];t[s]||(t[s]="example_".concat(s))}return t})(),accessToken:l}),(0,n.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,n.jsxs)("div",{className:"w-1/2 overflow-y-auto bg-white border-r border-gray-200 flex-shrink-0",children:[(0,n.jsxs)("div",{className:"border-b border-gray-200 bg-white px-6 py-4 flex items-center gap-3",children:[(0,n.jsx)(eu,{model:c.model,temperature:c.config.temperature,maxTokens:c.config.max_tokens,accessToken:l,onModelChange:e=>d({...c,model:e}),onTemperatureChange:e=>d({...c,config:{...c.config,temperature:e}}),onMaxTokensChange:e=>d({...c,config:{...c.config,max_tokens:e}})}),(0,n.jsxs)("div",{className:"ml-auto inline-flex items-center bg-gray-200 rounded-full p-0.5",children:[(0,n.jsx)("button",{className:"px-3 py-1 text-xs font-medium rounded-full transition-colors ".concat("pretty"===S?"bg-white text-gray-900 shadow-sm":"text-gray-600"),onClick:()=>Z("pretty"),children:"PRETTY"}),(0,n.jsx)("button",{className:"px-3 py-1 text-xs font-medium rounded-full transition-colors ".concat("dotprompt"===S?"bg-white text-gray-900 shadow-sm":"text-gray-600"),onClick:()=>Z("dotprompt"),children:"DOTPROMPT"})]})]}),"pretty"===S?(0,n.jsxs)("div",{className:"p-6 space-y-4 pb-20",children:[(0,n.jsx)(ef,{tools:c.tools,onAddTool:()=>P(),onEditTool:P,onRemoveTool:e=>{d({...c,tools:c.tools.filter((t,s)=>s!==e)})}}),(0,n.jsx)(e_,{value:c.developerMessage,onChange:e=>d({...c,developerMessage:e})}),(0,n.jsx)(eS,{messages:c.messages,onAddMessage:()=>{d({...c,messages:[...c.messages,{role:"user",content:""}]})},onUpdateMessage:(e,t,s)=>{let n=[...c.messages];n[e][t]=s,d({...c,messages:n})},onRemoveMessage:e=>{c.messages.length>1&&d({...c,messages:c.messages.filter((t,s)=>s!==e)})},onMoveMessage:(e,t)=>{let s=[...c.messages],[n]=s.splice(e,1);s.splice(t,0,n),d({...c,messages:s})}})]}):(0,n.jsx)(eK,{prompt:c})]}),(0,n.jsx)("div",{className:"w-1/2 flex-shrink-0",children:(0,n.jsx)(eV,{prompt:c,accessToken:l})})]})]}),(0,n.jsx)(eW,{visible:j,promptName:c.name,isSaving:w,onNameChange:e=>d({...c,name:e}),onPublish:T,onCancel:()=>b(!1)}),v&&(0,n.jsx)(ea,{visible:v,initialJson:null!==y?c.tools[y].json:"",onSave:e=>{try{var t,s;let n=JSON.parse(e),r={name:(null===(t=n.function)||void 0===t?void 0:t.name)||"Unnamed Tool",description:(null===(s=n.function)||void 0===s?void 0:s.description)||"",json:e};if(null!==y){let e=[...c.tools];e[y]=r,d({...c,tools:e})}else d({...c,tools:[...c.tools,r]});f(!1),N(null)}catch(e){U.Z.fromBackend("Invalid JSON format")}},onClose:()=>{f(!1),N(null)}}),(0,n.jsx)(e$,{isOpen:x,onClose:()=>u(!1),accessToken:l,promptId:(null==i?void 0:null===(t=i.prompt_spec)||void 0===t?void 0:t.prompt_id)||c.name,activeVersionId:h,onSelectVersion:e=>{try{let t=C({prompt_spec:e});d(t);let s=e.version||1;g("".concat(e.prompt_id,".v").concat(s))}catch(e){console.error("Error loading version:",e),U.Z.fromBackend("Failed to load prompt version")}}})]})},e0=s(20347),e1=e=>{let{accessToken:t,userRole:s}=e,[i,c]=(0,r.useState)([]),[d,m]=(0,r.useState)(!1),[p,x]=(0,r.useState)(null),[u,h]=(0,r.useState)(!1),[g,v]=(0,r.useState)(!1),[f,j]=(0,r.useState)(null),[b,y]=(0,r.useState)(!1),[N,w]=(0,r.useState)(null),_=!!s&&(0,e0.tY)(s),k=async()=>{if(t){m(!0);try{let e=await (0,o.getPromptsList)(t);console.log("prompts: ".concat(JSON.stringify(e))),c(e.prompts)}catch(e){console.error("Error fetching prompts:",e)}finally{m(!1)}}};(0,r.useEffect)(()=>{k()},[t]);let C=()=>{k(),v(!1),j(null),x(null)},S=async()=>{if(N&&t){y(!0);try{await (0,o.deletePromptCall)(t,N.id),U.Z.success('Prompt "'.concat(N.name,'" deleted successfully')),k()}catch(e){console.error("Error deleting prompt:",e),U.Z.fromBackend("Failed to delete prompt")}finally{y(!1),w(null)}}};return(0,n.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[g?(0,n.jsx)(eQ,{onClose:()=>{v(!1),j(null)},onSuccess:C,accessToken:t,initialPromptData:f}):p?(0,n.jsx)(Y,{promptId:p,onClose:()=>x(null),accessToken:t,isAdmin:_,onDelete:k,onEdit:e=>{j(e),v(!0)}}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(a.z,{onClick:()=>{p&&x(null),j(null),v(!0)},disabled:!t,children:"+ Add New Prompt"}),(0,n.jsx)(a.z,{onClick:()=>{p&&x(null),h(!0)},disabled:!t,variant:"secondary",children:"Upload .prompt File"})]})}),(0,n.jsx)(A,{promptsList:i,isLoading:d,onPromptClick:e=>{x(e)},onDeleteClick:(e,t)=>{w({id:e,name:t})},accessToken:t,isAdmin:_})]}),(0,n.jsx)(er,{visible:u,onClose:()=>{h(!1)},accessToken:t,onSuccess:C}),N&&(0,n.jsxs)(l.Z,{title:"Delete Prompt",open:null!==N,onOk:S,onCancel:()=>{w(null)},confirmLoading:b,okText:"Delete",okButtonProps:{danger:!0},children:[(0,n.jsxs)("p",{children:["Are you sure you want to delete prompt: ",N.name," ?"]}),(0,n.jsx)("p",{children:"This action cannot be undone."})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8143-af49726668341269.js b/litellm/proxy/_experimental/out/_next/static/chunks/8143-af49726668341269.js new file mode 100644 index 00000000000..4399298f84e --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/8143-af49726668341269.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8143],{18143:function(e,a,s){s.d(a,{Z:function(){return P}});var t=s(57437),l=s(40278),n=s(96889),r=s(12514),o=s(97765),i=s(21626),c=s(97214),d=s(28241),h=s(58834),u=s(69552),x=s(71876),m=s(96761),g=s(2265),p=s(47375),j=s(39789),Z=s(75105),y=s(78489),S=s(49804),_=s(14042),w=s(67101),f=s(92414),v=s(46030),k=s(27281),D=s(57365),E=s(12485),N=s(18135),C=s(35242),I=s(29706),F=s(77991),b=s(84264),T=s(19250),M=s(32176),A=s(59872);console.log("process.env.NODE_ENV","production");let L=e=>null!==e&&("Admin"===e||"Admin Viewer"===e);var P=e=>{let{accessToken:a,token:s,userRole:P,userID:V,keys:U,premiumUser:Y}=e,B=new Date,[O,q]=(0,g.useState)([]),[W,R]=(0,g.useState)([]),[G,K]=(0,g.useState)([]),[z,Q]=(0,g.useState)([]),[X,$]=(0,g.useState)([]),[H,J]=(0,g.useState)([]),[ee,ea]=(0,g.useState)([]),[es,et]=(0,g.useState)([]),[el,en]=(0,g.useState)([]),[er,eo]=(0,g.useState)([]),[ei,ec]=(0,g.useState)({}),[ed,eh]=(0,g.useState)([]),[eu,ex]=(0,g.useState)(""),[em,eg]=(0,g.useState)(["all-tags"]),[ep,ej]=(0,g.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[eZ,ey]=(0,g.useState)(null),[eS,e_]=(0,g.useState)(0),ew=new Date(B.getFullYear(),B.getMonth(),1),ef=new Date(B.getFullYear(),B.getMonth()+1,0),ev=eI(ew),ek=eI(ef);function eD(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}console.log("keys in usage",U),console.log("premium user in usage",Y);let eE=async()=>{if(a)try{let e=await (0,T.getProxyUISettings)(a);return console.log("usage tab: proxy_settings",e),e}catch(e){console.error("Error fetching proxy settings:",e)}};(0,g.useEffect)(()=>{eC(ep.from,ep.to)},[ep,em]);let eN=async(e,s,t)=>{if(!e||!s||!a)return;console.log("uiSelectedKey",t);let l=await (0,T.adminTopEndUsersCall)(a,t,e.toISOString(),s.toISOString());console.log("End user data updated successfully",l),Q(l)},eC=async(e,s)=>{if(!e||!s||!a)return;let t=await eE();null!=t&&t.DISABLE_EXPENSIVE_DB_QUERIES||(J((await (0,T.tagsSpendLogsCall)(a,e.toISOString(),s.toISOString(),0===em.length?void 0:em)).spend_per_tag),console.log("Tag spend data updated successfully"))};function eI(e){let a=e.getFullYear(),s=e.getMonth()+1,t=e.getDate();return"".concat(a,"-").concat(s<10?"0"+s:s,"-").concat(t<10?"0"+t:t)}console.log("Start date is ".concat(ev)),console.log("End date is ".concat(ek));let eF=async(e,a,s)=>{try{let s=await e();a(s)}catch(e){console.error(s,e)}},eb=(e,a,s,t)=>{let l=[],n=new Date(a),r=e=>{if(e.includes("-"))return e;{let[a,s]=e.split(" ");return new Date(new Date().getFullYear(),new Date("".concat(a," 01 2024")).getMonth(),parseInt(s)).toISOString().split("T")[0]}},o=new Map(e.map(e=>{let a=r(e.date);return[a,{...e,date:a}]}));for(;n<=s;){let e=n.toISOString().split("T")[0];if(o.has(e))l.push(o.get(e));else{let a={date:e,api_requests:0,total_tokens:0};t.forEach(e=>{a[e]||(a[e]=0)}),l.push(a)}n.setDate(n.getDate()+1)}return l},eT=async()=>{if(a)try{let e=await (0,T.adminSpendLogsCall)(a),s=new Date,t=new Date(s.getFullYear(),s.getMonth(),1),l=new Date(s.getFullYear(),s.getMonth()+1,0),n=eb(e,t,l,[]),r=Number(n.reduce((e,a)=>e+(a.spend||0),0).toFixed(2));e_(r),q(n)}catch(e){console.error("Error fetching overall spend:",e)}},eM=()=>eF(()=>a&&s?(0,T.adminspendByProvider)(a,s,ev,ek):Promise.reject("No access token or token"),eo,"Error fetching provider spend"),eA=async()=>{a&&await eF(async()=>(await (0,T.adminTopKeysCall)(a)).map(e=>({key:e.api_key.substring(0,10),api_key:e.api_key,key_alias:e.key_alias,spend:Number(e.total_spend.toFixed(2))})),R,"Error fetching top keys")},eL=async()=>{a&&await eF(async()=>(await (0,T.adminTopModelsCall)(a)).map(e=>({key:e.model,spend:(0,A.pw)(e.total_spend,2)})),K,"Error fetching top models")},eP=async()=>{a&&await eF(async()=>{let e=await (0,T.teamSpendLogsCall)(a),s=new Date,t=new Date(s.getFullYear(),s.getMonth(),1),l=new Date(s.getFullYear(),s.getMonth()+1,0);return $(eb(e.daily_spend,t,l,e.teams)),et(e.teams),e.total_spend_per_team.map(e=>({name:e.team_id||"",value:(0,A.pw)(e.total_spend||0,2)}))},en,"Error fetching team spend")},eV=()=>{a&&eF(async()=>(await (0,T.allTagNamesCall)(a)).tag_names,ea,"Error fetching tag names")},eU=()=>{a&&eF(()=>{var e,s;return(0,T.tagsSpendLogsCall)(a,null===(e=ep.from)||void 0===e?void 0:e.toISOString(),null===(s=ep.to)||void 0===s?void 0:s.toISOString(),void 0)},e=>J(e.spend_per_tag),"Error fetching top tags")},eY=()=>{a&&eF(()=>(0,T.adminTopEndUsersCall)(a,null,void 0,void 0),Q,"Error fetching top end users")},eB=async()=>{if(a)try{let e=await (0,T.adminGlobalActivity)(a,ev,ek),s=new Date,t=new Date(s.getFullYear(),s.getMonth(),1),l=new Date(s.getFullYear(),s.getMonth()+1,0),n=eb(e.daily_data||[],t,l,["api_requests","total_tokens"]);ec({...e,daily_data:n})}catch(e){console.error("Error fetching global activity:",e)}},eO=async()=>{if(a)try{let e=await (0,T.adminGlobalActivityPerModel)(a,ev,ek),s=new Date,t=new Date(s.getFullYear(),s.getMonth(),1),l=new Date(s.getFullYear(),s.getMonth()+1,0),n=e.map(e=>({...e,daily_data:eb(e.daily_data||[],t,l,["api_requests","total_tokens"])}));eh(n)}catch(e){console.error("Error fetching global activity per model:",e)}};return((0,g.useEffect)(()=>{(async()=>{if(a&&s&&P&&V){let e=await eE();e&&(ey(e),null!=e&&e.DISABLE_EXPENSIVE_DB_QUERIES)||(console.log("fetching data - valiue of proxySettings",eZ),eT(),eM(),eA(),eL(),eB(),eO(),L(P)&&(eP(),eV(),eU(),eY()))}})()},[a,s,P,V,ev,ek]),null==eZ?void 0:eZ.DISABLE_EXPENSIVE_DB_QUERIES)?(0,t.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"Database Query Limit Reached"}),(0,t.jsxs)(b.Z,{className:"mt-4",children:["SpendLogs in DB has ",eZ.NUM_SPEND_LOGS_ROWS," rows.",(0,t.jsx)("br",{}),"Please follow our guide to view usage when SpendLogs has more than 1M rows."]}),(0,t.jsx)(y.Z,{className:"mt-4",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/spending_monitoring",target:"_blank",children:"View Usage Guide"})})]})}):(0,t.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,t.jsxs)(N.Z,{children:[(0,t.jsxs)(C.Z,{className:"mt-2",children:[(0,t.jsx)(E.Z,{children:"All Up"}),L(P)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.Z,{children:"Team Based Usage"}),(0,t.jsx)(E.Z,{children:"Customer Usage"}),(0,t.jsx)(E.Z,{children:"Tag Based Usage"})]}):(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{})})]}),(0,t.jsxs)(F.Z,{children:[(0,t.jsx)(I.Z,{children:(0,t.jsxs)(N.Z,{children:[(0,t.jsxs)(C.Z,{variant:"solid",className:"mt-1",children:[(0,t.jsx)(E.Z,{children:"Cost"}),(0,t.jsx)(E.Z,{children:"Activity"})]}),(0,t.jsxs)(F.Z,{children:[(0,t.jsx)(I.Z,{children:(0,t.jsxs)(w.Z,{numItems:2,className:"gap-2 h-[100vh] w-full",children:[(0,t.jsxs)(S.Z,{numColSpan:2,children:[(0,t.jsxs)(b.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend ",new Date().toLocaleString("default",{month:"long"})," 1 -"," ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,t.jsx)(p.Z,{userSpend:eS,selectedTeam:null,userMaxBudget:null})]}),(0,t.jsx)(S.Z,{numColSpan:2,children:(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"Monthly Spend"}),(0,t.jsx)(l.Z,{data:O,index:"date",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$ ".concat((0,A.pw)(e,2)),yAxisWidth:100,tickGap:5})]})}),(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsxs)(r.Z,{className:"h-full",children:[(0,t.jsx)(m.Z,{children:"Top Virtual Keys"}),(0,t.jsx)(M.Z,{topKeys:W,teams:null})]})}),(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsxs)(r.Z,{className:"h-full",children:[(0,t.jsx)(m.Z,{children:"Top Models"}),(0,t.jsx)(l.Z,{className:"mt-4 h-40",data:G,index:"key",categories:["spend"],colors:["cyan"],yAxisWidth:200,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>"$".concat((0,A.pw)(e,2))})]})}),(0,t.jsx)(S.Z,{numColSpan:1}),(0,t.jsx)(S.Z,{numColSpan:2,children:(0,t.jsxs)(r.Z,{className:"mb-2",children:[(0,t.jsx)(m.Z,{children:"Spend by Provider"}),(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsx)(_.Z,{className:"mt-4 h-40",variant:"pie",data:er,index:"provider",category:"spend",colors:["cyan"],valueFormatter:e=>"$".concat((0,A.pw)(e,2))})}),(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(h.Z,{children:(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{children:"Provider"}),(0,t.jsx)(u.Z,{children:"Spend"})]})}),(0,t.jsx)(c.Z,{children:er.map(e=>(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(d.Z,{children:e.provider}),(0,t.jsx)(d.Z,{children:1e-5>parseFloat(e.spend.toFixed(2))?"less than 0.00":(0,A.pw)(e.spend,2)})]},e.provider))})]})})]})})]})})]})}),(0,t.jsx)(I.Z,{children:(0,t.jsxs)(w.Z,{numItems:1,className:"gap-2 h-[75vh] w-full",children:[(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"All Up"}),(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsxs)(S.Z,{children:[(0,t.jsxs)(o.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",eD(ei.sum_api_requests)]}),(0,t.jsx)(Z.Z,{className:"h-40",data:ei.daily_data,valueFormatter:eD,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,t.jsxs)(S.Z,{children:[(0,t.jsxs)(o.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",eD(ei.sum_total_tokens)]}),(0,t.jsx)(l.Z,{className:"h-40",data:ei.daily_data,valueFormatter:eD,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]}),(0,t.jsx)(t.Fragment,{children:ed.map((e,a)=>(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:e.model}),(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsxs)(S.Z,{children:[(0,t.jsxs)(o.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",eD(e.sum_api_requests)]}),(0,t.jsx)(Z.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],valueFormatter:eD,onValueChange:e=>console.log(e)})]}),(0,t.jsxs)(S.Z,{children:[(0,t.jsxs)(o.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",eD(e.sum_total_tokens)]}),(0,t.jsx)(l.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],valueFormatter:eD,onValueChange:e=>console.log(e)})]})]})]},a))})]})})]})]})}),(0,t.jsx)(I.Z,{children:(0,t.jsxs)(w.Z,{numItems:2,className:"gap-2 h-[75vh] w-full",children:[(0,t.jsxs)(S.Z,{numColSpan:2,children:[(0,t.jsxs)(r.Z,{className:"mb-2",children:[(0,t.jsx)(m.Z,{children:"Total Spend Per Team"}),(0,t.jsx)(n.Z,{data:el})]}),(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"Daily Spend Per Team"}),(0,t.jsx)(l.Z,{className:"h-72",data:X,showLegend:!0,index:"date",categories:es,yAxisWidth:80,stack:!0})]})]}),(0,t.jsx)(S.Z,{numColSpan:2})]})}),(0,t.jsxs)(I.Z,{children:[(0,t.jsxs)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:["Customers of your LLM API calls. Tracked when a `user` param is passed in your LLM calls"," ",(0,t.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/users",target:"_blank",children:"docs here"})]}),(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsx)(S.Z,{children:(0,t.jsx)(j.Z,{value:ep,onValueChange:e=>{ej(e),eN(e.from,e.to,null)}})}),(0,t.jsxs)(S.Z,{children:[(0,t.jsx)(b.Z,{children:"Select Key"}),(0,t.jsxs)(k.Z,{defaultValue:"all-keys",children:[(0,t.jsx)(D.Z,{value:"all-keys",onClick:()=>{eN(ep.from,ep.to,null)},children:"All Keys"},"all-keys"),null==U?void 0:U.map((e,a)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,t.jsx)(D.Z,{value:String(a),onClick:()=>{eN(ep.from,ep.to,e.token)},children:e.key_alias},a):null)]})]})]}),(0,t.jsx)(r.Z,{className:"mt-4",children:(0,t.jsxs)(i.Z,{className:"max-h-[70vh] min-h-[500px]",children:[(0,t.jsx)(h.Z,{children:(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{children:"Customer"}),(0,t.jsx)(u.Z,{children:"Spend"}),(0,t.jsx)(u.Z,{children:"Total Events"})]})}),(0,t.jsx)(c.Z,{children:null==z?void 0:z.map((e,a)=>(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(d.Z,{children:e.end_user}),(0,t.jsx)(d.Z,{children:(0,A.pw)(e.total_spend,2)}),(0,t.jsx)(d.Z,{children:e.total_count})]},a))})]})})]}),(0,t.jsxs)(I.Z,{children:[(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsx)(j.Z,{className:"mb-4",value:ep,onValueChange:e=>{ej(e),eC(e.from,e.to)}})}),(0,t.jsx)(S.Z,{children:Y?(0,t.jsx)("div",{children:(0,t.jsxs)(f.Z,{value:em,onValueChange:e=>eg(e),children:[(0,t.jsx)(v.Z,{value:"all-tags",onClick:()=>eg(["all-tags"]),children:"All Tags"},"all-tags"),ee&&ee.filter(e=>"all-tags"!==e).map((e,a)=>(0,t.jsx)(v.Z,{value:String(e),children:e},e))]})}):(0,t.jsx)("div",{children:(0,t.jsxs)(f.Z,{value:em,onValueChange:e=>eg(e),children:[(0,t.jsx)(v.Z,{value:"all-tags",onClick:()=>eg(["all-tags"]),children:"All Tags"},"all-tags"),ee&&ee.filter(e=>"all-tags"!==e).map((e,a)=>(0,t.jsxs)(D.Z,{value:String(e),disabled:!0,children:["✨ ",e," (Enterprise only Feature)"]},e))]})})})]}),(0,t.jsxs)(w.Z,{numItems:2,className:"gap-2 h-[75vh] w-full mb-4",children:[(0,t.jsx)(S.Z,{numColSpan:2,children:(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"Spend Per Tag"}),(0,t.jsxs)(b.Z,{children:["Get Started by Tracking cost per tag"," ",(0,t.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/cost_tracking",target:"_blank",children:"here"})]}),(0,t.jsx)(l.Z,{className:"h-72",data:H,index:"name",categories:["spend"],colors:["cyan"]})]})}),(0,t.jsx)(S.Z,{numColSpan:2})]})]})]})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8143-cd64b2e17d72ff26.js b/litellm/proxy/_experimental/out/_next/static/chunks/8143-cd64b2e17d72ff26.js deleted file mode 100644 index 8858df9bcc4..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/8143-cd64b2e17d72ff26.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8143],{18143:function(e,s,a){a.d(s,{Z:function(){return P}});var t=a(57437),l=a(40278),n=a(96889),r=a(12514),o=a(97765),i=a(21626),c=a(97214),d=a(28241),h=a(58834),u=a(69552),x=a(71876),m=a(96761),g=a(2265),p=a(47375),j=a(39789),Z=a(75105),y=a(78489),S=a(49804),_=a(14042),w=a(67101),f=a(92414),v=a(46030),k=a(27281),D=a(57365),E=a(12485),N=a(18135),C=a(35242),I=a(29706),F=a(77991),b=a(84264),T=a(19250),M=a(4863),A=a(59872);console.log("process.env.NODE_ENV","production");let L=e=>null!==e&&("Admin"===e||"Admin Viewer"===e);var P=e=>{let{accessToken:s,token:a,userRole:P,userID:V,keys:U,premiumUser:Y}=e,B=new Date,[O,q]=(0,g.useState)([]),[R,W]=(0,g.useState)([]),[G,K]=(0,g.useState)([]),[z,Q]=(0,g.useState)([]),[X,$]=(0,g.useState)([]),[H,J]=(0,g.useState)([]),[ee,es]=(0,g.useState)([]),[ea,et]=(0,g.useState)([]),[el,en]=(0,g.useState)([]),[er,eo]=(0,g.useState)([]),[ei,ec]=(0,g.useState)({}),[ed,eh]=(0,g.useState)([]),[eu,ex]=(0,g.useState)(""),[em,eg]=(0,g.useState)(["all-tags"]),[ep,ej]=(0,g.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[eZ,ey]=(0,g.useState)(null),[eS,e_]=(0,g.useState)(0),ew=new Date(B.getFullYear(),B.getMonth(),1),ef=new Date(B.getFullYear(),B.getMonth()+1,0),ev=eI(ew),ek=eI(ef);function eD(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}console.log("keys in usage",U),console.log("premium user in usage",Y);let eE=async()=>{if(s)try{let e=await (0,T.getProxyUISettings)(s);return console.log("usage tab: proxy_settings",e),e}catch(e){console.error("Error fetching proxy settings:",e)}};(0,g.useEffect)(()=>{eC(ep.from,ep.to)},[ep,em]);let eN=async(e,a,t)=>{if(!e||!a||!s)return;console.log("uiSelectedKey",t);let l=await (0,T.adminTopEndUsersCall)(s,t,e.toISOString(),a.toISOString());console.log("End user data updated successfully",l),Q(l)},eC=async(e,a)=>{if(!e||!a||!s)return;let t=await eE();null!=t&&t.DISABLE_EXPENSIVE_DB_QUERIES||(J((await (0,T.tagsSpendLogsCall)(s,e.toISOString(),a.toISOString(),0===em.length?void 0:em)).spend_per_tag),console.log("Tag spend data updated successfully"))};function eI(e){let s=e.getFullYear(),a=e.getMonth()+1,t=e.getDate();return"".concat(s,"-").concat(a<10?"0"+a:a,"-").concat(t<10?"0"+t:t)}console.log("Start date is ".concat(ev)),console.log("End date is ".concat(ek));let eF=async(e,s,a)=>{try{let a=await e();s(a)}catch(e){console.error(a,e)}},eb=(e,s,a,t)=>{let l=[],n=new Date(s),r=e=>{if(e.includes("-"))return e;{let[s,a]=e.split(" ");return new Date(new Date().getFullYear(),new Date("".concat(s," 01 2024")).getMonth(),parseInt(a)).toISOString().split("T")[0]}},o=new Map(e.map(e=>{let s=r(e.date);return[s,{...e,date:s}]}));for(;n<=a;){let e=n.toISOString().split("T")[0];if(o.has(e))l.push(o.get(e));else{let s={date:e,api_requests:0,total_tokens:0};t.forEach(e=>{s[e]||(s[e]=0)}),l.push(s)}n.setDate(n.getDate()+1)}return l},eT=async()=>{if(s)try{let e=await (0,T.adminSpendLogsCall)(s),a=new Date,t=new Date(a.getFullYear(),a.getMonth(),1),l=new Date(a.getFullYear(),a.getMonth()+1,0),n=eb(e,t,l,[]),r=Number(n.reduce((e,s)=>e+(s.spend||0),0).toFixed(2));e_(r),q(n)}catch(e){console.error("Error fetching overall spend:",e)}},eM=()=>eF(()=>s&&a?(0,T.adminspendByProvider)(s,a,ev,ek):Promise.reject("No access token or token"),eo,"Error fetching provider spend"),eA=async()=>{s&&await eF(async()=>(await (0,T.adminTopKeysCall)(s)).map(e=>({key:e.api_key.substring(0,10),api_key:e.api_key,key_alias:e.key_alias,spend:Number(e.total_spend.toFixed(2))})),W,"Error fetching top keys")},eL=async()=>{s&&await eF(async()=>(await (0,T.adminTopModelsCall)(s)).map(e=>({key:e.model,spend:(0,A.pw)(e.total_spend,2)})),K,"Error fetching top models")},eP=async()=>{s&&await eF(async()=>{let e=await (0,T.teamSpendLogsCall)(s),a=new Date,t=new Date(a.getFullYear(),a.getMonth(),1),l=new Date(a.getFullYear(),a.getMonth()+1,0);return $(eb(e.daily_spend,t,l,e.teams)),et(e.teams),e.total_spend_per_team.map(e=>({name:e.team_id||"",value:(0,A.pw)(e.total_spend||0,2)}))},en,"Error fetching team spend")},eV=()=>{s&&eF(async()=>(await (0,T.allTagNamesCall)(s)).tag_names,es,"Error fetching tag names")},eU=()=>{s&&eF(()=>{var e,a;return(0,T.tagsSpendLogsCall)(s,null===(e=ep.from)||void 0===e?void 0:e.toISOString(),null===(a=ep.to)||void 0===a?void 0:a.toISOString(),void 0)},e=>J(e.spend_per_tag),"Error fetching top tags")},eY=()=>{s&&eF(()=>(0,T.adminTopEndUsersCall)(s,null,void 0,void 0),Q,"Error fetching top end users")},eB=async()=>{if(s)try{let e=await (0,T.adminGlobalActivity)(s,ev,ek),a=new Date,t=new Date(a.getFullYear(),a.getMonth(),1),l=new Date(a.getFullYear(),a.getMonth()+1,0),n=eb(e.daily_data||[],t,l,["api_requests","total_tokens"]);ec({...e,daily_data:n})}catch(e){console.error("Error fetching global activity:",e)}},eO=async()=>{if(s)try{let e=await (0,T.adminGlobalActivityPerModel)(s,ev,ek),a=new Date,t=new Date(a.getFullYear(),a.getMonth(),1),l=new Date(a.getFullYear(),a.getMonth()+1,0),n=e.map(e=>({...e,daily_data:eb(e.daily_data||[],t,l,["api_requests","total_tokens"])}));eh(n)}catch(e){console.error("Error fetching global activity per model:",e)}};return((0,g.useEffect)(()=>{(async()=>{if(s&&a&&P&&V){let e=await eE();e&&(ey(e),null!=e&&e.DISABLE_EXPENSIVE_DB_QUERIES)||(console.log("fetching data - valiue of proxySettings",eZ),eT(),eM(),eA(),eL(),eB(),eO(),L(P)&&(eP(),eV(),eU(),eY()))}})()},[s,a,P,V,ev,ek]),null==eZ?void 0:eZ.DISABLE_EXPENSIVE_DB_QUERIES)?(0,t.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"Database Query Limit Reached"}),(0,t.jsxs)(b.Z,{className:"mt-4",children:["SpendLogs in DB has ",eZ.NUM_SPEND_LOGS_ROWS," rows.",(0,t.jsx)("br",{}),"Please follow our guide to view usage when SpendLogs has more than 1M rows."]}),(0,t.jsx)(y.Z,{className:"mt-4",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/spending_monitoring",target:"_blank",children:"View Usage Guide"})})]})}):(0,t.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,t.jsxs)(N.Z,{children:[(0,t.jsxs)(C.Z,{className:"mt-2",children:[(0,t.jsx)(E.Z,{children:"All Up"}),L(P)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.Z,{children:"Team Based Usage"}),(0,t.jsx)(E.Z,{children:"Customer Usage"}),(0,t.jsx)(E.Z,{children:"Tag Based Usage"})]}):(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{})})]}),(0,t.jsxs)(F.Z,{children:[(0,t.jsx)(I.Z,{children:(0,t.jsxs)(N.Z,{children:[(0,t.jsxs)(C.Z,{variant:"solid",className:"mt-1",children:[(0,t.jsx)(E.Z,{children:"Cost"}),(0,t.jsx)(E.Z,{children:"Activity"})]}),(0,t.jsxs)(F.Z,{children:[(0,t.jsx)(I.Z,{children:(0,t.jsxs)(w.Z,{numItems:2,className:"gap-2 h-[100vh] w-full",children:[(0,t.jsxs)(S.Z,{numColSpan:2,children:[(0,t.jsxs)(b.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend ",new Date().toLocaleString("default",{month:"long"})," 1 -"," ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,t.jsx)(p.Z,{userID:V,userRole:P,accessToken:s,userSpend:eS,selectedTeam:null,userMaxBudget:null})]}),(0,t.jsx)(S.Z,{numColSpan:2,children:(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"Monthly Spend"}),(0,t.jsx)(l.Z,{data:O,index:"date",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$ ".concat((0,A.pw)(e,2)),yAxisWidth:100,tickGap:5})]})}),(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsxs)(r.Z,{className:"h-full",children:[(0,t.jsx)(m.Z,{children:"Top Virtual Keys"}),(0,t.jsx)(M.Z,{topKeys:R,accessToken:s,userID:V,userRole:P,teams:null,premiumUser:Y})]})}),(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsxs)(r.Z,{className:"h-full",children:[(0,t.jsx)(m.Z,{children:"Top Models"}),(0,t.jsx)(l.Z,{className:"mt-4 h-40",data:G,index:"key",categories:["spend"],colors:["cyan"],yAxisWidth:200,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>"$".concat((0,A.pw)(e,2))})]})}),(0,t.jsx)(S.Z,{numColSpan:1}),(0,t.jsx)(S.Z,{numColSpan:2,children:(0,t.jsxs)(r.Z,{className:"mb-2",children:[(0,t.jsx)(m.Z,{children:"Spend by Provider"}),(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsx)(_.Z,{className:"mt-4 h-40",variant:"pie",data:er,index:"provider",category:"spend",colors:["cyan"],valueFormatter:e=>"$".concat((0,A.pw)(e,2))})}),(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(h.Z,{children:(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{children:"Provider"}),(0,t.jsx)(u.Z,{children:"Spend"})]})}),(0,t.jsx)(c.Z,{children:er.map(e=>(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(d.Z,{children:e.provider}),(0,t.jsx)(d.Z,{children:1e-5>parseFloat(e.spend.toFixed(2))?"less than 0.00":(0,A.pw)(e.spend,2)})]},e.provider))})]})})]})})]})})]})}),(0,t.jsx)(I.Z,{children:(0,t.jsxs)(w.Z,{numItems:1,className:"gap-2 h-[75vh] w-full",children:[(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"All Up"}),(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsxs)(S.Z,{children:[(0,t.jsxs)(o.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",eD(ei.sum_api_requests)]}),(0,t.jsx)(Z.Z,{className:"h-40",data:ei.daily_data,valueFormatter:eD,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,t.jsxs)(S.Z,{children:[(0,t.jsxs)(o.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",eD(ei.sum_total_tokens)]}),(0,t.jsx)(l.Z,{className:"h-40",data:ei.daily_data,valueFormatter:eD,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]}),(0,t.jsx)(t.Fragment,{children:ed.map((e,s)=>(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:e.model}),(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsxs)(S.Z,{children:[(0,t.jsxs)(o.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",eD(e.sum_api_requests)]}),(0,t.jsx)(Z.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],valueFormatter:eD,onValueChange:e=>console.log(e)})]}),(0,t.jsxs)(S.Z,{children:[(0,t.jsxs)(o.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",eD(e.sum_total_tokens)]}),(0,t.jsx)(l.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],valueFormatter:eD,onValueChange:e=>console.log(e)})]})]})]},s))})]})})]})]})}),(0,t.jsx)(I.Z,{children:(0,t.jsxs)(w.Z,{numItems:2,className:"gap-2 h-[75vh] w-full",children:[(0,t.jsxs)(S.Z,{numColSpan:2,children:[(0,t.jsxs)(r.Z,{className:"mb-2",children:[(0,t.jsx)(m.Z,{children:"Total Spend Per Team"}),(0,t.jsx)(n.Z,{data:el})]}),(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"Daily Spend Per Team"}),(0,t.jsx)(l.Z,{className:"h-72",data:X,showLegend:!0,index:"date",categories:ea,yAxisWidth:80,stack:!0})]})]}),(0,t.jsx)(S.Z,{numColSpan:2})]})}),(0,t.jsxs)(I.Z,{children:[(0,t.jsxs)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:["Customers of your LLM API calls. Tracked when a `user` param is passed in your LLM calls"," ",(0,t.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/users",target:"_blank",children:"docs here"})]}),(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsx)(S.Z,{children:(0,t.jsx)(j.Z,{value:ep,onValueChange:e=>{ej(e),eN(e.from,e.to,null)}})}),(0,t.jsxs)(S.Z,{children:[(0,t.jsx)(b.Z,{children:"Select Key"}),(0,t.jsxs)(k.Z,{defaultValue:"all-keys",children:[(0,t.jsx)(D.Z,{value:"all-keys",onClick:()=>{eN(ep.from,ep.to,null)},children:"All Keys"},"all-keys"),null==U?void 0:U.map((e,s)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,t.jsx)(D.Z,{value:String(s),onClick:()=>{eN(ep.from,ep.to,e.token)},children:e.key_alias},s):null)]})]})]}),(0,t.jsx)(r.Z,{className:"mt-4",children:(0,t.jsxs)(i.Z,{className:"max-h-[70vh] min-h-[500px]",children:[(0,t.jsx)(h.Z,{children:(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{children:"Customer"}),(0,t.jsx)(u.Z,{children:"Spend"}),(0,t.jsx)(u.Z,{children:"Total Events"})]})}),(0,t.jsx)(c.Z,{children:null==z?void 0:z.map((e,s)=>(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(d.Z,{children:e.end_user}),(0,t.jsx)(d.Z,{children:(0,A.pw)(e.total_spend,2)}),(0,t.jsx)(d.Z,{children:e.total_count})]},s))})]})})]}),(0,t.jsxs)(I.Z,{children:[(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsx)(j.Z,{className:"mb-4",value:ep,onValueChange:e=>{ej(e),eC(e.from,e.to)}})}),(0,t.jsx)(S.Z,{children:Y?(0,t.jsx)("div",{children:(0,t.jsxs)(f.Z,{value:em,onValueChange:e=>eg(e),children:[(0,t.jsx)(v.Z,{value:"all-tags",onClick:()=>eg(["all-tags"]),children:"All Tags"},"all-tags"),ee&&ee.filter(e=>"all-tags"!==e).map((e,s)=>(0,t.jsx)(v.Z,{value:String(e),children:e},e))]})}):(0,t.jsx)("div",{children:(0,t.jsxs)(f.Z,{value:em,onValueChange:e=>eg(e),children:[(0,t.jsx)(v.Z,{value:"all-tags",onClick:()=>eg(["all-tags"]),children:"All Tags"},"all-tags"),ee&&ee.filter(e=>"all-tags"!==e).map((e,s)=>(0,t.jsxs)(D.Z,{value:String(e),disabled:!0,children:["✨ ",e," (Enterprise only Feature)"]},e))]})})})]}),(0,t.jsxs)(w.Z,{numItems:2,className:"gap-2 h-[75vh] w-full mb-4",children:[(0,t.jsx)(S.Z,{numColSpan:2,children:(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"Spend Per Tag"}),(0,t.jsxs)(b.Z,{children:["Get Started by Tracking cost per tag"," ",(0,t.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/cost_tracking",target:"_blank",children:"here"})]}),(0,t.jsx)(l.Z,{className:"h-72",data:H,index:"name",categories:["spend"],colors:["cyan"]})]})}),(0,t.jsx)(S.Z,{numColSpan:2})]})]})]})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8345-1fd48ab6ac35310b.js b/litellm/proxy/_experimental/out/_next/static/chunks/8345-1fd48ab6ac35310b.js new file mode 100644 index 00000000000..f79c16f655b --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/8345-1fd48ab6ac35310b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8345,8717],{96473:function(e,t,n){n.d(t,{Z:function(){return i}});var a=n(1119),o=n(2265),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"},c=n(55015),i=o.forwardRef(function(e,t){return o.createElement(c.Z,(0,a.Z)({},e,{ref:t,icon:r}))})},77565:function(e,t,n){n.d(t,{Z:function(){return i}});var a=n(1119),o=n(2265),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},c=n(55015),i=o.forwardRef(function(e,t){return o.createElement(c.Z,(0,a.Z)({},e,{ref:t,icon:r}))})},57400:function(e,t,n){n.d(t,{Z:function(){return i}});var a=n(1119),o=n(2265),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"},c=n(55015),i=o.forwardRef(function(e,t){return o.createElement(c.Z,(0,a.Z)({},e,{ref:t,icon:r}))})},15883:function(e,t,n){n.d(t,{Z:function(){return i}});var a=n(1119),o=n(2265),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"},c=n(55015),i=o.forwardRef(function(e,t){return o.createElement(c.Z,(0,a.Z)({},e,{ref:t,icon:r}))})},96761:function(e,t,n){n.d(t,{Z:function(){return l}});var a=n(5853),o=n(26898),r=n(13241),c=n(1153),i=n(2265);let l=i.forwardRef((e,t)=>{let{color:n,children:l,className:d}=e,s=(0,a._T)(e,["color","children","className"]);return i.createElement("p",Object.assign({ref:t,className:(0,r.q)("font-medium text-tremor-title",n?(0,c.bM)(n,o.K.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",d)},s),l)});l.displayName="Title"},44851:function(e,t,n){n.d(t,{default:function(){return V}});var a=n(2265),o=n(77565),r=n(36760),c=n.n(r),i=n(1119),l=n(83145),d=n(26365),s=n(41154),u=n(50506),f=n(32559),p=n(6989),m=n(45287),h=n(31686),b=n(11993),g=n(66632),v=n(95814),x=a.forwardRef(function(e,t){var n=e.prefixCls,o=e.forceRender,r=e.className,i=e.style,l=e.children,s=e.isActive,u=e.role,f=e.classNames,p=e.styles,m=a.useState(s||o),h=(0,d.Z)(m,2),g=h[0],v=h[1];return(a.useEffect(function(){(o||s)&&v(!0)},[o,s]),g)?a.createElement("div",{ref:t,className:c()("".concat(n,"-content"),(0,b.Z)((0,b.Z)({},"".concat(n,"-content-active"),s),"".concat(n,"-content-inactive"),!s),r),style:i,role:u},a.createElement("div",{className:c()("".concat(n,"-content-box"),null==f?void 0:f.body),style:null==p?void 0:p.body},l)):null});x.displayName="PanelContent";var y=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],k=a.forwardRef(function(e,t){var n=e.showArrow,o=e.headerClass,r=e.isActive,l=e.onItemClick,d=e.forceRender,s=e.className,u=e.classNames,f=void 0===u?{}:u,m=e.styles,k=void 0===m?{}:m,w=e.prefixCls,C=e.collapsible,Z=e.accordion,I=e.panelKey,E=e.extra,S=e.header,N=e.expandIcon,M=e.openMotion,O=e.destroyInactivePanel,z=e.children,j=(0,p.Z)(e,y),P="disabled"===C,B=(0,b.Z)((0,b.Z)((0,b.Z)({onClick:function(){null==l||l(I)},onKeyDown:function(e){("Enter"===e.key||e.keyCode===v.Z.ENTER||e.which===v.Z.ENTER)&&(null==l||l(I))},role:Z?"tab":"button"},"aria-expanded",r),"aria-disabled",P),"tabIndex",P?-1:0),R="function"==typeof N?N(e):a.createElement("i",{className:"arrow"}),A=R&&a.createElement("div",(0,i.Z)({className:"".concat(w,"-expand-icon")},["header","icon"].includes(C)?B:{}),R),L=c()("".concat(w,"-item"),(0,b.Z)((0,b.Z)({},"".concat(w,"-item-active"),r),"".concat(w,"-item-disabled"),P),s),W=c()(o,"".concat(w,"-header"),(0,b.Z)({},"".concat(w,"-collapsible-").concat(C),!!C),f.header),T=(0,h.Z)({className:W,style:k.header},["header","icon"].includes(C)?{}:B);return a.createElement("div",(0,i.Z)({},j,{ref:t,className:L}),a.createElement("div",T,(void 0===n||n)&&A,a.createElement("span",(0,i.Z)({className:"".concat(w,"-header-text")},"header"===C?B:{}),S),null!=E&&"boolean"!=typeof E&&a.createElement("div",{className:"".concat(w,"-extra")},E)),a.createElement(g.ZP,(0,i.Z)({visible:r,leavedClassName:"".concat(w,"-content-hidden")},M,{forceRender:d,removeOnLeave:O}),function(e,t){var n=e.className,o=e.style;return a.createElement(x,{ref:t,prefixCls:w,className:n,classNames:f,style:o,styles:k,isActive:r,forceRender:d,role:Z?"tabpanel":void 0},z)}))}),w=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],C=function(e,t){var n=t.prefixCls,o=t.accordion,r=t.collapsible,c=t.destroyInactivePanel,l=t.onItemClick,d=t.activeKey,s=t.openMotion,u=t.expandIcon;return e.map(function(e,t){var f=e.children,m=e.label,h=e.key,b=e.collapsible,g=e.onItemClick,v=e.destroyInactivePanel,x=(0,p.Z)(e,w),y=String(null!=h?h:t),C=null!=b?b:r,Z=!1;return Z=o?d[0]===y:d.indexOf(y)>-1,a.createElement(k,(0,i.Z)({},x,{prefixCls:n,key:y,panelKey:y,isActive:Z,accordion:o,openMotion:s,expandIcon:u,header:m,collapsible:C,onItemClick:function(e){"disabled"!==C&&(l(e),null==g||g(e))},destroyInactivePanel:null!=v?v:c}),f)})},Z=function(e,t,n){if(!e)return null;var o=n.prefixCls,r=n.accordion,c=n.collapsible,i=n.destroyInactivePanel,l=n.onItemClick,d=n.activeKey,s=n.openMotion,u=n.expandIcon,f=e.key||String(t),p=e.props,m=p.header,h=p.headerClass,b=p.destroyInactivePanel,g=p.collapsible,v=p.onItemClick,x=!1;x=r?d[0]===f:d.indexOf(f)>-1;var y=null!=g?g:c,k={key:f,panelKey:f,header:m,headerClass:h,isActive:x,prefixCls:o,destroyInactivePanel:null!=b?b:i,openMotion:s,accordion:r,children:e.props.children,onItemClick:function(e){"disabled"!==y&&(l(e),null==v||v(e))},expandIcon:u,collapsible:y};return"string"==typeof e.type?e:(Object.keys(k).forEach(function(e){void 0===k[e]&&delete k[e]}),a.cloneElement(e,k))},I=n(18242);function E(e){var t=e;if(!Array.isArray(t)){var n=(0,s.Z)(t);t="number"===n||"string"===n?[t]:[]}return t.map(function(e){return String(e)})}var S=Object.assign(a.forwardRef(function(e,t){var n,o=e.prefixCls,r=void 0===o?"rc-collapse":o,s=e.destroyInactivePanel,p=e.style,h=e.accordion,b=e.className,g=e.children,v=e.collapsible,x=e.openMotion,y=e.expandIcon,k=e.activeKey,w=e.defaultActiveKey,S=e.onChange,N=e.items,M=c()(r,b),O=(0,u.Z)([],{value:k,onChange:function(e){return null==S?void 0:S(e)},defaultValue:w,postState:E}),z=(0,d.Z)(O,2),j=z[0],P=z[1];(0,f.ZP)(!g,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var B=(n={prefixCls:r,accordion:h,openMotion:x,expandIcon:y,collapsible:v,destroyInactivePanel:void 0!==s&&s,onItemClick:function(e){return P(function(){return h?j[0]===e?[]:[e]:j.indexOf(e)>-1?j.filter(function(t){return t!==e}):[].concat((0,l.Z)(j),[e])})},activeKey:j},Array.isArray(N)?C(N,n):(0,m.Z)(g).map(function(e,t){return Z(e,t,n)}));return a.createElement("div",(0,i.Z)({ref:t,className:M,style:p,role:h?"tablist":void 0},(0,I.Z)(e,{aria:!0,data:!0})),B)}),{Panel:k});S.Panel;var N=n(18694),M=n(68710),O=n(19722),z=n(71744),j=n(33759);let P=a.forwardRef((e,t)=>{let{getPrefixCls:n}=a.useContext(z.E_),{prefixCls:o,className:r,showArrow:i=!0}=e,l=n("collapse",o),d=c()({["".concat(l,"-no-arrow")]:!i},r);return a.createElement(S.Panel,Object.assign({ref:t},e,{prefixCls:l,className:d}))});var B=n(93463),R=n(12918),A=n(63074),L=n(99320),W=n(71140);let T=e=>{let{componentCls:t,contentBg:n,padding:a,headerBg:o,headerPadding:r,collapseHeaderPaddingSM:c,collapseHeaderPaddingLG:i,collapsePanelBorderRadius:l,lineWidth:d,lineType:s,colorBorder:u,colorText:f,colorTextHeading:p,colorTextDisabled:m,fontSizeLG:h,lineHeight:b,lineHeightLG:g,marginSM:v,paddingSM:x,paddingLG:y,paddingXS:k,motionDurationSlow:w,fontSizeIcon:C,contentPadding:Z,fontHeight:I,fontHeightLG:E}=e,S="".concat((0,B.bf)(d)," ").concat(s," ").concat(u);return{[t]:Object.assign(Object.assign({},(0,R.Wf)(e)),{backgroundColor:o,border:S,borderRadius:l,"&-rtl":{direction:"rtl"},["& > ".concat(t,"-item")]:{borderBottom:S,"&:first-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"".concat((0,B.bf)(l)," ").concat((0,B.bf)(l)," 0 0")}},"&:last-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"0 0 ".concat((0,B.bf)(l)," ").concat((0,B.bf)(l))}},["> ".concat(t,"-header")]:Object.assign(Object.assign({position:"relative",display:"flex",flexWrap:"nowrap",alignItems:"flex-start",padding:r,color:p,lineHeight:b,cursor:"pointer",transition:"all ".concat(w,", visibility 0s")},(0,R.Qy)(e)),{["> ".concat(t,"-header-text")]:{flex:"auto"},["".concat(t,"-expand-icon")]:{height:I,display:"flex",alignItems:"center",paddingInlineEnd:v},["".concat(t,"-arrow")]:Object.assign(Object.assign({},(0,R.Ro)()),{fontSize:C,transition:"transform ".concat(w),svg:{transition:"transform ".concat(w)}}),["".concat(t,"-header-text")]:{marginInlineEnd:"auto"}}),["".concat(t,"-collapsible-header")]:{cursor:"default",["".concat(t,"-header-text")]:{flex:"none",cursor:"pointer"},["".concat(t,"-expand-icon")]:{cursor:"pointer"}},["".concat(t,"-collapsible-icon")]:{cursor:"unset",["".concat(t,"-expand-icon")]:{cursor:"pointer"}}},["".concat(t,"-content")]:{color:f,backgroundColor:n,borderTop:S,["& > ".concat(t,"-content-box")]:{padding:Z},"&-hidden":{display:"none"}},"&-small":{["> ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{padding:c,paddingInlineStart:k,["> ".concat(t,"-expand-icon")]:{marginInlineStart:e.calc(x).sub(k).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:x}}},"&-large":{["> ".concat(t,"-item")]:{fontSize:h,lineHeight:g,["> ".concat(t,"-header")]:{padding:i,paddingInlineStart:a,["> ".concat(t,"-expand-icon")]:{height:E,marginInlineStart:e.calc(y).sub(a).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:y}}},["".concat(t,"-item:last-child")]:{borderBottom:0,["> ".concat(t,"-content")]:{borderRadius:"0 0 ".concat((0,B.bf)(l)," ").concat((0,B.bf)(l))}},["& ".concat(t,"-item-disabled > ").concat(t,"-header")]:{"\n &,\n & > .arrow\n ":{color:m,cursor:"not-allowed"}},["&".concat(t,"-icon-position-end")]:{["& > ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{["".concat(t,"-expand-icon")]:{order:1,paddingInlineEnd:0,paddingInlineStart:v}}}}})}},q=e=>{let{componentCls:t}=e,n="> ".concat(t,"-item > ").concat(t,"-header ").concat(t,"-arrow");return{["".concat(t,"-rtl")]:{[n]:{transform:"rotate(180deg)"}}}},K=e=>{let{componentCls:t,headerBg:n,borderlessContentPadding:a,borderlessContentBg:o,colorBorder:r}=e;return{["".concat(t,"-borderless")]:{backgroundColor:n,border:0,["> ".concat(t,"-item")]:{borderBottom:"1px solid ".concat(r)},["\n > ".concat(t,"-item:last-child,\n > ").concat(t,"-item:last-child ").concat(t,"-header\n ")]:{borderRadius:0},["> ".concat(t,"-item:last-child")]:{borderBottom:0},["> ".concat(t,"-item > ").concat(t,"-content")]:{backgroundColor:o,borderTop:0},["> ".concat(t,"-item > ").concat(t,"-content > ").concat(t,"-content-box")]:{padding:a}}}},_=e=>{let{componentCls:t,paddingSM:n}=e;return{["".concat(t,"-ghost")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-item")]:{borderBottom:0,["> ".concat(t,"-content")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-content-box")]:{paddingBlock:n}}}}}};var H=(0,L.I$)("Collapse",e=>{let t=(0,W.IX)(e,{collapseHeaderPaddingSM:"".concat((0,B.bf)(e.paddingXS)," ").concat((0,B.bf)(e.paddingSM)),collapseHeaderPaddingLG:"".concat((0,B.bf)(e.padding)," ").concat((0,B.bf)(e.paddingLG)),collapsePanelBorderRadius:e.borderRadiusLG});return[T(t),K(t),_(t),q(t),(0,A.Z)(t)]},e=>({headerPadding:"".concat(e.paddingSM,"px ").concat(e.padding,"px"),headerBg:e.colorFillAlter,contentPadding:"".concat(e.padding,"px 16px"),contentBg:e.colorBgContainer,borderlessContentPadding:"".concat(e.paddingXXS,"px 16px ").concat(e.padding,"px"),borderlessContentBg:"transparent"})),V=Object.assign(a.forwardRef((e,t)=>{let{getPrefixCls:n,direction:r,expandIcon:i,className:l,style:d}=(0,z.dj)("collapse"),{prefixCls:s,className:u,rootClassName:f,style:p,bordered:h=!0,ghost:b,size:g,expandIconPosition:v="start",children:x,destroyInactivePanel:y,destroyOnHidden:k,expandIcon:w}=e,C=(0,j.Z)(e=>{var t;return null!==(t=null!=g?g:e)&&void 0!==t?t:"middle"}),Z=n("collapse",s),I=n(),[E,P,B]=H(Z),R=a.useMemo(()=>"left"===v?"start":"right"===v?"end":v,[v]),A=null!=w?w:i,L=a.useCallback(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="function"==typeof A?A(e):a.createElement(o.Z,{rotate:e.isActive?"rtl"===r?-90:90:void 0,"aria-label":e.isActive?"expanded":"collapsed"});return(0,O.Tm)(t,()=>{var e;return{className:c()(null===(e=t.props)||void 0===e?void 0:e.className,"".concat(Z,"-arrow"))}})},[A,Z,r]),W=c()("".concat(Z,"-icon-position-").concat(R),{["".concat(Z,"-borderless")]:!h,["".concat(Z,"-rtl")]:"rtl"===r,["".concat(Z,"-ghost")]:!!b,["".concat(Z,"-").concat(C)]:"middle"!==C},l,u,f,P,B),T=a.useMemo(()=>Object.assign(Object.assign({},(0,M.Z)(I)),{motionAppear:!1,leavedClassName:"".concat(Z,"-content-hidden")}),[I,Z]),q=a.useMemo(()=>x?(0,m.Z)(x).map((e,t)=>{var n,a;let o=e.props;if(null==o?void 0:o.disabled){let r=null!==(n=e.key)&&void 0!==n?n:String(t),c=Object.assign(Object.assign({},(0,N.Z)(e.props,["disabled"])),{key:r,collapsible:null!==(a=o.collapsible)&&void 0!==a?a:"disabled"});return(0,O.Tm)(e,c)}return e}):null,[x]);return E(a.createElement(S,Object.assign({ref:t,openMotion:T},(0,N.Z)(e,["rootClassName"]),{expandIcon:L,prefixCls:Z,className:W,style:Object.assign(Object.assign({},d),p),destroyInactivePanel:null!=k?k:y}),q))}),{Panel:P})},23496:function(e,t,n){n.d(t,{Z:function(){return g}});var a=n(2265),o=n(36760),r=n.n(o),c=n(71744),i=n(33759),l=n(93463),d=n(12918),s=n(99320),u=n(71140);let f=e=>{let{componentCls:t}=e;return{[t]:{"&-horizontal":{["&".concat(t)]:{"&-sm":{marginBlock:e.marginXS},"&-md":{marginBlock:e.margin}}}}}},p=e=>{let{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:a,lineWidth:o,textPaddingInline:r,orientationMargin:c,verticalMarginInline:i}=e;return{[t]:Object.assign(Object.assign({},(0,d.Wf)(e)),{borderBlockStart:"".concat((0,l.bf)(o)," solid ").concat(a),"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:i,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:"".concat((0,l.bf)(o)," solid ").concat(a)},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:"".concat((0,l.bf)(e.marginLG)," 0")},["&-horizontal".concat(t,"-with-text")]:{display:"flex",alignItems:"center",margin:"".concat((0,l.bf)(e.dividerHorizontalWithTextGutterMargin)," 0"),color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:"0 ".concat(a),"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:"".concat((0,l.bf)(o)," solid transparent"),borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},["&-horizontal".concat(t,"-with-text-start")]:{"&::before":{width:"calc(".concat(c," * 100%)")},"&::after":{width:"calc(100% - ".concat(c," * 100%)")}},["&-horizontal".concat(t,"-with-text-end")]:{"&::before":{width:"calc(100% - ".concat(c," * 100%)")},"&::after":{width:"calc(".concat(c," * 100%)")}},["".concat(t,"-inner-text")]:{display:"inline-block",paddingBlock:0,paddingInline:r},"&-dashed":{background:"none",borderColor:a,borderStyle:"dashed",borderWidth:"".concat((0,l.bf)(o)," 0 0")},["&-horizontal".concat(t,"-with-text").concat(t,"-dashed")]:{"&::before, &::after":{borderStyle:"dashed none none"}},["&-vertical".concat(t,"-dashed")]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},"&-dotted":{background:"none",borderColor:a,borderStyle:"dotted",borderWidth:"".concat((0,l.bf)(o)," 0 0")},["&-horizontal".concat(t,"-with-text").concat(t,"-dotted")]:{"&::before, &::after":{borderStyle:"dotted none none"}},["&-vertical".concat(t,"-dotted")]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},["&-plain".concat(t,"-with-text")]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},["&-horizontal".concat(t,"-with-text-start").concat(t,"-no-default-orientation-margin-start")]:{"&::before":{width:0},"&::after":{width:"100%"},["".concat(t,"-inner-text")]:{paddingInlineStart:n}},["&-horizontal".concat(t,"-with-text-end").concat(t,"-no-default-orientation-margin-end")]:{"&::before":{width:"100%"},"&::after":{width:0},["".concat(t,"-inner-text")]:{paddingInlineEnd:n}}})}};var m=(0,s.I$)("Divider",e=>{let t=(0,u.IX)(e,{dividerHorizontalWithTextGutterMargin:e.margin,sizePaddingEdgeHorizontal:0});return[p(t),f(t)]},e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}}),h=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(e);ot.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]]);return n};let b={small:"sm",middle:"md"};var g=e=>{let{getPrefixCls:t,direction:n,className:o,style:l}=(0,c.dj)("divider"),{prefixCls:d,type:s="horizontal",orientation:u="center",orientationMargin:f,className:p,rootClassName:g,children:v,dashed:x,variant:y="solid",plain:k,style:w,size:C}=e,Z=h(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","variant","plain","style","size"]),I=t("divider",d),[E,S,N]=m(I),M=b[(0,i.Z)(C)],O=!!v,z=a.useMemo(()=>"left"===u?"rtl"===n?"end":"start":"right"===u?"rtl"===n?"start":"end":u,[n,u]),j="start"===z&&null!=f,P="end"===z&&null!=f,B=r()(I,o,S,N,"".concat(I,"-").concat(s),{["".concat(I,"-with-text")]:O,["".concat(I,"-with-text-").concat(z)]:O,["".concat(I,"-dashed")]:!!x,["".concat(I,"-").concat(y)]:"solid"!==y,["".concat(I,"-plain")]:!!k,["".concat(I,"-rtl")]:"rtl"===n,["".concat(I,"-no-default-orientation-margin-start")]:j,["".concat(I,"-no-default-orientation-margin-end")]:P,["".concat(I,"-").concat(M)]:!!M},p,g),R=a.useMemo(()=>"number"==typeof f?f:/^\d+$/.test(f)?Number(f):f,[f]);return E(a.createElement("div",Object.assign({className:B,style:Object.assign(Object.assign({},l),w)},Z,{role:"separator"}),v&&"vertical"!==s&&a.createElement("span",{className:"".concat(I,"-inner-text"),style:{marginInlineStart:j?R:void 0,marginInlineEnd:P?R:void 0}},v)))}},79205:function(e,t,n){n.d(t,{Z:function(){return u}});var a=n(2265);let o=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),r=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),c=e=>{let t=r(e);return t.charAt(0).toUpperCase()+t.slice(1)},i=function(){for(var e=arguments.length,t=Array(e),n=0;n!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim()},l=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var d={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let s=(0,a.forwardRef)((e,t)=>{let{color:n="currentColor",size:o=24,strokeWidth:r=2,absoluteStrokeWidth:c,className:s="",children:u,iconNode:f,...p}=e;return(0,a.createElement)("svg",{ref:t,...d,width:o,height:o,stroke:n,strokeWidth:c?24*Number(r)/Number(o):r,className:i("lucide",s),...!u&&!l(p)&&{"aria-hidden":"true"},...p},[...f.map(e=>{let[t,n]=e;return(0,a.createElement)(t,n)}),...Array.isArray(u)?u:[u]])}),u=(e,t)=>{let n=(0,a.forwardRef)((n,r)=>{let{className:l,...d}=n;return(0,a.createElement)(s,{ref:r,iconNode:t,className:i("lucide-".concat(o(c(e))),"lucide-".concat(e),l),...d})});return n.displayName=c(e),n}},82222:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},51817:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},98728:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("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"}]])},79862:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]])},32489:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},25523:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return a}});let a=n(47043)._(n(2265)).default.createContext(null)}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8449-6f1ee9a3834bb239.js b/litellm/proxy/_experimental/out/_next/static/chunks/8449-6f1ee9a3834bb239.js new file mode 100644 index 00000000000..7dbead3b640 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/8449-6f1ee9a3834bb239.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8449],{48449:function(e,s,l){l.d(s,{Z:function(){return er}});var t=l(57437),i=l(2265),r=l(57840),n=l(99376),o=l(10032),a=l(4260),c=l(5545),d=l(22116);l(25512);var u=l(78489),m=l(94789),_=l(12514),h=l(12485),g=l(18135),x=l(35242),p=l(29706),f=l(77991),j=l(21626),y=l(97214),S=l(28241),v=l(58834),I=l(69552),C=l(71876),Z=l(37592),b=l(56522),w=l(19250),k=l(9114),N=l(85968);let E={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:""},O={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"}]}};var T=e=>{let{isAddSSOModalVisible:s,isInstructionsModalVisible:l,handleAddSSOOk:r,handleAddSSOCancel:n,handleShowInstructions:u,handleInstructionsOk:m,handleInstructionsCancel:_,form:h,accessToken:g,ssoConfigured:x=!1}=e,[p,f]=(0,i.useState)(!1);(0,i.useEffect)(()=>{(async()=>{if(s&&g)try{let s=await (0,w.getSSOSettings)(g);if(console.log("Raw SSO data received:",s),s&&s.values){console.log("SSO values:",s.values),console.log("user_email from API:",s.values.user_email);let t=null;if(s.values.google_client_id)t="google";else if(s.values.microsoft_client_id)t="microsoft";else if(s.values.generic_client_id){var e,l;t=(null===(e=s.values.generic_authorization_endpoint)||void 0===e?void 0:e.includes("okta"))||(null===(l=s.values.generic_authorization_endpoint)||void 0===l?void 0:l.includes("auth0"))?"okta":"generic"}let i={sso_provider:t,proxy_base_url:s.values.proxy_base_url,user_email:s.values.user_email,...s.values};console.log("Setting form values:",i),h.resetFields(),setTimeout(()=>{h.setFieldsValue(i),console.log("Form values set, current form values:",h.getFieldsValue())},100)}}catch(e){console.error("Failed to load SSO settings:",e)}})()},[s,g,h]);let j=async e=>{if(!g){k.Z.fromBackend("No access token available");return}try{await (0,w.updateSSOSettings)(g,e),u(e)}catch(e){k.Z.fromBackend("Failed to save SSO settings: "+(0,N.O)(e))}},y=async()=>{if(!g){k.Z.fromBackend("No access token available");return}try{await (0,w.updateSSOSettings)(g,{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}),h.resetFields(),f(!1),r(),k.Z.success("SSO settings cleared successfully")}catch(e){console.error("Failed to clear SSO settings:",e),k.Z.fromBackend("Failed to clear SSO settings")}},S=e=>{let s=O[e];return s?s.fields.map(e=>(0,t.jsx)(o.Z.Item,{label:e.label,name:e.name,rules:[{required:!0,message:"Please enter the ".concat(e.label.toLowerCase())}],children:e.name.includes("client")?(0,t.jsx)(a.default.Password,{}):(0,t.jsx)(b.o,{placeholder:e.placeholder})},e.name)):null};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.Z,{title:x?"Edit SSO Settings":"Add SSO",visible:s,width:800,footer:null,onOk:r,onCancel:n,children:(0,t.jsxs)(o.Z,{form:h,onFinish:j,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Z.Item,{label:"SSO Provider",name:"sso_provider",rules:[{required:!0,message:"Please select an SSO provider"}],children:(0,t.jsx)(Z.default,{children:Object.entries(E).map(e=>{let[s,l]=e;return(0,t.jsx)(Z.default.Option,{value:s,children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0"},children:[l&&(0,t.jsx)("img",{src:l,alt:s,style:{height:24,width:24,marginRight:12,objectFit:"contain"}}),(0,t.jsxs)("span",{children:["okta"===s.toLowerCase()?"Okta / Auth0":s.charAt(0).toUpperCase()+s.slice(1)," ","SSO"]})]})},s)})})}),(0,t.jsx)(o.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.sso_provider!==s.sso_provider,children:e=>{let{getFieldValue:s}=e,l=s("sso_provider");return l?S(l):null}}),(0,t.jsx)(o.Z.Item,{label:"Proxy Admin Email",name:"user_email",rules:[{required:!0,message:"Please enter the email of the proxy admin"}],children:(0,t.jsx)(b.o,{})}),(0,t.jsx)(o.Z.Item,{label:"Proxy Base URL",name:"proxy_base_url",normalize:e=>null==e?void 0:e.trim(),rules:[{required:!0,message:"Please enter the proxy base url"},{pattern:/^https?:\/\/.+/,message:"URL must start with http:// or https://"},{validator:(e,s)=>s&&/^https?:\/\/.+/.test(s)&&s.endsWith("/")?Promise.reject("URL must not end with a trailing slash"):Promise.resolve()}],children:(0,t.jsx)(b.o,{placeholder:"https://example.com"})})]}),(0,t.jsxs)("div",{style:{textAlign:"right",marginTop:"10px",display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px"},children:[x&&(0,t.jsx)(c.ZP,{onClick:()=>f(!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)(c.ZP,{htmlType:"submit",children:"Save"})]})]})}),(0,t.jsxs)(d.Z,{title:"Confirm Clear SSO Settings",visible:p,onOk:y,onCancel:()=>f(!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)(d.Z,{title:"SSO Setup Instructions",visible:l,width:800,footer:null,onOk:m,onCancel:_,children:[(0,t.jsx)("p",{children:"Follow these steps to complete the SSO setup:"}),(0,t.jsx)(b.x,{className:"mt-2",children:"1. DO NOT Exit this TAB"}),(0,t.jsx)(b.x,{className:"mt-2",children:"2. Open a new tab, visit your proxy base url"}),(0,t.jsx)(b.x,{className:"mt-2",children:"3. Confirm your SSO is configured correctly and you can login on the new Tab"}),(0,t.jsx)(b.x,{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)(c.ZP,{onClick:m,children:"Done"})})]})]})},A=l(67982),P=l(67101),U=l(84264),R=l(49566),F=l(96761),M=l(29233),L=l(62272),G=l(23639),B=l(92403),D=l(29271),z=l(34419),q=e=>{let{accessToken:s,userID:l,proxySettings:r}=e,[n]=o.Z.useForm(),[a,c]=(0,i.useState)(!1),[d,h]=(0,i.useState)(null),[g,x]=(0,i.useState)("");(0,i.useEffect)(()=>{let e="";x(r&&r.PROXY_BASE_URL&&void 0!==r.PROXY_BASE_URL?r.PROXY_BASE_URL:window.location.origin)},[r]);let p="".concat(g,"/scim/v2"),f=async e=>{if(!s||!l){k.Z.fromBackend("You need to be logged in to create a SCIM token");return}try{c(!0);let t={key_alias:e.key_alias||"SCIM Access Token",team_id:null,models:[],allowed_routes:["/scim/*"]},i=await (0,w.keyCreateCall)(s,l,t);h(i),k.Z.success("SCIM token created successfully")}catch(e){console.error("Error creating SCIM token:",e),k.Z.fromBackend("Failed to create SCIM token: "+(0,N.O)(e))}finally{c(!1)}};return(0,t.jsx)(P.Z,{numItems:1,children:(0,t.jsxs)(_.Z,{children:[(0,t.jsx)("div",{className:"flex items-center mb-4",children:(0,t.jsx)(F.Z,{children:"SCIM Configuration"})}),(0,t.jsx)(U.Z,{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)(A.Z,{}),(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)(F.Z,{className:"text-lg flex items-center",children:[(0,t.jsx)(L.Z,{className:"h-5 w-5 mr-2"}),"SCIM Tenant URL"]})]}),(0,t.jsx)(U.Z,{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)(R.Z,{value:p,disabled:!0,className:"flex-grow"}),(0,t.jsx)(M.CopyToClipboard,{text:p,onCopy:()=>k.Z.success("URL copied to clipboard"),children:(0,t.jsxs)(u.Z,{variant:"primary",className:"ml-2 flex items-center",children:[(0,t.jsx)(G.Z,{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)(F.Z,{className:"text-lg flex items-center",children:[(0,t.jsx)(B.Z,{className:"h-5 w-5 mr-2"}),"Authentication Token"]})]}),(0,t.jsx)(m.Z,{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)(_.Z,{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)(D.Z,{className:"h-5 w-5 mr-2"}),(0,t.jsx)(F.Z,{className:"text-lg text-yellow-800",children:"Your SCIM Token"})]}),(0,t.jsx)(U.Z,{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)(R.Z,{value:d.key,className:"flex-grow mr-2 bg-white",type:"password",disabled:!0}),(0,t.jsx)(M.CopyToClipboard,{text:d.key,onCopy:()=>k.Z.success("Token copied to clipboard"),children:(0,t.jsxs)(u.Z,{variant:"primary",className:"flex items-center",children:[(0,t.jsx)(G.Z,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),(0,t.jsxs)(u.Z,{className:"mt-4 flex items-center",variant:"secondary",onClick:()=>h(null),children:[(0,t.jsx)(z.Z,{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)(o.Z,{form:n,onFinish:f,layout:"vertical",children:[(0,t.jsx)(o.Z.Item,{name:"key_alias",label:"Token Name",rules:[{required:!0,message:"Please enter a name for your token"}],children:(0,t.jsx)(R.Z,{placeholder:"SCIM Access Token"})}),(0,t.jsx)(o.Z.Item,{children:(0,t.jsxs)(u.Z,{variant:"primary",type:"submit",loading:a,className:"flex items-center",children:[(0,t.jsx)(B.Z,{className:"h-4 w-4 mr-1"}),"Create SCIM Token"]})})]})})]})]})]})})},V=e=>{let{accessToken:s,onSuccess:l}=e,[r]=o.Z.useForm(),[n,a]=(0,i.useState)(!1);(0,i.useEffect)(()=>{(async()=>{if(s)try{let e=await (0,w.getSSOSettings)(s);if(e&&e.values){let s=e.values.ui_access_mode,l={};s&&"object"==typeof s?l={ui_access_mode_type:s.type,restricted_sso_group:s.restricted_sso_group,sso_group_jwt_field:s.sso_group_jwt_field}:"string"==typeof s&&(l={ui_access_mode_type:s,restricted_sso_group:e.values.restricted_sso_group,sso_group_jwt_field:e.values.team_ids_jwt_field||e.values.sso_group_jwt_field}),r.setFieldsValue(l)}}catch(e){console.error("Failed to load UI access settings:",e)}})()},[s,r]);let d=async e=>{if(!s){k.Z.fromBackend("No access token available");return}a(!0);try{let t;t="all_authenticated_users"===e.ui_access_mode_type?{ui_access_mode:"none"}:{ui_access_mode:{type:e.ui_access_mode_type,restricted_sso_group:e.restricted_sso_group,sso_group_jwt_field:e.sso_group_jwt_field}},await (0,w.updateSSOSettings)(s,t),l()}catch(e){console.error("Failed to save UI access settings:",e),k.Z.fromBackend("Failed to save UI access settings")}finally{a(!1)}};return(0,t.jsxs)("div",{style:{padding:"16px"},children:[(0,t.jsx)("div",{style:{marginBottom:"16px"},children:(0,t.jsx)(b.x,{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)(o.Z,{form:r,onFinish:d,layout:"vertical",children:[(0,t.jsx)(o.Z.Item,{label:"UI Access Mode",name:"ui_access_mode_type",tooltip:"Controls who can access the UI interface",children:(0,t.jsxs)(Z.default,{placeholder:"Select access mode",children:[(0,t.jsx)(Z.default.Option,{value:"all_authenticated_users",children:"All Authenticated Users"}),(0,t.jsx)(Z.default.Option,{value:"restricted_sso_group",children:"Restricted SSO Group"})]})}),(0,t.jsx)(o.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.ui_access_mode_type!==s.ui_access_mode_type,children:e=>{let{getFieldValue:s}=e;return"restricted_sso_group"===s("ui_access_mode_type")?(0,t.jsx)(o.Z.Item,{label:"Restricted SSO Group",name:"restricted_sso_group",rules:[{required:!0,message:"Please enter the restricted SSO group"}],children:(0,t.jsx)(b.o,{placeholder:"ui-access-group"})}):null}}),(0,t.jsx)(o.Z.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)(b.o,{placeholder:"groups"})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"16px"},children:(0,t.jsx)(c.ZP,{type:"primary",htmlType:"submit",loading:n,style:{backgroundColor:"#6366f1",borderColor:"#6366f1"},children:"Update UI Access Control"})})]})]})},Y=l(12363),W=l(55584),J=l(29827),K=l(21770);let X=(0,l(90246).n)("uiSettings"),H=e=>{let s=(0,J.NL)();return(0,K.D)({mutationFn:async s=>{if(!e)throw Error("Access token is required");return(0,w.updateUiSettings)(e,s)},onSuccess:()=>{s.invalidateQueries({queryKey:X.all})}})};var Q=l(39760),$=l(5945),ee=l(50337),es=l(51653),el=l(58760),et=l(63709);function ei(){var e,s,l;let{accessToken:i}=(0,Q.Z)(),{data:n,isLoading:o,isError:a,error:c}=(0,W.L)(i),{mutate:d,isPending:u,error:m}=H(i),_=null==n?void 0:n.field_schema,h=null==_?void 0:null===(e=_.properties)||void 0===e?void 0:e.disable_model_add_for_internal_users,g=!!(null!==(s=null==n?void 0:n.values)&&void 0!==s?s:{}).disable_model_add_for_internal_users;return(0,t.jsx)($.Z,{title:"UI Settings",children:o?(0,t.jsx)(ee.Z,{active:!0}):a?(0,t.jsx)(es.Z,{type:"error",message:"Could not load UI settings",description:c instanceof Error?c.message:void 0}):(0,t.jsxs)(el.Z,{direction:"vertical",size:"large",style:{width:"100%"},children:[(null==_?void 0:_.description)&&(0,t.jsx)(r.default.Paragraph,{style:{marginBottom:0},children:_.description}),m&&(0,t.jsx)(es.Z,{type:"error",message:"Could not update UI settings",description:m instanceof Error?m.message:void 0}),(0,t.jsxs)(el.Z,{align:"start",size:"middle",children:[(0,t.jsx)(et.Z,{checked:g,disabled:u,loading:u,onChange:e=>{d({disable_model_add_for_internal_users:e},{onSuccess:()=>{k.Z.success("UI settings updated successfully")},onError:e=>{k.Z.fromBackend(e)}})},"aria-label":null!==(l=null==h?void 0:h.description)&&void 0!==l?l:"Disable model add for internal users"}),(0,t.jsxs)(el.Z,{direction:"vertical",size:4,children:[(0,t.jsx)(r.default.Text,{strong:!0,children:"Disable model add for internal users"}),(null==h?void 0:h.description)&&(0,t.jsx)(r.default.Text,{type:"secondary",children:h.description})]})]})]})})}var er=e=>{let{searchParams:s,accessToken:l,userID:Z,showSSOBanner:b,premiumUser:N,proxySettings:E,userRole:O}=e,[A]=o.Z.useForm(),[P]=o.Z.useForm(),{Title:U,Paragraph:R}=r.default,[F,M]=(0,i.useState)(""),[L,G]=(0,i.useState)(null),[B,D]=(0,i.useState)(null),[z,W]=(0,i.useState)(!1),[J,K]=(0,i.useState)(!1),[X,H]=(0,i.useState)(!1),[Q,$]=(0,i.useState)(!1),[ee,es]=(0,i.useState)(!1),[el,et]=(0,i.useState)(!1),[er,en]=(0,i.useState)(!1),[eo,ea]=(0,i.useState)(!1),[ec,ed]=(0,i.useState)(!1),[eu,em]=(0,i.useState)(!1),[e_,eh]=(0,i.useState)([]),[eg,ex]=(0,i.useState)(null),[ep,ef]=(0,i.useState)(!1);(0,n.useRouter)();let[ej,ey]=(0,i.useState)(null);console.log=function(){};let eS=(0,Y.n)(),ev="All IP Addresses Allowed",eI=eS;eI+="/fallback/login";let eC=async()=>{if(l)try{let e=await (0,w.getSSOSettings)(l);if(console.log("SSO data:",e),e&&e.values){let s=e.values.google_client_id&&e.values.google_client_secret,l=e.values.microsoft_client_id&&e.values.microsoft_client_secret,t=e.values.generic_client_id&&e.values.generic_client_secret;ef(s||l||t)}else ef(!1)}catch(e){console.error("Error checking SSO configuration:",e),ef(!1)}},eZ=async()=>{try{if(!0!==N){k.Z.fromBackend("This feature is only available for premium users. Please upgrade your account.");return}if(l){let e=await (0,w.getAllowedIPs)(l);eh(e&&e.length>0?e:[ev])}else eh([ev])}catch(e){console.error("Error fetching allowed IPs:",e),k.Z.fromBackend("Failed to fetch allowed IPs ".concat(e)),eh([ev])}finally{!0===N&&en(!0)}},eb=async e=>{try{if(l){await (0,w.addAllowedIP)(l,e.ip);let s=await (0,w.getAllowedIPs)(l);eh(s),k.Z.success("IP address added successfully")}}catch(e){console.error("Error adding IP:",e),k.Z.fromBackend("Failed to add IP address ".concat(e))}finally{ea(!1)}},ew=async e=>{ex(e),ed(!0)},ek=async()=>{if(eg&&l)try{await (0,w.deleteAllowedIP)(l,eg);let e=await (0,w.getAllowedIPs)(l);eh(e.length>0?e:[ev]),k.Z.success("IP address deleted successfully")}catch(e){console.error("Error deleting IP:",e),k.Z.fromBackend("Failed to delete IP address ".concat(e))}finally{ed(!1),ex(null)}};(0,i.useEffect)(()=>{(async()=>{if(null!=l){let e=[],s=await (0,w.userGetAllUsersCall)(l,"proxy_admin_viewer");console.log("proxy admin viewer response: ",s);let t=s.users;console.log("proxy viewers response: ".concat(t)),t.forEach(s=>{e.push({user_role:s.user_role,user_id:s.user_id,user_email:s.user_email})}),console.log("proxy viewers: ".concat(t));let i=(await (0,w.userGetAllUsersCall)(l,"proxy_admin")).users;i.forEach(s=>{e.push({user_role:s.user_role,user_id:s.user_id,user_email:s.user_email})}),console.log("proxy admins: ".concat(i)),console.log("combinedList: ".concat(e)),G(e),ey(await (0,w.getPossibleUserRoles)(l))}})()},[l]),(0,i.useEffect)(()=>{eC()},[l,N]);let eN=()=>{em(!1)};return console.log("admins: ".concat(null==L?void 0:L.length)),(0,t.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,t.jsx)(U,{level:4,children:"Admin Access "}),(0,t.jsx)(R,{children:"Go to 'Internal Users' page to add other admins."}),(0,t.jsxs)(g.Z,{children:[(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(h.Z,{children:"Security Settings"}),(0,t.jsx)(h.Z,{children:"SCIM"}),(0,t.jsx)(h.Z,{children:"UI Settings"})]}),(0,t.jsxs)(f.Z,{children:[(0,t.jsxs)(p.Z,{children:[(0,t.jsxs)(_.Z,{children:[(0,t.jsx)(U,{level:4,children:" ✨ Security Settings"}),(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)(u.Z,{style:{width:"150px"},onClick:()=>es(!0),children:ep?"Edit SSO Settings":"Add SSO"})}),(0,t.jsx)("div",{children:(0,t.jsx)(u.Z,{style:{width:"150px"},onClick:eZ,children:"Allowed IPs"})}),(0,t.jsx)("div",{children:(0,t.jsx)(u.Z,{style:{width:"150px"},onClick:()=>!0===N?em(!0):k.Z.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)(T,{isAddSSOModalVisible:ee,isInstructionsModalVisible:el,handleAddSSOOk:()=>{es(!1),A.resetFields(),l&&N&&eC()},handleAddSSOCancel:()=>{es(!1),A.resetFields()},handleShowInstructions:e=>{es(!1),et(!0)},handleInstructionsOk:()=>{et(!1),l&&N&&eC()},handleInstructionsCancel:()=>{et(!1),l&&N&&eC()},form:A,accessToken:l,ssoConfigured:ep}),(0,t.jsx)(d.Z,{title:"Manage Allowed IP Addresses",width:800,visible:er,onCancel:()=>en(!1),footer:[(0,t.jsx)(u.Z,{className:"mx-1",onClick:()=>ea(!0),children:"Add IP Address"},"add"),(0,t.jsx)(u.Z,{onClick:()=>en(!1),children:"Close"},"close")],children:(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(v.Z,{children:(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(I.Z,{children:"IP Address"}),(0,t.jsx)(I.Z,{className:"text-right",children:"Action"})]})}),(0,t.jsx)(y.Z,{children:e_.map((e,s)=>(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(S.Z,{children:e}),(0,t.jsx)(S.Z,{className:"text-right",children:e!==ev&&(0,t.jsx)(u.Z,{onClick:()=>ew(e),color:"red",size:"xs",children:"Delete"})})]},s))})]})}),(0,t.jsx)(d.Z,{title:"Add Allowed IP Address",visible:eo,onCancel:()=>ea(!1),footer:null,children:(0,t.jsxs)(o.Z,{onFinish:eb,children:[(0,t.jsx)(o.Z.Item,{name:"ip",rules:[{required:!0,message:"Please enter an IP address"}],children:(0,t.jsx)(a.default,{placeholder:"Enter IP address"})}),(0,t.jsx)(o.Z.Item,{children:(0,t.jsx)(c.ZP,{htmlType:"submit",children:"Add IP Address"})})]})}),(0,t.jsx)(d.Z,{title:"Confirm Delete",visible:ec,onCancel:()=>ed(!1),onOk:ek,footer:[(0,t.jsx)(u.Z,{className:"mx-1",onClick:()=>ek(),children:"Yes"},"delete"),(0,t.jsx)(u.Z,{onClick:()=>ed(!1),children:"Close"},"close")],children:(0,t.jsxs)("p",{children:["Are you sure you want to delete the IP address: ",eg,"?"]})}),(0,t.jsx)(d.Z,{title:"UI Access Control Settings",visible:eu,width:600,footer:null,onOk:eN,onCancel:()=>{em(!1)},children:(0,t.jsx)(V,{accessToken:l,onSuccess:()=>{eN(),k.Z.success("UI Access Control settings updated successfully")}})})]}),(0,t.jsxs)(m.Z,{title:"Login without SSO",color:"teal",children:["If you need to login without sso, you can access"," ",(0,t.jsxs)("a",{href:eI,target:"_blank",children:[(0,t.jsx)("b",{children:eI})," "]})]})]}),(0,t.jsx)(p.Z,{children:(0,t.jsx)(q,{accessToken:l,userID:Z,proxySettings:E})}),(0,t.jsx)(p.Z,{children:(0,t.jsx)(ei,{})})]})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8478-bf8a4bd3b67cacc0.js b/litellm/proxy/_experimental/out/_next/static/chunks/8478-bf8a4bd3b67cacc0.js new file mode 100644 index 00000000000..4ac48b8dfa9 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/8478-bf8a4bd3b67cacc0.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8478],{62338:function(e,s,t){t.d(s,{v:function(){return a.Z}});var a=t(40278)},16312:function(e,s,t){t.d(s,{z:function(){return a.Z}});var a=t(78489)},32176:function(e,s,t){t.d(s,{Z:function(){return g}});var a=t(57437),r=t(2265),l=t(62338),n=t(94292),i=t(19250);let c=e=>{let{key:s,info:t}=e;return{token:s,...t}};var o=t(12322),d=t(99981),u=t(16312),m=t(59872),x=t(44633),h=t(86462),p=t(39760),g=e=>{let{topKeys:s,teams:t,showTags:g=!1}=e,{accessToken:j,userRole:f,userId:_,premiumUser:y}=(0,p.Z)(),[v,k]=(0,r.useState)(!1),[b,Z]=(0,r.useState)(null),[N,w]=(0,r.useState)(void 0),[q,S]=(0,r.useState)("table"),[C,T]=(0,r.useState)(new Set),D=e=>{T(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},L=async e=>{if(j)try{let s=await (0,i.keyInfoV1Call)(j,e.api_key),t=c(s);w(t),Z(e.api_key),k(!0)}catch(e){console.error("Error fetching key info:",e)}},E=()=>{k(!1),Z(null),w(void 0)};r.useEffect(()=>{let e=e=>{"Escape"===e.key&&v&&E()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[v]);let A=[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(d.Z,{title:e.getValue(),children:(0,a.jsx)(u.z,{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:()=>L(e.row.original),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"}],F={header:"Spend (USD)",accessorKey:"spend",cell:e=>{let s=e.getValue();return s>0&&s<.01?"<$0.01":"$".concat((0,m.pw)(s,2))}},O=g?[...A,{header:"Tags",accessorKey:"tags",cell:e=>{let s=e.getValue(),t=e.row.original.api_key,r=C.has(t);if(!s||0===s.length)return"-";let l=s.sort((e,s)=>s.usage-e.usage),n=r?l:l.slice(0,2),i=s.length>2;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[n.map((e,s)=>(0,a.jsx)(d.Z,{title:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Tag Name:"})," ",e.tag]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend:"})," ",e.usage>0&&e.usage<.01?"<$0.01":"$".concat((0,m.pw)(e.usage,2))]})]}),children:(0,a.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[e.tag.slice(0,7),"..."]})},s)),i&&(0,a.jsx)("button",{onClick:()=>D(t),className:"ml-1 p-1 hover:bg-gray-200 rounded-full transition-colors",title:r?"Show fewer tags":"Show all tags",children:r?(0,a.jsx)(x.Z,{className:"h-3 w-3 text-gray-500"}):(0,a.jsx)(h.Z,{className:"h-3 w-3 text-gray-500"})})]})})}},F]:[...A,F],M=s.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?"".concat(e.key_alias.slice(0,10),"..."):e.key_alias||"-"}));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>S("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===q?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,a.jsx)("button",{onClick:()=>S("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===q?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===q?(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(l.v,{className:"mt-4 h-40 cursor-pointer hover:opacity-90",data:M,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showLegend:!1,valueFormatter:e=>"$".concat((0,m.pw)(e,2)),onValueChange:e=>L(e),showTooltip:!0,customTooltip:e=>{var s,t;let r=null===(t=e.payload)||void 0===t?void 0:null===(s=t[0])||void 0===s?void 0:s.payload;return(0,a.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==r?void 0:r.key_alias})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==r?void 0:r.api_key})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,a.jsxs)("span",{className:"text-white font-medium",children:["$",(0,m.pw)(null==r?void 0:r.spend,2)]})]})]})})}})}):(0,a.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,a.jsx)(o.w,{columns:O,data:s,renderSubComponent:()=>(0,a.jsx)(a.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),v&&b&&N&&(console.log("Rendering modal with:",{isModalOpen:v,selectedKey:b,keyData:N}),(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&E()},children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,a.jsx)("button",{onClick:E,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,a.jsx)("div",{className:"p-6 h-full",children:(0,a.jsx)(n.Z,{keyId:b,onClose:E,keyData:N,accessToken:j,userID:_,userRole:f,teams:t,premiumUser:y})})]})}))]})}},68478:function(e,s,t){t.d(s,{Z:function(){return eW}});var a=t(57437),r=t(40278),l=t(12514),n=t(49804),i=t(14042),c=t(67101),o=t(12485),d=t(18135),u=t(35242),m=t(29706),x=t(77991),h=t(21626),p=t(97214),g=t(28241),j=t(58834),f=t(69552),_=t(71876),y=t(84264),v=t(96761),k=t(33866),b=t(51653),Z=t(2265),N=t(19250),w=t(11713),q=t(90246),S=t(20347);let C=(0,q.n)("agents"),T=(e,s)=>(0,w.a)({queryKey:C.list({}),queryFn:async()=>await (0,N.getAgentsList)(e),enabled:!!e&&S.ZL.includes(s||"")}),D=(0,q.n)("customers"),L=(e,s)=>(0,w.a)({queryKey:D.list({}),queryFn:async()=>await (0,N.allEndUsersCall)(e),enabled:!!e&&S.ZL.includes(s||"")});var E=t(39760),A=t(59872),F=t(16312),O=t(75105),M=t(44851);let U={blue:"#3b82f6",cyan:"#06b6d4",indigo:"#6366f1",green:"#22c55e",red:"#ef4444",purple:"#8b5cf6"},V=e=>{let{active:s,payload:t,label:r}=e;if(s&&t&&t.length){let e=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),s=(e,s)=>{let t=s.substring(s.indexOf(".")+1);if(e.metrics&&t in e.metrics)return e.metrics[t]};return(0,a.jsxs)("div",{className:"w-56 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[(0,a.jsx)("p",{className:"text-tremor-content-strong",children:r}),t.map(t=>{var r;let l=null===(r=t.dataKey)||void 0===r?void 0:r.toString();if(!l||!t.payload)return null;let n=s(t.payload,l),i=l.includes("spend"),c=void 0!==n?i?"$".concat(n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})):n.toLocaleString():"N/A",o=U[t.color]||t.color;return(0,a.jsxs)("div",{className:"flex items-center justify-between space-x-4",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-2 ring-white drop-shadow-md",style:{backgroundColor:o}}),(0,a.jsx)("p",{className:"font-medium text-tremor-content dark:text-dark-tremor-content",children:e(l)})]}),(0,a.jsx)("p",{className:"font-medium text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",children:c})]},l)})]})}return null},z=e=>{let{categories:s,colors:t}=e,r=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return(0,a.jsx)("div",{className:"flex items-center justify-end space-x-4",children:s.map((e,s)=>{let l=U[t[s]]||t[s];return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-4 ring-white",style:{backgroundColor:l}}),(0,a.jsx)("p",{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:r(e)})]},e)})})};function Y(e){return e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?e/1e3+"k":e.toString()}function R(e){return 0===e?"$0":e>=1e6?"$"+e/1e6+"M":e>=1e3?"$"+e/1e3+"k":"$"+e}let I=e=>{var s,t;let{modelName:n,metrics:i,hidePromptCachingMetrics:o=!1}=e;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(c.Z,{numItems:4,className:"gap-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Requests"}),(0,a.jsx)(v.Z,{children:i.total_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Successful Requests"}),(0,a.jsx)(v.Z,{children:i.total_successful_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Tokens"}),(0,a.jsx)(v.Z,{children:i.total_tokens.toLocaleString()}),(0,a.jsxs)(y.Z,{children:[Math.round(i.total_tokens/i.total_successful_requests)," avg per successful request"]})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Spend"}),(0,a.jsxs)(v.Z,{children:["$",(0,A.pw)(i.total_spend,2)]}),(0,a.jsxs)(y.Z,{children:["$",(0,A.pw)(i.total_spend/i.total_successful_requests,3)," per successful request"]})]})]}),i.top_api_keys&&i.top_api_keys.length>0&&(0,a.jsxs)(l.Z,{className:"mt-4",children:[(0,a.jsx)(v.Z,{children:"Top Virtual Keys by Spend"}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)("div",{className:"grid grid-cols-1 gap-2",children:i.top_api_keys.map((e,s)=>(0,a.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"font-medium",children:e.key_alias||"".concat(e.api_key.substring(0,10),"...")}),e.team_id&&(0,a.jsxs)(y.Z,{className:"text-xs text-gray-500",children:["Team: ",e.team_id]})]}),(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsxs)(y.Z,{className:"font-medium",children:["$",(0,A.pw)(e.spend,2)]}),(0,a.jsxs)(y.Z,{className:"text-xs text-gray-500",children:[e.requests.toLocaleString()," requests | ",e.tokens.toLocaleString()," tokens"]})]})]},e.api_key))})})]}),(0,a.jsxs)(c.Z,{numItems:2,className:"gap-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Total Tokens"}),(0,a.jsx)(z,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,a.jsx)(O.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:Y,customTooltip:V,showLegend:!1})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Requests per day"}),(0,a.jsx)(z,{categories:["metrics.api_requests"],colors:["blue"]})]}),(0,a.jsx)(r.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.api_requests"],colors:["blue"],valueFormatter:Y,customTooltip:V,showLegend:!1})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Spend per day"}),(0,a.jsx)(z,{categories:["metrics.spend"],colors:["green"]})]}),(0,a.jsx)(r.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.spend"],colors:["green"],valueFormatter:e=>"$".concat((0,A.pw)(e,2,!0)),yAxisWidth:72})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Success vs Failed Requests"}),(0,a.jsx)(z,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,a.jsx)(O.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:Y,stack:!0,customTooltip:V,showLegend:!1})]}),!o&&(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Prompt Caching Metrics"}),(0,a.jsx)(z,{categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"]})]}),(0,a.jsxs)("div",{className:"mb-2",children:[(0,a.jsxs)(y.Z,{children:["Cache Read: ",(null===(s=i.total_cache_read_input_tokens)||void 0===s?void 0:s.toLocaleString())||0," tokens"]}),(0,a.jsxs)(y.Z,{children:["Cache Creation: ",(null===(t=i.total_cache_creation_input_tokens)||void 0===t?void 0:t.toLocaleString())||0," tokens"]})]}),(0,a.jsx)(O.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"],valueFormatter:Y,customTooltip:V,showLegend:!1})]})]})]})},$=e=>{let{modelMetrics:s,hidePromptCachingMetrics:t=!1}=e,r=Object.keys(s).sort((e,t)=>""===e?1:""===t?-1:s[t].total_spend-s[e].total_spend),n={total_requests:0,total_successful_requests:0,total_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,daily_data:{}};Object.values(s).forEach(e=>{n.total_requests+=e.total_requests,n.total_successful_requests+=e.total_successful_requests,n.total_tokens+=e.total_tokens,n.total_spend+=e.total_spend,n.total_cache_read_input_tokens+=e.total_cache_read_input_tokens||0,n.total_cache_creation_input_tokens+=e.total_cache_creation_input_tokens||0,e.daily_data.forEach(e=>{n.daily_data[e.date]||(n.daily_data[e.date]={prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,spend:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0}),n.daily_data[e.date].prompt_tokens+=e.metrics.prompt_tokens,n.daily_data[e.date].completion_tokens+=e.metrics.completion_tokens,n.daily_data[e.date].total_tokens+=e.metrics.total_tokens,n.daily_data[e.date].api_requests+=e.metrics.api_requests,n.daily_data[e.date].spend+=e.metrics.spend,n.daily_data[e.date].successful_requests+=e.metrics.successful_requests,n.daily_data[e.date].failed_requests+=e.metrics.failed_requests,n.daily_data[e.date].cache_read_input_tokens+=e.metrics.cache_read_input_tokens||0,n.daily_data[e.date].cache_creation_input_tokens+=e.metrics.cache_creation_input_tokens||0})});let i=Object.entries(n.daily_data).map(e=>{let[s,t]=e;return{date:s,metrics:t}}).sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime());return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,a.jsx)(v.Z,{children:"Overall Usage"}),(0,a.jsxs)(c.Z,{numItems:4,className:"gap-4 mb-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Requests"}),(0,a.jsx)(v.Z,{children:n.total_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Successful Requests"}),(0,a.jsx)(v.Z,{children:n.total_successful_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Tokens"}),(0,a.jsx)(v.Z,{children:n.total_tokens.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Spend"}),(0,a.jsxs)(v.Z,{children:["$",(0,A.pw)(n.total_spend,2)]})]})]}),(0,a.jsxs)(c.Z,{numItems:2,className:"gap-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Total Tokens Over Time"}),(0,a.jsx)(z,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,a.jsx)(O.Z,{className:"mt-4",data:i,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:Y,customTooltip:V,showLegend:!1})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Requests Over Time"}),(0,a.jsx)(O.Z,{className:"mt-4",data:i,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["emerald","red"],valueFormatter:e=>e.toLocaleString(),stack:!0,customTooltip:V,showLegend:!1})]})]})]}),(0,a.jsx)(M.default,{defaultActiveKey:r[0],children:r.map(e=>(0,a.jsx)(M.default.Panel,{header:(0,a.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,a.jsx)(v.Z,{children:s[e].label||"Unknown Item"}),(0,a.jsxs)("div",{className:"flex space-x-4 text-sm text-gray-500",children:[(0,a.jsxs)("span",{children:["$",(0,A.pw)(s[e].total_spend,2)]}),(0,a.jsxs)("span",{children:[s[e].total_requests.toLocaleString()," requests"]})]})]}),children:(0,a.jsx)(I,{modelName:e||"Unknown Model",metrics:s[e],hidePromptCachingMetrics:t})},e))})]})},K=(e,s)=>{let t=e.metadata.key_alias||"key-hash-".concat(s),a=e.metadata.team_id;return a?"".concat(t," (team_id: ").concat(a,")"):t},P=(e,s)=>{let t={};return e.results.forEach(e=>{Object.entries(e.breakdown[s]||{}).forEach(a=>{let[r,l]=a;t[r]||(t[r]={label:"api_keys"===s?K(l,r):r,total_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0,prompt_tokens:0,completion_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,top_api_keys:[],daily_data:[]}),t[r].total_requests+=l.metrics.api_requests,t[r].prompt_tokens+=l.metrics.prompt_tokens,t[r].completion_tokens+=l.metrics.completion_tokens,t[r].total_tokens+=l.metrics.total_tokens,t[r].total_spend+=l.metrics.spend,t[r].total_successful_requests+=l.metrics.successful_requests,t[r].total_failed_requests+=l.metrics.failed_requests,t[r].total_cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,t[r].total_cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0,t[r].daily_data.push({date:e.date,metrics:{prompt_tokens:l.metrics.prompt_tokens,completion_tokens:l.metrics.completion_tokens,total_tokens:l.metrics.total_tokens,api_requests:l.metrics.api_requests,spend:l.metrics.spend,successful_requests:l.metrics.successful_requests,failed_requests:l.metrics.failed_requests,cache_read_input_tokens:l.metrics.cache_read_input_tokens||0,cache_creation_input_tokens:l.metrics.cache_creation_input_tokens||0}})})}),"api_keys"!==s&&Object.entries(t).forEach(a=>{let[r,l]=a,n={};e.results.forEach(e=>{var t;let a=null===(t=e.breakdown[s])||void 0===t?void 0:t[r];a&&"api_key_breakdown"in a&&Object.entries(a.api_key_breakdown||{}).forEach(e=>{let[s,t]=e;n[s]||(n[s]={api_key:s,key_alias:t.metadata.key_alias,team_id:t.metadata.team_id,spend:0,requests:0,tokens:0}),n[s].spend+=t.metrics.spend,n[s].requests+=t.metrics.api_requests,n[s].tokens+=t.metrics.total_tokens})}),t[r].top_api_keys=Object.values(n).sort((e,s)=>s.spend-e.spend).slice(0,5)}),Object.values(t).forEach(e=>{e.daily_data.sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime())}),t};var W=t(78489),B=t(94789),H=t(49566),G=t(10032),J=t(22116),Q=t(37592),X=t(10353),ee=t(9114),es=e=>{let{isOpen:s,onClose:t,accessToken:r}=e,[l]=G.Z.useForm(),[n,i]=(0,Z.useState)(!1),[c,o]=(0,Z.useState)(null),[d,u]=(0,Z.useState)(!1),[m,x]=(0,Z.useState)("cloudzero"),[h,p]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{s&&r&&g()},[s,r]);let g=async()=>{u(!0);try{let e=await fetch("/cloudzero/settings",{method:"GET",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"}});if(e.ok){let s=await e.json();o(s),l.setFieldsValue({connection_id:s.connection_id})}else if(404!==e.status){let s=await e.json();ee.Z.fromBackend("Failed to load existing settings: ".concat(s.error||"Unknown error"))}}catch(e){console.error("Error loading CloudZero settings:",e),ee.Z.fromBackend("Failed to load existing settings")}finally{u(!1)}},j=async e=>{if(!r){ee.Z.fromBackend("No access token available");return}i(!0);try{let s={...e,timezone:"UTC"},t=await fetch(c?"/cloudzero/settings":"/cloudzero/init",{method:c?"PUT":"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify(s)}),a=await t.json();if(t.ok)return ee.Z.success(a.message||"CloudZero settings saved successfully"),o({api_key_masked:e.api_key.substring(0,4)+"****"+e.api_key.slice(-4),connection_id:e.connection_id,status:"configured"}),!0;return ee.Z.fromBackend(a.error||"Failed to save CloudZero settings"),!1}catch(e){return console.error("Error saving CloudZero settings:",e),ee.Z.fromBackend("Failed to save CloudZero settings"),!1}finally{i(!1)}},f=async()=>{if(!r){ee.Z.fromBackend("No access token available");return}p(!0);try{let e=await fetch("/cloudzero/export",{method:"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify({limit:1e5,operation:"replace_hourly"})}),s=await e.json();e.ok?(ee.Z.success(s.message||"Export to CloudZero completed successfully"),t()):ee.Z.fromBackend(s.error||"Failed to export to CloudZero")}catch(e){console.error("Error exporting to CloudZero:",e),ee.Z.fromBackend("Failed to export to CloudZero")}finally{p(!1)}},_=async()=>{p(!0);try{ee.Z.info("CSV export functionality coming soon!"),t()}catch(e){console.error("Error exporting CSV:",e),ee.Z.fromBackend("Failed to export CSV")}finally{p(!1)}},v=async()=>{if("cloudzero"===m){if(!c){let e=await l.validateFields();if(!await j(e))return}await f()}else await _()},k=()=>{l.resetFields(),x("cloudzero"),o(null),t()},b=[{value:"cloudzero",label:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("img",{src:"/cloudzero.png",alt:"CloudZero",className:"w-5 h-5",onError:e=>{e.target.style.display="none"}}),(0,a.jsx)("span",{children:"Export to CloudZero"})]})},{value:"csv",label:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,a.jsx)("span",{children:"Export to CSV"})]})}];return(0,a.jsx)(J.Z,{title:"Export Data",open:s,onCancel:k,footer:null,width:600,destroyOnClose:!0,children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"font-medium mb-2 block",children:"Export Destination"}),(0,a.jsx)(Q.default,{value:m,onChange:x,options:b,className:"w-full",size:"large"})]}),"cloudzero"===m&&(0,a.jsx)("div",{children:d?(0,a.jsx)("div",{className:"flex justify-center py-8",children:(0,a.jsx)(X.Z,{size:"large"})}):(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsx)(B.Z,{title:"Existing CloudZero Configuration",icon:()=>(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),color:"green",className:"mb-4",children:(0,a.jsxs)(y.Z,{children:["API Key: ",c.api_key_masked,(0,a.jsx)("br",{}),"Connection ID: ",c.connection_id]})}),!c&&(0,a.jsxs)(G.Z,{form:l,layout:"vertical",children:[(0,a.jsx)(G.Z.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!0,message:"Please enter your CloudZero API key"}],children:(0,a.jsx)(H.Z,{type:"password",placeholder:"Enter your CloudZero API key"})}),(0,a.jsx)(G.Z.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter the CloudZero connection ID"}],children:(0,a.jsx)(H.Z,{placeholder:"Enter CloudZero connection ID"})})]})]})}),"csv"===m&&(0,a.jsx)(B.Z,{title:"CSV Export",icon:()=>(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),color:"blue",children:(0,a.jsx)(y.Z,{children:"Export your usage data as a CSV file for analysis in spreadsheet applications."})}),(0,a.jsxs)("div",{className:"flex justify-end space-x-2 pt-4",children:[(0,a.jsx)(W.Z,{variant:"secondary",onClick:k,children:"Cancel"}),(0,a.jsx)(W.Z,{onClick:v,loading:n||h,disabled:n||h,children:"cloudzero"===m?"Export to CloudZero":"Export CSV"})]})]})})},et=e=>{var s,t;let{dateRange:r,selectedFilters:l}=e;return(0,a.jsxs)("div",{className:"text-sm text-gray-500",children:[null===(s=r.from)||void 0===s?void 0:s.toLocaleDateString()," - ",null===(t=r.to)||void 0===t?void 0:t.toLocaleDateString(),l.length>0&&" \xb7 ".concat(l.length," filter").concat(l.length>1?"s":"")]})},ea=t(29967),er=e=>{let{value:s,onChange:t,entityType:r}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Export type"}),(0,a.jsx)(ea.ZP.Group,{value:s,onChange:e=>t(e.target.value),className:"w-full",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"flex items-start p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors",children:[(0,a.jsx)(ea.ZP,{value:"daily",className:"mt-0.5"}),(0,a.jsxs)("div",{className:"ml-3 flex-1",children:[(0,a.jsx)("div",{className:"font-medium text-sm",children:"Day-by-day breakdown"}),(0,a.jsxs)("div",{className:"text-xs text-gray-500 mt-0.5",children:["Daily metrics for each ",r]})]})]}),(0,a.jsxs)("label",{className:"flex items-start p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors",children:[(0,a.jsx)(ea.ZP,{value:"daily_with_models",className:"mt-0.5"}),(0,a.jsxs)("div",{className:"ml-3 flex-1",children:[(0,a.jsxs)("div",{className:"font-medium text-sm",children:["Day-by-day by ",r," and model"]}),(0,a.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Daily metrics split by model"})]})]})]})})]})},el=e=>{let{value:s,onChange:t}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Format"}),(0,a.jsx)(Q.default,{value:s,onChange:t,className:"w-full",options:[{value:"csv",label:"CSV (Excel, Google Sheets)"},{value:"json",label:"JSON (includes metadata)"}]})]})},en=t(15452),ei=t.n(en);let ec=(e,s)=>{let t=[];return e.results.forEach(e=>{Object.entries(e.breakdown.entities||{}).forEach(a=>{var r;let[l,n]=a;t.push({Date:e.date,[s]:(null===(r=n.metadata)||void 0===r?void 0:r.team_alias)||l,["".concat(s," ID")]:l,"Spend ($)":(0,A.pw)(n.metrics.spend,4),Requests:n.metrics.api_requests,"Successful Requests":n.metrics.successful_requests,"Failed Requests":n.metrics.failed_requests,"Total Tokens":n.metrics.total_tokens,"Prompt Tokens":n.metrics.prompt_tokens||0,"Completion Tokens":n.metrics.completion_tokens||0})})}),t.sort((e,s)=>new Date(e.Date).getTime()-new Date(s.Date).getTime())},eo=(e,s)=>{let t=[];return e.results.forEach(e=>{let a={};Object.entries(e.breakdown.entities||{}).forEach(s=>{var t;let[r,l]=s;null===(t=l.metadata)||void 0===t||t.team_alias,a[r]||(a[r]={}),Object.entries(e.breakdown.models||{}).forEach(e=>{let[s,t]=e;Object.entries(l.api_key_breakdown||{}).forEach(e=>{let[t,l]=e;a[r][s]||(a[r][s]={spend:0,requests:0,successful:0,failed:0,tokens:0}),a[r][s].spend+=l.metrics.spend||0,a[r][s].requests+=l.metrics.api_requests||0,a[r][s].successful+=l.metrics.successful_requests||0,a[r][s].failed+=l.metrics.failed_requests||0,a[r][s].tokens+=l.metrics.total_tokens||0})})}),Object.entries(a).forEach(a=>{var r,l;let[n,i]=a,c=null===(r=e.breakdown.entities)||void 0===r?void 0:r[n],o=(null==c?void 0:null===(l=c.metadata)||void 0===l?void 0:l.team_alias)||n;Object.entries(i).forEach(a=>{let[r,l]=a;t.push({Date:e.date,[s]:o,["".concat(s," ID")]:n,Model:r,"Spend ($)":(0,A.pw)(l.spend,4),Requests:l.requests,Successful:l.successful,Failed:l.failed,"Total Tokens":l.tokens})})})}),t.sort((e,s)=>new Date(e.Date).getTime()-new Date(s.Date).getTime())},ed=(e,s,t)=>{switch(s){case"daily":default:return ec(e,t);case"daily_with_models":return eo(e,t)}},eu=(e,s,t,a,r)=>{var l,n;return{export_date:new Date().toISOString(),entity_type:e,date_range:{from:null===(l=s.from)||void 0===l?void 0:l.toISOString(),to:null===(n=s.to)||void 0===n?void 0:n.toISOString()},filters_applied:t.length>0?t:"None",export_scope:a,summary:{total_spend:r.metadata.total_spend,total_requests:r.metadata.total_api_requests,successful_requests:r.metadata.total_successful_requests,failed_requests:r.metadata.total_failed_requests,total_tokens:r.metadata.total_tokens}}},em=(e,s,t,a)=>{let r=ed(e,s,t),l=new Blob([ei().unparse(r)],{type:"text/csv;charset=utf-8;"}),n=window.URL.createObjectURL(l),i=document.createElement("a");i.href=n;let c="".concat(a,"_usage_").concat(s,"_").concat(new Date().toISOString().split("T")[0],".csv");i.download=c,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)},ex=(e,s,t,a,r,l)=>{let n=ed(e,s,t),i=new Blob([JSON.stringify({metadata:eu(a,r,l,s,e),data:n},null,2)],{type:"application/json"}),c=window.URL.createObjectURL(i),o=document.createElement("a");o.href=c;let d="".concat(a,"_usage_").concat(s,"_").concat(new Date().toISOString().split("T")[0],".json");o.download=d,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(c)};var eh=e=>{let{isOpen:s,onClose:t,entityType:r,spendData:l,dateRange:n,selectedFilters:i,customTitle:c}=e,[o,d]=(0,Z.useState)("csv"),[u,m]=(0,Z.useState)("daily"),[x,h]=(0,Z.useState)(!1),p=r.charAt(0).toUpperCase()+r.slice(1),g=c||"Export ".concat(p," Usage"),j=async e=>{let s=e||o;h(!0);try{"csv"===s?(em(l,u,p,r),ee.Z.success("".concat(p," usage data exported successfully as CSV"))):(ex(l,u,p,r,n,i),ee.Z.success("".concat(p," usage data exported successfully as JSON"))),t()}catch(e){console.error("Error exporting data:",e),ee.Z.fromBackend("Failed to export data")}finally{h(!1)}};return(0,a.jsx)(J.Z,{title:(0,a.jsx)("span",{className:"text-base font-semibold",children:g}),open:s,onCancel:t,footer:null,width:480,destroyOnClose:!0,children:(0,a.jsxs)("div",{className:"space-y-5 py-2",children:[(0,a.jsx)(et,{dateRange:n,selectedFilters:i}),(0,a.jsx)(er,{value:u,onChange:m,entityType:r}),(0,a.jsx)(el,{value:o,onChange:d}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-4 border-t",children:[(0,a.jsx)(F.z,{variant:"secondary",onClick:t,disabled:x,size:"sm",children:"Cancel"}),(0,a.jsx)(F.z,{onClick:()=>j(),loading:x,disabled:x,size:"sm",children:x?"Exporting...":"Export ".concat(o.toUpperCase())})]})]})})},ep=t(19431),eg=e=>{let{dateValue:s,entityType:t,spendData:r,showFilters:l=!1,filterLabel:n,filterPlaceholder:i,selectedFilters:c=[],onFiltersChange:o,filterOptions:d=[],customTitle:u,compactLayout:m=!1}=e,[x,h]=(0,Z.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsxs)("div",{className:"grid ".concat(l&&d.length>0?"grid-cols-[1fr_auto]":"grid-cols-[auto]"," items-end gap-4"),children:[l&&d.length>0&&(0,a.jsxs)("div",{children:[n&&(0,a.jsx)(ep.x,{className:"mb-2",children:n}),(0,a.jsx)(Q.default,{mode:"multiple",style:{width:"100%"},placeholder:i,value:c,onChange:o,options:d,allowClear:!0})]}),(0,a.jsx)("div",{className:"justify-self-end",children:(0,a.jsx)(ep.z,{onClick:()=>h(!0),icon:()=>(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),children:"Export Data"})})]})}),(0,a.jsx)(eh,{isOpen:x,onClose:()=>h(!1),entityType:t,spendData:r,dateRange:s,selectedFilters:c,customTitle:u})]})},ej=t(42673),ef=t(5540),e_=t(49634),ey=t(77398),ev=t.n(ey);let ek=[{label:"Today",shortLabel:"today",getValue:()=>({from:ev()().startOf("day").toDate(),to:ev()().endOf("day").toDate()})},{label:"Last 7 days",shortLabel:"7d",getValue:()=>({from:ev()().subtract(7,"days").startOf("day").toDate(),to:ev()().endOf("day").toDate()})},{label:"Last 30 days",shortLabel:"30d",getValue:()=>({from:ev()().subtract(30,"days").startOf("day").toDate(),to:ev()().endOf("day").toDate()})},{label:"Month to date",shortLabel:"MTD",getValue:()=>({from:ev()().startOf("month").toDate(),to:ev()().endOf("day").toDate()})},{label:"Year to date",shortLabel:"YTD",getValue:()=>({from:ev()().startOf("year").toDate(),to:ev()().endOf("day").toDate()})}];var eb=e=>{let{value:s,onValueChange:t,label:r="Select Time Range",showTimeRange:l=!0}=e,[n,i]=(0,Z.useState)(!1),[c,o]=(0,Z.useState)(s),[d,u]=(0,Z.useState)(null),[m,x]=(0,Z.useState)(""),[h,p]=(0,Z.useState)(""),g=(0,Z.useRef)(null),j=(0,Z.useCallback)(e=>{if(!e.from||!e.to)return null;for(let s of ek){let t=s.getValue(),a=ev()(e.from).isSame(ev()(t.from),"day"),r=ev()(e.to).isSame(ev()(t.to),"day");if(a&&r)return s.shortLabel}return null},[]);(0,Z.useEffect)(()=>{u(j(s))},[s,j]);let f=(0,Z.useCallback)(()=>{if(!m||!h)return{isValid:!0,error:""};let e=ev()(m,"YYYY-MM-DD"),s=ev()(h,"YYYY-MM-DD");return e.isValid()&&s.isValid()?s.isBefore(e)?{isValid:!1,error:"End date cannot be before start date"}:{isValid:!0,error:""}:{isValid:!1,error:"Invalid date format"}},[m,h])();(0,Z.useEffect)(()=>{s.from&&x(ev()(s.from).format("YYYY-MM-DD")),s.to&&p(ev()(s.to).format("YYYY-MM-DD")),o(s)},[s]),(0,Z.useEffect)(()=>{let e=e=>{g.current&&!g.current.contains(e.target)&&i(!1)};return n&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[n]);let _=(0,Z.useCallback)((e,s)=>{if(!e||!s)return"Select date range";let t=e=>ev()(e).format("D MMM, HH:mm");return"".concat(t(e)," - ").concat(t(s))},[]),y=(0,Z.useCallback)(e=>{let s;if(!e.from)return e;let t={...e},a=new Date(e.from);return s=new Date(e.to?e.to:e.from),a.toDateString(),s.toDateString(),a.setHours(0,0,0,0),s.setHours(23,59,59,999),t.from=a,t.to=s,t},[]),v=e=>{let{from:s,to:t}=e.getValue();o({from:s,to:t}),u(e.shortLabel),x(ev()(s).format("YYYY-MM-DD")),p(ev()(t).format("YYYY-MM-DD"))},k=(0,Z.useCallback)(()=>{try{if(m&&h&&f.isValid){let e=ev()(m,"YYYY-MM-DD").startOf("day"),s=ev()(h,"YYYY-MM-DD").endOf("day");if(e.isValid()&&s.isValid()){let t={from:e.toDate(),to:s.toDate()};o(t);let a=j(t);u(a)}}}catch(e){console.warn("Invalid date format:",e)}},[m,h,f.isValid,j]);return(0,Z.useEffect)(()=>{k()},[k]),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[r&&(0,a.jsx)(ep.x,{className:"text-sm font-medium text-gray-700 whitespace-nowrap",children:r}),(0,a.jsxs)("div",{className:"relative",ref:g,children:[(0,a.jsx)("div",{className:"w-[300px] px-3 py-2 text-sm border border-gray-300 rounded-md bg-white cursor-pointer hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500",onClick:()=>i(!n),children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(ef.Z,{className:"text-gray-600"}),(0,a.jsx)("span",{className:"text-gray-900",children:_(s.from,s.to)})]}),(0,a.jsx)("svg",{className:"w-4 h-4 text-gray-400 transition-transform ".concat(n?"rotate-180":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&(0,a.jsx)("div",{className:"absolute top-full right-0 z-[9999] min-w-[600px] mt-1 bg-white border border-gray-200 rounded-lg shadow-xl",children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsxs)("div",{className:"w-1/2 border-r border-gray-200",children:[(0,a.jsx)("div",{className:"p-3 border-b border-gray-200",children:(0,a.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:"Relative time"})}),(0,a.jsx)("div",{className:"h-[350px] overflow-y-auto",children:ek.map(e=>{let s=d===e.shortLabel;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 cursor-pointer border-b border-gray-100 transition-colors ".concat(s?"bg-blue-50 hover:bg-blue-100 border-blue-200":"hover:bg-gray-50"),onClick:()=>v(e),children:[(0,a.jsx)("span",{className:"text-sm ".concat(s?"text-blue-700 font-medium":"text-gray-700"),children:e.label}),(0,a.jsx)("span",{className:"text-xs px-2 py-1 rounded capitalize ".concat(s?"text-blue-700 bg-blue-100":"text-gray-500 bg-gray-100"),children:e.shortLabel})]},e.label)})})]}),(0,a.jsxs)("div",{className:"w-1/2 relative",children:[(0,a.jsx)("div",{className:"p-3.5 border-b border-gray-200",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(e_.Z,{className:"text-gray-600"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:"Start and end dates"})]})}),(0,a.jsxs)("div",{className:"p-6 space-y-6 pb-20",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm text-gray-700 mb-1 block",children:"Start date"}),(0,a.jsx)("input",{type:"date",value:m,onChange:e=>x(e.target.value),className:"w-65 px-3 py-2 text-sm border rounded-md cursor-pointer hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 ".concat(f.isValid?"border-gray-300":"border-red-300 focus:border-red-500 focus:ring-red-200")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm text-gray-700 mb-1 block",children:"End date"}),(0,a.jsx)("input",{type:"date",value:h,onChange:e=>p(e.target.value),className:"w-65 px-3 py-2 text-sm border rounded-md cursor-pointer hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 ".concat(f.isValid?"border-gray-300":"border-red-300 focus:border-red-500 focus:ring-red-200")})]}),!f.isValid&&f.error&&(0,a.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("svg",{className:"w-4 h-4 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),(0,a.jsx)("span",{className:"text-sm text-red-700 font-medium",children:f.error})]})}),c.from&&c.to&&f.isValid&&(0,a.jsxs)("div",{className:"bg-blue-50 p-3 rounded-md space-y-1",children:[(0,a.jsxs)("div",{className:"text-xs text-blue-800",children:[(0,a.jsx)("span",{className:"font-medium",children:"From:"})," ",ev()(c.from).format("MMM D, YYYY [at] HH:mm:ss")]}),(0,a.jsxs)("div",{className:"text-xs text-blue-800",children:[(0,a.jsx)("span",{className:"font-medium",children:"To:"})," ",ev()(c.to).format("MMM D, YYYY [at] HH:mm:ss")]})]})]}),(0,a.jsx)("div",{className:"absolute bottom-4 right-4",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(ep.z,{variant:"secondary",onClick:()=>{o(s),s.from&&x(ev()(s.from).format("YYYY-MM-DD")),s.to&&p(ev()(s.to).format("YYYY-MM-DD")),u(j(s)),i(!1)},children:"Cancel"}),(0,a.jsx)(ep.z,{onClick:()=>{c.from&&c.to&&f.isValid&&(t(c),requestIdleCallback(()=>{t(y(c))},{timeout:100}),i(!1))},disabled:!c.from||!c.to||!f.isValid,children:"Apply"})]})})]})]})})]})]})},eZ=t(91323);let eN=e=>{let{isDateChanging:s=!1}=e;return(0,a.jsx)("div",{className:"flex items-center justify-center h-40",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,a.jsx)(eZ.S,{className:"size-5"}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"text-gray-600 text-sm font-medium",children:s?"Processing date selection...":"Loading chart data..."}),(0,a.jsx)("span",{className:"text-gray-400 text-xs mt-1",children:s?"This will only take a moment":"Fetching your data"})]})]})})};var ew=t(35829),eq=t(97765),eS=t(99981),eC=e=>{let{accessToken:s,selectedTags:t,formatAbbreviatedNumber:l}=e,[n,i]=(0,Z.useState)({results:[],total_count:0,page:1,page_size:50,total_pages:0}),[c,k]=(0,Z.useState)(!1),[b,w]=(0,Z.useState)(1),q=async()=>{if(s){k(!0);try{let e=await (0,N.perUserAnalyticsCall)(s,b,50,t.length>0?t:void 0);i(e)}catch(e){console.error("Failed to fetch per-user data:",e)}finally{k(!1)}}};return(0,Z.useEffect)(()=>{q()},[s,t,b]),(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(v.Z,{children:"Per User Usage"}),(0,a.jsx)(eq.Z,{children:"Individual developer usage metrics"}),(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{className:"mb-6",children:[(0,a.jsx)(o.Z,{children:"User Details"}),(0,a.jsx)(o.Z,{children:"Usage Distribution"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)(m.Z,{children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(j.Z,{children:(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(f.Z,{children:"User ID"}),(0,a.jsx)(f.Z,{children:"User Email"}),(0,a.jsx)(f.Z,{children:"User Agent"}),(0,a.jsx)(f.Z,{className:"text-right",children:"Success Generations"}),(0,a.jsx)(f.Z,{className:"text-right",children:"Total Tokens"}),(0,a.jsx)(f.Z,{className:"text-right",children:"Failed Requests"}),(0,a.jsx)(f.Z,{className:"text-right",children:"Total Cost"})]})}),(0,a.jsx)(p.Z,{children:n.results.slice(0,10).map((e,s)=>(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(g.Z,{children:(0,a.jsx)(y.Z,{className:"font-medium",children:e.user_id})}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(y.Z,{children:e.user_email||"N/A"})}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(y.Z,{children:e.user_agent||"Unknown"})}),(0,a.jsx)(g.Z,{className:"text-right",children:(0,a.jsx)(y.Z,{children:l(e.successful_requests)})}),(0,a.jsx)(g.Z,{className:"text-right",children:(0,a.jsx)(y.Z,{children:l(e.total_tokens)})}),(0,a.jsx)(g.Z,{className:"text-right",children:(0,a.jsx)(y.Z,{children:l(e.failed_requests)})}),(0,a.jsx)(g.Z,{className:"text-right",children:(0,a.jsxs)(y.Z,{children:["$",l(e.spend,4)]})})]},s))})]}),n.results.length>10&&(0,a.jsxs)("div",{className:"mt-4 flex justify-between items-center",children:[(0,a.jsxs)(y.Z,{className:"text-sm text-gray-500",children:["Showing 10 of ",n.total_count," results"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(W.Z,{size:"sm",variant:"secondary",onClick:()=>{b>1&&w(b-1)},disabled:1===b,children:"Previous"}),(0,a.jsx)(W.Z,{size:"sm",variant:"secondary",onClick:()=>{b=n.total_pages,children:"Next"})]})]})]}),(0,a.jsxs)(m.Z,{children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)(v.Z,{className:"text-lg",children:"User Usage Distribution"}),(0,a.jsx)(eq.Z,{children:"Number of users by successful request frequency"})]}),(0,a.jsx)(r.Z,{data:(()=>{let e=new Map;n.results.forEach(s=>{let t=s.user_agent||"Unknown";e.set(t,(e.get(t)||0)+1)});let s=Array.from(e.entries()).sort((e,s)=>{let[,t]=e,[,a]=s;return a-t}).slice(0,8).map(e=>{let[s]=e;return s}),t={"1-9 requests":{range:[1,9],agents:{}},"10-99 requests":{range:[10,99],agents:{}},"100-999 requests":{range:[100,999],agents:{}},"1K-9.9K requests":{range:[1e3,9999],agents:{}},"10K-99.9K requests":{range:[1e4,99999],agents:{}},"100K+ requests":{range:[1e5,1/0],agents:{}}};return n.results.forEach(e=>{let a=e.successful_requests,r=e.user_agent||"Unknown";s.includes(r)&&Object.entries(t).forEach(e=>{let[s,t]=e;a>=t.range[0]&&a<=t.range[1]&&(t.agents[r]||(t.agents[r]=0),t.agents[r]++)})}),Object.entries(t).map(e=>{let[t,a]=e,r={category:t};return s.forEach(e=>{r[e]=a.agents[e]||0}),r})})(),index:"category",categories:(()=>{let e=new Map;return n.results.forEach(s=>{let t=s.user_agent||"Unknown";e.set(t,(e.get(t)||0)+1)}),Array.from(e.entries()).sort((e,s)=>{let[,t]=e,[,a]=s;return a-t}).slice(0,8).map(e=>{let[s]=e;return s})})(),colors:["blue","green","orange","red","purple","yellow","pink","indigo"],valueFormatter:e=>"".concat(e," users"),yAxisWidth:80,showLegend:!0,stack:!0})]})]})]})]})},eT=e=>{let{accessToken:s,userRole:t,dateValue:n,onDateChange:i}=e,[h,p]=(0,Z.useState)({results:[]}),[g,j]=(0,Z.useState)({results:[]}),[f,_]=(0,Z.useState)({results:[]}),[k,b]=(0,Z.useState)({results:[]}),[w,q]=(0,Z.useState)(""),[S,C]=(0,Z.useState)([]),[T,D]=(0,Z.useState)([]),[L,E]=(0,Z.useState)(!1),[A,F]=(0,Z.useState)(!1),[O,M]=(0,Z.useState)(!1),[U,V]=(0,Z.useState)(!1),[z,Y]=(0,Z.useState)(!1),R=new Date,I=async()=>{if(s){E(!0);try{let e=await (0,N.tagDistinctCall)(s);C(e.results.map(e=>e.tag))}catch(e){console.error("Failed to fetch available tags:",e)}finally{E(!1)}}},$=async()=>{if(s){F(!0);try{let e=await (0,N.tagDauCall)(s,R,w||void 0,T.length>0?T:void 0);p(e)}catch(e){console.error("Failed to fetch DAU data:",e)}finally{F(!1)}}},K=async()=>{if(s){M(!0);try{let e=await (0,N.tagWauCall)(s,R,w||void 0,T.length>0?T:void 0);j(e)}catch(e){console.error("Failed to fetch WAU data:",e)}finally{M(!1)}}},P=async()=>{if(s){V(!0);try{let e=await (0,N.tagMauCall)(s,R,w||void 0,T.length>0?T:void 0);_(e)}catch(e){console.error("Failed to fetch MAU data:",e)}finally{V(!1)}}},W=async()=>{if(s&&n.from&&n.to){Y(!0);try{let e=await (0,N.userAgentSummaryCall)(s,n.from,n.to,T.length>0?T:void 0);b(e)}catch(e){console.error("Failed to fetch user agent summary data:",e)}finally{Y(!1)}}};(0,Z.useEffect)(()=>{I()},[s]),(0,Z.useEffect)(()=>{if(!s)return;let e=setTimeout(()=>{$(),K(),P()},50);return()=>clearTimeout(e)},[s,w,T]),(0,Z.useEffect)(()=>{if(!n.from||!n.to)return;let e=setTimeout(()=>{W()},50);return()=>clearTimeout(e)},[s,n,T]);let B=e=>e.startsWith("User-Agent: ")?e.replace("User-Agent: ",""):e,H=e=>e.length>15?e.substring(0,15)+"...":e,G=e=>Object.entries(e.reduce((e,s)=>(e[s.tag]=(e[s.tag]||0)+s.active_users,e),{})).sort((e,s)=>{let[,t]=e,[,a]=s;return a-t}).map(e=>{let[s]=e;return s}),J=G(h.results).slice(0,10),X=G(g.results).slice(0,10),ee=G(f.results).slice(0,10),es=(()=>{let e=[],s=new Date;for(let t=6;t>=0;t--){let a=new Date(s);a.setDate(a.getDate()-t);let r={date:a.toISOString().split("T")[0]};J.forEach(e=>{r[B(e)]=0}),e.push(r)}return h.results.forEach(s=>{let t=B(s.tag),a=e.find(e=>e.date===s.date);a&&(a[t]=s.active_users)}),e})(),et=(()=>{let e=[];for(let s=1;s<=7;s++){let t={week:"Week ".concat(s)};X.forEach(e=>{t[B(e)]=0}),e.push(t)}return g.results.forEach(s=>{let t=B(s.tag),a=s.date.match(/Week (\d+)/);if(a){let r="Week ".concat(a[1]),l=e.find(e=>e.week===r);l&&(l[t]=s.active_users)}}),e})(),ea=(()=>{let e=[];for(let s=1;s<=7;s++){let t={month:"Month ".concat(s)};ee.forEach(e=>{t[B(e)]=0}),e.push(t)}return f.results.forEach(s=>{let t=B(s.tag),a=s.date.match(/Month (\d+)/);if(a){let r="Month ".concat(a[1]),l=e.find(e=>e.month===r);l&&(l[t]=s.active_users)}}),e})(),er=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e>=1e8||e>=1e7||e>=1e6?(e/1e6).toFixed(s)+"M":e>=1e4?(e/1e3).toFixed(s)+"K":e>=1e3?(e/1e3).toFixed(s)+"K":e.toFixed(s)};return(0,a.jsxs)("div",{className:"space-y-6 mt-6",children:[(0,a.jsx)(l.Z,{children:(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(v.Z,{children:"Summary by User Agent"}),(0,a.jsx)(eq.Z,{children:"Performance metrics for different user agents"})]}),(0,a.jsxs)("div",{className:"w-96",children:[(0,a.jsx)(y.Z,{className:"text-sm font-medium block mb-2",children:"Filter by User Agents"}),(0,a.jsx)(Q.default,{mode:"multiple",placeholder:"All User Agents",value:T,onChange:D,style:{width:"100%"},showSearch:!0,allowClear:!0,loading:L,optionFilterProp:"label",className:"rounded-md",maxTagCount:"responsive",children:S.map(e=>{let s=B(e),t=s.length>50?"".concat(s.substring(0,50),"..."):s;return(0,a.jsx)(Q.default.Option,{value:e,label:t,title:s,children:t},e)})})]})]}),z?(0,a.jsx)(eN,{isDateChanging:!1}):(0,a.jsxs)(c.Z,{numItems:4,className:"gap-4",children:[(k.results||[]).slice(0,4).map((e,s)=>{let t=B(e.tag),r=H(t);return(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(eS.Z,{title:t,placement:"top",children:(0,a.jsx)(v.Z,{className:"truncate",children:r})}),(0,a.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Success Requests"}),(0,a.jsx)(ew.Z,{className:"text-lg",children:er(e.successful_requests)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Total Tokens"}),(0,a.jsx)(ew.Z,{className:"text-lg",children:er(e.total_tokens)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Total Cost"}),(0,a.jsxs)(ew.Z,{className:"text-lg",children:["$",er(e.total_spend,4)]})]})]})]},s)}),Array.from({length:Math.max(0,4-(k.results||[]).length)}).map((e,s)=>(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"No Data"}),(0,a.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Success Requests"}),(0,a.jsx)(ew.Z,{className:"text-lg",children:"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Total Tokens"}),(0,a.jsx)(ew.Z,{className:"text-lg",children:"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Total Cost"}),(0,a.jsx)(ew.Z,{className:"text-lg",children:"-"})]})]})]},"empty-".concat(s)))]})]})}),(0,a.jsx)(l.Z,{children:(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{className:"mb-6",children:[(0,a.jsx)(o.Z,{children:"DAU/WAU/MAU"}),(0,a.jsx)(o.Z,{children:"Per User Usage (Last 30 Days)"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)(m.Z,{children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(v.Z,{children:"DAU, WAU & MAU per Agent"}),(0,a.jsx)(eq.Z,{children:"Active users across different time periods"})]}),(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{className:"mb-6",children:[(0,a.jsx)(o.Z,{children:"DAU"}),(0,a.jsx)(o.Z,{children:"WAU"}),(0,a.jsx)(o.Z,{children:"MAU"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)(m.Z,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(v.Z,{className:"text-lg",children:"Daily Active Users - Last 7 Days"})}),A?(0,a.jsx)(eN,{isDateChanging:!1}):(0,a.jsx)(r.Z,{data:es,index:"date",categories:J.map(B),valueFormatter:e=>er(e),yAxisWidth:60,showLegend:!0,stack:!0})]}),(0,a.jsxs)(m.Z,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(v.Z,{className:"text-lg",children:"Weekly Active Users - Last 7 Weeks"})}),O?(0,a.jsx)(eN,{isDateChanging:!1}):(0,a.jsx)(r.Z,{data:et,index:"week",categories:X.map(B),valueFormatter:e=>er(e),yAxisWidth:60,showLegend:!0,stack:!0})]}),(0,a.jsxs)(m.Z,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(v.Z,{className:"text-lg",children:"Monthly Active Users - Last 7 Months"})}),U?(0,a.jsx)(eN,{isDateChanging:!1}):(0,a.jsx)(r.Z,{data:ea,index:"month",categories:ee.map(B),valueFormatter:e=>er(e),yAxisWidth:60,showLegend:!0,stack:!0})]})]})]})]}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(eC,{accessToken:s,selectedTags:T,formatAbbreviatedNumber:er})})]})]})})]})},eD=t(47375),eL=t(32176),eE=t(62338),eA=t(12322);function eF(e){let{topModels:s}=e,[t,r]=(0,Z.useState)("table");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>r("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===t?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,a.jsx)("button",{onClick:()=>r("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===t?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===t?(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(eE.v,{className:"mt-4 h-40",data:s,index:"key",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$".concat((0,A.pw)(e,2)),layout:"vertical",yAxisWidth:200,showLegend:!1})}):(0,a.jsx)("div",{className:"border rounded-lg overflow-auto",children:(0,a.jsx)(eA.w,{columns:[{header:"Model",accessorKey:"key",cell:e=>e.getValue()||"-"},{header:"Spend (USD)",accessorKey:"spend",cell:e=>{let s=e.getValue();return"$".concat((0,A.pw)(s,2))}},{header:"Successful",accessorKey:"successful_requests",cell:e=>{var s;return(0,a.jsx)("span",{className:"text-green-600",children:(null===(s=e.getValue())||void 0===s?void 0:s.toLocaleString())||0})}},{header:"Failed",accessorKey:"failed_requests",cell:e=>{var s;return(0,a.jsx)("span",{className:"text-red-600",children:(null===(s=e.getValue())||void 0===s?void 0:s.toLocaleString())||0})}},{header:"Tokens",accessorKey:"tokens",cell:e=>{var s;return(null===(s=e.getValue())||void 0===s?void 0:s.toLocaleString())||0}}],data:s,renderSubComponent:()=>(0,a.jsx)(a.Fragment,{}),getRowCanExpand:()=>!1})})]})}var eO=e=>{let{accessToken:s,entityType:t,entityId:k,userID:b,userRole:w,entityList:q,premiumUser:S,dateValue:C}=e,[T,D]=(0,Z.useState)({results:[],metadata:{total_spend:0,total_api_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0}}),L=P(T,"models"),E=P(T,"api_keys"),[F,O]=(0,Z.useState)([]),M=async()=>{if(!s||!C.from||!C.to)return;let e=new Date(C.from),a=new Date(C.to);if("tag"===t)D(await (0,N.tagDailyActivityCall)(s,e,a,1,F.length>0?F:null));else if("team"===t)D(await (0,N.teamDailyActivityCall)(s,e,a,1,F.length>0?F:null));else if("organization"===t)D(await (0,N.organizationDailyActivityCall)(s,e,a,1,F.length>0?F:null));else if("customer"===t)D(await (0,N.customerDailyActivityCall)(s,e,a,1,F.length>0?F:null));else if("agent"===t)D(await (0,N.agentDailyActivityCall)(s,e,a,1,F.length>0?F:null));else throw Error("Invalid entity type")};(0,Z.useEffect)(()=>{M()},[s,C,k,F]);let U=()=>{let e={};return T.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={provider:t,spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=a.metrics.spend,e[t].requests+=a.metrics.api_requests,e[t].successful_requests+=a.metrics.successful_requests,e[t].failed_requests+=a.metrics.failed_requests,e[t].tokens+=a.metrics.total_tokens}catch(e){console.error("Error processing provider ".concat(t,": ").concat(e))}})}),Object.values(e).filter(e=>e.spend>0).sort((e,s)=>s.spend-e.spend)},V=(e,s)=>{if(q){let s=q.find(s=>s.value===e);if(s)return s.label}return(null==s?void 0:s.team_alias)?s.team_alias:e},z=e=>0===F.length?e:e.filter(e=>F.includes(e.metadata.id)),Y=()=>{let e={};return T.results.forEach(s=>{Object.entries(s.breakdown.entities||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{alias:V(t,a.metadata),id:t}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests,e[t].metrics.failed_requests+=a.metrics.failed_requests,e[t].metrics.total_tokens+=a.metrics.total_tokens})}),z(Object.values(e).sort((e,s)=>s.metrics.spend-e.metrics.spend))},I=t.charAt(0).toUpperCase()+t.slice(1);return(0,a.jsxs)("div",{style:{width:"100%"},className:"relative",children:[(0,a.jsx)(eg,{dateValue:C,entityType:t,spendData:T,showFilters:null!==q&&q.length>0,filterLabel:"Filter by ".concat(t),filterPlaceholder:"Select ".concat(t," to filter..."),selectedFilters:F,onFiltersChange:O,filterOptions:(()=>{if(q)return q})()||void 0}),(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{variant:"solid",className:"mt-1",children:[(0,a.jsx)(o.Z,{children:"Cost"}),(0,a.jsx)(o.Z,{children:"agent"===t?"Request / Token Consumption":"Model Activity"}),(0,a.jsx)(o.Z,{children:"Key Activity"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsx)(m.Z,{children:(0,a.jsxs)(c.Z,{numItems:2,className:"gap-2 w-full",children:[(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)(v.Z,{children:[I," Spend Overview"]}),(0,a.jsxs)(c.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Spend"}),(0,a.jsxs)(y.Z,{className:"text-2xl font-bold mt-2",children:["$",(0,A.pw)(T.metadata.total_spend,2)]})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2",children:T.metadata.total_api_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Successful Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:T.metadata.total_successful_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Failed Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:T.metadata.total_failed_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Tokens"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2",children:T.metadata.total_tokens.toLocaleString()})]})]})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Daily Spend"}),(0,a.jsx)(r.Z,{data:[...T.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:R,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload,l=Object.keys(r.breakdown.entities||{}).length;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.date}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Total Spend: $",(0,A.pw)(r.metrics.spend,2)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",r.metrics.api_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Successful: ",r.metrics.successful_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Failed: ",r.metrics.failed_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total Tokens: ",r.metrics.total_tokens]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total ",I,"s: ",l]}),(0,a.jsxs)("div",{className:"mt-2 border-t pt-2",children:[(0,a.jsxs)("p",{className:"font-semibold",children:["Spend by ",I,":"]}),Object.entries(r.breakdown.entities||{}).sort((e,s)=>{let[,t]=e,[,a]=s,r=t.metrics.spend;return a.metrics.spend-r}).slice(0,5).map(e=>{let[s,t]=e;return(0,a.jsxs)("p",{className:"text-sm text-gray-600",children:[V(s,t.metadata),": $",(0,A.pw)(t.metrics.spend,2)]},s)}),l>5&&(0,a.jsxs)("p",{className:"text-sm text-gray-500 italic",children:["...and ",l-5," more"]})]})]})}})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsx)(l.Z,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,a.jsxs)(v.Z,{children:["Spend Per ",I]}),(0,a.jsx)(eq.Z,{className:"text-xs",children:"Showing Top 5 by Spend"}),(0,a.jsxs)("div",{className:"flex items-center text-sm text-gray-500",children:[(0,a.jsxs)("span",{children:["Get Started by Tracking cost per ",I," "]}),(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/enterprise#spend-tracking",className:"text-blue-500 hover:text-blue-700 ml-1",children:"here"})]})]}),(0,a.jsxs)(c.Z,{numItems:2,className:"gap-6",children:[(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsx)(r.Z,{className:"mt-4 h-52",data:Y().slice(0,5).map(e=>({...e,metadata:{...e.metadata,alias_display:e.metadata.alias&&e.metadata.alias.length>15?"".concat(e.metadata.alias.slice(0,15),"..."):e.metadata.alias}})),index:"metadata.alias_display",categories:["metrics.spend"],colors:["cyan"],valueFormatter:R,layout:"vertical",showLegend:!1,yAxisWidth:150,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.metadata.alias}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,A.pw)(r.metrics.spend,4)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Requests: ",r.metrics.api_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-green-600",children:["Successful: ",r.metrics.successful_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-red-600",children:["Failed: ",r.metrics.failed_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.metrics.total_tokens.toLocaleString()]})]})}})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsx)("div",{className:"h-52 overflow-y-auto",children:(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(j.Z,{children:(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(f.Z,{children:I}),(0,a.jsx)(f.Z,{children:"Spend"}),(0,a.jsx)(f.Z,{className:"text-green-600",children:"Successful"}),(0,a.jsx)(f.Z,{className:"text-red-600",children:"Failed"}),(0,a.jsx)(f.Z,{children:"Tokens"})]})}),(0,a.jsx)(p.Z,{children:Y().filter(e=>e.metrics.spend>0).map(e=>(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(g.Z,{children:e.metadata.alias}),(0,a.jsxs)(g.Z,{children:["$",(0,A.pw)(e.metrics.spend,4)]}),(0,a.jsx)(g.Z,{className:"text-green-600",children:e.metrics.successful_requests.toLocaleString()}),(0,a.jsx)(g.Z,{className:"text-red-600",children:e.metrics.failed_requests.toLocaleString()}),(0,a.jsx)(g.Z,{children:e.metrics.total_tokens.toLocaleString()})]},e.metadata.id))})]})})})]})]})})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Top Virtual Keys"}),(0,a.jsx)(eL.Z,{topKeys:(()=>{console.log("debugTags",{spendData:T});let e={};return T.results.forEach(s=>{let{breakdown:t}=s,{entities:a}=t;console.log("debugTags",{entities:a});let r=Object.keys(a).reduce((e,s)=>{let{api_key_breakdown:t}=a[s];return Object.keys(t).forEach(a=>{let r={tag:s,usage:t[a].metrics.spend};e[a]?e[a].push(r):e[a]=[r]}),e},{});console.log("debugTags",{tagDictionary:r}),Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:a.metadata.key_alias,team_id:a.metadata.team_id||null,tags:r[t]||[]}},console.log("debugTags",{keySpend:e})),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests,e[t].metrics.failed_requests+=a.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",tags:t.metadata.tags||"-",spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),teams:null,showTags:"tag"===t})]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"agent"===t?"Top Agents":"Top Models"}),(0,a.jsx)(eF,{topModels:(()=>{let e={};return T.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=a.metrics.spend}catch(e){console.error("Error adding spend for ".concat(t,": ").concat(e,", got metrics: ").concat(JSON.stringify(a)))}e[t].requests+=a.metrics.api_requests,e[t].successful_requests+=a.metrics.successful_requests,e[t].failed_requests+=a.metrics.failed_requests,e[t].tokens+=a.metrics.total_tokens})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,...t}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})()})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsx)(l.Z,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsx)(v.Z,{children:"Provider Usage"}),(0,a.jsxs)(c.Z,{numItems:2,children:[(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsx)(i.Z,{className:"mt-4 h-40",data:U(),index:"provider",category:"spend",valueFormatter:e=>"$".concat((0,A.pw)(e,2)),colors:["cyan","blue","indigo","violet","purple"]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(j.Z,{children:(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(f.Z,{children:"Provider"}),(0,a.jsx)(f.Z,{children:"Spend"}),(0,a.jsx)(f.Z,{className:"text-green-600",children:"Successful"}),(0,a.jsx)(f.Z,{className:"text-red-600",children:"Failed"}),(0,a.jsx)(f.Z,{children:"Tokens"})]})}),(0,a.jsx)(p.Z,{children:U().map(e=>(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(g.Z,{children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[e.provider&&(0,a.jsx)("img",{src:(0,ej.dr)(e.provider).logo,alt:"".concat(e.provider," logo"),className:"w-4 h-4",onError:s=>{let t=s.target,a=t.parentElement;if(a){var r;let s=document.createElement("div");s.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",s.textContent=(null===(r=e.provider)||void 0===r?void 0:r.charAt(0))||"-",a.replaceChild(s,t)}}}),(0,a.jsx)("span",{children:e.provider})]})}),(0,a.jsxs)(g.Z,{children:["$",(0,A.pw)(e.spend,2)]}),(0,a.jsx)(g.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,a.jsx)(g.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,a.jsx)(g.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})})]})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)($,{modelMetrics:L,hidePromptCachingMetrics:"agent"===t})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)($,{modelMetrics:E,hidePromptCachingMetrics:"agent"===t})})]})]})]})},eM=t(64739),eU=t(37527),eV=t(41361),ez=t(40312),eY=t(71891),eR=t(69993),eI=t(48231),e$=t(9775);let eK=[{value:"global",label:"Global Usage",showForAdmin:"Global Usage",showForNonAdmin:"Your Usage",description:"View usage across all resources",descriptionForAdmin:"View usage across all resources",descriptionForNonAdmin:"View your usage",icon:(0,a.jsx)(eM.Z,{style:{fontSize:"16px"}})},{value:"organization",label:"Organization Usage",showForAdmin:"Organization Usage",showForNonAdmin:"Your Organization Usage",description:"View organization-level usage",descriptionForAdmin:"View usage across all organizations",descriptionForNonAdmin:"View your organization's usage",icon:(0,a.jsx)(eU.Z,{style:{fontSize:"16px"}})},{value:"team",label:"Team Usage",description:"View usage by team",icon:(0,a.jsx)(eV.Z,{style:{fontSize:"16px"}})},{value:"customer",label:"Customer Usage",description:"View usage by customer accounts",icon:(0,a.jsx)(ez.Z,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"tag",label:"Tag Usage",description:"View usage grouped by tags",icon:(0,a.jsx)(eY.Z,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"agent",label:"Agent Usage (A2A)",description:"View usage by AI agents",icon:(0,a.jsx)(eR.Z,{style:{fontSize:"16px"}}),adminOnly:!0,badgeText:"New"},{value:"user-agent-activity",label:"User Agent Activity",description:"View detailed user agent activity logs",icon:(0,a.jsx)(eI.Z,{style:{fontSize:"16px"}}),adminOnly:!0}],eP=e=>{let{value:s,onChange:t,isAdmin:r,title:l="Usage View",description:n="Select the usage data you want to view","data-id":i}=e,c=eK.filter(e=>!e.adminOnly||!!r).map(e=>{let s=e.label,t=e.description;return e.showForAdmin&&e.showForNonAdmin&&(s=r?e.showForAdmin:e.showForNonAdmin),e.descriptionForAdmin&&e.descriptionForNonAdmin&&(t=r?e.descriptionForAdmin:e.descriptionForNonAdmin),{value:e.value,label:s,description:t,icon:e.icon,badgeText:e.badgeText}});return(0,a.jsx)("div",{className:"w-full","data-id":i,children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-start gap-4",children:[(0,a.jsxs)("div",{className:"flex items-stretch gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"flex-shrink-0 flex items-center",children:(0,a.jsx)(e$.Z,{style:{fontSize:"32px"}})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-0.5 leading-tight",children:l}),(0,a.jsx)("p",{className:"text-xs text-gray-600 leading-tight",children:n})]})]}),(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)(Q.default,{value:s,onChange:t,className:"w-54 sm:w-64 md:w-72",size:"large",options:c.map(e=>({value:e.value,label:e.label})),optionRender:e=>{let s=c.find(s=>s.value===e.value);return s?(0,a.jsxs)("div",{className:"flex items-center gap-2 py-1",children:[(0,a.jsx)("div",{className:"flex-shrink-0 mt-0.5",children:s.icon}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900",children:s.label}),(0,a.jsx)("div",{className:"text-xs text-gray-600 mt-0.5",children:s.description})]}),s.badgeText&&(0,a.jsx)("div",{className:"items-center",children:(0,a.jsx)(k.Z,{color:"blue",count:s.badgeText})})]}):e.label},labelRender:e=>{let s=c.find(s=>s.value===e.value);return s?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{children:s.icon}),(0,a.jsx)("span",{className:"text-sm",children:s.label})]}):e.label}})})]})})};var eW=e=>{var s,t,w,q,C,D,O,M,U,V,z;let{teams:Y,organizations:I}=e,{accessToken:K,userRole:W,userId:B,premiumUser:H}=(0,E.Z)(),[G,J]=(0,Z.useState)({results:[],metadata:{}}),[Q,X]=(0,Z.useState)(!1),[ee,et]=(0,Z.useState)(!1),ea=(0,Z.useMemo)(()=>new Date(Date.now()-6048e5),[]),er=(0,Z.useMemo)(()=>new Date,[]),[el,en]=(0,Z.useState)({from:ea,to:er}),[ei,ec]=(0,Z.useState)([]),{data:eo=[]}=L(K,W),{data:ed}=T(K,W),[eu,em]=(0,Z.useState)("groups"),[ex,ep]=(0,Z.useState)(!1),[eg,ef]=(0,Z.useState)(!1),[e_,ey]=(0,Z.useState)(!0),[ev,ek]=(0,Z.useState)(!0),[eZ,ew]=(0,Z.useState)("global"),[eq,eS]=(0,Z.useState)(!0),eC=async()=>{K&&ec(Object.values(await (0,N.tagListCall)(K)).map(e=>({label:e.name,value:e.name})))};(0,Z.useEffect)(()=>{eC()},[K]);let eE=(null===(s=G.metadata)||void 0===s?void 0:s.total_spend)||0,eA=()=>{let e={};return G.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests||0,e[t].metrics.failed_requests+=a.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{provider:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}})},eF=(0,Z.useCallback)(async()=>{if(!K||!el.from||!el.to)return;X(!0);let e=new Date(el.from),s=new Date(el.to);try{try{let t=await (0,N.userDailyActivityAggregatedCall)(K,e,s);J(t);return}catch(e){}let t=await (0,N.userDailyActivityCall)(K,e,s);if(t.metadata.total_pages<=1){J(t);return}let a=[...t.results],r={...t.metadata};for(let l=2;l<=t.metadata.total_pages;l++){let t=await (0,N.userDailyActivityCall)(K,e,s,l);a.push(...t.results),t.metadata&&(r.total_spend+=t.metadata.total_spend||0,r.total_api_requests+=t.metadata.total_api_requests||0,r.total_successful_requests+=t.metadata.total_successful_requests||0,r.total_failed_requests+=t.metadata.total_failed_requests||0,r.total_tokens+=t.metadata.total_tokens||0)}J({results:a,metadata:r})}catch(e){console.error("Error fetching user spend data:",e)}finally{X(!1),et(!1)}},[K,el.from,el.to]),eM=(0,Z.useCallback)(e=>{et(!0),X(!0),en(e)},[]);(0,Z.useEffect)(()=>{if(!el.from||!el.to)return;let e=setTimeout(()=>{eF()},50);return()=>clearTimeout(e)},[eF]);let eU=P(G,"models"),eV=P(G,"api_keys"),ez=P(G,"mcp_servers");return(0,a.jsxs)("div",{style:{width:"100%"},className:"p-8 relative",children:[(0,a.jsx)("div",{className:"flex items-end justify-between gap-6 mb-6",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-end justify-between gap-6 mb-4 w-full",children:[(0,a.jsx)(k.Z,{color:"blue",count:"New",children:(0,a.jsx)(eP,{value:eZ,onChange:e=>ew(e),isAdmin:S.ZL.includes(W||"")})}),(0,a.jsx)(eb,{value:el,onValueChange:eM})]}),"global"===eZ&&(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsxs)(u.Z,{variant:"solid",className:"mt-1",children:[(0,a.jsx)(o.Z,{children:"Cost"}),(0,a.jsx)(o.Z,{children:"Model Activity"}),(0,a.jsx)(o.Z,{children:"Key Activity"}),(0,a.jsx)(o.Z,{children:"MCP Server Activity"})]}),(0,a.jsx)(F.z,{onClick:()=>ef(!0),icon:()=>(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),children:"Export Data"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsx)(m.Z,{children:(0,a.jsxs)(c.Z,{numItems:2,className:"gap-2 w-full",children:[(0,a.jsxs)(n.Z,{numColSpan:2,children:[(0,a.jsxs)(y.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend"," ",el.from&&el.to&&(0,a.jsxs)(a.Fragment,{children:[el.from.toLocaleDateString("en-US",{month:"short",day:"numeric",year:el.from.getFullYear()!==el.to.getFullYear()?"numeric":void 0})," - ",el.to.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]})]}),(0,a.jsx)(eD.Z,{userSpend:eE,selectedTeam:null,userMaxBudget:null})]}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Usage Metrics"}),(0,a.jsxs)(c.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2",children:(null===(w=G.metadata)||void 0===w?void 0:null===(t=w.total_api_requests)||void 0===t?void 0:t.toLocaleString())||0})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Successful Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:(null===(C=G.metadata)||void 0===C?void 0:null===(q=C.total_successful_requests)||void 0===q?void 0:q.toLocaleString())||0})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Failed Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:(null===(O=G.metadata)||void 0===O?void 0:null===(D=O.total_failed_requests)||void 0===D?void 0:D.toLocaleString())||0})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Tokens"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2",children:(null===(U=G.metadata)||void 0===U?void 0:null===(M=U.total_tokens)||void 0===M?void 0:M.toLocaleString())||0})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Average Cost per Request"}),(0,a.jsxs)(y.Z,{className:"text-2xl font-bold mt-2",children:["$",(0,A.pw)((eE||0)/((null===(V=G.metadata)||void 0===V?void 0:V.total_api_requests)||1),4)]})]})]})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Daily Spend"}),Q?(0,a.jsx)(eN,{isDateChanging:ee}):(0,a.jsx)(r.Z,{data:[...G.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:R,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.date}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,A.pw)(r.metrics.spend,2)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Requests: ",r.metrics.api_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Successful: ",r.metrics.successful_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Failed: ",r.metrics.failed_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.metrics.total_tokens]})]})}})]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(l.Z,{className:"h-full",children:[(0,a.jsx)(v.Z,{children:"Top Virtual Keys"}),(0,a.jsx)(eL.Z,{topKeys:(()=>{let e={};return G.results.forEach(s=>{Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:a.metadata.key_alias,team_id:null,tags:a.metadata.tags||[]}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests,e[t].metrics.failed_requests+=a.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),console.log("debugTags",{keySpend:e,userSpendData:G}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",tags:t.metadata.tags||[],spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),teams:null})]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(l.Z,{className:"h-full",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(v.Z,{children:"groups"===eu?"Top Public Model Names":"Top Litellm Models"}),(0,a.jsxs)("div",{className:"flex bg-gray-100 rounded-lg p-1",children:[(0,a.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("groups"===eu?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>em("groups"),children:"Public Model Name"}),(0,a.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("individual"===eu?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>em("individual"),children:"Litellm Model Name"})]})]}),Q?(0,a.jsx)(eN,{isDateChanging:ee}):(0,a.jsx)(r.Z,{className:"mt-4 h-40",data:"groups"===eu?(()=>{let e={};return G.results.forEach(s=>{Object.entries(s.breakdown.model_groups||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests||0,e[t].metrics.failed_requests+=a.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})():(()=>{let e={};return G.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests||0,e[t].metrics.failed_requests+=a.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),index:"key",categories:["spend"],colors:["cyan"],valueFormatter:R,layout:"vertical",yAxisWidth:200,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.key}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,A.pw)(r.spend,2)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",r.requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-green-600",children:["Successful: ",r.successful_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-red-600",children:["Failed: ",r.failed_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.tokens.toLocaleString()]})]})}})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{className:"h-full",children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,a.jsx)(v.Z,{children:"Spend by Provider"})}),Q?(0,a.jsx)(eN,{isDateChanging:ee}):(0,a.jsxs)(c.Z,{numItems:2,children:[(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsx)(i.Z,{className:"mt-4 h-40",data:eA(),index:"provider",category:"spend",valueFormatter:e=>"$".concat((0,A.pw)(e,2)),colors:["cyan"]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(j.Z,{children:(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(f.Z,{children:"Provider"}),(0,a.jsx)(f.Z,{children:"Spend"}),(0,a.jsx)(f.Z,{className:"text-green-600",children:"Successful"}),(0,a.jsx)(f.Z,{className:"text-red-600",children:"Failed"}),(0,a.jsx)(f.Z,{children:"Tokens"})]})}),(0,a.jsx)(p.Z,{children:eA().filter(e=>e.spend>0).map(e=>(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(g.Z,{children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[e.provider&&(0,a.jsx)("img",{src:(0,ej.dr)(e.provider).logo,alt:"".concat(e.provider," logo"),className:"w-4 h-4",onError:s=>{let t=s.target,a=t.parentElement;if(a){var r;let s=document.createElement("div");s.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",s.textContent=(null===(r=e.provider)||void 0===r?void 0:r.charAt(0))||"-",a.replaceChild(s,t)}}}),(0,a.jsx)("span",{children:e.provider})]})}),(0,a.jsxs)(g.Z,{children:["$",(0,A.pw)(e.spend,2)]}),(0,a.jsx)(g.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,a.jsx)(g.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,a.jsx)(g.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})]})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)($,{modelMetrics:eU})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)($,{modelMetrics:eV})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)($,{modelMetrics:ez})})]})]}),"organization"===eZ&&(0,a.jsxs)(a.Fragment,{children:[e_&&(0,a.jsx)(b.Z,{banner:!0,type:"info",message:"Organization usage is a new feature.",description:"Spend is tracked from feature launch and previous data isn't backfilled, so only future usage appears here.",closable:!0,onClose:()=>ey(!1),className:"mb-5"}),(0,a.jsx)(eO,{accessToken:K,entityType:"organization",userID:B,userRole:W,dateValue:el,entityList:(null==I?void 0:I.map(e=>({label:e.organization_alias,value:e.organization_id})))||null,premiumUser:H})]}),"team"===eZ&&(0,a.jsx)(eO,{accessToken:K,entityType:"team",userID:B,userRole:W,entityList:(null==Y?void 0:Y.map(e=>({label:e.team_alias,value:e.team_id})))||null,premiumUser:H,dateValue:el}),"customer"===eZ&&(0,a.jsxs)(a.Fragment,{children:[ev&&(0,a.jsx)(b.Z,{banner:!0,type:"info",message:"Customer usage is a new feature.",description:"Spend is tracked from feature launch and previous data isn't backfilled, so only future usage appears here.",closable:!0,onClose:()=>ek(!1),className:"mb-5"}),(0,a.jsx)(eO,{accessToken:K,entityType:"customer",userID:B,userRole:W,entityList:(null==eo?void 0:eo.map(e=>({label:e.alias||e.user_id,value:e.user_id})))||null,premiumUser:H,dateValue:el})]}),"tag"===eZ&&(0,a.jsx)(eO,{accessToken:K,entityType:"tag",userID:B,userRole:W,entityList:ei,premiumUser:H,dateValue:el}),"agent"===eZ&&(0,a.jsxs)(a.Fragment,{children:[eq&&(0,a.jsx)(b.Z,{banner:!0,type:"info",message:"Agent usage (A2A) is a new feature.",description:"Spend is tracked from feature launch and previous data isn't backfilled, so only future usage appears here.",closable:!0,onClose:()=>eS(!1),className:"mb-5"}),(0,a.jsx)(eO,{accessToken:K,entityType:"agent",userID:B,userRole:W,entityList:(null==ed?void 0:null===(z=ed.agents)||void 0===z?void 0:z.map(e=>({label:e.agent_name,value:e.agent_id})))||null,premiumUser:H,dateValue:el})," "]}),"user-agent-activity"===eZ&&(0,a.jsx)(eT,{accessToken:K,userRole:W,dateValue:el})]})}),(0,a.jsx)(es,{isOpen:ex,onClose:()=>ep(!1),accessToken:K}),(0,a.jsx)(eh,{isOpen:eg,onClose:()=>ef(!1),entityType:"team",spendData:{results:G.results,metadata:G.metadata},dateRange:el,selectedFilters:[],customTitle:"Export Usage Data"})]})}},91323:function(e,s,t){t.d(s,{S:function(){return n}});var a=t(57437),r=t(2265),l=t(10012);function n(e){var s,t;let{className:n="",...i}=e,c=(0,r.useId)();return s=()=>{let e=document.getAnimations().filter(e=>e instanceof CSSAnimation&&"spin"===e.animationName),s=e.find(e=>{var s;return(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))===c}),t=e.find(e=>{var s;return e.effect instanceof KeyframeEffect&&(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))!==c});s&&t&&(s.currentTime=t.currentTime)},t=[c],(0,r.useLayoutEffect)(s,t),(0,a.jsxs)("svg",{"data-spinner-id":c,className:(0,l.cx)("pointer-events-none size-12 animate-spin text-current",n),fill:"none",viewBox:"0 0 24 24",...i,children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}},47375:function(e,s,t){var a=t(57437),r=t(2265),l=t(19250),n=t(59872),i=t(39760);s.Z=e=>{let{userSpend:s,userMaxBudget:t,selectedTeam:c}=e,{accessToken:o,userRole:d,userId:u}=(0,i.Z)();console.log("userSpend: ".concat(s));let[m,x]=(0,r.useState)(null!==s?s:0),[h,p]=(0,r.useState)(c?Number((0,n.pw)(c.max_budget,4)):null);(0,r.useEffect)(()=>{if(c){if("Default Team"===c.team_alias)p(t);else{let e=!1;if(c.team_memberships)for(let s of c.team_memberships)s.user_id===u&&"max_budget"in s.litellm_budget_table&&null!==s.litellm_budget_table.max_budget&&(p(s.litellm_budget_table.max_budget),e=!0);e||p(c.max_budget)}}},[c,t]);let[g,j]=(0,r.useState)([]);(0,r.useEffect)(()=>{let e=async()=>{if(!o||!u||!d)return};(async()=>{try{if(null===u||null===d)return;if(null!==o){let e=(await (0,l.modelAvailableCall)(o,u,d)).data.map(e=>e.id);console.log("available_model_names:",e),j(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[d,o,u]),(0,r.useEffect)(()=>{null!==s&&x(s)},[s]);let f=[];c&&c.models&&(f=c.models),f&&f.includes("all-proxy-models")?(console.log("user models:",g),f=g):f&&f.includes("all-team-models")?f=c.models:f&&0===f.length&&(f=g);let _=null!==h?"$".concat((0,n.pw)(Number(h),4)," limit"):"No limit",y=void 0!==m?(0,n.pw)(m,4):null;return console.log("spend in view user spend: ".concat(m)),(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,a.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",y]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,a.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:_})]})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/849-d1cabf66d71a8808.js b/litellm/proxy/_experimental/out/_next/static/chunks/849-21e5bc782ade4577.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/849-d1cabf66d71a8808.js rename to litellm/proxy/_experimental/out/_next/static/chunks/849-21e5bc782ade4577.js index cf75876f70e..e2a2666f41c 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/849-d1cabf66d71a8808.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/849-21e5bc782ade4577.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{14042:function(e,t,n){"use strict";n.d(t,{Z:function(){return eM}});var r=n(5853),o=n(7084),i=n(26898),a=n(13241),c=n(1153),l=n(2265),s=n(60474),u=n(47625),p=n(93765),f=n(86757),d=n.n(f),y=n(87602),m=n(9841),v=n(81889),h=n(82944),b=["points","className","baseLinePoints","connectNulls"];function g(){return(g=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){x(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),x(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},j=function(e,t){var n=k(e);t&&(n=[n.reduce(function(e,t){return[].concat(A(e),A(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return"".concat(e).concat(0===n?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===n.length?"".concat(r,"Z"):r},P=function(e,t,n){var r=j(e,n);return"".concat("Z"===r.slice(-1)?r.slice(0,-1):r,"L").concat(j(t.reverse(),n).slice(1))},w=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,o=e.connectNulls,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,b);if(!t||!t.length)return null;var a=(0,y.Z)("recharts-polygon",n);if(r&&r.length){var c=i.stroke&&"none"!==i.stroke,s=P(t,r,o);return l.createElement("g",{className:a},l.createElement("path",g({},(0,h.L6)(i,!0),{fill:"Z"===s.slice(-1)?i.fill:"none",stroke:"none",d:s})),c?l.createElement("path",g({},(0,h.L6)(i,!0),{fill:"none",d:j(t,o)})):null,c?l.createElement("path",g({},(0,h.L6)(i,!0),{fill:"none",d:j(r,o)})):null)}var u=j(t,o);return l.createElement("path",g({},(0,h.L6)(i,!0),{fill:"Z"===u.slice(-1)?i.fill:"none",className:a,d:u}))},E=n(58811),S=n(41637),T=n(39206);function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(){return(R=Object.assign?Object.assign.bind():function(e){for(var t=1;t1e-5?"outer"===t?"start":"end":n<-.00001?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,o=e.axisLine,i=e.axisLineType,a=I(I({},(0,h.L6)(this.props,!1)),{},{fill:"none"},(0,h.L6)(o,!1));if("circle"===i)return l.createElement(v.o,R({className:"recharts-polar-angle-axis-line"},a,{cx:t,cy:n,r:r}));var c=this.props.ticks.map(function(e){return(0,T.op)(t,n,r,e.coordinate)});return l.createElement(w,R({className:"recharts-polar-angle-axis-line"},a,{points:c}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,o=t.tick,i=t.tickLine,a=t.tickFormatter,c=t.stroke,s=(0,h.L6)(this.props,!1),u=(0,h.L6)(o,!1),p=I(I({},s),{},{fill:"none"},(0,h.L6)(i,!1)),f=n.map(function(t,n){var f=e.getTickLineCoord(t),d=I(I(I({textAnchor:e.getTickTextAnchor(t)},s),{},{stroke:"none",fill:c},u),{},{index:n,payload:t,x:f.x2,y:f.y2});return l.createElement(m.m,R({className:(0,y.Z)("recharts-polar-angle-axis-tick",(0,T.$S)(o)),key:"tick-".concat(t.coordinate)},(0,S.bw)(e.props,t,n)),i&&l.createElement("line",R({className:"recharts-polar-angle-axis-tick-line"},p,f)),o&&r.renderTickItem(o,d,a?a(t.value,n):t.value))});return l.createElement(m.m,{className:"recharts-polar-angle-axis-ticks"},f)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return!(n<=0)&&t&&t.length?l.createElement(m.m,{className:(0,y.Z)("recharts-polar-angle-axis",this.props.className)},r&&this.renderAxisLine(),this.renderTicks()):null}}],n=[{key:"renderTickItem",value:function(e,t,n){return l.isValidElement(e)?l.cloneElement(e,t):d()(e)?e(t):l.createElement(E.x,R({},t,{className:"recharts-polar-angle-axis-tick-value"}),n)}}],t&&C(r.prototype,t),n&&C(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(l.PureComponent);Z(M,"displayName","PolarAngleAxis"),Z(M,"axisType","angleAxis"),Z(M,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var V=n(35802),$=n.n(V),q=n(37891),z=n.n(q),G=n(26680),Y=["cx","cy","angle","ticks","axisLine"],H=["ticks","tick","angle","tickFormatter","stroke"];function U(e){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W(){return(W=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ee(e,t){for(var n=0;n0?es()(e,"paddingAngle",0):0;if(n){var c=(0,eb.k4)(n.endAngle-n.startAngle,e.endAngle-e.startAngle),l=eP(eP({},e),{},{startAngle:i+a,endAngle:i+c(r)+a});o.push(l),i=l.endAngle}else{var s=e.endAngle,p=e.startAngle,f=(0,eb.k4)(0,s-p)(r),d=eP(eP({},e),{},{startAngle:i+a,endAngle:i+f+a});o.push(d),i=d.endAngle}}),l.createElement(m.m,null,e.renderSectorsStatically(o))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case"ArrowRight":var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!ep()(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,o=t.className,i=t.label,a=t.cx,c=t.cy,s=t.innerRadius,u=t.outerRadius,p=t.isAnimationActive,f=this.state.isAnimationFinished;if(n||!r||!r.length||!(0,eb.hj)(a)||!(0,eb.hj)(c)||!(0,eb.hj)(s)||!(0,eb.hj)(u))return null;var d=(0,y.Z)("recharts-pie",o);return l.createElement(m.m,{tabIndex:this.props.rootTabIndex,className:d,ref:function(t){e.pieRef=t}},this.renderSectors(),i&&this.renderLabels(r),G._.renderCallByParent(this.props,null,!1),(!p||f)&&em.e.renderCallByParent(this.props,r,!1))}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e=360?A:A-1)*u,x=a.reduce(function(e,t){var n=(0,eg.F$)(t,g,0);return e+((0,eb.hj)(n)?n:0)},0);return x>0&&(t=a.map(function(e,t){var r,o=(0,eg.F$)(e,g,0),i=(0,eg.F$)(e,f,t),a=((0,eb.hj)(o)?o:0)/x,s=(r=t?n.endAngle+(0,eb.uY)(h)*u*(0!==o?1:0):l)+(0,eb.uY)(h)*((0!==o?m:0)+a*O),p=(r+s)/2,d=(v.innerRadius+v.outerRadius)/2,b=[{name:i,value:o,payload:e,dataKey:g,type:y}],A=(0,T.op)(v.cx,v.cy,d,p);return n=eP(eP(eP({percent:a,cornerRadius:c,name:i,tooltipPayload:b,midAngle:p,middleRadius:d,tooltipPosition:A},e),v),{},{value:(0,eg.F$)(e,g),startAngle:r,endAngle:s,payload:e,paddingAngle:(0,eb.uY)(h)*u})})),eP(eP({},v),{},{sectors:t,data:a})});var eI=(0,p.z)({chartName:"PieChart",GraphicalChild:eN,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:M},{axisType:"radiusAxis",AxisComp:ea}],formatAxisMap:T.t9,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),eC=n(8147),eD=n(92666),eF=n(98593);let e_=e=>{let{active:t,payload:n,valueFormatter:r}=e;if(t&&(null==n?void 0:n[0])){let e=null==n?void 0:n[0];return l.createElement(eF.$B,null,l.createElement("div",{className:(0,a.q)("px-4 py-2")},l.createElement(eF.zX,{value:r(e.value),name:e.name,color:e.payload.color})))}return null},eZ=(e,t)=>e.map((e,n)=>{let r=ne||t((0,c.vP)(n.map(e=>e[r]))),eK=e=>{let{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:a,className:c}=e;return l.createElement("g",null,l.createElement(s.L,{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:a,className:c,fill:"",opacity:.3,style:{outline:"none"}}))},eM=l.forwardRef((e,t)=>{let{data:n=[],category:s="value",index:p="name",colors:f=i.s,variant:d="donut",valueFormatter:y=c.Cj,label:m,showLabel:v=!0,animationDuration:h=900,showAnimation:b=!1,showTooltip:g=!0,noDataText:A,onValueChange:O,customTooltip:x,className:k}=e,j=(0,r._T)(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),P="donut"==d,w=eB(m,y,n,s),[E,S]=l.useState(void 0),T=!!O;return(0,l.useEffect)(()=>{let e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach(e=>{e.setAttribute("style","outline: none")})},[E]),l.createElement("div",Object.assign({ref:t,className:(0,a.q)("w-full h-40",k)},j),l.createElement(u.h,{className:"h-full w-full"},(null==n?void 0:n.length)?l.createElement(eI,{onClick:T&&E?()=>{S(void 0),null==O||O(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},v&&P?l.createElement("text",{className:(0,a.q)("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},w):null,l.createElement(eN,{className:(0,a.q)("stroke-tremor-background dark:stroke-dark-tremor-background",O?"cursor-pointer":"cursor-default"),data:eZ(n,f),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:P?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:s,nameKey:p,isAnimationActive:b,animationDuration:h,onClick:function(e,t,n){n.stopPropagation(),T&&(E===t?(S(void 0),null==O||O(null)):(S(t),null==O||O(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:E,inactiveShape:eK,style:{outline:"none"}}),l.createElement(eC.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:g?e=>{var t;let{active:n,payload:r}=e;return x?l.createElement(x,{payload:null==r?void 0:r.map(e=>{var t,n,i;return Object.assign(Object.assign({},e),{color:null!==(i=null===(n=null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.payload)||void 0===n?void 0:n.color)&&void 0!==i?i:o.fr.Gray})}),active:n,label:null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.name}):l.createElement(e_,{active:n,payload:r,valueFormatter:y})}:l.createElement(l.Fragment,null)})):l.createElement(eD.Z,{noDataText:A})))});eM.displayName="DonutChart"},35802:function(e,t,n){var r=n(67646),o=n(58905),i=n(88157);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},37891:function(e,t,n){var r=n(67646),o=n(88157),i=n(20121);e.exports=function(e,t){return e&&e.length?r(e,o(t,2),i):void 0}},58710:function(e,t,n){"use strict";var r=n(2265);let o=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 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},92668:function(e,t,n){"use strict";n.d(t,{I:function(){return c}});var r=n(59121),o=n(31091),i=n(63497),a=n(99649);function c(e,t){let{years:n=0,months:c=0,weeks:l=0,days:s=0,hours:u=0,minutes:p=0,seconds:f=0}=t,d=(0,a.Q)(e),y=c||n?(0,o.z)(d,c+12*n):d,m=s||l?(0,r.E)(y,s+7*l):y;return(0,i.L)(e,m.getTime()+1e3*(f+60*(p+60*u)))}}}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{14042:function(e,t,n){"use strict";n.d(t,{Z:function(){return eM}});var r=n(5853),o=n(7084),i=n(26898),a=n(13241),c=n(1153),l=n(2265),s=n(60474),u=n(47625),p=n(93765),f=n(86757),d=n.n(f),y=n(61994),m=n(9841),v=n(81889),h=n(82944),b=["points","className","baseLinePoints","connectNulls"];function g(){return(g=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){x(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),x(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},j=function(e,t){var n=k(e);t&&(n=[n.reduce(function(e,t){return[].concat(A(e),A(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return"".concat(e).concat(0===n?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===n.length?"".concat(r,"Z"):r},P=function(e,t,n){var r=j(e,n);return"".concat("Z"===r.slice(-1)?r.slice(0,-1):r,"L").concat(j(t.reverse(),n).slice(1))},w=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,o=e.connectNulls,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,b);if(!t||!t.length)return null;var a=(0,y.Z)("recharts-polygon",n);if(r&&r.length){var c=i.stroke&&"none"!==i.stroke,s=P(t,r,o);return l.createElement("g",{className:a},l.createElement("path",g({},(0,h.L6)(i,!0),{fill:"Z"===s.slice(-1)?i.fill:"none",stroke:"none",d:s})),c?l.createElement("path",g({},(0,h.L6)(i,!0),{fill:"none",d:j(t,o)})):null,c?l.createElement("path",g({},(0,h.L6)(i,!0),{fill:"none",d:j(r,o)})):null)}var u=j(t,o);return l.createElement("path",g({},(0,h.L6)(i,!0),{fill:"Z"===u.slice(-1)?i.fill:"none",className:a,d:u}))},E=n(58811),S=n(41637),T=n(39206);function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(){return(R=Object.assign?Object.assign.bind():function(e){for(var t=1;t1e-5?"outer"===t?"start":"end":n<-.00001?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,o=e.axisLine,i=e.axisLineType,a=I(I({},(0,h.L6)(this.props,!1)),{},{fill:"none"},(0,h.L6)(o,!1));if("circle"===i)return l.createElement(v.o,R({className:"recharts-polar-angle-axis-line"},a,{cx:t,cy:n,r:r}));var c=this.props.ticks.map(function(e){return(0,T.op)(t,n,r,e.coordinate)});return l.createElement(w,R({className:"recharts-polar-angle-axis-line"},a,{points:c}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,o=t.tick,i=t.tickLine,a=t.tickFormatter,c=t.stroke,s=(0,h.L6)(this.props,!1),u=(0,h.L6)(o,!1),p=I(I({},s),{},{fill:"none"},(0,h.L6)(i,!1)),f=n.map(function(t,n){var f=e.getTickLineCoord(t),d=I(I(I({textAnchor:e.getTickTextAnchor(t)},s),{},{stroke:"none",fill:c},u),{},{index:n,payload:t,x:f.x2,y:f.y2});return l.createElement(m.m,R({className:(0,y.Z)("recharts-polar-angle-axis-tick",(0,T.$S)(o)),key:"tick-".concat(t.coordinate)},(0,S.bw)(e.props,t,n)),i&&l.createElement("line",R({className:"recharts-polar-angle-axis-tick-line"},p,f)),o&&r.renderTickItem(o,d,a?a(t.value,n):t.value))});return l.createElement(m.m,{className:"recharts-polar-angle-axis-ticks"},f)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return!(n<=0)&&t&&t.length?l.createElement(m.m,{className:(0,y.Z)("recharts-polar-angle-axis",this.props.className)},r&&this.renderAxisLine(),this.renderTicks()):null}}],n=[{key:"renderTickItem",value:function(e,t,n){return l.isValidElement(e)?l.cloneElement(e,t):d()(e)?e(t):l.createElement(E.x,R({},t,{className:"recharts-polar-angle-axis-tick-value"}),n)}}],t&&C(r.prototype,t),n&&C(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(l.PureComponent);Z(M,"displayName","PolarAngleAxis"),Z(M,"axisType","angleAxis"),Z(M,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var V=n(35802),$=n.n(V),q=n(37891),z=n.n(q),G=n(26680),Y=["cx","cy","angle","ticks","axisLine"],H=["ticks","tick","angle","tickFormatter","stroke"];function U(e){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W(){return(W=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ee(e,t){for(var n=0;n0?es()(e,"paddingAngle",0):0;if(n){var c=(0,eb.k4)(n.endAngle-n.startAngle,e.endAngle-e.startAngle),l=eP(eP({},e),{},{startAngle:i+a,endAngle:i+c(r)+a});o.push(l),i=l.endAngle}else{var s=e.endAngle,p=e.startAngle,f=(0,eb.k4)(0,s-p)(r),d=eP(eP({},e),{},{startAngle:i+a,endAngle:i+f+a});o.push(d),i=d.endAngle}}),l.createElement(m.m,null,e.renderSectorsStatically(o))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case"ArrowRight":var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!ep()(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,o=t.className,i=t.label,a=t.cx,c=t.cy,s=t.innerRadius,u=t.outerRadius,p=t.isAnimationActive,f=this.state.isAnimationFinished;if(n||!r||!r.length||!(0,eb.hj)(a)||!(0,eb.hj)(c)||!(0,eb.hj)(s)||!(0,eb.hj)(u))return null;var d=(0,y.Z)("recharts-pie",o);return l.createElement(m.m,{tabIndex:this.props.rootTabIndex,className:d,ref:function(t){e.pieRef=t}},this.renderSectors(),i&&this.renderLabels(r),G._.renderCallByParent(this.props,null,!1),(!p||f)&&em.e.renderCallByParent(this.props,r,!1))}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e=360?A:A-1)*u,x=a.reduce(function(e,t){var n=(0,eg.F$)(t,g,0);return e+((0,eb.hj)(n)?n:0)},0);return x>0&&(t=a.map(function(e,t){var r,o=(0,eg.F$)(e,g,0),i=(0,eg.F$)(e,f,t),a=((0,eb.hj)(o)?o:0)/x,s=(r=t?n.endAngle+(0,eb.uY)(h)*u*(0!==o?1:0):l)+(0,eb.uY)(h)*((0!==o?m:0)+a*O),p=(r+s)/2,d=(v.innerRadius+v.outerRadius)/2,b=[{name:i,value:o,payload:e,dataKey:g,type:y}],A=(0,T.op)(v.cx,v.cy,d,p);return n=eP(eP(eP({percent:a,cornerRadius:c,name:i,tooltipPayload:b,midAngle:p,middleRadius:d,tooltipPosition:A},e),v),{},{value:(0,eg.F$)(e,g),startAngle:r,endAngle:s,payload:e,paddingAngle:(0,eb.uY)(h)*u})})),eP(eP({},v),{},{sectors:t,data:a})});var eI=(0,p.z)({chartName:"PieChart",GraphicalChild:eN,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:M},{axisType:"radiusAxis",AxisComp:ea}],formatAxisMap:T.t9,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),eC=n(8147),eD=n(92666),eF=n(98593);let e_=e=>{let{active:t,payload:n,valueFormatter:r}=e;if(t&&(null==n?void 0:n[0])){let e=null==n?void 0:n[0];return l.createElement(eF.$B,null,l.createElement("div",{className:(0,a.q)("px-4 py-2")},l.createElement(eF.zX,{value:r(e.value),name:e.name,color:e.payload.color})))}return null},eZ=(e,t)=>e.map((e,n)=>{let r=ne||t((0,c.vP)(n.map(e=>e[r]))),eK=e=>{let{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:a,className:c}=e;return l.createElement("g",null,l.createElement(s.L,{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:a,className:c,fill:"",opacity:.3,style:{outline:"none"}}))},eM=l.forwardRef((e,t)=>{let{data:n=[],category:s="value",index:p="name",colors:f=i.s,variant:d="donut",valueFormatter:y=c.Cj,label:m,showLabel:v=!0,animationDuration:h=900,showAnimation:b=!1,showTooltip:g=!0,noDataText:A,onValueChange:O,customTooltip:x,className:k}=e,j=(0,r._T)(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),P="donut"==d,w=eB(m,y,n,s),[E,S]=l.useState(void 0),T=!!O;return(0,l.useEffect)(()=>{let e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach(e=>{e.setAttribute("style","outline: none")})},[E]),l.createElement("div",Object.assign({ref:t,className:(0,a.q)("w-full h-40",k)},j),l.createElement(u.h,{className:"h-full w-full"},(null==n?void 0:n.length)?l.createElement(eI,{onClick:T&&E?()=>{S(void 0),null==O||O(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},v&&P?l.createElement("text",{className:(0,a.q)("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},w):null,l.createElement(eN,{className:(0,a.q)("stroke-tremor-background dark:stroke-dark-tremor-background",O?"cursor-pointer":"cursor-default"),data:eZ(n,f),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:P?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:s,nameKey:p,isAnimationActive:b,animationDuration:h,onClick:function(e,t,n){n.stopPropagation(),T&&(E===t?(S(void 0),null==O||O(null)):(S(t),null==O||O(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:E,inactiveShape:eK,style:{outline:"none"}}),l.createElement(eC.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:g?e=>{var t;let{active:n,payload:r}=e;return x?l.createElement(x,{payload:null==r?void 0:r.map(e=>{var t,n,i;return Object.assign(Object.assign({},e),{color:null!==(i=null===(n=null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.payload)||void 0===n?void 0:n.color)&&void 0!==i?i:o.fr.Gray})}),active:n,label:null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.name}):l.createElement(e_,{active:n,payload:r,valueFormatter:y})}:l.createElement(l.Fragment,null)})):l.createElement(eD.Z,{noDataText:A})))});eM.displayName="DonutChart"},35802:function(e,t,n){var r=n(67646),o=n(58905),i=n(88157);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},37891:function(e,t,n){var r=n(67646),o=n(88157),i=n(20121);e.exports=function(e,t){return e&&e.length?r(e,o(t,2),i):void 0}},58710:function(e,t,n){"use strict";var r=n(2265);let o=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 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},92668:function(e,t,n){"use strict";n.d(t,{I:function(){return c}});var r=n(59121),o=n(31091),i=n(63497),a=n(99649);function c(e,t){let{years:n=0,months:c=0,weeks:l=0,days:s=0,hours:u=0,minutes:p=0,seconds:f=0}=t,d=(0,a.Q)(e),y=c||n?(0,o.z)(d,c+12*n):d,m=s||l?(0,r.E)(y,s+7*l):y;return(0,i.L)(e,m.getTime()+1e3*(f+60*(p+60*u)))}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8524-1ca8e08eb33e0bd4.js b/litellm/proxy/_experimental/out/_next/static/chunks/8524-a45c50157efc9fc1.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/8524-1ca8e08eb33e0bd4.js rename to litellm/proxy/_experimental/out/_next/static/chunks/8524-a45c50157efc9fc1.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8650-a9eabc94d72e96b6.js b/litellm/proxy/_experimental/out/_next/static/chunks/8650-a9eabc94d72e96b6.js deleted file mode 100644 index a5910427885..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/8650-a9eabc94d72e96b6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8650],{83669:function(e,t,n){n.d(t,{Z:function(){return l}});var o=n(1119),a=n(2265),r={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"},c=n(55015),l=a.forwardRef(function(e,t){return a.createElement(c.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},62670:function(e,t,n){n.d(t,{Z:function(){return l}});var o=n(1119),a=n(2265),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 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"},c=n(55015),l=a.forwardRef(function(e,t){return a.createElement(c.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},29271:function(e,t,n){n.d(t,{Z:function(){return l}});var o=n(1119),a=n(2265),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:"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"},c=n(55015),l=a.forwardRef(function(e,t){return a.createElement(c.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},45246:function(e,t,n){n.d(t,{Z:function(){return l}});var o=n(1119),a=n(2265),r={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"},c=n(55015),l=a.forwardRef(function(e,t){return a.createElement(c.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},89245:function(e,t,n){n.d(t,{Z:function(){return l}});var o=n(1119),a=n(2265),r={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"},c=n(55015),l=a.forwardRef(function(e,t){return a.createElement(c.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},69993:function(e,t,n){n.d(t,{Z:function(){return l}});var o=n(1119),a=n(2265),r={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"},c=n(55015),l=a.forwardRef(function(e,t){return a.createElement(c.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},58630:function(e,t,n){n.d(t,{Z:function(){return l}});var o=n(1119),a=n(2265),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"},c=n(55015),l=a.forwardRef(function(e,t){return a.createElement(c.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},67101:function(e,t,n){n.d(t,{Z:function(){return d}});var o=n(5853),a=n(13241),r=n(1153),c=n(2265),l=n(9496);let i=(0,r.fn)("Grid"),s=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"",d=c.forwardRef((e,t)=>{let{numItems:n=1,numItemsSm:r,numItemsMd:d,numItemsLg:u,children:m,className:p}=e,g=(0,o._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),f=s(n,l._m),b=s(r,l.LH),h=s(d,l.l5),v=s(u,l.N4),y=(0,a.q)(f,b,h,v);return c.createElement("div",Object.assign({ref:t,className:(0,a.q)(i("root"),"grid",y,p)},g),m)});d.displayName="Grid"},9496:function(e,t,n){n.d(t,{LH:function(){return a},N4:function(){return c},PT:function(){return l},SP:function(){return i},VS:function(){return s},_m:function(){return o},_w:function(){return d},l5:function(){return r}});let o={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"},r={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"},c={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"},l={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"},i={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"},s={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"},d={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"}},33866:function(e,t,n){n.d(t,{Z:function(){return R}});var o=n(2265),a=n(36760),r=n.n(a),c=n(66632),l=n(93350),i=n(19722),s=n(71744),d=n(93463),u=n(12918),m=n(18536),p=n(71140),g=n(99320);let f=new d.E4("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),b=new d.E4("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),h=new d.E4("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),v=new d.E4("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),y=new d.E4("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),x=new d.E4("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),w=e=>{let{componentCls:t,iconCls:n,antCls:o,badgeShadowSize:a,textFontSize:r,textFontSizeSM:c,statusSize:l,dotSize:i,textFontWeight:s,indicatorHeight:p,indicatorHeightSM:g,marginXS:w,calc:k}=e,C="".concat(o,"-scroll-number"),O=(0,m.Z)(e,(e,n)=>{let{darkColor:o}=n;return{["&".concat(t," ").concat(t,"-color-").concat(e)]:{background:o,["&:not(".concat(t,"-count)")]:{color:o},"a:hover &":{background:o}}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,["".concat(t,"-count")]:{display:"inline-flex",justifyContent:"center",zIndex:e.indicatorZIndex,minWidth:p,height:p,color:e.badgeTextColor,fontWeight:s,fontSize:r,lineHeight:(0,d.bf)(p),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:k(p).div(2).equal(),boxShadow:"0 0 0 ".concat((0,d.bf)(a)," ").concat(e.badgeShadowColor),transition:"background ".concat(e.motionDurationMid),a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},["".concat(t,"-count-sm")]:{minWidth:g,height:g,fontSize:c,lineHeight:(0,d.bf)(g),borderRadius:k(g).div(2).equal()},["".concat(t,"-multiple-words")]:{padding:"0 ".concat((0,d.bf)(e.paddingXS)),bdi:{unicodeBidi:"plaintext"}},["".concat(t,"-dot")]:{zIndex:e.indicatorZIndex,width:i,minWidth:i,height:i,background:e.badgeColor,borderRadius:"100%",boxShadow:"0 0 0 ".concat((0,d.bf)(a)," ").concat(e.badgeShadowColor)},["".concat(t,"-count, ").concat(t,"-dot, ").concat(C,"-custom-component")]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",["&".concat(n,"-spin")]:{animationName:x,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},["&".concat(t,"-status")]:{lineHeight:"inherit",verticalAlign:"baseline",["".concat(t,"-status-dot")]:{position:"relative",top:-1,display:"inline-block",width:l,height:l,verticalAlign:"middle",borderRadius:"50%"},["".concat(t,"-status-success")]:{backgroundColor:e.colorSuccess},["".concat(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:a,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:f,animationDuration:e.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},["".concat(t,"-status-default")]:{backgroundColor:e.colorTextPlaceholder},["".concat(t,"-status-error")]:{backgroundColor:e.colorError},["".concat(t,"-status-warning")]:{backgroundColor:e.colorWarning},["".concat(t,"-status-text")]:{marginInlineStart:w,color:e.colorText,fontSize:e.fontSize}}}),O),{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:b,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["".concat(t,"-zoom-leave")]:{animationName:h,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["&".concat(t,"-not-a-wrapper")]:{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:v,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["".concat(t,"-zoom-leave")]:{animationName:y,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["&:not(".concat(t,"-status)")]:{verticalAlign:"middle"},["".concat(C,"-custom-component, ").concat(t,"-count")]:{transform:"none"},["".concat(C,"-custom-component, ").concat(C)]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[C]:{overflow:"hidden",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseOutBack),["".concat(C,"-only")]:{position:"relative",display:"inline-block",height:p,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseOutBack),WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",["> p".concat(C,"-only-unit")]:{height:p,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},["".concat(C,"-symbol")]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",["".concat(t,"-count, ").concat(t,"-dot, ").concat(C,"-custom-component")]:{transform:"translate(-50%, -50%)"}}})}},k=e=>{let{fontHeight:t,lineWidth:n,marginXS:o,colorBorderBg:a}=e,r=e.colorTextLightSolid,c=e.colorError,l=e.colorErrorHover;return(0,p.IX)(e,{badgeFontHeight:t,badgeShadowSize:n,badgeTextColor:r,badgeColor:c,badgeColorHover:l,badgeShadowColor:a,badgeProcessingDuration:"1.2s",badgeRibbonOffset:o,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},C=e=>{let{fontSize:t,lineHeight:n,fontSizeSM:o,lineWidth:a}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*n)-2*a,indicatorHeightSM:t,dotSize:o/2,textFontSize:o,textFontSizeSM:o,textFontWeight:"normal",statusSize:o/2}};var O=(0,g.I$)("Badge",e=>w(k(e)),C);let E=e=>{let{antCls:t,badgeFontHeight:n,marginXS:o,badgeRibbonOffset:a,calc:r}=e,c="".concat(t,"-ribbon"),l=(0,m.Z)(e,(e,t)=>{let{darkColor:n}=t;return{["&".concat(c,"-color-").concat(e)]:{background:n,color:n}}});return{["".concat(t,"-ribbon-wrapper")]:{position:"relative"},[c]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"absolute",top:o,padding:"0 ".concat((0,d.bf)(e.paddingXS)),color:e.colorPrimary,lineHeight:(0,d.bf)(n),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,["".concat(c,"-text")]:{color:e.badgeTextColor},["".concat(c,"-corner")]:{position:"absolute",top:"100%",width:a,height:a,color:"currentcolor",border:"".concat((0,d.bf)(r(a).div(2).equal())," solid"),transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),l),{["&".concat(c,"-placement-end")]:{insetInlineEnd:r(a).mul(-1).equal(),borderEndEndRadius:0,["".concat(c,"-corner")]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},["&".concat(c,"-placement-start")]:{insetInlineStart:r(a).mul(-1).equal(),borderEndStartRadius:0,["".concat(c,"-corner")]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}};var N=(0,g.I$)(["Badge","Ribbon"],e=>E(k(e)),C);let S=e=>{let t;let{prefixCls:n,value:a,current:c,offset:l=0}=e;return l&&(t={position:"absolute",top:"".concat(l,"00%"),left:0}),o.createElement("span",{style:t,className:r()("".concat(n,"-only-unit"),{current:c})},a)};var j=e=>{let t,n;let{prefixCls:a,count:r,value:c}=e,l=Number(c),i=Math.abs(r),[s,d]=o.useState(l),[u,m]=o.useState(i),p=()=>{d(l),m(i)};if(o.useEffect(()=>{let e=setTimeout(p,1e3);return()=>clearTimeout(e)},[l]),s===l||Number.isNaN(l)||Number.isNaN(s))t=[o.createElement(S,Object.assign({},e,{key:l,current:!0}))],n={transition:"none"};else{t=[];let a=l+10,r=[];for(let e=l;e<=a;e+=1)r.push(e);let c=ue%10===s);t=(c<0?r.slice(0,d+1):r.slice(d)).map((t,n)=>o.createElement(S,Object.assign({},e,{key:t,value:t%10,offset:c<0?n-d:n,current:n===d}))),n={transform:"translateY(".concat(-function(e,t,n){let o=e,a=0;for(;(o+10)%10!==t;)o+=n,a+=n;return a}(s,l,c),"00%)")}}return o.createElement("span",{className:"".concat(a,"-only"),style:n,onTransitionEnd:p},t)},Z=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let I=o.forwardRef((e,t)=>{let{prefixCls:n,count:a,className:c,motionClassName:l,style:d,title:u,show:m,component:p="sup",children:g}=e,f=Z(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:b}=o.useContext(s.E_),h=b("scroll-number",n),v=Object.assign(Object.assign({},f),{"data-show":m,style:d,className:r()(h,c,l),title:u}),y=a;if(a&&Number(a)%1==0){let e=String(a).split("");y=o.createElement("bdi",null,e.map((t,n)=>o.createElement(j,{prefixCls:h,count:Number(a),value:t,key:e.length-n})))}return((null==d?void 0:d.borderColor)&&(v.style=Object.assign(Object.assign({},d),{boxShadow:"0 0 0 1px ".concat(d.borderColor," inset")})),g)?(0,i.Tm)(g,e=>({className:r()("".concat(h,"-custom-component"),null==e?void 0:e.className,l)})):o.createElement(p,Object.assign({},v,{ref:t}),y)});var z=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let M=o.forwardRef((e,t)=>{var n,a,d,u,m;let{prefixCls:p,scrollNumberPrefixCls:g,children:f,status:b,text:h,color:v,count:y=null,overflowCount:x=99,dot:w=!1,size:k="default",title:C,offset:E,style:N,className:S,rootClassName:j,classNames:Z,styles:M,showZero:R=!1}=e,P=z(e,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:B,direction:A,badge:L}=o.useContext(s.E_),T=B("badge",p),[W,H,G]=O(T),D=y>x?"".concat(x,"+"):y,q="0"===D||0===D||"0"===h||0===h,F=null===y||q&&!R,V=(null!=b||null!=v)&&F,_=null!=b||!q,K=w&&!q,X=K?"":D,$=(0,o.useMemo)(()=>((null==X||""===X)&&(null==h||""===h)||q&&!R)&&!K,[X,q,R,K,h]),U=(0,o.useRef)(y);$||(U.current=y);let Y=U.current,Q=(0,o.useRef)(X);$||(Q.current=X);let J=Q.current,ee=(0,o.useRef)(K);$||(ee.current=K);let et=(0,o.useMemo)(()=>{if(!E)return Object.assign(Object.assign({},null==L?void 0:L.style),N);let e={marginTop:E[1]};return"rtl"===A?e.left=Number.parseInt(E[0],10):e.right=-Number.parseInt(E[0],10),Object.assign(Object.assign(Object.assign({},e),null==L?void 0:L.style),N)},[A,E,N,null==L?void 0:L.style]),en=null!=C?C:"string"==typeof Y||"number"==typeof Y?Y:void 0,eo=!$&&(0===h?R:!!h&&!0!==h),ea=eo?o.createElement("span",{className:"".concat(T,"-status-text")},h):null,er=Y&&"object"==typeof Y?(0,i.Tm)(Y,e=>({style:Object.assign(Object.assign({},et),e.style)})):void 0,ec=(0,l.o2)(v,!1),el=r()(null==Z?void 0:Z.indicator,null===(n=null==L?void 0:L.classNames)||void 0===n?void 0:n.indicator,{["".concat(T,"-status-dot")]:V,["".concat(T,"-status-").concat(b)]:!!b,["".concat(T,"-color-").concat(v)]:ec}),ei={};v&&!ec&&(ei.color=v,ei.background=v);let es=r()(T,{["".concat(T,"-status")]:V,["".concat(T,"-not-a-wrapper")]:!f,["".concat(T,"-rtl")]:"rtl"===A},S,j,null==L?void 0:L.className,null===(a=null==L?void 0:L.classNames)||void 0===a?void 0:a.root,null==Z?void 0:Z.root,H,G);if(!f&&V&&(h||_||!F)){let e=et.color;return W(o.createElement("span",Object.assign({},P,{className:es,style:Object.assign(Object.assign(Object.assign({},null==M?void 0:M.root),null===(d=null==L?void 0:L.styles)||void 0===d?void 0:d.root),et)}),o.createElement("span",{className:el,style:Object.assign(Object.assign(Object.assign({},null==M?void 0:M.indicator),null===(u=null==L?void 0:L.styles)||void 0===u?void 0:u.indicator),ei)}),eo&&o.createElement("span",{style:{color:e},className:"".concat(T,"-status-text")},h)))}return W(o.createElement("span",Object.assign({ref:t},P,{className:es,style:Object.assign(Object.assign({},null===(m=null==L?void 0:L.styles)||void 0===m?void 0:m.root),null==M?void 0:M.root)}),f,o.createElement(c.ZP,{visible:!$,motionName:"".concat(T,"-zoom"),motionAppear:!1,motionDeadline:1e3},e=>{var t,n;let{className:a}=e,c=B("scroll-number",g),l=ee.current,i=r()(null==Z?void 0:Z.indicator,null===(t=null==L?void 0:L.classNames)||void 0===t?void 0:t.indicator,{["".concat(T,"-dot")]:l,["".concat(T,"-count")]:!l,["".concat(T,"-count-sm")]:"small"===k,["".concat(T,"-multiple-words")]:!l&&J&&J.toString().length>1,["".concat(T,"-status-").concat(b)]:!!b,["".concat(T,"-color-").concat(v)]:ec}),s=Object.assign(Object.assign(Object.assign({},null==M?void 0:M.indicator),null===(n=null==L?void 0:L.styles)||void 0===n?void 0:n.indicator),et);return v&&!ec&&((s=s||{}).background=v),o.createElement(I,{prefixCls:c,show:!$,motionClassName:a,className:i,count:J,title:en,style:s,key:"scrollNumber"},er)}),ea))});M.Ribbon=e=>{let{className:t,prefixCls:n,style:a,color:c,children:i,text:d,placement:u="end",rootClassName:m}=e,{getPrefixCls:p,direction:g}=o.useContext(s.E_),f=p("ribbon",n),b="".concat(f,"-wrapper"),[h,v,y]=N(f,b),x=(0,l.o2)(c,!1),w=r()(f,"".concat(f,"-placement-").concat(u),{["".concat(f,"-rtl")]:"rtl"===g,["".concat(f,"-color-").concat(c)]:x},t),k={},C={};return c&&!x&&(k.background=c,C.color=c),h(o.createElement("div",{className:r()(b,m,v,y)},i,o.createElement("div",{className:r()(w,v),style:Object.assign(Object.assign({},k),a)},o.createElement("span",{className:"".concat(f,"-text")},d),o.createElement("div",{className:"".concat(f,"-corner"),style:C}))))};var R=M},44851:function(e,t,n){n.d(t,{default:function(){return F}});var o=n(2265),a=n(77565),r=n(36760),c=n.n(r),l=n(1119),i=n(83145),s=n(26365),d=n(41154),u=n(50506),m=n(32559),p=n(6989),g=n(45287),f=n(31686),b=n(11993),h=n(66632),v=n(95814),y=o.forwardRef(function(e,t){var n=e.prefixCls,a=e.forceRender,r=e.className,l=e.style,i=e.children,d=e.isActive,u=e.role,m=e.classNames,p=e.styles,g=o.useState(d||a),f=(0,s.Z)(g,2),h=f[0],v=f[1];return(o.useEffect(function(){(a||d)&&v(!0)},[a,d]),h)?o.createElement("div",{ref:t,className:c()("".concat(n,"-content"),(0,b.Z)((0,b.Z)({},"".concat(n,"-content-active"),d),"".concat(n,"-content-inactive"),!d),r),style:l,role:u},o.createElement("div",{className:c()("".concat(n,"-content-box"),null==m?void 0:m.body),style:null==p?void 0:p.body},i)):null});y.displayName="PanelContent";var x=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],w=o.forwardRef(function(e,t){var n=e.showArrow,a=e.headerClass,r=e.isActive,i=e.onItemClick,s=e.forceRender,d=e.className,u=e.classNames,m=void 0===u?{}:u,g=e.styles,w=void 0===g?{}:g,k=e.prefixCls,C=e.collapsible,O=e.accordion,E=e.panelKey,N=e.extra,S=e.header,j=e.expandIcon,Z=e.openMotion,I=e.destroyInactivePanel,z=e.children,M=(0,p.Z)(e,x),R="disabled"===C,P=(0,b.Z)((0,b.Z)((0,b.Z)({onClick:function(){null==i||i(E)},onKeyDown:function(e){("Enter"===e.key||e.keyCode===v.Z.ENTER||e.which===v.Z.ENTER)&&(null==i||i(E))},role:O?"tab":"button"},"aria-expanded",r),"aria-disabled",R),"tabIndex",R?-1:0),B="function"==typeof j?j(e):o.createElement("i",{className:"arrow"}),A=B&&o.createElement("div",(0,l.Z)({className:"".concat(k,"-expand-icon")},["header","icon"].includes(C)?P:{}),B),L=c()("".concat(k,"-item"),(0,b.Z)((0,b.Z)({},"".concat(k,"-item-active"),r),"".concat(k,"-item-disabled"),R),d),T=c()(a,"".concat(k,"-header"),(0,b.Z)({},"".concat(k,"-collapsible-").concat(C),!!C),m.header),W=(0,f.Z)({className:T,style:w.header},["header","icon"].includes(C)?{}:P);return o.createElement("div",(0,l.Z)({},M,{ref:t,className:L}),o.createElement("div",W,(void 0===n||n)&&A,o.createElement("span",(0,l.Z)({className:"".concat(k,"-header-text")},"header"===C?P:{}),S),null!=N&&"boolean"!=typeof N&&o.createElement("div",{className:"".concat(k,"-extra")},N)),o.createElement(h.ZP,(0,l.Z)({visible:r,leavedClassName:"".concat(k,"-content-hidden")},Z,{forceRender:s,removeOnLeave:I}),function(e,t){var n=e.className,a=e.style;return o.createElement(y,{ref:t,prefixCls:k,className:n,classNames:m,style:a,styles:w,isActive:r,forceRender:s,role:O?"tabpanel":void 0},z)}))}),k=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],C=function(e,t){var n=t.prefixCls,a=t.accordion,r=t.collapsible,c=t.destroyInactivePanel,i=t.onItemClick,s=t.activeKey,d=t.openMotion,u=t.expandIcon;return e.map(function(e,t){var m=e.children,g=e.label,f=e.key,b=e.collapsible,h=e.onItemClick,v=e.destroyInactivePanel,y=(0,p.Z)(e,k),x=String(null!=f?f:t),C=null!=b?b:r,O=!1;return O=a?s[0]===x:s.indexOf(x)>-1,o.createElement(w,(0,l.Z)({},y,{prefixCls:n,key:x,panelKey:x,isActive:O,accordion:a,openMotion:d,expandIcon:u,header:g,collapsible:C,onItemClick:function(e){"disabled"!==C&&(i(e),null==h||h(e))},destroyInactivePanel:null!=v?v:c}),m)})},O=function(e,t,n){if(!e)return null;var a=n.prefixCls,r=n.accordion,c=n.collapsible,l=n.destroyInactivePanel,i=n.onItemClick,s=n.activeKey,d=n.openMotion,u=n.expandIcon,m=e.key||String(t),p=e.props,g=p.header,f=p.headerClass,b=p.destroyInactivePanel,h=p.collapsible,v=p.onItemClick,y=!1;y=r?s[0]===m:s.indexOf(m)>-1;var x=null!=h?h:c,w={key:m,panelKey:m,header:g,headerClass:f,isActive:y,prefixCls:a,destroyInactivePanel:null!=b?b:l,openMotion:d,accordion:r,children:e.props.children,onItemClick:function(e){"disabled"!==x&&(i(e),null==v||v(e))},expandIcon:u,collapsible:x};return"string"==typeof e.type?e:(Object.keys(w).forEach(function(e){void 0===w[e]&&delete w[e]}),o.cloneElement(e,w))},E=n(18242);function N(e){var t=e;if(!Array.isArray(t)){var n=(0,d.Z)(t);t="number"===n||"string"===n?[t]:[]}return t.map(function(e){return String(e)})}var S=Object.assign(o.forwardRef(function(e,t){var n,a=e.prefixCls,r=void 0===a?"rc-collapse":a,d=e.destroyInactivePanel,p=e.style,f=e.accordion,b=e.className,h=e.children,v=e.collapsible,y=e.openMotion,x=e.expandIcon,w=e.activeKey,k=e.defaultActiveKey,S=e.onChange,j=e.items,Z=c()(r,b),I=(0,u.Z)([],{value:w,onChange:function(e){return null==S?void 0:S(e)},defaultValue:k,postState:N}),z=(0,s.Z)(I,2),M=z[0],R=z[1];(0,m.ZP)(!h,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var P=(n={prefixCls:r,accordion:f,openMotion:y,expandIcon:x,collapsible:v,destroyInactivePanel:void 0!==d&&d,onItemClick:function(e){return R(function(){return f?M[0]===e?[]:[e]:M.indexOf(e)>-1?M.filter(function(t){return t!==e}):[].concat((0,i.Z)(M),[e])})},activeKey:M},Array.isArray(j)?C(j,n):(0,g.Z)(h).map(function(e,t){return O(e,t,n)}));return o.createElement("div",(0,l.Z)({ref:t,className:Z,style:p,role:f?"tablist":void 0},(0,E.Z)(e,{aria:!0,data:!0})),P)}),{Panel:w});S.Panel;var j=n(18694),Z=n(68710),I=n(19722),z=n(71744),M=n(33759);let R=o.forwardRef((e,t)=>{let{getPrefixCls:n}=o.useContext(z.E_),{prefixCls:a,className:r,showArrow:l=!0}=e,i=n("collapse",a),s=c()({["".concat(i,"-no-arrow")]:!l},r);return o.createElement(S.Panel,Object.assign({ref:t},e,{prefixCls:i,className:s}))});var P=n(93463),B=n(12918),A=n(63074),L=n(99320),T=n(71140);let W=e=>{let{componentCls:t,contentBg:n,padding:o,headerBg:a,headerPadding:r,collapseHeaderPaddingSM:c,collapseHeaderPaddingLG:l,collapsePanelBorderRadius:i,lineWidth:s,lineType:d,colorBorder:u,colorText:m,colorTextHeading:p,colorTextDisabled:g,fontSizeLG:f,lineHeight:b,lineHeightLG:h,marginSM:v,paddingSM:y,paddingLG:x,paddingXS:w,motionDurationSlow:k,fontSizeIcon:C,contentPadding:O,fontHeight:E,fontHeightLG:N}=e,S="".concat((0,P.bf)(s)," ").concat(d," ").concat(u);return{[t]:Object.assign(Object.assign({},(0,B.Wf)(e)),{backgroundColor:a,border:S,borderRadius:i,"&-rtl":{direction:"rtl"},["& > ".concat(t,"-item")]:{borderBottom:S,"&:first-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"".concat((0,P.bf)(i)," ").concat((0,P.bf)(i)," 0 0")}},"&:last-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"0 0 ".concat((0,P.bf)(i)," ").concat((0,P.bf)(i))}},["> ".concat(t,"-header")]:Object.assign(Object.assign({position:"relative",display:"flex",flexWrap:"nowrap",alignItems:"flex-start",padding:r,color:p,lineHeight:b,cursor:"pointer",transition:"all ".concat(k,", visibility 0s")},(0,B.Qy)(e)),{["> ".concat(t,"-header-text")]:{flex:"auto"},["".concat(t,"-expand-icon")]:{height:E,display:"flex",alignItems:"center",paddingInlineEnd:v},["".concat(t,"-arrow")]:Object.assign(Object.assign({},(0,B.Ro)()),{fontSize:C,transition:"transform ".concat(k),svg:{transition:"transform ".concat(k)}}),["".concat(t,"-header-text")]:{marginInlineEnd:"auto"}}),["".concat(t,"-collapsible-header")]:{cursor:"default",["".concat(t,"-header-text")]:{flex:"none",cursor:"pointer"},["".concat(t,"-expand-icon")]:{cursor:"pointer"}},["".concat(t,"-collapsible-icon")]:{cursor:"unset",["".concat(t,"-expand-icon")]:{cursor:"pointer"}}},["".concat(t,"-content")]:{color:m,backgroundColor:n,borderTop:S,["& > ".concat(t,"-content-box")]:{padding:O},"&-hidden":{display:"none"}},"&-small":{["> ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{padding:c,paddingInlineStart:w,["> ".concat(t,"-expand-icon")]:{marginInlineStart:e.calc(y).sub(w).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:y}}},"&-large":{["> ".concat(t,"-item")]:{fontSize:f,lineHeight:h,["> ".concat(t,"-header")]:{padding:l,paddingInlineStart:o,["> ".concat(t,"-expand-icon")]:{height:N,marginInlineStart:e.calc(x).sub(o).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:x}}},["".concat(t,"-item:last-child")]:{borderBottom:0,["> ".concat(t,"-content")]:{borderRadius:"0 0 ".concat((0,P.bf)(i)," ").concat((0,P.bf)(i))}},["& ".concat(t,"-item-disabled > ").concat(t,"-header")]:{"\n &,\n & > .arrow\n ":{color:g,cursor:"not-allowed"}},["&".concat(t,"-icon-position-end")]:{["& > ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{["".concat(t,"-expand-icon")]:{order:1,paddingInlineEnd:0,paddingInlineStart:v}}}}})}},H=e=>{let{componentCls:t}=e,n="> ".concat(t,"-item > ").concat(t,"-header ").concat(t,"-arrow");return{["".concat(t,"-rtl")]:{[n]:{transform:"rotate(180deg)"}}}},G=e=>{let{componentCls:t,headerBg:n,borderlessContentPadding:o,borderlessContentBg:a,colorBorder:r}=e;return{["".concat(t,"-borderless")]:{backgroundColor:n,border:0,["> ".concat(t,"-item")]:{borderBottom:"1px solid ".concat(r)},["\n > ".concat(t,"-item:last-child,\n > ").concat(t,"-item:last-child ").concat(t,"-header\n ")]:{borderRadius:0},["> ".concat(t,"-item:last-child")]:{borderBottom:0},["> ".concat(t,"-item > ").concat(t,"-content")]:{backgroundColor:a,borderTop:0},["> ".concat(t,"-item > ").concat(t,"-content > ").concat(t,"-content-box")]:{padding:o}}}},D=e=>{let{componentCls:t,paddingSM:n}=e;return{["".concat(t,"-ghost")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-item")]:{borderBottom:0,["> ".concat(t,"-content")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-content-box")]:{paddingBlock:n}}}}}};var q=(0,L.I$)("Collapse",e=>{let t=(0,T.IX)(e,{collapseHeaderPaddingSM:"".concat((0,P.bf)(e.paddingXS)," ").concat((0,P.bf)(e.paddingSM)),collapseHeaderPaddingLG:"".concat((0,P.bf)(e.padding)," ").concat((0,P.bf)(e.paddingLG)),collapsePanelBorderRadius:e.borderRadiusLG});return[W(t),G(t),D(t),H(t),(0,A.Z)(t)]},e=>({headerPadding:"".concat(e.paddingSM,"px ").concat(e.padding,"px"),headerBg:e.colorFillAlter,contentPadding:"".concat(e.padding,"px 16px"),contentBg:e.colorBgContainer,borderlessContentPadding:"".concat(e.paddingXXS,"px 16px ").concat(e.padding,"px"),borderlessContentBg:"transparent"})),F=Object.assign(o.forwardRef((e,t)=>{let{getPrefixCls:n,direction:r,expandIcon:l,className:i,style:s}=(0,z.dj)("collapse"),{prefixCls:d,className:u,rootClassName:m,style:p,bordered:f=!0,ghost:b,size:h,expandIconPosition:v="start",children:y,destroyInactivePanel:x,destroyOnHidden:w,expandIcon:k}=e,C=(0,M.Z)(e=>{var t;return null!==(t=null!=h?h:e)&&void 0!==t?t:"middle"}),O=n("collapse",d),E=n(),[N,R,P]=q(O),B=o.useMemo(()=>"left"===v?"start":"right"===v?"end":v,[v]),A=null!=k?k:l,L=o.useCallback(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="function"==typeof A?A(e):o.createElement(a.Z,{rotate:e.isActive?"rtl"===r?-90:90:void 0,"aria-label":e.isActive?"expanded":"collapsed"});return(0,I.Tm)(t,()=>{var e;return{className:c()(null===(e=t.props)||void 0===e?void 0:e.className,"".concat(O,"-arrow"))}})},[A,O,r]),T=c()("".concat(O,"-icon-position-").concat(B),{["".concat(O,"-borderless")]:!f,["".concat(O,"-rtl")]:"rtl"===r,["".concat(O,"-ghost")]:!!b,["".concat(O,"-").concat(C)]:"middle"!==C},i,u,m,R,P),W=o.useMemo(()=>Object.assign(Object.assign({},(0,Z.Z)(E)),{motionAppear:!1,leavedClassName:"".concat(O,"-content-hidden")}),[E,O]),H=o.useMemo(()=>y?(0,g.Z)(y).map((e,t)=>{var n,o;let a=e.props;if(null==a?void 0:a.disabled){let r=null!==(n=e.key)&&void 0!==n?n:String(t),c=Object.assign(Object.assign({},(0,j.Z)(e.props,["disabled"])),{key:r,collapsible:null!==(o=a.collapsible)&&void 0!==o?o:"disabled"});return(0,I.Tm)(e,c)}return e}):null,[y]);return N(o.createElement(S,Object.assign({ref:t,openMotion:W},(0,j.Z)(e,["rootClassName"]),{expandIcon:L,prefixCls:O,className:T,style:Object.assign(Object.assign({},s),p),destroyInactivePanel:null!=w?w:x}),H))}),{Panel:R})},58760:function(e,t,n){n.d(t,{Z:function(){return N}});var o=n(2265),a=n(36760),r=n.n(a),c=n(45287);function l(e){return["small","middle","large"].includes(e)}function i(e){return!!e&&"number"==typeof e&&!Number.isNaN(e)}var s=n(71744),d=n(77685),u=n(17691),m=n(99320);let p=e=>{let{componentCls:t,borderRadius:n,paddingSM:o,colorBorder:a,paddingXS:r,fontSizeLG:c,fontSizeSM:l,borderRadiusLG:i,borderRadiusSM:s,colorBgContainerDisabled:d,lineWidth:m}=e;return{[t]:[{display:"inline-flex",alignItems:"center",gap:0,paddingInline:o,margin:0,background:d,borderWidth:m,borderStyle:"solid",borderColor:a,borderRadius:n,"&-large":{fontSize:c,borderRadius:i},"&-small":{paddingInline:r,borderRadius:s,fontSize:l},"&-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,u.c)(e,{focus:!1})]}};var g=(0,m.I$)(["Space","Addon"],e=>[p(e)]),f=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let b=o.forwardRef((e,t)=>{let{className:n,children:a,style:c,prefixCls:l}=e,i=f(e,["className","children","style","prefixCls"]),{getPrefixCls:u,direction:m}=o.useContext(s.E_),p=u("space-addon",l),[b,h,v]=g(p),{compactItemClassnames:y,compactSize:x}=(0,d.ri)(p,m),w=r()(p,h,y,v,{["".concat(p,"-").concat(x)]:x},n);return b(o.createElement("div",Object.assign({ref:t,className:w,style:c},i),a))}),h=o.createContext({latestIndex:0}),v=h.Provider;var y=e=>{let{className:t,index:n,children:a,split:r,style:c}=e,{latestIndex:l}=o.useContext(h);return null==a?null:o.createElement(o.Fragment,null,o.createElement("div",{className:t,style:c},a),n{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"}},["".concat(t,"-item:empty")]:{display:"none"},["".concat(t,"-item > ").concat(n,"-badge-not-a-wrapper:only-child")]:{display:"block"}}}},k=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}}}};var C=(0,m.I$)("Space",e=>{let t=(0,x.IX)(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[w(t),k(t)]},()=>({}),{resetStyle:!1}),O=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let E=o.forwardRef((e,t)=>{var n;let{getPrefixCls:a,direction:d,size:u,className:m,style:p,classNames:g,styles:f}=(0,s.dj)("space"),{size:b=null!=u?u:"small",align:h,className:x,rootClassName:w,children:k,direction:E="horizontal",prefixCls:N,split:S,style:j,wrap:Z=!1,classNames:I,styles:z}=e,M=O(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[R,P]=Array.isArray(b)?b:[b,b],B=l(P),A=l(R),L=i(P),T=i(R),W=(0,c.Z)(k,{keepEmpty:!0}),H=void 0===h&&"horizontal"===E?"center":h,G=a("space",N),[D,q,F]=C(G),V=r()(G,m,q,"".concat(G,"-").concat(E),{["".concat(G,"-rtl")]:"rtl"===d,["".concat(G,"-align-").concat(H)]:H,["".concat(G,"-gap-row-").concat(P)]:B,["".concat(G,"-gap-col-").concat(R)]:A},x,w,F),_=r()("".concat(G,"-item"),null!==(n=null==I?void 0:I.item)&&void 0!==n?n:g.item),K=Object.assign(Object.assign({},f.item),null==z?void 0:z.item),X=W.map((e,t)=>{let n=(null==e?void 0:e.key)||"".concat(_,"-").concat(t);return o.createElement(y,{className:_,key:n,index:t,split:S,style:K},e)}),$=o.useMemo(()=>({latestIndex:W.reduce((e,t,n)=>null!=t?n:e,0)}),[W]);if(0===W.length)return null;let U={};return Z&&(U.flexWrap="wrap"),!A&&T&&(U.columnGap=R),!B&&L&&(U.rowGap=P),D(o.createElement("div",Object.assign({ref:t,className:V,style:Object.assign(Object.assign(Object.assign({},U),p),j)},M),o.createElement(v,{value:$},X)))});E.Compact=d.ZP,E.Addon=b;var N=E},79205:function(e,t,n){n.d(t,{Z:function(){return u}});var o=n(2265);let a=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),r=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),c=e=>{let t=r(e);return t.charAt(0).toUpperCase()+t.slice(1)},l=function(){for(var e=arguments.length,t=Array(e),n=0;n!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim()},i=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var s={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 d=(0,o.forwardRef)((e,t)=>{let{color:n="currentColor",size:a=24,strokeWidth:r=2,absoluteStrokeWidth:c,className:d="",children:u,iconNode:m,...p}=e;return(0,o.createElement)("svg",{ref:t,...s,width:a,height:a,stroke:n,strokeWidth:c?24*Number(r)/Number(a):r,className:l("lucide",d),...!u&&!i(p)&&{"aria-hidden":"true"},...p},[...m.map(e=>{let[t,n]=e;return(0,o.createElement)(t,n)}),...Array.isArray(u)?u:[u]])}),u=(e,t)=>{let n=(0,o.forwardRef)((n,r)=>{let{className:i,...s}=n;return(0,o.createElement)(d,{ref:r,iconNode:t,className:l("lucide-".concat(a(c(e))),"lucide-".concat(e),i),...s})});return n.displayName=c(e),n}},30401:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},64935:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]])},78867:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},96362:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("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"}]])},29202:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},54001:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("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"}]])},96137:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("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"}]])},80221:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},11239:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},10900:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});t.Z=a},71437:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),o.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"}))});t.Z=a},82376:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}))});t.Z=a},53410:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"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"}))});t.Z=a},74998:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 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"}))});t.Z=a}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8717-8efb62338a426030.js b/litellm/proxy/_experimental/out/_next/static/chunks/8717-8efb62338a426030.js new file mode 100644 index 00000000000..3fe23aac837 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/8717-8efb62338a426030.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8717],{77565:function(e,n,t){t.d(n,{Z:function(){return l}});var a=t(1119),c=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},r=t(55015),l=c.forwardRef(function(e,n){return c.createElement(r.Z,(0,a.Z)({},e,{ref:n,icon:o}))})},57400:function(e,n,t){t.d(n,{Z:function(){return l}});var a=t(1119),c=t(2265),o={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"},r=t(55015),l=c.forwardRef(function(e,n){return c.createElement(r.Z,(0,a.Z)({},e,{ref:n,icon:o}))})},15883:function(e,n,t){t.d(n,{Z:function(){return l}});var a=t(1119),c=t(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"},r=t(55015),l=c.forwardRef(function(e,n){return c.createElement(r.Z,(0,a.Z)({},e,{ref:n,icon:o}))})},96761:function(e,n,t){t.d(n,{Z:function(){return i}});var a=t(5853),c=t(26898),o=t(13241),r=t(1153),l=t(2265);let i=l.forwardRef((e,n)=>{let{color:t,children:i,className:s}=e,d=(0,a._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:n,className:(0,o.q)("font-medium text-tremor-title",t?(0,r.bM)(t,c.K.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",s)},d),i)});i.displayName="Title"},44851:function(e,n,t){t.d(n,{default:function(){return G}});var a=t(2265),c=t(77565),o=t(36760),r=t.n(o),l=t(1119),i=t(83145),s=t(26365),d=t(41154),u=t(50506),p=t(32559),f=t(6989),m=t(45287),b=t(31686),v=t(11993),g=t(66632),h=t(95814),x=a.forwardRef(function(e,n){var t=e.prefixCls,c=e.forceRender,o=e.className,l=e.style,i=e.children,d=e.isActive,u=e.role,p=e.classNames,f=e.styles,m=a.useState(d||c),b=(0,s.Z)(m,2),g=b[0],h=b[1];return(a.useEffect(function(){(c||d)&&h(!0)},[c,d]),g)?a.createElement("div",{ref:n,className:r()("".concat(t,"-content"),(0,v.Z)((0,v.Z)({},"".concat(t,"-content-active"),d),"".concat(t,"-content-inactive"),!d),o),style:l,role:u},a.createElement("div",{className:r()("".concat(t,"-content-box"),null==p?void 0:p.body),style:null==f?void 0:f.body},i)):null});x.displayName="PanelContent";var y=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],C=a.forwardRef(function(e,n){var t=e.showArrow,c=e.headerClass,o=e.isActive,i=e.onItemClick,s=e.forceRender,d=e.className,u=e.classNames,p=void 0===u?{}:u,m=e.styles,C=void 0===m?{}:m,I=e.prefixCls,Z=e.collapsible,N=e.accordion,k=e.panelKey,E=e.extra,w=e.header,P=e.expandIcon,R=e.openMotion,O=e.destroyInactivePanel,S=e.children,j=(0,f.Z)(e,y),M="disabled"===Z,A=(0,v.Z)((0,v.Z)((0,v.Z)({onClick:function(){null==i||i(k)},onKeyDown:function(e){("Enter"===e.key||e.keyCode===h.Z.ENTER||e.which===h.Z.ENTER)&&(null==i||i(k))},role:N?"tab":"button"},"aria-expanded",o),"aria-disabled",M),"tabIndex",M?-1:0),B="function"==typeof P?P(e):a.createElement("i",{className:"arrow"}),K=B&&a.createElement("div",(0,l.Z)({className:"".concat(I,"-expand-icon")},["header","icon"].includes(Z)?A:{}),B),z=r()("".concat(I,"-item"),(0,v.Z)((0,v.Z)({},"".concat(I,"-item-active"),o),"".concat(I,"-item-disabled"),M),d),L=r()(c,"".concat(I,"-header"),(0,v.Z)({},"".concat(I,"-collapsible-").concat(Z),!!Z),p.header),T=(0,b.Z)({className:L,style:C.header},["header","icon"].includes(Z)?{}:A);return a.createElement("div",(0,l.Z)({},j,{ref:n,className:z}),a.createElement("div",T,(void 0===t||t)&&K,a.createElement("span",(0,l.Z)({className:"".concat(I,"-header-text")},"header"===Z?A:{}),w),null!=E&&"boolean"!=typeof E&&a.createElement("div",{className:"".concat(I,"-extra")},E)),a.createElement(g.ZP,(0,l.Z)({visible:o,leavedClassName:"".concat(I,"-content-hidden")},R,{forceRender:s,removeOnLeave:O}),function(e,n){var t=e.className,c=e.style;return a.createElement(x,{ref:n,prefixCls:I,className:t,classNames:p,style:c,styles:C,isActive:o,forceRender:s,role:N?"tabpanel":void 0},S)}))}),I=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],Z=function(e,n){var t=n.prefixCls,c=n.accordion,o=n.collapsible,r=n.destroyInactivePanel,i=n.onItemClick,s=n.activeKey,d=n.openMotion,u=n.expandIcon;return e.map(function(e,n){var p=e.children,m=e.label,b=e.key,v=e.collapsible,g=e.onItemClick,h=e.destroyInactivePanel,x=(0,f.Z)(e,I),y=String(null!=b?b:n),Z=null!=v?v:o,N=!1;return N=c?s[0]===y:s.indexOf(y)>-1,a.createElement(C,(0,l.Z)({},x,{prefixCls:t,key:y,panelKey:y,isActive:N,accordion:c,openMotion:d,expandIcon:u,header:m,collapsible:Z,onItemClick:function(e){"disabled"!==Z&&(i(e),null==g||g(e))},destroyInactivePanel:null!=h?h:r}),p)})},N=function(e,n,t){if(!e)return null;var c=t.prefixCls,o=t.accordion,r=t.collapsible,l=t.destroyInactivePanel,i=t.onItemClick,s=t.activeKey,d=t.openMotion,u=t.expandIcon,p=e.key||String(n),f=e.props,m=f.header,b=f.headerClass,v=f.destroyInactivePanel,g=f.collapsible,h=f.onItemClick,x=!1;x=o?s[0]===p:s.indexOf(p)>-1;var y=null!=g?g:r,C={key:p,panelKey:p,header:m,headerClass:b,isActive:x,prefixCls:c,destroyInactivePanel:null!=v?v:l,openMotion:d,accordion:o,children:e.props.children,onItemClick:function(e){"disabled"!==y&&(i(e),null==h||h(e))},expandIcon:u,collapsible:y};return"string"==typeof e.type?e:(Object.keys(C).forEach(function(e){void 0===C[e]&&delete C[e]}),a.cloneElement(e,C))},k=t(18242);function E(e){var n=e;if(!Array.isArray(n)){var t=(0,d.Z)(n);n="number"===t||"string"===t?[n]:[]}return n.map(function(e){return String(e)})}var w=Object.assign(a.forwardRef(function(e,n){var t,c=e.prefixCls,o=void 0===c?"rc-collapse":c,d=e.destroyInactivePanel,f=e.style,b=e.accordion,v=e.className,g=e.children,h=e.collapsible,x=e.openMotion,y=e.expandIcon,C=e.activeKey,I=e.defaultActiveKey,w=e.onChange,P=e.items,R=r()(o,v),O=(0,u.Z)([],{value:C,onChange:function(e){return null==w?void 0:w(e)},defaultValue:I,postState:E}),S=(0,s.Z)(O,2),j=S[0],M=S[1];(0,p.ZP)(!g,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var A=(t={prefixCls:o,accordion:b,openMotion:x,expandIcon:y,collapsible:h,destroyInactivePanel:void 0!==d&&d,onItemClick:function(e){return M(function(){return b?j[0]===e?[]:[e]:j.indexOf(e)>-1?j.filter(function(n){return n!==e}):[].concat((0,i.Z)(j),[e])})},activeKey:j},Array.isArray(P)?Z(P,t):(0,m.Z)(g).map(function(e,n){return N(e,n,t)}));return a.createElement("div",(0,l.Z)({ref:n,className:R,style:f,role:b?"tablist":void 0},(0,k.Z)(e,{aria:!0,data:!0})),A)}),{Panel:C});w.Panel;var P=t(18694),R=t(68710),O=t(19722),S=t(71744),j=t(33759);let M=a.forwardRef((e,n)=>{let{getPrefixCls:t}=a.useContext(S.E_),{prefixCls:c,className:o,showArrow:l=!0}=e,i=t("collapse",c),s=r()({["".concat(i,"-no-arrow")]:!l},o);return a.createElement(w.Panel,Object.assign({ref:n},e,{prefixCls:i,className:s}))});var A=t(93463),B=t(12918),K=t(63074),z=t(99320),L=t(71140);let T=e=>{let{componentCls:n,contentBg:t,padding:a,headerBg:c,headerPadding:o,collapseHeaderPaddingSM:r,collapseHeaderPaddingLG:l,collapsePanelBorderRadius:i,lineWidth:s,lineType:d,colorBorder:u,colorText:p,colorTextHeading:f,colorTextDisabled:m,fontSizeLG:b,lineHeight:v,lineHeightLG:g,marginSM:h,paddingSM:x,paddingLG:y,paddingXS:C,motionDurationSlow:I,fontSizeIcon:Z,contentPadding:N,fontHeight:k,fontHeightLG:E}=e,w="".concat((0,A.bf)(s)," ").concat(d," ").concat(u);return{[n]:Object.assign(Object.assign({},(0,B.Wf)(e)),{backgroundColor:c,border:w,borderRadius:i,"&-rtl":{direction:"rtl"},["& > ".concat(n,"-item")]:{borderBottom:w,"&:first-child":{["\n &,\n & > ".concat(n,"-header")]:{borderRadius:"".concat((0,A.bf)(i)," ").concat((0,A.bf)(i)," 0 0")}},"&:last-child":{["\n &,\n & > ".concat(n,"-header")]:{borderRadius:"0 0 ".concat((0,A.bf)(i)," ").concat((0,A.bf)(i))}},["> ".concat(n,"-header")]:Object.assign(Object.assign({position:"relative",display:"flex",flexWrap:"nowrap",alignItems:"flex-start",padding:o,color:f,lineHeight:v,cursor:"pointer",transition:"all ".concat(I,", visibility 0s")},(0,B.Qy)(e)),{["> ".concat(n,"-header-text")]:{flex:"auto"},["".concat(n,"-expand-icon")]:{height:k,display:"flex",alignItems:"center",paddingInlineEnd:h},["".concat(n,"-arrow")]:Object.assign(Object.assign({},(0,B.Ro)()),{fontSize:Z,transition:"transform ".concat(I),svg:{transition:"transform ".concat(I)}}),["".concat(n,"-header-text")]:{marginInlineEnd:"auto"}}),["".concat(n,"-collapsible-header")]:{cursor:"default",["".concat(n,"-header-text")]:{flex:"none",cursor:"pointer"},["".concat(n,"-expand-icon")]:{cursor:"pointer"}},["".concat(n,"-collapsible-icon")]:{cursor:"unset",["".concat(n,"-expand-icon")]:{cursor:"pointer"}}},["".concat(n,"-content")]:{color:p,backgroundColor:t,borderTop:w,["& > ".concat(n,"-content-box")]:{padding:N},"&-hidden":{display:"none"}},"&-small":{["> ".concat(n,"-item")]:{["> ".concat(n,"-header")]:{padding:r,paddingInlineStart:C,["> ".concat(n,"-expand-icon")]:{marginInlineStart:e.calc(x).sub(C).equal()}},["> ".concat(n,"-content > ").concat(n,"-content-box")]:{padding:x}}},"&-large":{["> ".concat(n,"-item")]:{fontSize:b,lineHeight:g,["> ".concat(n,"-header")]:{padding:l,paddingInlineStart:a,["> ".concat(n,"-expand-icon")]:{height:E,marginInlineStart:e.calc(y).sub(a).equal()}},["> ".concat(n,"-content > ").concat(n,"-content-box")]:{padding:y}}},["".concat(n,"-item:last-child")]:{borderBottom:0,["> ".concat(n,"-content")]:{borderRadius:"0 0 ".concat((0,A.bf)(i)," ").concat((0,A.bf)(i))}},["& ".concat(n,"-item-disabled > ").concat(n,"-header")]:{"\n &,\n & > .arrow\n ":{color:m,cursor:"not-allowed"}},["&".concat(n,"-icon-position-end")]:{["& > ".concat(n,"-item")]:{["> ".concat(n,"-header")]:{["".concat(n,"-expand-icon")]:{order:1,paddingInlineEnd:0,paddingInlineStart:h}}}}})}},_=e=>{let{componentCls:n}=e,t="> ".concat(n,"-item > ").concat(n,"-header ").concat(n,"-arrow");return{["".concat(n,"-rtl")]:{[t]:{transform:"rotate(180deg)"}}}},V=e=>{let{componentCls:n,headerBg:t,borderlessContentPadding:a,borderlessContentBg:c,colorBorder:o}=e;return{["".concat(n,"-borderless")]:{backgroundColor:t,border:0,["> ".concat(n,"-item")]:{borderBottom:"1px solid ".concat(o)},["\n > ".concat(n,"-item:last-child,\n > ").concat(n,"-item:last-child ").concat(n,"-header\n ")]:{borderRadius:0},["> ".concat(n,"-item:last-child")]:{borderBottom:0},["> ".concat(n,"-item > ").concat(n,"-content")]:{backgroundColor:c,borderTop:0},["> ".concat(n,"-item > ").concat(n,"-content > ").concat(n,"-content-box")]:{padding:a}}}},X=e=>{let{componentCls:n,paddingSM:t}=e;return{["".concat(n,"-ghost")]:{backgroundColor:"transparent",border:0,["> ".concat(n,"-item")]:{borderBottom:0,["> ".concat(n,"-content")]:{backgroundColor:"transparent",border:0,["> ".concat(n,"-content-box")]:{paddingBlock:t}}}}}};var q=(0,z.I$)("Collapse",e=>{let n=(0,L.IX)(e,{collapseHeaderPaddingSM:"".concat((0,A.bf)(e.paddingXS)," ").concat((0,A.bf)(e.paddingSM)),collapseHeaderPaddingLG:"".concat((0,A.bf)(e.padding)," ").concat((0,A.bf)(e.paddingLG)),collapsePanelBorderRadius:e.borderRadiusLG});return[T(n),V(n),X(n),_(n),(0,K.Z)(n)]},e=>({headerPadding:"".concat(e.paddingSM,"px ").concat(e.padding,"px"),headerBg:e.colorFillAlter,contentPadding:"".concat(e.padding,"px 16px"),contentBg:e.colorBgContainer,borderlessContentPadding:"".concat(e.paddingXXS,"px 16px ").concat(e.padding,"px"),borderlessContentBg:"transparent"})),G=Object.assign(a.forwardRef((e,n)=>{let{getPrefixCls:t,direction:o,expandIcon:l,className:i,style:s}=(0,S.dj)("collapse"),{prefixCls:d,className:u,rootClassName:p,style:f,bordered:b=!0,ghost:v,size:g,expandIconPosition:h="start",children:x,destroyInactivePanel:y,destroyOnHidden:C,expandIcon:I}=e,Z=(0,j.Z)(e=>{var n;return null!==(n=null!=g?g:e)&&void 0!==n?n:"middle"}),N=t("collapse",d),k=t(),[E,M,A]=q(N),B=a.useMemo(()=>"left"===h?"start":"right"===h?"end":h,[h]),K=null!=I?I:l,z=a.useCallback(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="function"==typeof K?K(e):a.createElement(c.Z,{rotate:e.isActive?"rtl"===o?-90:90:void 0,"aria-label":e.isActive?"expanded":"collapsed"});return(0,O.Tm)(n,()=>{var e;return{className:r()(null===(e=n.props)||void 0===e?void 0:e.className,"".concat(N,"-arrow"))}})},[K,N,o]),L=r()("".concat(N,"-icon-position-").concat(B),{["".concat(N,"-borderless")]:!b,["".concat(N,"-rtl")]:"rtl"===o,["".concat(N,"-ghost")]:!!v,["".concat(N,"-").concat(Z)]:"middle"!==Z},i,u,p,M,A),T=a.useMemo(()=>Object.assign(Object.assign({},(0,R.Z)(k)),{motionAppear:!1,leavedClassName:"".concat(N,"-content-hidden")}),[k,N]),_=a.useMemo(()=>x?(0,m.Z)(x).map((e,n)=>{var t,a;let c=e.props;if(null==c?void 0:c.disabled){let o=null!==(t=e.key)&&void 0!==t?t:String(n),r=Object.assign(Object.assign({},(0,P.Z)(e.props,["disabled"])),{key:o,collapsible:null!==(a=c.collapsible)&&void 0!==a?a:"disabled"});return(0,O.Tm)(e,r)}return e}):null,[x]);return E(a.createElement(w,Object.assign({ref:n,openMotion:T},(0,P.Z)(e,["rootClassName"]),{expandIcon:z,prefixCls:N,className:L,style:Object.assign(Object.assign({},s),f),destroyInactivePanel:null!=C?C:y}),_))}),{Panel:M})},25523:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"RouterContext",{enumerable:!0,get:function(){return a}});let a=t(47043)._(t(2265)).default.createContext(null)}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/874-30480fb6dbcf8a20.js b/litellm/proxy/_experimental/out/_next/static/chunks/874-8183327be01d369a.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/874-30480fb6dbcf8a20.js rename to litellm/proxy/_experimental/out/_next/static/chunks/874-8183327be01d369a.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8866-b7bd349857d39311.js b/litellm/proxy/_experimental/out/_next/static/chunks/8866-b7bd349857d39311.js deleted file mode 100644 index 3a2a34f00e5..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/8866-b7bd349857d39311.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8866],{62338:function(e,s,t){t.d(s,{v:function(){return a.Z}});var a=t(40278)},16312:function(e,s,t){t.d(s,{z:function(){return a.Z}});var a=t(78489)},28866:function(e,s,t){t.d(s,{Z:function(){return eE}});var a=t(57437),r=t(40278),l=t(12514),n=t(49804),i=t(14042),c=t(67101),o=t(12485),d=t(18135),u=t(35242),m=t(29706),x=t(77991),h=t(21626),p=t(97214),j=t(28241),_=t(58834),g=t(69552),f=t(71876),y=t(84264),v=t(96761),k=t(51653),b=t(2265),Z=t(19250),N=t(11713),w=t(90246),q=t(20347);let S=(0,w.n)("customers"),C=(e,s)=>(0,N.a)({queryKey:S.list({}),queryFn:async()=>await (0,Z.allEndUsersCall)(e),enabled:!!e&&q.ZL.includes(s||"")});var T=t(59872),D=t(16312),L=t(75105),E=t(44851);function F(e){return e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?e/1e3+"k":e.toString()}function O(e){return 0===e?"$0":e>=1e6?"$"+e/1e6+"M":e>=1e3?"$"+e/1e3+"k":"$"+e}let A={blue:"#3b82f6",cyan:"#06b6d4",indigo:"#6366f1",green:"#22c55e",red:"#ef4444",purple:"#8b5cf6"},M=e=>{let{active:s,payload:t,label:r}=e;if(s&&t&&t.length){let e=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),s=(e,s)=>{let t=s.substring(s.indexOf(".")+1);if(e.metrics&&t in e.metrics)return e.metrics[t]};return(0,a.jsxs)("div",{className:"w-56 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[(0,a.jsx)("p",{className:"text-tremor-content-strong",children:r}),t.map(t=>{var r;let l=null===(r=t.dataKey)||void 0===r?void 0:r.toString();if(!l||!t.payload)return null;let n=s(t.payload,l),i=l.includes("spend"),c=void 0!==n?i?"$".concat(n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})):n.toLocaleString():"N/A",o=A[t.color]||t.color;return(0,a.jsxs)("div",{className:"flex items-center justify-between space-x-4",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-2 ring-white drop-shadow-md",style:{backgroundColor:o}}),(0,a.jsx)("p",{className:"font-medium text-tremor-content dark:text-dark-tremor-content",children:e(l)})]}),(0,a.jsx)("p",{className:"font-medium text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",children:c})]},l)})]})}return null},U=e=>{let{categories:s,colors:t}=e,r=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return(0,a.jsx)("div",{className:"flex items-center justify-end space-x-4",children:s.map((e,s)=>{let l=A[t[s]]||t[s];return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-4 ring-white",style:{backgroundColor:l}}),(0,a.jsx)("p",{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:r(e)})]},e)})})},V=e=>{var s,t;let{modelName:n,metrics:i}=e;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(c.Z,{numItems:4,className:"gap-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Requests"}),(0,a.jsx)(v.Z,{children:i.total_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Successful Requests"}),(0,a.jsx)(v.Z,{children:i.total_successful_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Tokens"}),(0,a.jsx)(v.Z,{children:i.total_tokens.toLocaleString()}),(0,a.jsxs)(y.Z,{children:[Math.round(i.total_tokens/i.total_successful_requests)," avg per successful request"]})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Spend"}),(0,a.jsxs)(v.Z,{children:["$",(0,T.pw)(i.total_spend,2)]}),(0,a.jsxs)(y.Z,{children:["$",(0,T.pw)(i.total_spend/i.total_successful_requests,3)," per successful request"]})]})]}),i.top_api_keys&&i.top_api_keys.length>0&&(0,a.jsxs)(l.Z,{className:"mt-4",children:[(0,a.jsx)(v.Z,{children:"Top Virtual Keys by Spend"}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)("div",{className:"grid grid-cols-1 gap-2",children:i.top_api_keys.map((e,s)=>(0,a.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"font-medium",children:e.key_alias||"".concat(e.api_key.substring(0,10),"...")}),e.team_id&&(0,a.jsxs)(y.Z,{className:"text-xs text-gray-500",children:["Team: ",e.team_id]})]}),(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsxs)(y.Z,{className:"font-medium",children:["$",(0,T.pw)(e.spend,2)]}),(0,a.jsxs)(y.Z,{className:"text-xs text-gray-500",children:[e.requests.toLocaleString()," requests | ",e.tokens.toLocaleString()," tokens"]})]})]},e.api_key))})})]}),(0,a.jsxs)(c.Z,{numItems:2,className:"gap-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Total Tokens"}),(0,a.jsx)(U,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,a.jsx)(L.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:F,customTooltip:M,showLegend:!1})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Requests per day"}),(0,a.jsx)(U,{categories:["metrics.api_requests"],colors:["blue"]})]}),(0,a.jsx)(r.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.api_requests"],colors:["blue"],valueFormatter:F,customTooltip:M,showLegend:!1})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Spend per day"}),(0,a.jsx)(U,{categories:["metrics.spend"],colors:["green"]})]}),(0,a.jsx)(r.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.spend"],colors:["green"],valueFormatter:e=>"$".concat((0,T.pw)(e,2,!0)),yAxisWidth:72})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Success vs Failed Requests"}),(0,a.jsx)(U,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,a.jsx)(L.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:F,stack:!0,customTooltip:M,showLegend:!1})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Prompt Caching Metrics"}),(0,a.jsx)(U,{categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"]})]}),(0,a.jsxs)("div",{className:"mb-2",children:[(0,a.jsxs)(y.Z,{children:["Cache Read: ",(null===(s=i.total_cache_read_input_tokens)||void 0===s?void 0:s.toLocaleString())||0," tokens"]}),(0,a.jsxs)(y.Z,{children:["Cache Creation: ",(null===(t=i.total_cache_creation_input_tokens)||void 0===t?void 0:t.toLocaleString())||0," tokens"]})]}),(0,a.jsx)(L.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"],valueFormatter:F,customTooltip:M,showLegend:!1})]})]})]})},Y=e=>{let{modelMetrics:s}=e,t=Object.keys(s).sort((e,t)=>""===e?1:""===t?-1:s[t].total_spend-s[e].total_spend),r={total_requests:0,total_successful_requests:0,total_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,daily_data:{}};Object.values(s).forEach(e=>{r.total_requests+=e.total_requests,r.total_successful_requests+=e.total_successful_requests,r.total_tokens+=e.total_tokens,r.total_spend+=e.total_spend,r.total_cache_read_input_tokens+=e.total_cache_read_input_tokens||0,r.total_cache_creation_input_tokens+=e.total_cache_creation_input_tokens||0,e.daily_data.forEach(e=>{r.daily_data[e.date]||(r.daily_data[e.date]={prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,spend:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0}),r.daily_data[e.date].prompt_tokens+=e.metrics.prompt_tokens,r.daily_data[e.date].completion_tokens+=e.metrics.completion_tokens,r.daily_data[e.date].total_tokens+=e.metrics.total_tokens,r.daily_data[e.date].api_requests+=e.metrics.api_requests,r.daily_data[e.date].spend+=e.metrics.spend,r.daily_data[e.date].successful_requests+=e.metrics.successful_requests,r.daily_data[e.date].failed_requests+=e.metrics.failed_requests,r.daily_data[e.date].cache_read_input_tokens+=e.metrics.cache_read_input_tokens||0,r.daily_data[e.date].cache_creation_input_tokens+=e.metrics.cache_creation_input_tokens||0})});let n=Object.entries(r.daily_data).map(e=>{let[s,t]=e;return{date:s,metrics:t}}).sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime());return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,a.jsx)(v.Z,{children:"Overall Usage"}),(0,a.jsxs)(c.Z,{numItems:4,className:"gap-4 mb-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Requests"}),(0,a.jsx)(v.Z,{children:r.total_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Successful Requests"}),(0,a.jsx)(v.Z,{children:r.total_successful_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Tokens"}),(0,a.jsx)(v.Z,{children:r.total_tokens.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Spend"}),(0,a.jsxs)(v.Z,{children:["$",(0,T.pw)(r.total_spend,2)]})]})]}),(0,a.jsxs)(c.Z,{numItems:2,className:"gap-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Total Tokens Over Time"}),(0,a.jsx)(U,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,a.jsx)(L.Z,{className:"mt-4",data:n,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:F,customTooltip:M,showLegend:!1})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Requests Over Time"}),(0,a.jsx)(L.Z,{className:"mt-4",data:n,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["emerald","red"],valueFormatter:e=>e.toLocaleString(),stack:!0,customTooltip:M,showLegend:!1})]})]})]}),(0,a.jsx)(E.default,{defaultActiveKey:t[0],children:t.map(e=>(0,a.jsx)(E.default.Panel,{header:(0,a.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,a.jsx)(v.Z,{children:s[e].label||"Unknown Item"}),(0,a.jsxs)("div",{className:"flex space-x-4 text-sm text-gray-500",children:[(0,a.jsxs)("span",{children:["$",(0,T.pw)(s[e].total_spend,2)]}),(0,a.jsxs)("span",{children:[s[e].total_requests.toLocaleString()," requests"]})]})]}),children:(0,a.jsx)(V,{modelName:e||"Unknown Model",metrics:s[e]})},e))})]})},R=(e,s)=>{let t=e.metadata.key_alias||"key-hash-".concat(s),a=e.metadata.team_id;return a?"".concat(t," (team_id: ").concat(a,")"):t},z=(e,s)=>{let t={};return e.results.forEach(e=>{Object.entries(e.breakdown[s]||{}).forEach(a=>{let[r,l]=a;t[r]||(t[r]={label:"api_keys"===s?R(l,r):r,total_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0,prompt_tokens:0,completion_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,top_api_keys:[],daily_data:[]}),t[r].total_requests+=l.metrics.api_requests,t[r].prompt_tokens+=l.metrics.prompt_tokens,t[r].completion_tokens+=l.metrics.completion_tokens,t[r].total_tokens+=l.metrics.total_tokens,t[r].total_spend+=l.metrics.spend,t[r].total_successful_requests+=l.metrics.successful_requests,t[r].total_failed_requests+=l.metrics.failed_requests,t[r].total_cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,t[r].total_cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0,t[r].daily_data.push({date:e.date,metrics:{prompt_tokens:l.metrics.prompt_tokens,completion_tokens:l.metrics.completion_tokens,total_tokens:l.metrics.total_tokens,api_requests:l.metrics.api_requests,spend:l.metrics.spend,successful_requests:l.metrics.successful_requests,failed_requests:l.metrics.failed_requests,cache_read_input_tokens:l.metrics.cache_read_input_tokens||0,cache_creation_input_tokens:l.metrics.cache_creation_input_tokens||0}})})}),"api_keys"!==s&&Object.entries(t).forEach(a=>{let[r,l]=a,n={};e.results.forEach(e=>{var t;let a=null===(t=e.breakdown[s])||void 0===t?void 0:t[r];a&&"api_key_breakdown"in a&&Object.entries(a.api_key_breakdown||{}).forEach(e=>{let[s,t]=e;n[s]||(n[s]={api_key:s,key_alias:t.metadata.key_alias,team_id:t.metadata.team_id,spend:0,requests:0,tokens:0}),n[s].spend+=t.metrics.spend,n[s].requests+=t.metrics.api_requests,n[s].tokens+=t.metrics.total_tokens})}),t[r].top_api_keys=Object.values(n).sort((e,s)=>s.spend-e.spend).slice(0,5)}),Object.values(t).forEach(e=>{e.daily_data.sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime())}),t};var I=t(78489),$=t(94789),K=t(49566),P=t(10032),W=t(22116),B=t(37592),H=t(10353),G=t(9114),J=e=>{let{isOpen:s,onClose:t,accessToken:r}=e,[l]=P.Z.useForm(),[n,i]=(0,b.useState)(!1),[c,o]=(0,b.useState)(null),[d,u]=(0,b.useState)(!1),[m,x]=(0,b.useState)("cloudzero"),[h,p]=(0,b.useState)(!1);(0,b.useEffect)(()=>{s&&r&&j()},[s,r]);let j=async()=>{u(!0);try{let e=await fetch("/cloudzero/settings",{method:"GET",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"}});if(e.ok){let s=await e.json();o(s),l.setFieldsValue({connection_id:s.connection_id})}else if(404!==e.status){let s=await e.json();G.Z.fromBackend("Failed to load existing settings: ".concat(s.error||"Unknown error"))}}catch(e){console.error("Error loading CloudZero settings:",e),G.Z.fromBackend("Failed to load existing settings")}finally{u(!1)}},_=async e=>{if(!r){G.Z.fromBackend("No access token available");return}i(!0);try{let s={...e,timezone:"UTC"},t=await fetch(c?"/cloudzero/settings":"/cloudzero/init",{method:c?"PUT":"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify(s)}),a=await t.json();if(t.ok)return G.Z.success(a.message||"CloudZero settings saved successfully"),o({api_key_masked:e.api_key.substring(0,4)+"****"+e.api_key.slice(-4),connection_id:e.connection_id,status:"configured"}),!0;return G.Z.fromBackend(a.error||"Failed to save CloudZero settings"),!1}catch(e){return console.error("Error saving CloudZero settings:",e),G.Z.fromBackend("Failed to save CloudZero settings"),!1}finally{i(!1)}},g=async()=>{if(!r){G.Z.fromBackend("No access token available");return}p(!0);try{let e=await fetch("/cloudzero/export",{method:"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify({limit:1e5,operation:"replace_hourly"})}),s=await e.json();e.ok?(G.Z.success(s.message||"Export to CloudZero completed successfully"),t()):G.Z.fromBackend(s.error||"Failed to export to CloudZero")}catch(e){console.error("Error exporting to CloudZero:",e),G.Z.fromBackend("Failed to export to CloudZero")}finally{p(!1)}},f=async()=>{p(!0);try{G.Z.info("CSV export functionality coming soon!"),t()}catch(e){console.error("Error exporting CSV:",e),G.Z.fromBackend("Failed to export CSV")}finally{p(!1)}},v=async()=>{if("cloudzero"===m){if(!c){let e=await l.validateFields();if(!await _(e))return}await g()}else await f()},k=()=>{l.resetFields(),x("cloudzero"),o(null),t()},Z=[{value:"cloudzero",label:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("img",{src:"/cloudzero.png",alt:"CloudZero",className:"w-5 h-5",onError:e=>{e.target.style.display="none"}}),(0,a.jsx)("span",{children:"Export to CloudZero"})]})},{value:"csv",label:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,a.jsx)("span",{children:"Export to CSV"})]})}];return(0,a.jsx)(W.Z,{title:"Export Data",open:s,onCancel:k,footer:null,width:600,destroyOnClose:!0,children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"font-medium mb-2 block",children:"Export Destination"}),(0,a.jsx)(B.default,{value:m,onChange:x,options:Z,className:"w-full",size:"large"})]}),"cloudzero"===m&&(0,a.jsx)("div",{children:d?(0,a.jsx)("div",{className:"flex justify-center py-8",children:(0,a.jsx)(H.Z,{size:"large"})}):(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsx)($.Z,{title:"Existing CloudZero Configuration",icon:()=>(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),color:"green",className:"mb-4",children:(0,a.jsxs)(y.Z,{children:["API Key: ",c.api_key_masked,(0,a.jsx)("br",{}),"Connection ID: ",c.connection_id]})}),!c&&(0,a.jsxs)(P.Z,{form:l,layout:"vertical",children:[(0,a.jsx)(P.Z.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!0,message:"Please enter your CloudZero API key"}],children:(0,a.jsx)(K.Z,{type:"password",placeholder:"Enter your CloudZero API key"})}),(0,a.jsx)(P.Z.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter the CloudZero connection ID"}],children:(0,a.jsx)(K.Z,{placeholder:"Enter CloudZero connection ID"})})]})]})}),"csv"===m&&(0,a.jsx)($.Z,{title:"CSV Export",icon:()=>(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),color:"blue",children:(0,a.jsx)(y.Z,{children:"Export your usage data as a CSV file for analysis in spreadsheet applications."})}),(0,a.jsxs)("div",{className:"flex justify-end space-x-2 pt-4",children:[(0,a.jsx)(I.Z,{variant:"secondary",onClick:k,children:"Cancel"}),(0,a.jsx)(I.Z,{onClick:v,loading:n||h,disabled:n||h,children:"cloudzero"===m?"Export to CloudZero":"Export CSV"})]})]})})},Q=t(97765),X=t(4863),ee=t(42673),es=e=>{var s,t;let{dateRange:r,selectedFilters:l}=e;return(0,a.jsxs)("div",{className:"text-sm text-gray-500",children:[null===(s=r.from)||void 0===s?void 0:s.toLocaleDateString()," - ",null===(t=r.to)||void 0===t?void 0:t.toLocaleDateString(),l.length>0&&" \xb7 ".concat(l.length," filter").concat(l.length>1?"s":"")]})},et=t(29967),ea=e=>{let{value:s,onChange:t,entityType:r}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Export type"}),(0,a.jsx)(et.ZP.Group,{value:s,onChange:e=>t(e.target.value),className:"w-full",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"flex items-start p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors",children:[(0,a.jsx)(et.ZP,{value:"daily",className:"mt-0.5"}),(0,a.jsxs)("div",{className:"ml-3 flex-1",children:[(0,a.jsx)("div",{className:"font-medium text-sm",children:"Day-by-day breakdown"}),(0,a.jsxs)("div",{className:"text-xs text-gray-500 mt-0.5",children:["Daily metrics for each ",r]})]})]}),(0,a.jsxs)("label",{className:"flex items-start p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors",children:[(0,a.jsx)(et.ZP,{value:"daily_with_models",className:"mt-0.5"}),(0,a.jsxs)("div",{className:"ml-3 flex-1",children:[(0,a.jsxs)("div",{className:"font-medium text-sm",children:["Day-by-day by ",r," and model"]}),(0,a.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Daily metrics split by model"})]})]})]})})]})},er=e=>{let{value:s,onChange:t}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Format"}),(0,a.jsx)(B.default,{value:s,onChange:t,className:"w-full",options:[{value:"csv",label:"CSV (Excel, Google Sheets)"},{value:"json",label:"JSON (includes metadata)"}]})]})},el=t(15452),en=t.n(el);let ei=(e,s)=>{let t=[];return e.results.forEach(e=>{Object.entries(e.breakdown.entities||{}).forEach(a=>{var r;let[l,n]=a;t.push({Date:e.date,[s]:(null===(r=n.metadata)||void 0===r?void 0:r.team_alias)||l,["".concat(s," ID")]:l,"Spend ($)":(0,T.pw)(n.metrics.spend,4),Requests:n.metrics.api_requests,"Successful Requests":n.metrics.successful_requests,"Failed Requests":n.metrics.failed_requests,"Total Tokens":n.metrics.total_tokens,"Prompt Tokens":n.metrics.prompt_tokens||0,"Completion Tokens":n.metrics.completion_tokens||0})})}),t.sort((e,s)=>new Date(e.Date).getTime()-new Date(s.Date).getTime())},ec=(e,s)=>{let t=[];return e.results.forEach(e=>{let a={};Object.entries(e.breakdown.entities||{}).forEach(s=>{var t;let[r,l]=s;null===(t=l.metadata)||void 0===t||t.team_alias,a[r]||(a[r]={}),Object.entries(e.breakdown.models||{}).forEach(e=>{let[s,t]=e;Object.entries(l.api_key_breakdown||{}).forEach(e=>{let[t,l]=e;a[r][s]||(a[r][s]={spend:0,requests:0,successful:0,failed:0,tokens:0}),a[r][s].spend+=l.metrics.spend||0,a[r][s].requests+=l.metrics.api_requests||0,a[r][s].successful+=l.metrics.successful_requests||0,a[r][s].failed+=l.metrics.failed_requests||0,a[r][s].tokens+=l.metrics.total_tokens||0})})}),Object.entries(a).forEach(a=>{var r,l;let[n,i]=a,c=null===(r=e.breakdown.entities)||void 0===r?void 0:r[n],o=(null==c?void 0:null===(l=c.metadata)||void 0===l?void 0:l.team_alias)||n;Object.entries(i).forEach(a=>{let[r,l]=a;t.push({Date:e.date,[s]:o,["".concat(s," ID")]:n,Model:r,"Spend ($)":(0,T.pw)(l.spend,4),Requests:l.requests,Successful:l.successful,Failed:l.failed,"Total Tokens":l.tokens})})})}),t.sort((e,s)=>new Date(e.Date).getTime()-new Date(s.Date).getTime())},eo=(e,s,t)=>{switch(s){case"daily":default:return ei(e,t);case"daily_with_models":return ec(e,t)}},ed=(e,s,t,a,r)=>{var l,n;return{export_date:new Date().toISOString(),entity_type:e,date_range:{from:null===(l=s.from)||void 0===l?void 0:l.toISOString(),to:null===(n=s.to)||void 0===n?void 0:n.toISOString()},filters_applied:t.length>0?t:"None",export_scope:a,summary:{total_spend:r.metadata.total_spend,total_requests:r.metadata.total_api_requests,successful_requests:r.metadata.total_successful_requests,failed_requests:r.metadata.total_failed_requests,total_tokens:r.metadata.total_tokens}}},eu=(e,s,t,a)=>{let r=eo(e,s,t),l=new Blob([en().unparse(r)],{type:"text/csv;charset=utf-8;"}),n=window.URL.createObjectURL(l),i=document.createElement("a");i.href=n;let c="".concat(a,"_usage_").concat(s,"_").concat(new Date().toISOString().split("T")[0],".csv");i.download=c,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)},em=(e,s,t,a,r,l)=>{let n=eo(e,s,t),i=new Blob([JSON.stringify({metadata:ed(a,r,l,s,e),data:n},null,2)],{type:"application/json"}),c=window.URL.createObjectURL(i),o=document.createElement("a");o.href=c;let d="".concat(a,"_usage_").concat(s,"_").concat(new Date().toISOString().split("T")[0],".json");o.download=d,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(c)};var ex=e=>{let{isOpen:s,onClose:t,entityType:r,spendData:l,dateRange:n,selectedFilters:i,customTitle:c}=e,[o,d]=(0,b.useState)("csv"),[u,m]=(0,b.useState)("daily"),[x,h]=(0,b.useState)(!1),p=r.charAt(0).toUpperCase()+r.slice(1),j=c||"Export ".concat(p," Usage"),_=async e=>{let s=e||o;h(!0);try{"csv"===s?(eu(l,u,p,r),G.Z.success("".concat(p," usage data exported successfully as CSV"))):(em(l,u,p,r,n,i),G.Z.success("".concat(p," usage data exported successfully as JSON"))),t()}catch(e){console.error("Error exporting data:",e),G.Z.fromBackend("Failed to export data")}finally{h(!1)}};return(0,a.jsx)(W.Z,{title:(0,a.jsx)("span",{className:"text-base font-semibold",children:j}),open:s,onCancel:t,footer:null,width:480,destroyOnClose:!0,children:(0,a.jsxs)("div",{className:"space-y-5 py-2",children:[(0,a.jsx)(es,{dateRange:n,selectedFilters:i}),(0,a.jsx)(ea,{value:u,onChange:m,entityType:r}),(0,a.jsx)(er,{value:o,onChange:d}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-4 border-t",children:[(0,a.jsx)(D.z,{variant:"secondary",onClick:t,disabled:x,size:"sm",children:"Cancel"}),(0,a.jsx)(D.z,{onClick:()=>_(),loading:x,disabled:x,size:"sm",children:x?"Exporting...":"Export ".concat(o.toUpperCase())})]})]})})},eh=t(19431),ep=e=>{let{dateValue:s,entityType:t,spendData:r,showFilters:l=!1,filterLabel:n,filterPlaceholder:i,selectedFilters:c=[],onFiltersChange:o,filterOptions:d=[],customTitle:u,compactLayout:m=!1}=e,[x,h]=(0,b.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsxs)("div",{className:"grid ".concat(l&&d.length>0?"grid-cols-[1fr_auto]":"grid-cols-[auto]"," items-end gap-4"),children:[l&&d.length>0&&(0,a.jsxs)("div",{children:[n&&(0,a.jsx)(eh.x,{className:"mb-2",children:n}),(0,a.jsx)(B.default,{mode:"multiple",style:{width:"100%"},placeholder:i,value:c,onChange:o,options:d,allowClear:!0})]}),(0,a.jsx)("div",{className:"justify-self-end",children:(0,a.jsx)(eh.z,{onClick:()=>h(!0),icon:()=>(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),children:"Export Data"})})]})}),(0,a.jsx)(ex,{isOpen:x,onClose:()=>h(!1),entityType:t,spendData:r,dateRange:s,selectedFilters:c,customTitle:u})]})},ej=t(62338),e_=t(12322);function eg(e){let{topModels:s}=e,[t,r]=(0,b.useState)("table");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>r("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===t?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,a.jsx)("button",{onClick:()=>r("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===t?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===t?(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(ej.v,{className:"mt-4 h-40",data:s,index:"key",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$".concat((0,T.pw)(e,2)),layout:"vertical",yAxisWidth:200,showLegend:!1})}):(0,a.jsx)("div",{className:"border rounded-lg overflow-auto",children:(0,a.jsx)(e_.w,{columns:[{header:"Model",accessorKey:"key",cell:e=>e.getValue()||"-"},{header:"Spend (USD)",accessorKey:"spend",cell:e=>{let s=e.getValue();return"$".concat((0,T.pw)(s,2))}},{header:"Successful",accessorKey:"successful_requests",cell:e=>{var s;return(0,a.jsx)("span",{className:"text-green-600",children:(null===(s=e.getValue())||void 0===s?void 0:s.toLocaleString())||0})}},{header:"Failed",accessorKey:"failed_requests",cell:e=>{var s;return(0,a.jsx)("span",{className:"text-red-600",children:(null===(s=e.getValue())||void 0===s?void 0:s.toLocaleString())||0})}},{header:"Tokens",accessorKey:"tokens",cell:e=>{var s;return(null===(s=e.getValue())||void 0===s?void 0:s.toLocaleString())||0}}],data:s,renderSubComponent:()=>(0,a.jsx)(a.Fragment,{}),getRowCanExpand:()=>!1})})]})}var ef=e=>{let{accessToken:s,entityType:t,entityId:k,userID:N,userRole:w,entityList:q,premiumUser:S,dateValue:C}=e,[D,L]=(0,b.useState)({results:[],metadata:{total_spend:0,total_api_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0}}),E=z(D,"models"),F=z(D,"api_keys"),[A,M]=(0,b.useState)([]),U=async()=>{if(!s||!C.from||!C.to)return;let e=new Date(C.from),a=new Date(C.to);if("tag"===t)L(await (0,Z.tagDailyActivityCall)(s,e,a,1,A.length>0?A:null));else if("team"===t)L(await (0,Z.teamDailyActivityCall)(s,e,a,1,A.length>0?A:null));else if("organization"===t)L(await (0,Z.organizationDailyActivityCall)(s,e,a,1,A.length>0?A:null));else if("customer"===t)L(await (0,Z.customerDailyActivityCall)(s,e,a,1,A.length>0?A:null));else throw Error("Invalid entity type")};(0,b.useEffect)(()=>{U()},[s,C,k,A]);let V=()=>{let e={};return D.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={provider:t,spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=a.metrics.spend,e[t].requests+=a.metrics.api_requests,e[t].successful_requests+=a.metrics.successful_requests,e[t].failed_requests+=a.metrics.failed_requests,e[t].tokens+=a.metrics.total_tokens}catch(e){console.error("Error processing provider ".concat(t,": ").concat(e))}})}),Object.values(e).filter(e=>e.spend>0).sort((e,s)=>s.spend-e.spend)},R=e=>0===A.length?e:e.filter(e=>A.includes(e.metadata.id)),I=()=>{let e={};return D.results.forEach(s=>{Object.entries(s.breakdown.entities||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{alias:a.metadata.team_alias||t,id:t}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests,e[t].metrics.failed_requests+=a.metrics.failed_requests,e[t].metrics.total_tokens+=a.metrics.total_tokens})}),R(Object.values(e).sort((e,s)=>s.metrics.spend-e.metrics.spend))},$=t.charAt(0).toUpperCase()+t.slice(1);return(0,a.jsxs)("div",{style:{width:"100%"},className:"relative",children:[(0,a.jsx)(ep,{dateValue:C,entityType:t,spendData:D,showFilters:null!==q&&q.length>0,filterLabel:"Filter by ".concat(t),filterPlaceholder:"Select ".concat(t," to filter..."),selectedFilters:A,onFiltersChange:M,filterOptions:(()=>{if(q)return q})()||void 0}),(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{variant:"solid",className:"mt-1",children:[(0,a.jsx)(o.Z,{children:"Cost"}),(0,a.jsx)(o.Z,{children:"Model Activity"}),(0,a.jsx)(o.Z,{children:"Key Activity"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsx)(m.Z,{children:(0,a.jsxs)(c.Z,{numItems:2,className:"gap-2 w-full",children:[(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)(v.Z,{children:[$," Spend Overview"]}),(0,a.jsxs)(c.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Spend"}),(0,a.jsxs)(y.Z,{className:"text-2xl font-bold mt-2",children:["$",(0,T.pw)(D.metadata.total_spend,2)]})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2",children:D.metadata.total_api_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Successful Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:D.metadata.total_successful_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Failed Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:D.metadata.total_failed_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Tokens"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2",children:D.metadata.total_tokens.toLocaleString()})]})]})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Daily Spend"}),(0,a.jsx)(r.Z,{data:[...D.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:O,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload,l=Object.keys(r.breakdown.entities||{}).length;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.date}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Total Spend: $",(0,T.pw)(r.metrics.spend,2)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",r.metrics.api_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Successful: ",r.metrics.successful_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Failed: ",r.metrics.failed_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total Tokens: ",r.metrics.total_tokens]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total ",$,"s: ",l]}),(0,a.jsxs)("div",{className:"mt-2 border-t pt-2",children:[(0,a.jsxs)("p",{className:"font-semibold",children:["Spend by ",$,":"]}),Object.entries(r.breakdown.entities||{}).sort((e,s)=>{let[,t]=e,[,a]=s,r=t.metrics.spend;return a.metrics.spend-r}).slice(0,5).map(e=>{let[s,t]=e;return(0,a.jsxs)("p",{className:"text-sm text-gray-600",children:[t.metadata.team_alias||s,": $",(0,T.pw)(t.metrics.spend,2)]},s)}),l>5&&(0,a.jsxs)("p",{className:"text-sm text-gray-500 italic",children:["...and ",l-5," more"]})]})]})}})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsx)(l.Z,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,a.jsxs)(v.Z,{children:["Spend Per ",$]}),(0,a.jsx)(Q.Z,{className:"text-xs",children:"Showing Top 5 by Spend"}),(0,a.jsxs)("div",{className:"flex items-center text-sm text-gray-500",children:[(0,a.jsxs)("span",{children:["Get Started by Tracking cost per ",$," "]}),(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/enterprise#spend-tracking",className:"text-blue-500 hover:text-blue-700 ml-1",children:"here"})]})]}),(0,a.jsxs)(c.Z,{numItems:2,className:"gap-6",children:[(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsx)(r.Z,{className:"mt-4 h-52",data:I().slice(0,5).map(e=>({...e,metadata:{...e.metadata,alias_display:e.metadata.alias&&e.metadata.alias.length>15?"".concat(e.metadata.alias.slice(0,15),"..."):e.metadata.alias}})),index:"metadata.alias_display",categories:["metrics.spend"],colors:["cyan"],valueFormatter:O,layout:"vertical",showLegend:!1,yAxisWidth:150,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.metadata.alias}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,T.pw)(r.metrics.spend,4)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Requests: ",r.metrics.api_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-green-600",children:["Successful: ",r.metrics.successful_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-red-600",children:["Failed: ",r.metrics.failed_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.metrics.total_tokens.toLocaleString()]})]})}})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsx)("div",{className:"h-52 overflow-y-auto",children:(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:(0,a.jsxs)(f.Z,{children:[(0,a.jsx)(g.Z,{children:$}),(0,a.jsx)(g.Z,{children:"Spend"}),(0,a.jsx)(g.Z,{className:"text-green-600",children:"Successful"}),(0,a.jsx)(g.Z,{className:"text-red-600",children:"Failed"}),(0,a.jsx)(g.Z,{children:"Tokens"})]})}),(0,a.jsx)(p.Z,{children:I().filter(e=>e.metrics.spend>0).map(e=>(0,a.jsxs)(f.Z,{children:[(0,a.jsx)(j.Z,{children:e.metadata.alias}),(0,a.jsxs)(j.Z,{children:["$",(0,T.pw)(e.metrics.spend,4)]}),(0,a.jsx)(j.Z,{className:"text-green-600",children:e.metrics.successful_requests.toLocaleString()}),(0,a.jsx)(j.Z,{className:"text-red-600",children:e.metrics.failed_requests.toLocaleString()}),(0,a.jsx)(j.Z,{children:e.metrics.total_tokens.toLocaleString()})]},e.metadata.id))})]})})})]})]})})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Top Virtual Keys"}),(0,a.jsx)(X.Z,{topKeys:(()=>{console.log("debugTags",{spendData:D});let e={};return D.results.forEach(s=>{let{breakdown:t}=s,{entities:a}=t;console.log("debugTags",{entities:a});let r=Object.keys(a).reduce((e,s)=>{let{api_key_breakdown:t}=a[s];return Object.keys(t).forEach(a=>{let r={tag:s,usage:t[a].metrics.spend};e[a]?e[a].push(r):e[a]=[r]}),e},{});console.log("debugTags",{tagDictionary:r}),Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:a.metadata.key_alias,team_id:a.metadata.team_id||null,tags:r[t]||[]}},console.log("debugTags",{keySpend:e})),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests,e[t].metrics.failed_requests+=a.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",tags:t.metadata.tags||"-",spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),accessToken:s,userID:N,userRole:w,teams:null,premiumUser:S,showTags:"tag"===t})]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Top Models"}),(0,a.jsx)(eg,{topModels:(()=>{let e={};return D.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=a.metrics.spend}catch(e){console.error("Error adding spend for ".concat(t,": ").concat(e,", got metrics: ").concat(JSON.stringify(a)))}e[t].requests+=a.metrics.api_requests,e[t].successful_requests+=a.metrics.successful_requests,e[t].failed_requests+=a.metrics.failed_requests,e[t].tokens+=a.metrics.total_tokens})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,...t}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})()})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsx)(l.Z,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsx)(v.Z,{children:"Provider Usage"}),(0,a.jsxs)(c.Z,{numItems:2,children:[(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsx)(i.Z,{className:"mt-4 h-40",data:V(),index:"provider",category:"spend",valueFormatter:e=>"$".concat((0,T.pw)(e,2)),colors:["cyan","blue","indigo","violet","purple"]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:(0,a.jsxs)(f.Z,{children:[(0,a.jsx)(g.Z,{children:"Provider"}),(0,a.jsx)(g.Z,{children:"Spend"}),(0,a.jsx)(g.Z,{className:"text-green-600",children:"Successful"}),(0,a.jsx)(g.Z,{className:"text-red-600",children:"Failed"}),(0,a.jsx)(g.Z,{children:"Tokens"})]})}),(0,a.jsx)(p.Z,{children:V().map(e=>(0,a.jsxs)(f.Z,{children:[(0,a.jsx)(j.Z,{children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[e.provider&&(0,a.jsx)("img",{src:(0,ee.dr)(e.provider).logo,alt:"".concat(e.provider," logo"),className:"w-4 h-4",onError:s=>{let t=s.target,a=t.parentElement;if(a){var r;let s=document.createElement("div");s.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",s.textContent=(null===(r=e.provider)||void 0===r?void 0:r.charAt(0))||"-",a.replaceChild(s,t)}}}),(0,a.jsx)("span",{children:e.provider})]})}),(0,a.jsxs)(j.Z,{children:["$",(0,T.pw)(e.spend,2)]}),(0,a.jsx)(j.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,a.jsx)(j.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,a.jsx)(j.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})})]})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(Y,{modelMetrics:E})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(Y,{modelMetrics:F})})]})]})]})},ey=t(5540),ev=t(49634),ek=t(77398),eb=t.n(ek);let eZ=[{label:"Today",shortLabel:"today",getValue:()=>({from:eb()().startOf("day").toDate(),to:eb()().endOf("day").toDate()})},{label:"Last 7 days",shortLabel:"7d",getValue:()=>({from:eb()().subtract(7,"days").startOf("day").toDate(),to:eb()().endOf("day").toDate()})},{label:"Last 30 days",shortLabel:"30d",getValue:()=>({from:eb()().subtract(30,"days").startOf("day").toDate(),to:eb()().endOf("day").toDate()})},{label:"Month to date",shortLabel:"MTD",getValue:()=>({from:eb()().startOf("month").toDate(),to:eb()().endOf("day").toDate()})},{label:"Year to date",shortLabel:"YTD",getValue:()=>({from:eb()().startOf("year").toDate(),to:eb()().endOf("day").toDate()})}];var eN=e=>{let{value:s,onValueChange:t,label:r="Select Time Range",showTimeRange:l=!0}=e,[n,i]=(0,b.useState)(!1),[c,o]=(0,b.useState)(s),[d,u]=(0,b.useState)(null),[m,x]=(0,b.useState)(""),[h,p]=(0,b.useState)(""),j=(0,b.useRef)(null),_=(0,b.useCallback)(e=>{if(!e.from||!e.to)return null;for(let s of eZ){let t=s.getValue(),a=eb()(e.from).isSame(eb()(t.from),"day"),r=eb()(e.to).isSame(eb()(t.to),"day");if(a&&r)return s.shortLabel}return null},[]);(0,b.useEffect)(()=>{u(_(s))},[s,_]);let g=(0,b.useCallback)(()=>{if(!m||!h)return{isValid:!0,error:""};let e=eb()(m,"YYYY-MM-DD"),s=eb()(h,"YYYY-MM-DD");return e.isValid()&&s.isValid()?s.isBefore(e)?{isValid:!1,error:"End date cannot be before start date"}:{isValid:!0,error:""}:{isValid:!1,error:"Invalid date format"}},[m,h])();(0,b.useEffect)(()=>{s.from&&x(eb()(s.from).format("YYYY-MM-DD")),s.to&&p(eb()(s.to).format("YYYY-MM-DD")),o(s)},[s]),(0,b.useEffect)(()=>{let e=e=>{j.current&&!j.current.contains(e.target)&&i(!1)};return n&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[n]);let f=(0,b.useCallback)((e,s)=>{if(!e||!s)return"Select date range";let t=e=>eb()(e).format("D MMM, HH:mm");return"".concat(t(e)," - ").concat(t(s))},[]),y=(0,b.useCallback)(e=>{let s;if(!e.from)return e;let t={...e},a=new Date(e.from);return s=new Date(e.to?e.to:e.from),a.toDateString(),s.toDateString(),a.setHours(0,0,0,0),s.setHours(23,59,59,999),t.from=a,t.to=s,t},[]),v=e=>{let{from:s,to:t}=e.getValue();o({from:s,to:t}),u(e.shortLabel),x(eb()(s).format("YYYY-MM-DD")),p(eb()(t).format("YYYY-MM-DD"))},k=(0,b.useCallback)(()=>{try{if(m&&h&&g.isValid){let e=eb()(m,"YYYY-MM-DD").startOf("day"),s=eb()(h,"YYYY-MM-DD").endOf("day");if(e.isValid()&&s.isValid()){let t={from:e.toDate(),to:s.toDate()};o(t);let a=_(t);u(a)}}}catch(e){console.warn("Invalid date format:",e)}},[m,h,g.isValid,_]);return(0,b.useEffect)(()=>{k()},[k]),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[r&&(0,a.jsx)(eh.x,{className:"text-sm font-medium text-gray-700 whitespace-nowrap",children:r}),(0,a.jsxs)("div",{className:"relative",ref:j,children:[(0,a.jsx)("div",{className:"w-[300px] px-3 py-2 text-sm border border-gray-300 rounded-md bg-white cursor-pointer hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500",onClick:()=>i(!n),children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(ey.Z,{className:"text-gray-600"}),(0,a.jsx)("span",{className:"text-gray-900",children:f(s.from,s.to)})]}),(0,a.jsx)("svg",{className:"w-4 h-4 text-gray-400 transition-transform ".concat(n?"rotate-180":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&(0,a.jsx)("div",{className:"absolute top-full left-0 z-[9999] min-w-[600px] mt-1 bg-white border border-gray-200 rounded-lg shadow-xl",children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsxs)("div",{className:"w-1/2 border-r border-gray-200",children:[(0,a.jsx)("div",{className:"p-3 border-b border-gray-200",children:(0,a.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:"Relative time"})}),(0,a.jsx)("div",{className:"h-[350px] overflow-y-auto",children:eZ.map(e=>{let s=d===e.shortLabel;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 cursor-pointer border-b border-gray-100 transition-colors ".concat(s?"bg-blue-50 hover:bg-blue-100 border-blue-200":"hover:bg-gray-50"),onClick:()=>v(e),children:[(0,a.jsx)("span",{className:"text-sm ".concat(s?"text-blue-700 font-medium":"text-gray-700"),children:e.label}),(0,a.jsx)("span",{className:"text-xs px-2 py-1 rounded capitalize ".concat(s?"text-blue-700 bg-blue-100":"text-gray-500 bg-gray-100"),children:e.shortLabel})]},e.label)})})]}),(0,a.jsxs)("div",{className:"w-1/2 relative",children:[(0,a.jsx)("div",{className:"p-3.5 border-b border-gray-200",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(ev.Z,{className:"text-gray-600"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:"Start and end dates"})]})}),(0,a.jsxs)("div",{className:"p-6 space-y-6 pb-20",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm text-gray-700 mb-1 block",children:"Start date"}),(0,a.jsx)("input",{type:"date",value:m,onChange:e=>x(e.target.value),className:"w-65 px-3 py-2 text-sm border rounded-md cursor-pointer hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 ".concat(g.isValid?"border-gray-300":"border-red-300 focus:border-red-500 focus:ring-red-200")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm text-gray-700 mb-1 block",children:"End date"}),(0,a.jsx)("input",{type:"date",value:h,onChange:e=>p(e.target.value),className:"w-65 px-3 py-2 text-sm border rounded-md cursor-pointer hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 ".concat(g.isValid?"border-gray-300":"border-red-300 focus:border-red-500 focus:ring-red-200")})]}),!g.isValid&&g.error&&(0,a.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("svg",{className:"w-4 h-4 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),(0,a.jsx)("span",{className:"text-sm text-red-700 font-medium",children:g.error})]})}),c.from&&c.to&&g.isValid&&(0,a.jsxs)("div",{className:"bg-blue-50 p-3 rounded-md space-y-1",children:[(0,a.jsxs)("div",{className:"text-xs text-blue-800",children:[(0,a.jsx)("span",{className:"font-medium",children:"From:"})," ",eb()(c.from).format("MMM D, YYYY [at] HH:mm:ss")]}),(0,a.jsxs)("div",{className:"text-xs text-blue-800",children:[(0,a.jsx)("span",{className:"font-medium",children:"To:"})," ",eb()(c.to).format("MMM D, YYYY [at] HH:mm:ss")]})]})]}),(0,a.jsx)("div",{className:"absolute bottom-4 right-4",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(eh.z,{variant:"secondary",onClick:()=>{o(s),s.from&&x(eb()(s.from).format("YYYY-MM-DD")),s.to&&p(eb()(s.to).format("YYYY-MM-DD")),u(_(s)),i(!1)},children:"Cancel"}),(0,a.jsx)(eh.z,{onClick:()=>{c.from&&c.to&&g.isValid&&(t(c),requestIdleCallback(()=>{t(y(c))},{timeout:100}),i(!1))},disabled:!c.from||!c.to||!g.isValid,children:"Apply"})]})})]})]})})]})]})},ew=t(91323);let eq=e=>{let{isDateChanging:s=!1}=e;return(0,a.jsx)("div",{className:"flex items-center justify-center h-40",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,a.jsx)(ew.S,{className:"size-5"}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"text-gray-600 text-sm font-medium",children:s?"Processing date selection...":"Loading chart data..."}),(0,a.jsx)("span",{className:"text-gray-400 text-xs mt-1",children:s?"This will only take a moment":"Fetching your data"})]})]})})};var eS=t(35829),eC=t(99981),eT=e=>{let{accessToken:s,selectedTags:t,formatAbbreviatedNumber:l}=e,[n,i]=(0,b.useState)({results:[],total_count:0,page:1,page_size:50,total_pages:0}),[c,k]=(0,b.useState)(!1),[N,w]=(0,b.useState)(1),q=async()=>{if(s){k(!0);try{let e=await (0,Z.perUserAnalyticsCall)(s,N,50,t.length>0?t:void 0);i(e)}catch(e){console.error("Failed to fetch per-user data:",e)}finally{k(!1)}}};return(0,b.useEffect)(()=>{q()},[s,t,N]),(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(v.Z,{children:"Per User Usage"}),(0,a.jsx)(Q.Z,{children:"Individual developer usage metrics"}),(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{className:"mb-6",children:[(0,a.jsx)(o.Z,{children:"User Details"}),(0,a.jsx)(o.Z,{children:"Usage Distribution"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)(m.Z,{children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:(0,a.jsxs)(f.Z,{children:[(0,a.jsx)(g.Z,{children:"User ID"}),(0,a.jsx)(g.Z,{children:"User Email"}),(0,a.jsx)(g.Z,{children:"User Agent"}),(0,a.jsx)(g.Z,{className:"text-right",children:"Success Generations"}),(0,a.jsx)(g.Z,{className:"text-right",children:"Total Tokens"}),(0,a.jsx)(g.Z,{className:"text-right",children:"Failed Requests"}),(0,a.jsx)(g.Z,{className:"text-right",children:"Total Cost"})]})}),(0,a.jsx)(p.Z,{children:n.results.slice(0,10).map((e,s)=>(0,a.jsxs)(f.Z,{children:[(0,a.jsx)(j.Z,{children:(0,a.jsx)(y.Z,{className:"font-medium",children:e.user_id})}),(0,a.jsx)(j.Z,{children:(0,a.jsx)(y.Z,{children:e.user_email||"N/A"})}),(0,a.jsx)(j.Z,{children:(0,a.jsx)(y.Z,{children:e.user_agent||"Unknown"})}),(0,a.jsx)(j.Z,{className:"text-right",children:(0,a.jsx)(y.Z,{children:l(e.successful_requests)})}),(0,a.jsx)(j.Z,{className:"text-right",children:(0,a.jsx)(y.Z,{children:l(e.total_tokens)})}),(0,a.jsx)(j.Z,{className:"text-right",children:(0,a.jsx)(y.Z,{children:l(e.failed_requests)})}),(0,a.jsx)(j.Z,{className:"text-right",children:(0,a.jsxs)(y.Z,{children:["$",l(e.spend,4)]})})]},s))})]}),n.results.length>10&&(0,a.jsxs)("div",{className:"mt-4 flex justify-between items-center",children:[(0,a.jsxs)(y.Z,{className:"text-sm text-gray-500",children:["Showing 10 of ",n.total_count," results"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(I.Z,{size:"sm",variant:"secondary",onClick:()=>{N>1&&w(N-1)},disabled:1===N,children:"Previous"}),(0,a.jsx)(I.Z,{size:"sm",variant:"secondary",onClick:()=>{N=n.total_pages,children:"Next"})]})]})]}),(0,a.jsxs)(m.Z,{children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)(v.Z,{className:"text-lg",children:"User Usage Distribution"}),(0,a.jsx)(Q.Z,{children:"Number of users by successful request frequency"})]}),(0,a.jsx)(r.Z,{data:(()=>{let e=new Map;n.results.forEach(s=>{let t=s.user_agent||"Unknown";e.set(t,(e.get(t)||0)+1)});let s=Array.from(e.entries()).sort((e,s)=>{let[,t]=e,[,a]=s;return a-t}).slice(0,8).map(e=>{let[s]=e;return s}),t={"1-9 requests":{range:[1,9],agents:{}},"10-99 requests":{range:[10,99],agents:{}},"100-999 requests":{range:[100,999],agents:{}},"1K-9.9K requests":{range:[1e3,9999],agents:{}},"10K-99.9K requests":{range:[1e4,99999],agents:{}},"100K+ requests":{range:[1e5,1/0],agents:{}}};return n.results.forEach(e=>{let a=e.successful_requests,r=e.user_agent||"Unknown";s.includes(r)&&Object.entries(t).forEach(e=>{let[s,t]=e;a>=t.range[0]&&a<=t.range[1]&&(t.agents[r]||(t.agents[r]=0),t.agents[r]++)})}),Object.entries(t).map(e=>{let[t,a]=e,r={category:t};return s.forEach(e=>{r[e]=a.agents[e]||0}),r})})(),index:"category",categories:(()=>{let e=new Map;return n.results.forEach(s=>{let t=s.user_agent||"Unknown";e.set(t,(e.get(t)||0)+1)}),Array.from(e.entries()).sort((e,s)=>{let[,t]=e,[,a]=s;return a-t}).slice(0,8).map(e=>{let[s]=e;return s})})(),colors:["blue","green","orange","red","purple","yellow","pink","indigo"],valueFormatter:e=>"".concat(e," users"),yAxisWidth:80,showLegend:!0,stack:!0})]})]})]})]})},eD=e=>{let{accessToken:s,userRole:t,dateValue:n,onDateChange:i}=e,[h,p]=(0,b.useState)({results:[]}),[j,_]=(0,b.useState)({results:[]}),[g,f]=(0,b.useState)({results:[]}),[k,N]=(0,b.useState)({results:[]}),[w,q]=(0,b.useState)(""),[S,C]=(0,b.useState)([]),[T,D]=(0,b.useState)([]),[L,E]=(0,b.useState)(!1),[F,O]=(0,b.useState)(!1),[A,M]=(0,b.useState)(!1),[U,V]=(0,b.useState)(!1),[Y,R]=(0,b.useState)(!1),z=new Date,I=async()=>{if(s){E(!0);try{let e=await (0,Z.tagDistinctCall)(s);C(e.results.map(e=>e.tag))}catch(e){console.error("Failed to fetch available tags:",e)}finally{E(!1)}}},$=async()=>{if(s){O(!0);try{let e=await (0,Z.tagDauCall)(s,z,w||void 0,T.length>0?T:void 0);p(e)}catch(e){console.error("Failed to fetch DAU data:",e)}finally{O(!1)}}},K=async()=>{if(s){M(!0);try{let e=await (0,Z.tagWauCall)(s,z,w||void 0,T.length>0?T:void 0);_(e)}catch(e){console.error("Failed to fetch WAU data:",e)}finally{M(!1)}}},P=async()=>{if(s){V(!0);try{let e=await (0,Z.tagMauCall)(s,z,w||void 0,T.length>0?T:void 0);f(e)}catch(e){console.error("Failed to fetch MAU data:",e)}finally{V(!1)}}},W=async()=>{if(s&&n.from&&n.to){R(!0);try{let e=await (0,Z.userAgentSummaryCall)(s,n.from,n.to,T.length>0?T:void 0);N(e)}catch(e){console.error("Failed to fetch user agent summary data:",e)}finally{R(!1)}}};(0,b.useEffect)(()=>{I()},[s]),(0,b.useEffect)(()=>{if(!s)return;let e=setTimeout(()=>{$(),K(),P()},50);return()=>clearTimeout(e)},[s,w,T]),(0,b.useEffect)(()=>{if(!n.from||!n.to)return;let e=setTimeout(()=>{W()},50);return()=>clearTimeout(e)},[s,n,T]);let H=e=>e.startsWith("User-Agent: ")?e.replace("User-Agent: ",""):e,G=e=>e.length>15?e.substring(0,15)+"...":e,J=e=>Object.entries(e.reduce((e,s)=>(e[s.tag]=(e[s.tag]||0)+s.active_users,e),{})).sort((e,s)=>{let[,t]=e,[,a]=s;return a-t}).map(e=>{let[s]=e;return s}),X=J(h.results).slice(0,10),ee=J(j.results).slice(0,10),es=J(g.results).slice(0,10),et=(()=>{let e=[],s=new Date;for(let t=6;t>=0;t--){let a=new Date(s);a.setDate(a.getDate()-t);let r={date:a.toISOString().split("T")[0]};X.forEach(e=>{r[H(e)]=0}),e.push(r)}return h.results.forEach(s=>{let t=H(s.tag),a=e.find(e=>e.date===s.date);a&&(a[t]=s.active_users)}),e})(),ea=(()=>{let e=[];for(let s=1;s<=7;s++){let t={week:"Week ".concat(s)};ee.forEach(e=>{t[H(e)]=0}),e.push(t)}return j.results.forEach(s=>{let t=H(s.tag),a=s.date.match(/Week (\d+)/);if(a){let r="Week ".concat(a[1]),l=e.find(e=>e.week===r);l&&(l[t]=s.active_users)}}),e})(),er=(()=>{let e=[];for(let s=1;s<=7;s++){let t={month:"Month ".concat(s)};es.forEach(e=>{t[H(e)]=0}),e.push(t)}return g.results.forEach(s=>{let t=H(s.tag),a=s.date.match(/Month (\d+)/);if(a){let r="Month ".concat(a[1]),l=e.find(e=>e.month===r);l&&(l[t]=s.active_users)}}),e})(),el=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e>=1e8||e>=1e7||e>=1e6?(e/1e6).toFixed(s)+"M":e>=1e4?(e/1e3).toFixed(s)+"K":e>=1e3?(e/1e3).toFixed(s)+"K":e.toFixed(s)};return(0,a.jsxs)("div",{className:"space-y-6 mt-6",children:[(0,a.jsx)(l.Z,{children:(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(v.Z,{children:"Summary by User Agent"}),(0,a.jsx)(Q.Z,{children:"Performance metrics for different user agents"})]}),(0,a.jsxs)("div",{className:"w-96",children:[(0,a.jsx)(y.Z,{className:"text-sm font-medium block mb-2",children:"Filter by User Agents"}),(0,a.jsx)(B.default,{mode:"multiple",placeholder:"All User Agents",value:T,onChange:D,style:{width:"100%"},showSearch:!0,allowClear:!0,loading:L,optionFilterProp:"label",className:"rounded-md",maxTagCount:"responsive",children:S.map(e=>{let s=H(e),t=s.length>50?"".concat(s.substring(0,50),"..."):s;return(0,a.jsx)(B.default.Option,{value:e,label:t,title:s,children:t},e)})})]})]}),Y?(0,a.jsx)(eq,{isDateChanging:!1}):(0,a.jsxs)(c.Z,{numItems:4,className:"gap-4",children:[(k.results||[]).slice(0,4).map((e,s)=>{let t=H(e.tag),r=G(t);return(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(eC.Z,{title:t,placement:"top",children:(0,a.jsx)(v.Z,{className:"truncate",children:r})}),(0,a.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Success Requests"}),(0,a.jsx)(eS.Z,{className:"text-lg",children:el(e.successful_requests)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Total Tokens"}),(0,a.jsx)(eS.Z,{className:"text-lg",children:el(e.total_tokens)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Total Cost"}),(0,a.jsxs)(eS.Z,{className:"text-lg",children:["$",el(e.total_spend,4)]})]})]})]},s)}),Array.from({length:Math.max(0,4-(k.results||[]).length)}).map((e,s)=>(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"No Data"}),(0,a.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Success Requests"}),(0,a.jsx)(eS.Z,{className:"text-lg",children:"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Total Tokens"}),(0,a.jsx)(eS.Z,{className:"text-lg",children:"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Total Cost"}),(0,a.jsx)(eS.Z,{className:"text-lg",children:"-"})]})]})]},"empty-".concat(s)))]})]})}),(0,a.jsx)(l.Z,{children:(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{className:"mb-6",children:[(0,a.jsx)(o.Z,{children:"DAU/WAU/MAU"}),(0,a.jsx)(o.Z,{children:"Per User Usage (Last 30 Days)"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)(m.Z,{children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(v.Z,{children:"DAU, WAU & MAU per Agent"}),(0,a.jsx)(Q.Z,{children:"Active users across different time periods"})]}),(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{className:"mb-6",children:[(0,a.jsx)(o.Z,{children:"DAU"}),(0,a.jsx)(o.Z,{children:"WAU"}),(0,a.jsx)(o.Z,{children:"MAU"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)(m.Z,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(v.Z,{className:"text-lg",children:"Daily Active Users - Last 7 Days"})}),F?(0,a.jsx)(eq,{isDateChanging:!1}):(0,a.jsx)(r.Z,{data:et,index:"date",categories:X.map(H),valueFormatter:e=>el(e),yAxisWidth:60,showLegend:!0,stack:!0})]}),(0,a.jsxs)(m.Z,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(v.Z,{className:"text-lg",children:"Weekly Active Users - Last 7 Weeks"})}),A?(0,a.jsx)(eq,{isDateChanging:!1}):(0,a.jsx)(r.Z,{data:ea,index:"week",categories:ee.map(H),valueFormatter:e=>el(e),yAxisWidth:60,showLegend:!0,stack:!0})]}),(0,a.jsxs)(m.Z,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(v.Z,{className:"text-lg",children:"Monthly Active Users - Last 7 Months"})}),U?(0,a.jsx)(eq,{isDateChanging:!1}):(0,a.jsx)(r.Z,{data:er,index:"month",categories:es.map(H),valueFormatter:e=>el(e),yAxisWidth:60,showLegend:!0,stack:!0})]})]})]})]}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(eT,{accessToken:s,selectedTags:T,formatAbbreviatedNumber:el})})]})]})})]})},eL=t(47375),eE=e=>{var s,t,N,w,S,L,E,F,A,M;let{accessToken:U,userRole:V,userID:R,teams:I,organizations:$,premiumUser:K}=e,[P,W]=(0,b.useState)({results:[],metadata:{}}),[B,H]=(0,b.useState)(!1),[G,Q]=(0,b.useState)(!1),es=(0,b.useMemo)(()=>new Date(Date.now()-6048e5),[]),et=(0,b.useMemo)(()=>new Date,[]),[ea,er]=(0,b.useState)({from:es,to:et}),[el,en]=(0,b.useState)([]),{data:ei=[]}=C(U,V),[ec,eo]=(0,b.useState)("groups"),[ed,eu]=(0,b.useState)(!1),[em,eh]=(0,b.useState)(!1),[ep,ej]=(0,b.useState)(!0),[e_,eg]=(0,b.useState)(!0),ey=async()=>{U&&en(Object.values(await (0,Z.tagListCall)(U)).map(e=>({label:e.name,value:e.name})))};(0,b.useEffect)(()=>{ey()},[U]);let ev=(null===(s=P.metadata)||void 0===s?void 0:s.total_spend)||0,ek=()=>{let e={};return P.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests||0,e[t].metrics.failed_requests+=a.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{provider:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}})},eb=(0,b.useCallback)(async()=>{if(!U||!ea.from||!ea.to)return;H(!0);let e=new Date(ea.from),s=new Date(ea.to);try{try{let t=await (0,Z.userDailyActivityAggregatedCall)(U,e,s);W(t);return}catch(e){}let t=await (0,Z.userDailyActivityCall)(U,e,s);if(t.metadata.total_pages<=1){W(t);return}let a=[...t.results],r={...t.metadata};for(let l=2;l<=t.metadata.total_pages;l++){let t=await (0,Z.userDailyActivityCall)(U,e,s,l);a.push(...t.results),t.metadata&&(r.total_spend+=t.metadata.total_spend||0,r.total_api_requests+=t.metadata.total_api_requests||0,r.total_successful_requests+=t.metadata.total_successful_requests||0,r.total_failed_requests+=t.metadata.total_failed_requests||0,r.total_tokens+=t.metadata.total_tokens||0)}W({results:a,metadata:r})}catch(e){console.error("Error fetching user spend data:",e)}finally{H(!1),Q(!1)}},[U,ea.from,ea.to]),eZ=(0,b.useCallback)(e=>{Q(!0),H(!0),er(e)},[]);(0,b.useEffect)(()=>{if(!ea.from||!ea.to)return;let e=setTimeout(()=>{eb()},50);return()=>clearTimeout(e)},[eb]);let ew=z(P,"models"),eS=z(P,"api_keys"),eC=z(P,"mcp_servers");return(0,a.jsxs)("div",{style:{width:"100%"},className:"p-8 relative",children:[(0,a.jsx)("div",{className:"flex items-end justify-between gap-6 mb-6",children:(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)("div",{className:"flex items-end justify-start gap-6 mb-6",children:[(0,a.jsxs)(u.Z,{variant:"solid",children:[q.ZL.includes(V||"")?(0,a.jsx)(o.Z,{children:"Global Usage"}):(0,a.jsx)(o.Z,{children:"Your Usage"}),q.ZL.includes(V||"")?(0,a.jsx)(o.Z,{children:"Organization Usage"}):(0,a.jsx)(o.Z,{children:"Your Organization Usage"}),(0,a.jsx)(o.Z,{children:"Team Usage"}),q.ZL.includes(V||"")?(0,a.jsx)(o.Z,{children:"Customer Usage"}):(0,a.jsx)(a.Fragment,{}),q.ZL.includes(V||"")?(0,a.jsx)(o.Z,{children:"Tag Usage"}):(0,a.jsx)(a.Fragment,{}),q.ZL.includes(V||"")?(0,a.jsx)(o.Z,{children:"User Agent Activity"}):(0,a.jsx)(a.Fragment,{})]}),(0,a.jsx)(eN,{value:ea,onValueChange:eZ})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsx)(m.Z,{children:(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsxs)(u.Z,{variant:"solid",className:"mt-1",children:[(0,a.jsx)(o.Z,{children:"Cost"}),(0,a.jsx)(o.Z,{children:"Model Activity"}),(0,a.jsx)(o.Z,{children:"Key Activity"}),(0,a.jsx)(o.Z,{children:"MCP Server Activity"})]}),(0,a.jsx)(D.z,{onClick:()=>eh(!0),icon:()=>(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),children:"Export Data"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsx)(m.Z,{children:(0,a.jsxs)(c.Z,{numItems:2,className:"gap-2 w-full",children:[(0,a.jsxs)(n.Z,{numColSpan:2,children:[(0,a.jsxs)(y.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend"," ",ea.from&&ea.to&&(0,a.jsxs)(a.Fragment,{children:[ea.from.toLocaleDateString("en-US",{month:"short",day:"numeric",year:ea.from.getFullYear()!==ea.to.getFullYear()?"numeric":void 0})," - ",ea.to.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]})]}),(0,a.jsx)(eL.Z,{userID:R,userRole:V,accessToken:U,userSpend:ev,selectedTeam:null,userMaxBudget:null})]}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Usage Metrics"}),(0,a.jsxs)(c.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2",children:(null===(N=P.metadata)||void 0===N?void 0:null===(t=N.total_api_requests)||void 0===t?void 0:t.toLocaleString())||0})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Successful Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:(null===(S=P.metadata)||void 0===S?void 0:null===(w=S.total_successful_requests)||void 0===w?void 0:w.toLocaleString())||0})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Failed Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:(null===(E=P.metadata)||void 0===E?void 0:null===(L=E.total_failed_requests)||void 0===L?void 0:L.toLocaleString())||0})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Tokens"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2",children:(null===(A=P.metadata)||void 0===A?void 0:null===(F=A.total_tokens)||void 0===F?void 0:F.toLocaleString())||0})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Average Cost per Request"}),(0,a.jsxs)(y.Z,{className:"text-2xl font-bold mt-2",children:["$",(0,T.pw)((ev||0)/((null===(M=P.metadata)||void 0===M?void 0:M.total_api_requests)||1),4)]})]})]})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Daily Spend"}),B?(0,a.jsx)(eq,{isDateChanging:G}):(0,a.jsx)(r.Z,{data:[...P.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:O,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.date}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,T.pw)(r.metrics.spend,2)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Requests: ",r.metrics.api_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Successful: ",r.metrics.successful_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Failed: ",r.metrics.failed_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.metrics.total_tokens]})]})}})]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(l.Z,{className:"h-full",children:[(0,a.jsx)(v.Z,{children:"Top Virtual Keys"}),(0,a.jsx)(X.Z,{topKeys:(()=>{let e={};return P.results.forEach(s=>{Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:a.metadata.key_alias,team_id:null,tags:a.metadata.tags||[]}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests,e[t].metrics.failed_requests+=a.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),console.log("debugTags",{keySpend:e,userSpendData:P}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",tags:t.metadata.tags||[],spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),accessToken:U,userID:R,userRole:V,teams:null,premiumUser:K})]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(l.Z,{className:"h-full",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(v.Z,{children:"groups"===ec?"Top Public Model Names":"Top Litellm Models"}),(0,a.jsxs)("div",{className:"flex bg-gray-100 rounded-lg p-1",children:[(0,a.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("groups"===ec?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>eo("groups"),children:"Public Model Name"}),(0,a.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("individual"===ec?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>eo("individual"),children:"Litellm Model Name"})]})]}),B?(0,a.jsx)(eq,{isDateChanging:G}):(0,a.jsx)(r.Z,{className:"mt-4 h-40",data:"groups"===ec?(()=>{let e={};return P.results.forEach(s=>{Object.entries(s.breakdown.model_groups||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests||0,e[t].metrics.failed_requests+=a.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})():(()=>{let e={};return P.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests||0,e[t].metrics.failed_requests+=a.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),index:"key",categories:["spend"],colors:["cyan"],valueFormatter:O,layout:"vertical",yAxisWidth:200,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.key}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,T.pw)(r.spend,2)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",r.requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-green-600",children:["Successful: ",r.successful_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-red-600",children:["Failed: ",r.failed_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.tokens.toLocaleString()]})]})}})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{className:"h-full",children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,a.jsx)(v.Z,{children:"Spend by Provider"})}),B?(0,a.jsx)(eq,{isDateChanging:G}):(0,a.jsxs)(c.Z,{numItems:2,children:[(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsx)(i.Z,{className:"mt-4 h-40",data:ek(),index:"provider",category:"spend",valueFormatter:e=>"$".concat((0,T.pw)(e,2)),colors:["cyan"]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(_.Z,{children:(0,a.jsxs)(f.Z,{children:[(0,a.jsx)(g.Z,{children:"Provider"}),(0,a.jsx)(g.Z,{children:"Spend"}),(0,a.jsx)(g.Z,{className:"text-green-600",children:"Successful"}),(0,a.jsx)(g.Z,{className:"text-red-600",children:"Failed"}),(0,a.jsx)(g.Z,{children:"Tokens"})]})}),(0,a.jsx)(p.Z,{children:ek().filter(e=>e.spend>0).map(e=>(0,a.jsxs)(f.Z,{children:[(0,a.jsx)(j.Z,{children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[e.provider&&(0,a.jsx)("img",{src:(0,ee.dr)(e.provider).logo,alt:"".concat(e.provider," logo"),className:"w-4 h-4",onError:s=>{let t=s.target,a=t.parentElement;if(a){var r;let s=document.createElement("div");s.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",s.textContent=(null===(r=e.provider)||void 0===r?void 0:r.charAt(0))||"-",a.replaceChild(s,t)}}}),(0,a.jsx)("span",{children:e.provider})]})}),(0,a.jsxs)(j.Z,{children:["$",(0,T.pw)(e.spend,2)]}),(0,a.jsx)(j.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,a.jsx)(j.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,a.jsx)(j.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})]})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(Y,{modelMetrics:ew})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(Y,{modelMetrics:eS})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(Y,{modelMetrics:eC})})]})]})}),(0,a.jsxs)(m.Z,{children:[ep&&(0,a.jsx)(k.Z,{banner:!0,type:"info",message:"Organization usage is a new feature.",description:"Spend is tracked from feature launch and previous data isn't backfilled, so only future usage appears here.",closable:!0,onClose:()=>ej(!1),className:"mb-5"}),(0,a.jsx)(ef,{accessToken:U,entityType:"organization",userID:R,userRole:V,dateValue:ea,entityList:(null==$?void 0:$.map(e=>({label:e.organization_alias,value:e.organization_id})))||null,premiumUser:K})]}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(ef,{accessToken:U,entityType:"team",userID:R,userRole:V,entityList:(null==I?void 0:I.map(e=>({label:e.team_alias,value:e.team_id})))||null,premiumUser:K,dateValue:ea})}),(0,a.jsxs)(m.Z,{children:[e_&&(0,a.jsx)(k.Z,{banner:!0,type:"info",message:"Customer usage is a new feature.",description:"Spend is tracked from feature launch and previous data isn't backfilled, so only future usage appears here.",closable:!0,onClose:()=>eg(!1),className:"mb-5"}),(0,a.jsx)(ef,{accessToken:U,entityType:"customer",userID:R,userRole:V,entityList:(null==ei?void 0:ei.map(e=>({label:e.alias||e.user_id,value:e.user_id})))||null,premiumUser:K,dateValue:ea})]}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(ef,{accessToken:U,entityType:"tag",userID:R,userRole:V,entityList:el,premiumUser:K,dateValue:ea})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(eD,{accessToken:U,userRole:V,dateValue:ea})})]})]})})}),(0,a.jsx)(J,{isOpen:ed,onClose:()=>eu(!1),accessToken:U}),(0,a.jsx)(ex,{isOpen:em,onClose:()=>eh(!1),entityType:"team",spendData:{results:P.results,metadata:P.metadata},dateRange:ea,selectedFilters:[],customTitle:"Export Usage Data"})]})}},4863:function(e,s,t){t.d(s,{Z:function(){return p}});var a=t(57437),r=t(2265),l=t(62338),n=t(94292),i=t(19250);let c=e=>{let{key:s,info:t}=e;return{token:s,...t}};var o=t(12322),d=t(99981),u=t(16312),m=t(59872),x=t(44633),h=t(86462),p=e=>{let{topKeys:s,accessToken:t,userID:p,userRole:j,teams:_,premiumUser:g,showTags:f=!1}=e,[y,v]=(0,r.useState)(!1),[k,b]=(0,r.useState)(null),[Z,N]=(0,r.useState)(void 0),[w,q]=(0,r.useState)("table"),[S,C]=(0,r.useState)(new Set),T=e=>{C(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},D=async e=>{if(t)try{let s=await (0,i.keyInfoV1Call)(t,e.api_key),a=c(s);N(a),b(e.api_key),v(!0)}catch(e){console.error("Error fetching key info:",e)}},L=()=>{v(!1),b(null),N(void 0)};r.useEffect(()=>{let e=e=>{"Escape"===e.key&&y&&L()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[y]);let E=[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(d.Z,{title:e.getValue(),children:(0,a.jsx)(u.z,{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:()=>D(e.row.original),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"}],F={header:"Spend (USD)",accessorKey:"spend",cell:e=>{let s=e.getValue();return s>0&&s<.01?"<$0.01":"$".concat((0,m.pw)(s,2))}},O=f?[...E,{header:"Tags",accessorKey:"tags",cell:e=>{let s=e.getValue(),t=e.row.original.api_key,r=S.has(t);if(!s||0===s.length)return"-";let l=s.sort((e,s)=>s.usage-e.usage),n=r?l:l.slice(0,2),i=s.length>2;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[n.map((e,s)=>(0,a.jsx)(d.Z,{title:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Tag Name:"})," ",e.tag]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend:"})," ",e.usage>0&&e.usage<.01?"<$0.01":"$".concat((0,m.pw)(e.usage,2))]})]}),children:(0,a.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[e.tag.slice(0,7),"..."]})},s)),i&&(0,a.jsx)("button",{onClick:()=>T(t),className:"ml-1 p-1 hover:bg-gray-200 rounded-full transition-colors",title:r?"Show fewer tags":"Show all tags",children:r?(0,a.jsx)(x.Z,{className:"h-3 w-3 text-gray-500"}):(0,a.jsx)(h.Z,{className:"h-3 w-3 text-gray-500"})})]})})}},F]:[...E,F],A=s.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?"".concat(e.key_alias.slice(0,10),"..."):e.key_alias||"-"}));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>q("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===w?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,a.jsx)("button",{onClick:()=>q("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===w?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===w?(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(l.v,{className:"mt-4 h-40 cursor-pointer hover:opacity-90",data:A,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showLegend:!1,valueFormatter:e=>"$".concat((0,m.pw)(e,2)),onValueChange:e=>D(e),showTooltip:!0,customTooltip:e=>{var s,t;let r=null===(t=e.payload)||void 0===t?void 0:null===(s=t[0])||void 0===s?void 0:s.payload;return(0,a.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==r?void 0:r.key_alias})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==r?void 0:r.api_key})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,a.jsxs)("span",{className:"text-white font-medium",children:["$",(0,m.pw)(null==r?void 0:r.spend,2)]})]})]})})}})}):(0,a.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,a.jsx)(o.w,{columns:O,data:s,renderSubComponent:()=>(0,a.jsx)(a.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),y&&k&&Z&&(console.log("Rendering modal with:",{isModalOpen:y,selectedKey:k,keyData:Z}),(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&L()},children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,a.jsx)("button",{onClick:L,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,a.jsx)("div",{className:"p-6 h-full",children:(0,a.jsx)(n.Z,{keyId:k,onClose:L,keyData:Z,accessToken:t,userID:p,userRole:j,teams:_,premiumUser:g})})]})}))]})}},91323:function(e,s,t){t.d(s,{S:function(){return n}});var a=t(57437),r=t(2265),l=t(10012);function n(e){var s,t;let{className:n="",...i}=e,c=(0,r.useId)();return s=()=>{let e=document.getAnimations().filter(e=>e instanceof CSSAnimation&&"spin"===e.animationName),s=e.find(e=>{var s;return(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))===c}),t=e.find(e=>{var s;return e.effect instanceof KeyframeEffect&&(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))!==c});s&&t&&(s.currentTime=t.currentTime)},t=[c],(0,r.useLayoutEffect)(s,t),(0,a.jsxs)("svg",{"data-spinner-id":c,className:(0,l.cx)("pointer-events-none size-12 animate-spin text-current",n),fill:"none",viewBox:"0 0 24 24",...i,children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}},47375:function(e,s,t){var a=t(57437),r=t(2265),l=t(19250),n=t(59872);s.Z=e=>{let{userID:s,userRole:t,accessToken:i,userSpend:c,userMaxBudget:o,selectedTeam:d}=e;console.log("userSpend: ".concat(c));let[u,m]=(0,r.useState)(null!==c?c:0),[x,h]=(0,r.useState)(d?Number((0,n.pw)(d.max_budget,4)):null);(0,r.useEffect)(()=>{if(d){if("Default Team"===d.team_alias)h(o);else{let e=!1;if(d.team_memberships)for(let t of d.team_memberships)t.user_id===s&&"max_budget"in t.litellm_budget_table&&null!==t.litellm_budget_table.max_budget&&(h(t.litellm_budget_table.max_budget),e=!0);e||h(d.max_budget)}}},[d,o]);let[p,j]=(0,r.useState)([]);(0,r.useEffect)(()=>{let e=async()=>{if(!i||!s||!t)return};(async()=>{try{if(null===s||null===t)return;if(null!==i){let e=(await (0,l.modelAvailableCall)(i,s,t)).data.map(e=>e.id);console.log("available_model_names:",e),j(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[t,i,s]),(0,r.useEffect)(()=>{null!==c&&m(c)},[c]);let _=[];d&&d.models&&(_=d.models),_&&_.includes("all-proxy-models")?(console.log("user models:",p),_=p):_&&_.includes("all-team-models")?_=d.models:_&&0===_.length&&(_=p);let g=null!==x?"$".concat((0,n.pw)(Number(x),4)," limit"):"No limit",f=void 0!==u?(0,n.pw)(u,4):null;return console.log("spend in view user spend: ".concat(u)),(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,a.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",f]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,a.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:g})]})]})})}},10012:function(e,s,t){t.d(s,{cx:function(){return n}});var a=t(49096),r=t(53335);let{cva:l,cx:n,compose:i}=(0,a.ZD)({hooks:{onComplete:e=>(0,r.m6)(e)}})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9039-c2b251eebb008762.js b/litellm/proxy/_experimental/out/_next/static/chunks/9039-c2b251eebb008762.js new file mode 100644 index 00000000000..23588fc9066 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/9039-c2b251eebb008762.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9039],{69039:function(e,s,a){a.r(s),a.d(s,{default:function(){return ec}});var t=a(57437),r=a(2265),n=a(71253),l=a(9114),i=a(26430),o=a(96473),d=a(50010),c=a(26349),m=a(37592),u=a(4260),x=a(5545),g=a(99981),h=a(93837),p=a(27930),v=a(66830),f=a(95459),y=a(10703),j=a(91643),b=a(26832),N=a(32489),w=a(98728),k=a(79862),A=a(82222),C=a(51817),S=a(62831),T=a(17906),L=a(94263),P=a(88712),Z=a(94331),M=a(38398),E=a(33152);function U(e){let{messages:s,isLoading:a}=e;if(0===s.length)return(0,t.jsx)("div",{className:"h-full"});let r=[],n=0;for(;n(0,t.jsxs)("div",{className:"whitespace-pre-wrap break-words",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:[(0,t.jsx)(P.Z,{message:e}),(0,t.jsx)(S.UG,{components:{code(e){let{node:s,inline:a,className:r,children:n,...l}=e,i=/language-(\w+)/.exec(r||"");return!a&&i?(0,t.jsx)(T.Z,{style:L.Z,language:i[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...l,children:String(n).replace(/\n$/,"")}):(0,t.jsx)("code",{className:"".concat(r," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),...l,children:n})},pre:e=>{let{node:s,...a}=e;return(0,t.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...a})}},children:"string"==typeof e.content?e.content:""})]});return(0,t.jsxs)("div",{className:"flex flex-col gap-6 min-w-0 w-full p-4",children:[r.map((e,s)=>{let n=e.assistant,i=(null==n?void 0:n.model)||"Assistant";return(0,t.jsxs)("div",{className:"space-y-4",children:[e.user&&(0,t.jsxs)("div",{className:"space-y-2 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-blue-100 text-blue-600",children:(0,t.jsx)(k.Z,{size:16})}),(0,t.jsx)("div",{className:"text-sm font-semibold text-gray-700",children:"You"})]}),l(e.user)]}),(0,t.jsx)("div",{className:"border-t border-gray-200"}),n?(0,t.jsxs)("div",{className:"space-y-3 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-gray-100 text-gray-600",children:(0,t.jsx)(A.Z,{size:16})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-gray-700",children:i}),n.toolName&&(0,t.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:n.toolName})]})]}),n.reasoningContent&&(0,t.jsx)(Z.Z,{reasoningContent:n.reasoningContent}),n.searchResults&&(0,t.jsx)(E.J,{searchResults:n.searchResults}),l(n),(n.timeToFirstToken||n.totalLatency||n.usage)&&(0,t.jsx)(M.Z,{timeToFirstToken:n.timeToFirstToken,totalLatency:n.totalLatency,usage:n.usage,toolName:n.toolName})]}):a&&s===r.length-1?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,t.jsx)(C.Z,{size:18,className:"animate-spin"}),(0,t.jsx)("span",{children:"Generating response..."})]}):(0,t.jsx)("div",{className:"text-sm text-gray-500",children:"Waiting for a response..."})]},s)}),a&&0===r.length&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-gray-500",children:[(0,t.jsx)(C.Z,{size:18,className:"animate-spin"}),(0,t.jsx)("span",{children:"Generating response..."})]})]})}var R=a(10353);function _(e){let{value:s,options:a,loading:r,config:n,onChange:l}=e;return(0,t.jsx)(m.default,{value:s||void 0,placeholder:r?"Loading ".concat(n.selectorLabel.toLowerCase(),"s..."):n.selectorPlaceholder,onChange:l,loading:r,showSearch:!0,filterOption:(e,s)=>{var a;return(null!==(a=null==s?void 0:s.label)&&void 0!==a?a:"").toLowerCase().includes(e.toLowerCase())},options:a,className:"w-48",notFoundContent:r?(0,t.jsx)("div",{className:"flex items-center justify-center py-2",children:(0,t.jsx)(R.Z,{size:"small"})}):"No ".concat(n.selectorLabel.toLowerCase(),"s available")})}var I=a(99020),O=a(97415),z=a(67479),K=a(4156),B=a(23496),D=a(85847),W=a(79326);let F="/v1/chat/completions",G="/a2a",V={[F]:{id:F,label:"/v1/chat/completions",selectorType:"model",selectorLabel:"Model",selectorPlaceholder:"Select a model",inputPlaceholder:"Send a prompt to compare models",loadingMessage:"Gathering responses from all models...",validationMessage:"Select a model before sending a message."},[G]:{id:G,label:"/a2a (Agents)",selectorType:"agent",selectorLabel:"Agent",selectorPlaceholder:"Select an agent",inputPlaceholder:"Send a message to compare agents",loadingMessage:"Gathering responses from all agents...",validationMessage:"Select an agent before sending a message."}},H=()=>Object.values(V).map(e=>({value:e.id,label:e.label})),X=e=>V[e],Y=e=>"agent"===V[e].selectorType,q=e=>e.map(e=>({value:e,label:e})),J=e=>e.map(e=>({value:e.agent_name,label:e.agent_name||e.agent_id})),$=(e,s)=>Y(s)?e.agent:e.model,Q=(e,s)=>{let a=$(e,s);return!!(a&&a.trim())};function ee(e){let{comparison:s,onUpdate:a,onRemove:n,canRemove:l,selectorOptions:i,isLoadingOptions:o,endpointConfig:d,apiKey:c}=e,m=Y(d.id),u=$(s,d.id),[x,g]=(0,r.useState)(!1),h=e=>{e?a({applyAcrossModels:!0,temperature:s.temperature,maxTokens:s.maxTokens,tags:[...s.tags],vectorStores:[...s.vectorStores],guardrails:[...s.guardrails],useAdvancedParams:s.useAdvancedParams},{applyToAll:!0,keysToApply:["temperature","maxTokens","tags","vectorStores","guardrails","useAdvancedParams"]}):a({applyAcrossModels:!1})},p=e=>{a({useAdvancedParams:e},s.applyAcrossModels?{applyToAll:!0,keysToApply:["useAdvancedParams"]}:void 0)},v=(e,t)=>{a({[e]:t},s.applyAcrossModels?{applyToAll:!0,keysToApply:[e]}:void 0)},f=s.useAdvancedParams?1:.4,y=s.useAdvancedParams?"text-gray-700":"text-gray-400",j=()=>{g(e=>!e)},b=(0,t.jsxs)("div",{className:"w-[300px] max-h-[65vh] overflow-y-auto relative",children:[(0,t.jsx)("button",{onClick:()=>{g(!1)},className:"absolute top-0 right-0 p-1 hover:bg-gray-100 rounded transition-colors text-gray-500 hover:text-gray-700 z-10",children:(0,t.jsx)(N.Z,{size:14})}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)(K.Z,{checked:s.applyAcrossModels,onChange:e=>h(e.target.checked),children:(0,t.jsx)("span",{className:"text-xs font-medium",children:"Sync Settings Across Models"})})}),(0,t.jsx)(B.Z,{className:"border-gray-200"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-gray-700 mb-1.5 uppercase tracking-wide",children:"General Settings"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-600 block mb-0.5",children:"Tags"}),(0,t.jsx)(I.Z,{value:s.tags,onChange:e=>v("tags",e),accessToken:c})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-600 block mb-0.5",children:"Vector Stores"}),(0,t.jsx)(O.Z,{value:s.vectorStores,onChange:e=>v("vectorStores",e),accessToken:c})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-600 block mb-0.5",children:"Guardrails"}),(0,t.jsx)(z.Z,{value:s.guardrails,onChange:e=>v("guardrails",e),accessToken:c})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-gray-700 mb-1.5 uppercase tracking-wide",children:"Advanced Settings"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 pb-1",children:(0,t.jsx)(K.Z,{checked:s.useAdvancedParams,onChange:e=>p(e.target.checked),children:(0,t.jsx)("span",{className:"text-sm font-medium",children:"Use Advanced Parameters"})})}),(0,t.jsxs)("div",{className:"space-y-2 transition-opacity duration-200",style:{opacity:f},children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("label",{className:"text-xs font-medium ".concat(y),children:"Temperature"}),(0,t.jsx)("span",{className:"text-xs ".concat(y),children:s.temperature.toFixed(2)})]}),(0,t.jsx)(D.Z,{min:0,max:2,step:.01,value:s.temperature,onChange:e=>{v("temperature",Math.min(2,Math.max(0,Number((Array.isArray(e)?e[0]:e).toFixed(2)))))},disabled:!s.useAdvancedParams})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("label",{className:"text-xs font-medium ".concat(y),children:"Max Tokens"}),(0,t.jsx)("span",{className:"text-xs ".concat(y),children:s.maxTokens})]}),(0,t.jsx)(D.Z,{min:1,max:32768,step:1,value:s.maxTokens,onChange:e=>{v("maxTokens",Math.min(32768,Math.max(1,Math.round(Array.isArray(e)?e[0]:e))))},disabled:!s.useAdvancedParams})]})]})]})]})]})]});return(0,t.jsxs)("div",{className:"bg-white first:border-l-0 border-l border-gray-200 flex flex-col min-h-0",children:[(0,t.jsxs)("div",{className:"border-b flex items-center justify-between gap-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-1",children:[(0,t.jsx)(_,{value:u,options:i,loading:o,config:d,onChange:e=>a(m?{agent:e}:{model:e})}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)(W.Z,{content:b,trigger:[],open:x,onOpenChange:()=>{},placement:"bottomRight",destroyTooltipOnHide:!1,children:(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),j()},className:"p-2 rounded-lg transition-colors ".concat(x?"bg-gray-200 text-gray-700":"hover:bg-gray-100 text-gray-600"),children:(0,t.jsx)(w.Z,{size:18})})})})]}),l&&(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},className:"p-2 hover:bg-red-50 text-red-600 rounded-lg transition-colors",children:(0,t.jsx)(N.Z,{size:18})})]}),(0,t.jsx)("div",{className:"relative flex-1 flex flex-col min-h-0",children:(0,t.jsx)("div",{className:"flex-1 max-h-[calc(100vh-385px)] overflow-auto rounded-b-2xl",children:(0,t.jsx)(U,{messages:s.messages,isLoading:s.isLoading})})})]})}var es=a(79276);let{TextArea:ea}=u.default;function et(e){let{value:s,onChange:a,onSend:r,disabled:n,hasAttachment:l,uploadComponent:i}=e,o=!n&&(s.trim().length>0||!!l);return(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[i&&(0,t.jsx)("div",{className:"flex-shrink-0 mr-2",children:i}),(0,t.jsx)(ea,{value:s,onChange:e=>a(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),o&&r())},placeholder:"Type your message... (Shift+Enter for new line)",disabled:n,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,t.jsx)(x.ZP,{onClick:r,disabled:!o,icon:(0,t.jsx)(es.Z,{}),shape:"circle"})]})})}let er=["Can you summarize the key points?","What assumptions did you make?","What are the next steps?"],en=["Write me a poem","Explain quantum computing","Draft a polite email requesting a meeting"];function el(e){let{accessToken:s,disabledPersonalKeyCreation:a}=e,[n,N]=(0,r.useState)([{id:"1",model:"",agent:"",messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1},{id:"2",model:"",agent:"",messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1}]),[w,k]=(0,r.useState)([]),[A,C]=(0,r.useState)([]),[S,T]=(0,r.useState)(!1),[L,P]=(0,r.useState)(!1),[Z,M]=(0,r.useState)(F),E=X(Z),U=Y(Z),R=U?J(A):q(w),_=U?L:S,[I,O]=(0,r.useState)(""),[z,K]=(0,r.useState)(null),[B,D]=(0,r.useState)(null),[W,G]=(0,r.useState)(a?"custom":"session"),[V,$]=(0,r.useState)(""),[es,ea]=(0,r.useState)("");(0,r.useEffect)(()=>{let e=setTimeout(()=>{ea(V)},300);return()=>clearTimeout(e)},[V]),(0,r.useEffect)(()=>()=>{B&&URL.revokeObjectURL(B)},[B]);let el=(0,r.useMemo)(()=>"session"===W?s||"":es.trim(),[W,s,es]),ei=(0,r.useMemo)(()=>n.length>0&&n.every(e=>!e.isLoading&&e.messages.some(e=>"assistant"===e.role)),[n]);(0,r.useEffect)(()=>{let e=!0;return(async()=>{if(!el){k([]);return}T(!0);try{let s=await (0,y.p)(el);if(!e)return;let a=Array.from(new Set(s.map(e=>e.model_group)));k(a)}catch(s){console.error("CompareUI: failed to fetch models",s),e&&k([])}finally{e&&T(!1)}})(),()=>{e=!1}},[el]),(0,r.useEffect)(()=>{let e=!0;return(async()=>{if(!el||!U){C([]);return}P(!0);try{let s=await (0,j.o)(el);if(!e)return;C(s)}catch(s){console.error("CompareUI: failed to fetch agents",s),e&&C([])}finally{e&&P(!1)}})(),()=>{e=!1}},[el,U]),(0,r.useEffect)(()=>{0!==w.length&&N(e=>e.map((e,s)=>{var a,t,r,n,l;return{...e,temperature:null!==(a=e.temperature)&&void 0!==a?a:1,maxTokens:null!==(t=e.maxTokens)&&void 0!==t?t:2048,applyAcrossModels:null!==(r=e.applyAcrossModels)&&void 0!==r&&r,useAdvancedParams:null!==(n=e.useAdvancedParams)&&void 0!==n&&n,...e.model?{}:{model:null!==(l=w[s%w.length])&&void 0!==l?l:""}}}))},[w]);let eo=e=>{n.length>1&&N(s=>s.filter(s=>s.id!==e))},ed=(e,s,a)=>{N(t=>{var r;if((null==a?void 0:a.applyToAll)&&(null===(r=a.keysToApply)||void 0===r?void 0:r.length)){let r={};a.keysToApply.forEach(e=>{let a=s[e];void 0!==a&&(r[e]=Array.isArray(a)?[...a]:a)});let n=Object.keys(r).length>0;return t.map(a=>a.id===e?{...a,...s}:n?{...a,...r}:a)}return t.map(a=>a.id===e?{...a,...s}:a)})},ec=()=>{B&&URL.revokeObjectURL(B),K(null),D(null)},em=(e,s,a)=>{s&&N(t=>t.map(t=>{if(t.id!==e)return t;let r=[...t.messages],n=r[r.length-1];if(n&&"assistant"===n.role){var l;let e="string"==typeof n.content?n.content:"";r[r.length-1]={...n,content:e+s,model:null!==(l=n.model)&&void 0!==l?l:a}}else r.push({role:"assistant",content:s,model:a});return{...t,messages:r}}))},eu=(e,s)=>{s&&N(a=>a.map(a=>{if(a.id!==e)return a;let t=[...a.messages],r=t[t.length-1];return r&&"assistant"===r.role?t[t.length-1]={...r,reasoningContent:(r.reasoningContent||"")+s}:r&&"user"===r.role&&t.push({role:"assistant",content:"",reasoningContent:s}),{...a,messages:t}}))},ex=(e,s)=>{N(a=>a.map(a=>{if(a.id!==e)return a;let t=[...a.messages],r=t[t.length-1];return r&&"assistant"===r.role?t[t.length-1]={...r,timeToFirstToken:s}:r&&"user"===r.role&&t.push({role:"assistant",content:"",timeToFirstToken:s}),{...a,messages:t}}))},eg=(e,s)=>{N(a=>a.map(a=>{if(a.id!==e)return a;let t=[...a.messages],r=t[t.length-1];return r&&"assistant"===r.role?t[t.length-1]={...r,totalLatency:s}:r&&"user"===r.role&&t.push({role:"assistant",content:"",totalLatency:s}),{...a,messages:t}}))},eh=(e,s,a)=>{N(t=>t.map(t=>{if(t.id!==e)return t;let r=[...t.messages],n=r[r.length-1];return n&&"assistant"===n.role&&(r[r.length-1]={...n,usage:s,toolName:a}),{...t,messages:r}}))},ep=(e,s)=>{s&&N(a=>a.map(a=>{if(a.id!==e)return a;let t=[...a.messages],r=t[t.length-1];return r&&"assistant"===r.role&&(t[t.length-1]={...r,searchResults:s}),{...a,messages:t}}))},ev=!!s,ef=async e=>{let s=e.trim(),a=!!z;if(!s&&!a)return;if(!el){l.Z.fromBackend("Please provide a Virtual Key or select Current UI Session");return}if(0===n.length)return;if(n.some(e=>!Q(e,Z))){l.Z.fromBackend(E.validationMessage);return}let t=a?await (0,v.Sn)(s,z):{role:"user",content:s},r=(0,v.Hk)(s,a,B||void 0,null==z?void 0:z.name),i=new Map;n.forEach(e=>{var a;let n=null!==(a=e.traceId)&&void 0!==a?a:(0,h.Z)(),l=[...e.messages.map(e=>{let{role:s,content:a}=e;return{role:s,content:Array.isArray(a)?a:"string"==typeof a?a:""}}),t];i.set(e.id,{id:e.id,model:e.model,agent:e.agent,inputMessage:s,traceId:n,tags:e.tags,vectorStores:e.vectorStores,guardrails:e.guardrails,temperature:e.temperature,maxTokens:e.maxTokens,displayMessages:[...e.messages,r],apiChatHistory:l})}),0!==i.size&&(N(e=>e.map(e=>{let s=i.get(e.id);return s?{...e,traceId:s.traceId,messages:s.displayMessages,isLoading:!0}:e})),O(""),ec(),i.forEach(e=>{var s;let a=e.tags.length>0?e.tags:void 0,t=e.vectorStores.length>0?e.vectorStores:void 0,r=e.guardrails.length>0?e.guardrails:void 0,i=n.find(s=>s.id===e.id),o=null!==(s=null==i?void 0:i.useAdvancedParams)&&void 0!==s&&s;(U?(0,b.m)(e.agent,e.inputMessage,(s,a)=>{N(t=>t.map(t=>{if(t.id!==e.id)return t;let r=[...t.messages],n=r[r.length-1];if(n&&"assistant"===n.role){var l;r[r.length-1]={...n,content:s,model:null!==(l=n.model)&&void 0!==l?l:a}}else r.push({role:"assistant",content:s,model:a});return{...t,messages:r}}))},el,void 0,s=>ex(e.id,s),s=>eg(e.id,s)):(0,f.n)(e.apiChatHistory,(s,a)=>em(e.id,s,a),e.model,el,a,void 0,s=>eu(e.id,s),s=>ex(e.id,s),s=>eh(e.id,s),e.traceId,t,r,void 0,void 0,s=>ep(e.id,s),o?e.temperature:void 0,o?e.maxTokens:void 0,s=>eg(e.id,s))).catch(s=>{let a=s instanceof Error?s.message:String(s);console.error("CompareUI: failed to fetch response",s),l.Z.fromBackend(a),N(s=>s.map(s=>{if(s.id!==e.id)return s;let t=[...s.messages],r=t[t.length-1],n=r&&"assistant"===r.role&&"string"==typeof r.content?r.content:"";return r&&"assistant"===r.role?t[t.length-1]={...r,content:n?"".concat(n,"\nError fetching response: ").concat(a):"Error fetching response: ".concat(a)}:t.push({role:"assistant",content:"Error fetching response: ".concat(a)}),{...s,messages:t}}))}).finally(()=>{N(s=>s.map(s=>s.id===e.id?{...s,isLoading:!1}:s))})}))},ey=e=>{O(e)},ej=n.some(e=>e.messages.length>0),eb=n.some(e=>e.isLoading),eN=!!z,ew=!!(null==z?void 0:z.name.toLowerCase().endsWith(".pdf")),ek=!ej&&!eb&&!eN;return(0,t.jsx)("div",{className:"w-full h-full p-4 bg-white",children:(0,t.jsxs)("div",{className:"rounded-2xl border border-gray-200 bg-white shadow-sm min-h-[calc(100vh-160px)] flex flex-col",children:[(0,t.jsx)("div",{className:"border-b px-4 py-2",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-600",children:"Virtual Key Source"}),(0,t.jsxs)(m.default,{value:W,onChange:e=>G(e),disabled:a,className:"w-48",children:[(0,t.jsx)(m.default.Option,{value:"session",disabled:!ev,children:"Current UI Session"}),(0,t.jsx)(m.default.Option,{value:"custom",children:"Virtual Key"})]}),"custom"===W&&(0,t.jsx)(u.default.Password,{value:V,onChange:e=>$(e.target.value),placeholder:"Enter Virtual Key",className:"w-56"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-600",children:"Endpoint"}),(0,t.jsx)(m.default,{value:Z,onChange:e=>M(e),className:"w-56",children:H().map(e=>(0,t.jsx)(m.default.Option,{value:e.value,children:e.label},e.value))})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(x.ZP,{onClick:()=>{N(e=>e.map(e=>({...e,messages:[],traceId:void 0,isLoading:!1}))),O(""),ec()},disabled:!ej,icon:(0,t.jsx)(i.Z,{}),children:"Clear All Chats"}),(0,t.jsx)(g.Z,{title:n.length>=3?"Compare up to 3 models at a time":"Add another comparison",children:(0,t.jsx)(x.ZP,{onClick:()=>{var e,s,a;if(n.length>=3)return;let t=null!==(s=w[n.length%(w.length||1)])&&void 0!==s?s:"",r=null!==(a=null===(e=A[n.length%(A.length||1)])||void 0===e?void 0:e.agent_name)&&void 0!==a?a:"",l={id:Date.now().toString(),model:t,agent:r,messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1};N(e=>[...e,l])},disabled:n.length>=3,icon:(0,t.jsx)(o.Z,{}),children:"Add Comparison"})})]})]})}),(0,t.jsx)("div",{className:"grid flex-1 min-h-0 auto-rows-[minmax(0,1fr)]",style:{gridTemplateColumns:"repeat(".concat(n.length,", minmax(0, 1fr))")},children:n.map(e=>(0,t.jsx)(ee,{comparison:e,onUpdate:(s,a)=>ed(e.id,s,a),onRemove:()=>eo(e.id),canRemove:n.length>1,selectorOptions:R,isLoadingOptions:_,endpointConfig:E,apiKey:el},e.id))}),(0,t.jsx)("div",{className:"flex justify-center pb-4",children:(0,t.jsx)("div",{className:"w-full max-w-3xl px-4",children:(0,t.jsxs)("div",{className:"border border-gray-200 shadow-lg rounded-xl bg-white p-4",children:[(0,t.jsx)("div",{className:"flex items-center justify-between gap-4 mb-3 min-h-8",children:eN?(0,t.jsx)("span",{className:"text-sm text-gray-500",children:"Attachment ready to send"}):ek?(0,t.jsx)("div",{className:"flex items-center gap-2 overflow-x-auto",children:en.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>ey(e),className:"shrink-0 rounded-full border border-gray-200 px-3 py-1 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100 cursor-pointer",children:e},e))}):ei&&!eN?(0,t.jsx)("div",{className:"flex items-center gap-2 overflow-x-auto",children:er.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>ey(e),className:"shrink-0 rounded-full border border-gray-200 px-3 py-1 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100 cursor-pointer",children:e},e))}):eb?(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,t.jsx)("span",{className:"h-2 w-2 rounded-full bg-blue-500 animate-pulse","aria-hidden":!0}),E.loadingMessage]}):(0,t.jsx)("span",{className:"text-sm text-gray-500",children:E.inputPlaceholder})}),z&&(0,t.jsx)("div",{className:"mb-3",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:ew?(0,t.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,t.jsx)(d.Z,{style:{fontSize:"16px",color:"white"}})}):(0,t.jsx)("img",{src:B||"",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:z.name}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:ew?"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:ec,children:(0,t.jsx)(c.Z,{style:{fontSize:"12px"}})})]})}),(0,t.jsx)(et,{value:I,onChange:e=>{O(e)},onSend:()=>{ef(I)},disabled:0===n.length||n.every(e=>e.isLoading),hasAttachment:eN,uploadComponent:(0,t.jsx)(p.Z,{chatUploadedImage:z,chatImagePreviewUrl:B,onImageUpload:e=>(B&&URL.revokeObjectURL(B),K(e),D(URL.createObjectURL(e)),!1),onRemoveImage:ec})})]})})})]})})}var ei=a(58643),eo=a(39760),ed=a(91624);function ec(){let{accessToken:e,userRole:s,userId:a,disabledPersonalKeyCreation:l,token:i}=(0,eo.Z)(),[o,d]=(0,r.useState)(void 0);return(0,r.useEffect)(()=>{(async()=>{if(e){let s=await (0,ed.C)(e);s&&d({PROXY_BASE_URL:s.PROXY_BASE_URL,LITELLM_UI_API_DOC_BASE_URL:s.LITELLM_UI_API_DOC_BASE_URL})}})()},[e]),(0,t.jsxs)(ei.v0,{className:"h-full w-full",children:[(0,t.jsxs)(ei.td,{className:"mb-0",children:[(0,t.jsx)(ei.OK,{children:"Chat"}),(0,t.jsx)(ei.OK,{children:"Compare"})]}),(0,t.jsxs)(ei.nP,{className:"h-full",children:[(0,t.jsx)(ei.x4,{className:"h-full",children:(0,t.jsx)(n.Z,{accessToken:e,token:i,userRole:s,userID:a,disabledPersonalKeyCreation:l,proxySettings:o})}),(0,t.jsx)(ei.x4,{className:"h-full",children:(0,t.jsx)(el,{accessToken:e,disabledPersonalKeyCreation:l})})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9111-42e423f1cc12f2de.js b/litellm/proxy/_experimental/out/_next/static/chunks/9111-42e423f1cc12f2de.js new file mode 100644 index 00000000000..fd5621d2379 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/9111-42e423f1cc12f2de.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9111],{89111:function(e,l,s){s.d(l,{Z:function(){return er}});var a=s(57437),t=s(78489),n=s(12514),i=s(67101),r=s(57365),c=s(59341),d=s(12485),o=s(18135),u=s(35242),m=s(29706),h=s(77991),g=s(21626),x=s(97214),f=s(28241),j=s(58834),b=s(69552),p=s(71876),y=s(84264),v=s(49566),k=s(2265),Z=s(57840),C=s(4260),_=s(37592),S=s(10032),w=s(22116),N=s(5545),E=s(9114),A=s(19250),O=s(23496),L=s(10353),T=s(4156);let{Title:F}=Z.default;var R=e=>{let{accessToken:l}=e,[s,i]=(0,k.useState)(!0),[r,c]=(0,k.useState)([]);(0,k.useEffect)(()=>{d()},[l]);let d=async()=>{if(l){i(!0);try{let e=await (0,A.getEmailEventSettings)(l);c(e.settings)}catch(e){console.error("Failed to fetch email event settings:",e),E.Z.fromBackend(e)}finally{i(!1)}}},o=(e,l)=>{c(r.map(s=>s.event===e?{...s,enabled:l}:s))},u=async()=>{if(l)try{await (0,A.updateEmailEventSettings)(l,{settings:r}),E.Z.success("Email event settings updated successfully")}catch(e){console.error("Failed to update email event settings:",e),E.Z.fromBackend(e)}},m=async()=>{if(l)try{await (0,A.resetEmailEventSettings)(l),E.Z.success("Email event settings reset to defaults"),d()}catch(e){console.error("Failed to reset email event settings:",e),E.Z.fromBackend(e)}},h=e=>{if(e.includes("Virtual Key Created"))return"An email will be sent to the user when a new virtual key is created with their user ID";if(e.includes("New User Invitation"))return"An email will be sent to the email address of the user when a new user is created";{let l=e.split(/(?=[A-Z])/).join(" ").toLowerCase();return"Receive an email notification when ".concat(l)}};return(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(F,{level:4,children:"Email Notifications"}),(0,a.jsx)(y.Z,{children:"Select which events should trigger email notifications."}),(0,a.jsx)(O.Z,{}),s?(0,a.jsx)("div",{style:{textAlign:"center",padding:"20px"},children:(0,a.jsx)(L.Z,{size:"large"})}):(0,a.jsx)("div",{className:"space-y-4",children:r.map(e=>(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(T.Z,{checked:e.enabled,onChange:l=>o(e.event,l.target.checked)}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)(y.Z,{children:e.event}),(0,a.jsx)("div",{className:"text-sm text-gray-500 block",children:h(e.event)})]})]},e.event))}),(0,a.jsxs)("div",{className:"mt-6 flex space-x-4",children:[(0,a.jsx)(t.Z,{onClick:u,disabled:s,children:"Save Changes"}),(0,a.jsx)(t.Z,{onClick:m,variant:"secondary",disabled:s,children:"Reset to Defaults"})]})]})};let{Title:P}=Z.default;var I=e=>{let{accessToken:l,premiumUser:s,alerts:r}=e,c=async()=>{if(!l)return;let e={};r.filter(e=>"email"===e.name).forEach(l=>{var s;Object.entries(null!==(s=l.variables)&&void 0!==s?s:{}).forEach(l=>{let[s,a]=l,t=document.querySelector('input[name="'.concat(s,'"]'));t&&t.value&&(e[s]=null==t?void 0:t.value)})}),console.log("updatedVariables",e);try{await (0,A.setCallbacksCall)(l,{general_settings:{alerting:["email"]},environment_variables:e}),E.Z.success("Email settings updated successfully")}catch(e){E.Z.fromBackend(e)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mt-6 mb-6",children:(0,a.jsx)(R,{accessToken:l})}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(P,{level:4,children:"Email Server Settings"}),(0,a.jsxs)(y.Z,{children:[(0,a.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: email alerts"]})," ",(0,a.jsx)("br",{})]}),(0,a.jsx)("div",{className:"flex w-full",children:r.filter(e=>"email"===e.name).map((e,l)=>{var t;return(0,a.jsx)(f.Z,{children:(0,a.jsx)("ul",{children:(0,a.jsx)(i.Z,{numItems:2,children:Object.entries(null!==(t=e.variables)&&void 0!==t?t:{}).map(e=>{let[l,t]=e;return(0,a.jsxs)("li",{className:"mx-2 my-2",children:[!0!=s&&("EMAIL_LOGO_URL"===l||"EMAIL_SUPPORT_CONTACT"===l)?(0,a.jsxs)("div",{children:[(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:(0,a.jsxs)(y.Z,{className:"mt-2",children:[" ✨ ",l]})}),(0,a.jsx)(v.Z,{name:l,defaultValue:t,type:"password",disabled:!0,style:{width:"400px"}})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"mt-2",children:l}),(0,a.jsx)(v.Z,{name:l,defaultValue:t,type:"password",style:{width:"400px"}})]}),(0,a.jsxs)("p",{style:{fontSize:"small",fontStyle:"italic"},children:["SMTP_HOST"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP host address, e.g. `smtp.resend.com`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PORT"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP port number, e.g. `587`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_USERNAME"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP username, e.g. `username`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PASSWORD"===l&&(0,a.jsx)("span",{style:{color:"red"},children:" Required * "}),"SMTP_SENDER_EMAIL"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the sender email address, e.g. `sender@berri.ai`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"TEST_EMAIL_ADDRESS"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Email Address to send `Test Email Alert` to. example: `info@berri.ai`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"EMAIL_LOGO_URL"===l&&(0,a.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the Logo that appears in the email, pass a url to your logo"}),"EMAIL_SUPPORT_CONTACT"===l&&(0,a.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the support email address that appears in the email. Default is support@berri.ai"})]})]},l)})})})},l)})}),(0,a.jsx)(t.Z,{className:"mt-2",onClick:()=>c(),children:"Save Changes"}),(0,a.jsx)(t.Z,{onClick:async()=>{if(l)try{await (0,A.serviceHealthCheck)(l,"email"),E.Z.success("Email test triggered. Check your configured email inbox/logs.")}catch(e){E.Z.fromBackend(e)}},className:"mx-2",children:"Test Email Alerts"})]})]})},M=s(2740),U=s(19015),B=s(44643),D=s(74998),W=s(41649),q=s(47323),H=e=>{let{alertingSettings:l,handleInputChange:s,handleResetField:n,handleSubmit:i,premiumUser:r}=e,[d]=S.Z.useForm();return(0,a.jsxs)(S.Z,{form:d,onFinish:()=>{console.log("INSIDE ONFINISH");let e=d.getFieldsValue(),l=Object.entries(e).every(e=>{let[l,s]=e;return"boolean"!=typeof s&&(""===s||null==s)});console.log("formData: ".concat(JSON.stringify(e),", isEmpty: ").concat(l)),l?console.log("Some form fields are empty."):i(e)},labelAlign:"left",children:[l.map((e,l)=>(0,a.jsxs)(p.Z,{children:[(0,a.jsxs)(f.Z,{align:"center",children:[(0,a.jsx)(y.Z,{children:e.field_name}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),e.premium_field?r?(0,a.jsx)(S.Z.Item,{name:e.field_name,children:(0,a.jsx)(f.Z,{children:"Integer"===e.field_type?(0,a.jsx)(U.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l)}):"Boolean"===e.field_type?(0,a.jsx)(c.Z,{checked:e.field_value,onChange:l=>s(e.field_name,l)}):(0,a.jsx)(C.default,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}):(0,a.jsx)(f.Z,{children:(0,a.jsx)(t.Z,{className:"flex items-center justify-center",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})})}):(0,a.jsx)(S.Z.Item,{name:e.field_name,className:"mb-0",valuePropName:"Boolean"===e.field_type?"checked":"value",children:(0,a.jsx)(f.Z,{children:"Integer"===e.field_type?(0,a.jsx)(U.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l),className:"p-0"}):"Boolean"===e.field_type?(0,a.jsx)(c.Z,{checked:e.field_value,onChange:l=>{s(e.field_name,l),d.setFieldsValue({[e.field_name]:l})}}):(0,a.jsx)(C.default,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}),(0,a.jsx)(f.Z,{children:!0==e.stored_in_db?(0,a.jsx)(W.Z,{icon:B.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,a.jsx)(W.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,a.jsx)(W.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,a.jsx)(f.Z,{children:(0,a.jsx)(q.Z,{icon:D.Z,color:"red",onClick:()=>n(e.field_name,l),children:"Reset"})})]},l)),(0,a.jsx)("div",{children:(0,a.jsx)(N.ZP,{htmlType:"submit",children:"Update Settings"})})]})},z=e=>{let{accessToken:l,premiumUser:s}=e,[t,n]=(0,k.useState)([]);return(0,k.useEffect)(()=>{l&&(0,A.alertingSettingsCall)(l).then(e=>{n(e)})},[l]),(0,a.jsx)(H,{alertingSettings:t,handleInputChange:(e,l)=>{let s=t.map(s=>s.field_name===e?{...s,field_value:l}:s);console.log("updatedSettings: ".concat(JSON.stringify(s))),n(s)},handleResetField:(e,s)=>{if(l)try{let l=t.map(l=>l.field_name===e?{...l,stored_in_db:null,field_value:l.field_default_value}:l);n(l)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:e=>{if(!l||(console.log("formValues: ".concat(e)),null==e||void 0==e))return;let s={};t.forEach(e=>{s[e.field_name]=e.field_value});let a={...e,...s};console.log("mergedFormValues: ".concat(JSON.stringify(a)));let{slack_alerting:n,...i}=a;console.log("slack_alerting: ".concat(n,", alertingArgs: ").concat(JSON.stringify(i)));try{(0,A.updateConfigFieldSetting)(l,"alerting_args",i),"boolean"==typeof n&&(!0==n?(0,A.updateConfigFieldSetting)(l,"alerting",["slack"]):(0,A.updateConfigFieldSetting)(l,"alerting",[])),E.Z.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:s})},V=s(91126),J=s(53410),G=s(99981),K=s(56609),Q=s(6833);let X=[{value:"success",label:"Success"},{value:"failure",label:"Failure"},{value:"success_and_failure",label:"Success & Failure"}],Y=e=>{let{callbacks:l,availableCallbacks:s={},onTest:n=()=>{},onEdit:i=()=>{},onDelete:r=()=>{},onAdd:c=()=>{}}=e,d=[{title:(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"Callback Name"}),dataIndex:"name",key:"name",render:(e,l)=>{var t;let n=l.name;console.log("availableCallbacks",s);let i=(null===(t=s[n])||void 0===t?void 0:t.ui_callback_name)||n;return(0,a.jsx)("div",{className:"font-medium text-gray-800",children:i})}},{title:(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"Mode"}),key:"mode",render:(e,l)=>{var s;let t=l.mode||"success",n=(null===(s=X.find(e=>e.value===t))||void 0===s?void 0:s.label)||t,i="success"===t?"bg-green-100 text-green-800":"failure"===t?"bg-red-100 text-red-800":"bg-blue-100 text-blue-800";return(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat(i),children:n})},width:240},{title:(0,a.jsx)("span",{className:"font-medium text-gray-700 text-right w-full block",children:"Actions"}),key:"actions",align:"right",render:(e,l)=>(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(G.Z,{title:"Test Callback",children:(0,a.jsx)(q.Z,{icon:V.Z,size:"sm",className:"cursor-pointer text-indigo-600 hover:text-indigo-700",onClick:()=>n(l)})}),(0,a.jsx)(G.Z,{title:"Edit Callback",children:(0,a.jsx)(q.Z,{icon:J.Z,size:"sm",className:"cursor-pointer text-indigo-600 hover:text-indigo-700",onClick:()=>i(l)})}),(0,a.jsx)(G.Z,{title:"Delete Callback",children:(0,a.jsx)(q.Z,{icon:D.Z,size:"sm",className:"cursor-pointer text-indigo-600 hover:text-red-600",onClick:()=>r(l)})})]}),width:240}];return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"w-full mt-4",children:[(0,a.jsx)(t.Z,{onClick:c,className:"mx-auto",children:"+ Add Callback"}),(0,a.jsx)("div",{className:"flex justify-between items-center my-2",children:(0,a.jsx)(Q.Z,{level:4,children:"Active Logging Callbacks"})}),0===l.length?(0,a.jsx)("div",{className:"flex flex-col items-center justify-center p-8 bg-gray-50 border border-gray-200 rounded-lg",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-700 mb-2",children:"No callbacks configured"}),(0,a.jsx)("p",{className:"text-gray-500",children:"Add your first callback to start logging data to external services."})]})}):(0,a.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg overflow-hidden",children:(0,a.jsx)(K.Z,{columns:d,dataSource:l,rowKey:e=>e.name,pagination:!1,rowClassName:()=>"hover:bg-gray-50"})})]})})};var $=s(85968),ee=s(21609);let{Title:el,Paragraph:es}=Z.default,ea=e=>{let{params:l,callbackConfigs:s,selectedCallback:t}=e;return l&&0!==l.length?(0,a.jsx)("div",{className:"space-y-4 mt-6 p-4 bg-gray-50 rounded-lg border",children:l.map(e=>{var l;let n=s.find(e=>e.id===t),i=(null==n?void 0:null===(l=n.dynamic_params)||void 0===l?void 0:l[e])||{},r=i.type||"text",c=i.ui_name||e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),d=i.required||!1;return(0,a.jsx)(M.Z,{label:(0,a.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:[c," "]}),name:e,className:"mb-4",rules:d?[{required:!0,message:"Please enter the ".concat(c.toLowerCase())}]:void 0,children:"password"===r?(0,a.jsx)(C.default.Password,{size:"large",placeholder:"Enter your ".concat(c.toLowerCase()),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}):"number"===r?(0,a.jsx)(C.default,{type:"number",size:"large",placeholder:"Enter ".concat(c.toLowerCase()),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",min:0,max:1,step:.1}):(0,a.jsx)(C.default,{size:"large",placeholder:"Enter your ".concat(c.toLowerCase()),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})},e)})}):null},et=e=>{let{callbackConfigs:l,selectedCallback:s,onCallbackChange:t,disabled:n=!1}=e;return(0,a.jsx)(M.Z,{label:"Callback",name:"callback",rules:n?void 0:[{required:!0,message:"Please select a callback"}],children:(0,a.jsx)(_.default,{placeholder:"Choose a logging callback...",size:"large",className:"w-full",showSearch:!0,disabled:n,value:s,filterOption:(e,l)=>{var s,a;return(null!==(a=null==l?void 0:null===(s=l.value)||void 0===s?void 0:s.toString())&&void 0!==a?a:"").toLowerCase().includes(e.toLowerCase())},onChange:t,children:l.map(e=>{let l=e.logo,s=l&&(l.includes("/")||l.startsWith("data:")||l.startsWith("http"))?l:"".concat("../ui/assets/logos/").concat(l);return(0,a.jsx)(r.Z,{value:e.id,children:(0,a.jsxs)("div",{className:"flex items-center space-x-3 py-1",children:[(0,a.jsx)("div",{className:"w-6 h-6 flex items-center justify-center",children:(0,a.jsx)("img",{src:s,alt:"".concat(e.displayName," logo"),className:"w-6 h-6 rounded object-contain",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsx)("span",{className:"font-medium text-gray-900",children:e.displayName})]})},e.id)})})})},en=(e,l,s)=>{if(!e)return s?Object.keys(s):[];let a=l.find(l=>l.id===e);return(null==a?void 0:a.dynamic_params)?Object.keys(a.dynamic_params):s?Object.keys(s):[]},ei=(e,l)=>({environment_variables:e,litellm_settings:{success_callback:[l]}});var er=e=>{let{accessToken:l,userRole:s,userID:r,premiumUser:Z}=e,[C,_]=(0,k.useState)([]),[O,L]=(0,k.useState)([]),[T,F]=(0,k.useState)(!1),[R]=S.Z.useForm(),[P]=S.Z.useForm(),[M,U]=(0,k.useState)(null),[B,D]=(0,k.useState)(""),[W,q]=(0,k.useState)({}),[H,V]=(0,k.useState)([]),[J,G]=(0,k.useState)(!1),[K,Q]=(0,k.useState)([]),[X,el]=(0,k.useState)({}),[es,er]=(0,k.useState)([]),[ec,ed]=(0,k.useState)(!1),[eo,eu]=(0,k.useState)(null),[em,eh]=(0,k.useState)(!1),[eg,ex]=(0,k.useState)(null),[ef,ej]=(0,k.useState)(!1),[eb,ep]=(0,k.useState)(!1),[ey,ev]=(0,k.useState)(!1);(0,k.useEffect)(()=>{l&&(0,A.getCallbackConfigsCall)(l).then(e=>{Q(e||[])}).catch(e=>{E.Z.fromBackend("Failed to load callback configs: "+(0,$.O)(e))})},[l]),(0,k.useEffect)(()=>{if(ec&&eo){let e=Object.fromEntries(Object.entries(eo.variables||{}).map(e=>{let[l,s]=e;return[l,null!=s?s:""]}));P.setFieldsValue({...e,callback:eo.name})}},[ec,eo,P]);let ek=e=>{H.includes(e)?V(H.filter(l=>l!==e)):V([...H,e])},eZ={llm_exceptions:"LLM Exceptions",llm_too_slow:"LLM Responses Too Slow",llm_requests_hanging:"LLM Requests Hanging",budget_alerts:"Budget Alerts (API Keys, Users)",db_exceptions:"Database Exceptions (Read/Write)",daily_reports:"Weekly/Monthly Spend Reports",outage_alerts:"Outage Alerts",region_outage_alerts:"Region Outage Alerts"};(0,k.useEffect)(()=>{l&&s&&r&&(0,A.getCallbacksCall)(l,r,s).then(e=>{_(e.callbacks),el(e.available_callbacks);let l=e.alerts;if(l&&l.length>0){let e=l[0],s=e.variables.SLACK_WEBHOOK_URL;V(e.active_alerts),D(s),q(e.alerts_to_webhook)}L(l)})},[l,s,r]);let eC=e=>H&&H.includes(e),e_=async(e,a,t)=>{if(!l)return;t?ej(!0):ep(!0);let n=ei(e,a);try{if(await (0,A.setCallbacksCall)(l,n),E.Z.success(t?"Callback updated successfully":"Callback ".concat(a," added successfully")),t?(ed(!1),P.resetFields(),eu(null)):(G(!1),R.resetFields(),U(null),er([])),r&&s){let e=await (0,A.getCallbacksCall)(l,r,s);_(e.callbacks)}}catch(e){E.Z.fromBackend(e)}finally{t?ej(!1):ep(!1)}},eS=async e=>{eo&&await e_(e,eo.name,!0)},ew=async e=>{let l=null==e?void 0:e.callback;l&&await e_(e,l,!1)},eN=async()=>{if(!l)return;let e={};Object.entries(eZ).forEach(l=>{let[s,a]=l,t=document.querySelector('input[name="'.concat(s,'"]')),n=(null==t?void 0:t.value)||"";e[s]=n});try{await (0,A.setCallbacksCall)(l,{general_settings:{alert_to_webhook_url:e,alert_types:H}})}catch(e){E.Z.fromBackend(e)}E.Z.success("Alerts updated successfully")},eE=e=>{ex(e),eh(!0)},eA=async()=>{if(eg&&l)try{if(ev(!0),await (0,A.deleteCallback)(l,eg.name),E.Z.success("Callback ".concat(eg.name," deleted successfully")),r&&s){let e=await (0,A.getCallbacksCall)(l,r,s);_(e.callbacks)}eh(!1),ex(null)}catch(e){console.error("Failed to delete callback:",e),E.Z.fromBackend(e)}finally{ev(!1)}};return l?(0,a.jsxs)("div",{className:"w-full mx-4",children:[(0,a.jsx)(i.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,a.jsxs)(o.Z,{children:[(0,a.jsxs)(u.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(d.Z,{value:"1",children:"Logging Callbacks"}),(0,a.jsx)(d.Z,{value:"2",children:"Alerting Types"}),(0,a.jsx)(d.Z,{value:"3",children:"Alerting Settings"}),(0,a.jsx)(d.Z,{value:"4",children:"Email Alerts"})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(m.Z,{children:(0,a.jsx)(Y,{callbacks:C,availableCallbacks:X,onAdd:()=>G(!0),onEdit:e=>{eu(e),ed(!0)},onDelete:e=>eE(e),onTest:async e=>{try{await (0,A.serviceHealthCheck)(l,e.name),E.Z.success("Health check triggered")}catch(e){E.Z.fromBackend((0,$.O)(e))}}})}),(0,a.jsx)(m.Z,{children:(0,a.jsxs)(n.Z,{children:[(0,a.jsxs)(y.Z,{className:"my-2",children:["Alerts are only supported for Slack Webhook URLs. Get your webhook urls from"," ",(0,a.jsx)("a",{href:"https://api.slack.com/messaging/webhooks",target:"_blank",style:{color:"blue"},children:"here"})]}),(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(j.Z,{children:(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(b.Z,{}),(0,a.jsx)(b.Z,{}),(0,a.jsx)(b.Z,{children:"Slack Webhook URL"})]})}),(0,a.jsx)(x.Z,{children:Object.entries(eZ).map((e,l)=>{let[s,n]=e;return(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(f.Z,{children:"region_outage_alerts"==s?Z?(0,a.jsx)(c.Z,{id:"switch",name:"switch",checked:eC(s),onChange:()=>ek(s)}):(0,a.jsx)(t.Z,{className:"flex items-center justify-center",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})}):(0,a.jsx)(c.Z,{id:"switch",name:"switch",checked:eC(s),onChange:()=>ek(s)})}),(0,a.jsx)(f.Z,{children:(0,a.jsx)(y.Z,{children:n})}),(0,a.jsx)(f.Z,{children:(0,a.jsx)(v.Z,{name:s,type:"password",defaultValue:W&&W[s]?W[s]:B})})]},l)})})]}),(0,a.jsx)(t.Z,{size:"xs",className:"mt-2",onClick:eN,children:"Save Changes"}),(0,a.jsx)(t.Z,{onClick:async()=>{try{await (0,A.serviceHealthCheck)(l,"slack"),E.Z.success("Alert test triggered. Test request to slack made - check logs/alerts on slack to verify")}catch(e){E.Z.fromBackend((0,$.O)(e))}},className:"mx-2",children:"Test Alerts"})]})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(z,{accessToken:l,premiumUser:Z})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(I,{accessToken:l,premiumUser:Z,alerts:O})})]})]})}),(0,a.jsxs)(w.Z,{title:"Add Logging Callback",open:J,width:800,onCancel:()=>{G(!1),U(null),er([])},footer:null,children:[(0,a.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/logging",className:"mb-8 mt-4",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: Logging"]}),(0,a.jsxs)(S.Z,{form:R,onFinish:ew,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsx)(et,{callbackConfigs:K,selectedCallback:M,onCallbackChange:e=>{U(e),er(en(e,K))}}),(0,a.jsx)(ea,{params:es,callbackConfigs:K,selectedCallback:M}),(0,a.jsxs)("div",{className:"flex justify-end space-x-3 pt-6 mt-6 border-t border-gray-200",children:[(0,a.jsx)(N.ZP,{onClick:()=>{G(!1),U(null),er([]),R.resetFields()},disabled:eb,children:"Cancel"}),(0,a.jsx)(N.ZP,{htmlType:"submit",loading:eb,disabled:eb,children:eb?"Adding...":"Add Callback"})]})]})]}),(0,a.jsx)(w.Z,{open:ec,width:800,title:"Edit Callback Settings",onCancel:()=>{ed(!1),eu(null),P.resetFields()},footer:null,children:(0,a.jsxs)(S.Z,{form:P,onFinish:eS,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[eo&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(et,{callbackConfigs:K,selectedCallback:eo.name,onCallbackChange:()=>{},disabled:!0}),(0,a.jsx)(ea,{params:en(eo.name,K,eo.variables),callbackConfigs:K,selectedCallback:eo.name})]}),(0,a.jsxs)("div",{className:"flex justify-end space-x-3 pt-6 mt-6 border-t border-gray-200",children:[(0,a.jsx)(N.ZP,{onClick:()=>{ed(!1),eu(null),P.resetFields()},disabled:ef,children:"Cancel"}),(0,a.jsx)(N.ZP,{onClick:()=>{P.submit()},loading:ef,disabled:ef,children:ef?"Saving...":"Save Changes"})]})]})}),(0,a.jsx)(ee.Z,{isOpen:em,title:"Delete Callback",message:"Are you sure you want to delete this callback? This action cannot be undone.",resourceInformationTitle:"Callback Information",resourceInformation:[{label:"Callback Name",value:null==eg?void 0:eg.name},{label:"Mode",value:(null==eg?void 0:eg.mode)||"success"}],onCancel:()=>{eh(!1),ex(null)},onOk:eA,confirmLoading:ey})]}):null}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9111-54de5662a0888480.js b/litellm/proxy/_experimental/out/_next/static/chunks/9111-54de5662a0888480.js deleted file mode 100644 index e703cb7fb18..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/9111-54de5662a0888480.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9111],{89111:function(e,l,s){s.d(l,{Z:function(){return er}});var a=s(57437),t=s(78489),n=s(12514),i=s(67101),r=s(57365),c=s(59341),d=s(12485),o=s(18135),u=s(35242),m=s(29706),h=s(77991),g=s(21626),x=s(97214),f=s(28241),j=s(58834),b=s(69552),p=s(71876),y=s(84264),v=s(49566),k=s(2265),Z=s(57840),C=s(4260),_=s(37592),S=s(10032),w=s(22116),N=s(5545),E=s(9114),A=s(19250),O=s(23496),L=s(10353),T=s(61994);let{Title:F}=Z.default;var R=e=>{let{accessToken:l}=e,[s,i]=(0,k.useState)(!0),[r,c]=(0,k.useState)([]);(0,k.useEffect)(()=>{d()},[l]);let d=async()=>{if(l){i(!0);try{let e=await (0,A.getEmailEventSettings)(l);c(e.settings)}catch(e){console.error("Failed to fetch email event settings:",e),E.Z.fromBackend(e)}finally{i(!1)}}},o=(e,l)=>{c(r.map(s=>s.event===e?{...s,enabled:l}:s))},u=async()=>{if(l)try{await (0,A.updateEmailEventSettings)(l,{settings:r}),E.Z.success("Email event settings updated successfully")}catch(e){console.error("Failed to update email event settings:",e),E.Z.fromBackend(e)}},m=async()=>{if(l)try{await (0,A.resetEmailEventSettings)(l),E.Z.success("Email event settings reset to defaults"),d()}catch(e){console.error("Failed to reset email event settings:",e),E.Z.fromBackend(e)}},h=e=>{if(e.includes("Virtual Key Created"))return"An email will be sent to the user when a new virtual key is created with their user ID";if(e.includes("New User Invitation"))return"An email will be sent to the email address of the user when a new user is created";{let l=e.split(/(?=[A-Z])/).join(" ").toLowerCase();return"Receive an email notification when ".concat(l)}};return(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(F,{level:4,children:"Email Notifications"}),(0,a.jsx)(y.Z,{children:"Select which events should trigger email notifications."}),(0,a.jsx)(O.Z,{}),s?(0,a.jsx)("div",{style:{textAlign:"center",padding:"20px"},children:(0,a.jsx)(L.Z,{size:"large"})}):(0,a.jsx)("div",{className:"space-y-4",children:r.map(e=>(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(T.Z,{checked:e.enabled,onChange:l=>o(e.event,l.target.checked)}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)(y.Z,{children:e.event}),(0,a.jsx)("div",{className:"text-sm text-gray-500 block",children:h(e.event)})]})]},e.event))}),(0,a.jsxs)("div",{className:"mt-6 flex space-x-4",children:[(0,a.jsx)(t.Z,{onClick:u,disabled:s,children:"Save Changes"}),(0,a.jsx)(t.Z,{onClick:m,variant:"secondary",disabled:s,children:"Reset to Defaults"})]})]})};let{Title:P}=Z.default;var I=e=>{let{accessToken:l,premiumUser:s,alerts:r}=e,c=async()=>{if(!l)return;let e={};r.filter(e=>"email"===e.name).forEach(l=>{var s;Object.entries(null!==(s=l.variables)&&void 0!==s?s:{}).forEach(l=>{let[s,a]=l,t=document.querySelector('input[name="'.concat(s,'"]'));t&&t.value&&(e[s]=null==t?void 0:t.value)})}),console.log("updatedVariables",e);try{await (0,A.setCallbacksCall)(l,{general_settings:{alerting:["email"]},environment_variables:e}),E.Z.success("Email settings updated successfully")}catch(e){E.Z.fromBackend(e)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mt-6 mb-6",children:(0,a.jsx)(R,{accessToken:l})}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(P,{level:4,children:"Email Server Settings"}),(0,a.jsxs)(y.Z,{children:[(0,a.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: email alerts"]})," ",(0,a.jsx)("br",{})]}),(0,a.jsx)("div",{className:"flex w-full",children:r.filter(e=>"email"===e.name).map((e,l)=>{var t;return(0,a.jsx)(f.Z,{children:(0,a.jsx)("ul",{children:(0,a.jsx)(i.Z,{numItems:2,children:Object.entries(null!==(t=e.variables)&&void 0!==t?t:{}).map(e=>{let[l,t]=e;return(0,a.jsxs)("li",{className:"mx-2 my-2",children:[!0!=s&&("EMAIL_LOGO_URL"===l||"EMAIL_SUPPORT_CONTACT"===l)?(0,a.jsxs)("div",{children:[(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:(0,a.jsxs)(y.Z,{className:"mt-2",children:[" ✨ ",l]})}),(0,a.jsx)(v.Z,{name:l,defaultValue:t,type:"password",disabled:!0,style:{width:"400px"}})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"mt-2",children:l}),(0,a.jsx)(v.Z,{name:l,defaultValue:t,type:"password",style:{width:"400px"}})]}),(0,a.jsxs)("p",{style:{fontSize:"small",fontStyle:"italic"},children:["SMTP_HOST"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP host address, e.g. `smtp.resend.com`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PORT"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP port number, e.g. `587`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_USERNAME"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP username, e.g. `username`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PASSWORD"===l&&(0,a.jsx)("span",{style:{color:"red"},children:" Required * "}),"SMTP_SENDER_EMAIL"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the sender email address, e.g. `sender@berri.ai`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"TEST_EMAIL_ADDRESS"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Email Address to send `Test Email Alert` to. example: `info@berri.ai`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"EMAIL_LOGO_URL"===l&&(0,a.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the Logo that appears in the email, pass a url to your logo"}),"EMAIL_SUPPORT_CONTACT"===l&&(0,a.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the support email address that appears in the email. Default is support@berri.ai"})]})]},l)})})})},l)})}),(0,a.jsx)(t.Z,{className:"mt-2",onClick:()=>c(),children:"Save Changes"}),(0,a.jsx)(t.Z,{onClick:async()=>{if(l)try{await (0,A.serviceHealthCheck)(l,"email"),E.Z.success("Email test triggered. Check your configured email inbox/logs.")}catch(e){E.Z.fromBackend(e)}},className:"mx-2",children:"Test Email Alerts"})]})]})},M=s(2740),U=s(19015),B=s(44643),D=s(74998),W=s(41649),q=s(47323),H=e=>{let{alertingSettings:l,handleInputChange:s,handleResetField:n,handleSubmit:i,premiumUser:r}=e,[d]=S.Z.useForm();return(0,a.jsxs)(S.Z,{form:d,onFinish:()=>{console.log("INSIDE ONFINISH");let e=d.getFieldsValue(),l=Object.entries(e).every(e=>{let[l,s]=e;return"boolean"!=typeof s&&(""===s||null==s)});console.log("formData: ".concat(JSON.stringify(e),", isEmpty: ").concat(l)),l?console.log("Some form fields are empty."):i(e)},labelAlign:"left",children:[l.map((e,l)=>(0,a.jsxs)(p.Z,{children:[(0,a.jsxs)(f.Z,{align:"center",children:[(0,a.jsx)(y.Z,{children:e.field_name}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),e.premium_field?r?(0,a.jsx)(S.Z.Item,{name:e.field_name,children:(0,a.jsx)(f.Z,{children:"Integer"===e.field_type?(0,a.jsx)(U.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l)}):"Boolean"===e.field_type?(0,a.jsx)(c.Z,{checked:e.field_value,onChange:l=>s(e.field_name,l)}):(0,a.jsx)(C.default,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}):(0,a.jsx)(f.Z,{children:(0,a.jsx)(t.Z,{className:"flex items-center justify-center",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})})}):(0,a.jsx)(S.Z.Item,{name:e.field_name,className:"mb-0",valuePropName:"Boolean"===e.field_type?"checked":"value",children:(0,a.jsx)(f.Z,{children:"Integer"===e.field_type?(0,a.jsx)(U.Z,{step:1,value:e.field_value,onChange:l=>s(e.field_name,l),className:"p-0"}):"Boolean"===e.field_type?(0,a.jsx)(c.Z,{checked:e.field_value,onChange:l=>{s(e.field_name,l),d.setFieldsValue({[e.field_name]:l})}}):(0,a.jsx)(C.default,{value:e.field_value,onChange:l=>s(e.field_name,l)})})}),(0,a.jsx)(f.Z,{children:!0==e.stored_in_db?(0,a.jsx)(W.Z,{icon:B.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,a.jsx)(W.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,a.jsx)(W.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,a.jsx)(f.Z,{children:(0,a.jsx)(q.Z,{icon:D.Z,color:"red",onClick:()=>n(e.field_name,l),children:"Reset"})})]},l)),(0,a.jsx)("div",{children:(0,a.jsx)(N.ZP,{htmlType:"submit",children:"Update Settings"})})]})},z=e=>{let{accessToken:l,premiumUser:s}=e,[t,n]=(0,k.useState)([]);return(0,k.useEffect)(()=>{l&&(0,A.alertingSettingsCall)(l).then(e=>{n(e)})},[l]),(0,a.jsx)(H,{alertingSettings:t,handleInputChange:(e,l)=>{let s=t.map(s=>s.field_name===e?{...s,field_value:l}:s);console.log("updatedSettings: ".concat(JSON.stringify(s))),n(s)},handleResetField:(e,s)=>{if(l)try{let l=t.map(l=>l.field_name===e?{...l,stored_in_db:null,field_value:l.field_default_value}:l);n(l)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:e=>{if(!l||(console.log("formValues: ".concat(e)),null==e||void 0==e))return;let s={};t.forEach(e=>{s[e.field_name]=e.field_value});let a={...e,...s};console.log("mergedFormValues: ".concat(JSON.stringify(a)));let{slack_alerting:n,...i}=a;console.log("slack_alerting: ".concat(n,", alertingArgs: ").concat(JSON.stringify(i)));try{(0,A.updateConfigFieldSetting)(l,"alerting_args",i),"boolean"==typeof n&&(!0==n?(0,A.updateConfigFieldSetting)(l,"alerting",["slack"]):(0,A.updateConfigFieldSetting)(l,"alerting",[])),E.Z.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:s})},V=s(91126),J=s(53410),G=s(99981),K=s(56609),Q=s(6833);let X=[{value:"success",label:"Success"},{value:"failure",label:"Failure"},{value:"success_and_failure",label:"Success & Failure"}],Y=e=>{let{callbacks:l,availableCallbacks:s={},onTest:n=()=>{},onEdit:i=()=>{},onDelete:r=()=>{},onAdd:c=()=>{}}=e,d=[{title:(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"Callback Name"}),dataIndex:"name",key:"name",render:(e,l)=>{var t;let n=l.name;console.log("availableCallbacks",s);let i=(null===(t=s[n])||void 0===t?void 0:t.ui_callback_name)||n;return(0,a.jsx)("div",{className:"font-medium text-gray-800",children:i})}},{title:(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"Mode"}),key:"mode",render:(e,l)=>{var s;let t=l.mode||"success",n=(null===(s=X.find(e=>e.value===t))||void 0===s?void 0:s.label)||t,i="success"===t?"bg-green-100 text-green-800":"failure"===t?"bg-red-100 text-red-800":"bg-blue-100 text-blue-800";return(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat(i),children:n})},width:240},{title:(0,a.jsx)("span",{className:"font-medium text-gray-700 text-right w-full block",children:"Actions"}),key:"actions",align:"right",render:(e,l)=>(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(G.Z,{title:"Test Callback",children:(0,a.jsx)(q.Z,{icon:V.Z,size:"sm",className:"cursor-pointer text-indigo-600 hover:text-indigo-700",onClick:()=>n(l)})}),(0,a.jsx)(G.Z,{title:"Edit Callback",children:(0,a.jsx)(q.Z,{icon:J.Z,size:"sm",className:"cursor-pointer text-indigo-600 hover:text-indigo-700",onClick:()=>i(l)})}),(0,a.jsx)(G.Z,{title:"Delete Callback",children:(0,a.jsx)(q.Z,{icon:D.Z,size:"sm",className:"cursor-pointer text-indigo-600 hover:text-red-600",onClick:()=>r(l)})})]}),width:240}];return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"w-full mt-4",children:[(0,a.jsx)(t.Z,{onClick:c,className:"mx-auto",children:"+ Add Callback"}),(0,a.jsx)("div",{className:"flex justify-between items-center my-2",children:(0,a.jsx)(Q.Z,{level:4,children:"Active Logging Callbacks"})}),0===l.length?(0,a.jsx)("div",{className:"flex flex-col items-center justify-center p-8 bg-gray-50 border border-gray-200 rounded-lg",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-700 mb-2",children:"No callbacks configured"}),(0,a.jsx)("p",{className:"text-gray-500",children:"Add your first callback to start logging data to external services."})]})}):(0,a.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg overflow-hidden",children:(0,a.jsx)(K.Z,{columns:d,dataSource:l,rowKey:e=>e.name,pagination:!1,rowClassName:()=>"hover:bg-gray-50"})})]})})};var $=s(85968),ee=s(21609);let{Title:el,Paragraph:es}=Z.default,ea=e=>{let{params:l,callbackConfigs:s,selectedCallback:t}=e;return l&&0!==l.length?(0,a.jsx)("div",{className:"space-y-4 mt-6 p-4 bg-gray-50 rounded-lg border",children:l.map(e=>{var l;let n=s.find(e=>e.id===t),i=(null==n?void 0:null===(l=n.dynamic_params)||void 0===l?void 0:l[e])||{},r=i.type||"text",c=i.ui_name||e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),d=i.required||!1;return(0,a.jsx)(M.Z,{label:(0,a.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:[c," "]}),name:e,className:"mb-4",rules:d?[{required:!0,message:"Please enter the ".concat(c.toLowerCase())}]:void 0,children:"password"===r?(0,a.jsx)(C.default.Password,{size:"large",placeholder:"Enter your ".concat(c.toLowerCase()),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}):"number"===r?(0,a.jsx)(C.default,{type:"number",size:"large",placeholder:"Enter ".concat(c.toLowerCase()),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",min:0,max:1,step:.1}):(0,a.jsx)(C.default,{size:"large",placeholder:"Enter your ".concat(c.toLowerCase()),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})},e)})}):null},et=e=>{let{callbackConfigs:l,selectedCallback:s,onCallbackChange:t,disabled:n=!1}=e;return(0,a.jsx)(M.Z,{label:"Callback",name:"callback",rules:n?void 0:[{required:!0,message:"Please select a callback"}],children:(0,a.jsx)(_.default,{placeholder:"Choose a logging callback...",size:"large",className:"w-full",showSearch:!0,disabled:n,value:s,filterOption:(e,l)=>{var s,a;return(null!==(a=null==l?void 0:null===(s=l.value)||void 0===s?void 0:s.toString())&&void 0!==a?a:"").toLowerCase().includes(e.toLowerCase())},onChange:t,children:l.map(e=>{let l=e.logo,s=l&&(l.includes("/")||l.startsWith("data:")||l.startsWith("http"))?l:"".concat("../ui/assets/logos/").concat(l);return(0,a.jsx)(r.Z,{value:e.id,children:(0,a.jsxs)("div",{className:"flex items-center space-x-3 py-1",children:[(0,a.jsx)("div",{className:"w-6 h-6 flex items-center justify-center",children:(0,a.jsx)("img",{src:s,alt:"".concat(e.displayName," logo"),className:"w-6 h-6 rounded object-contain",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsx)("span",{className:"font-medium text-gray-900",children:e.displayName})]})},e.id)})})})},en=(e,l,s)=>{if(!e)return s?Object.keys(s):[];let a=l.find(l=>l.id===e);return(null==a?void 0:a.dynamic_params)?Object.keys(a.dynamic_params):s?Object.keys(s):[]},ei=(e,l)=>({environment_variables:e,litellm_settings:{success_callback:[l]}});var er=e=>{let{accessToken:l,userRole:s,userID:r,premiumUser:Z}=e,[C,_]=(0,k.useState)([]),[O,L]=(0,k.useState)([]),[T,F]=(0,k.useState)(!1),[R]=S.Z.useForm(),[P]=S.Z.useForm(),[M,U]=(0,k.useState)(null),[B,D]=(0,k.useState)(""),[W,q]=(0,k.useState)({}),[H,V]=(0,k.useState)([]),[J,G]=(0,k.useState)(!1),[K,Q]=(0,k.useState)([]),[X,el]=(0,k.useState)({}),[es,er]=(0,k.useState)([]),[ec,ed]=(0,k.useState)(!1),[eo,eu]=(0,k.useState)(null),[em,eh]=(0,k.useState)(!1),[eg,ex]=(0,k.useState)(null),[ef,ej]=(0,k.useState)(!1),[eb,ep]=(0,k.useState)(!1),[ey,ev]=(0,k.useState)(!1);(0,k.useEffect)(()=>{l&&(0,A.getCallbackConfigsCall)(l).then(e=>{Q(e||[])}).catch(e=>{E.Z.fromBackend("Failed to load callback configs: "+(0,$.O)(e))})},[l]),(0,k.useEffect)(()=>{if(ec&&eo){let e=Object.fromEntries(Object.entries(eo.variables||{}).map(e=>{let[l,s]=e;return[l,null!=s?s:""]}));P.setFieldsValue({...e,callback:eo.name})}},[ec,eo,P]);let ek=e=>{H.includes(e)?V(H.filter(l=>l!==e)):V([...H,e])},eZ={llm_exceptions:"LLM Exceptions",llm_too_slow:"LLM Responses Too Slow",llm_requests_hanging:"LLM Requests Hanging",budget_alerts:"Budget Alerts (API Keys, Users)",db_exceptions:"Database Exceptions (Read/Write)",daily_reports:"Weekly/Monthly Spend Reports",outage_alerts:"Outage Alerts",region_outage_alerts:"Region Outage Alerts"};(0,k.useEffect)(()=>{l&&s&&r&&(0,A.getCallbacksCall)(l,r,s).then(e=>{_(e.callbacks),el(e.available_callbacks);let l=e.alerts;if(l&&l.length>0){let e=l[0],s=e.variables.SLACK_WEBHOOK_URL;V(e.active_alerts),D(s),q(e.alerts_to_webhook)}L(l)})},[l,s,r]);let eC=e=>H&&H.includes(e),e_=async(e,a,t)=>{if(!l)return;t?ej(!0):ep(!0);let n=ei(e,a);try{if(await (0,A.setCallbacksCall)(l,n),E.Z.success(t?"Callback updated successfully":"Callback ".concat(a," added successfully")),t?(ed(!1),P.resetFields(),eu(null)):(G(!1),R.resetFields(),U(null),er([])),r&&s){let e=await (0,A.getCallbacksCall)(l,r,s);_(e.callbacks)}}catch(e){E.Z.fromBackend(e)}finally{t?ej(!1):ep(!1)}},eS=async e=>{eo&&await e_(e,eo.name,!0)},ew=async e=>{let l=null==e?void 0:e.callback;l&&await e_(e,l,!1)},eN=async()=>{if(!l)return;let e={};Object.entries(eZ).forEach(l=>{let[s,a]=l,t=document.querySelector('input[name="'.concat(s,'"]')),n=(null==t?void 0:t.value)||"";e[s]=n});try{await (0,A.setCallbacksCall)(l,{general_settings:{alert_to_webhook_url:e,alert_types:H}})}catch(e){E.Z.fromBackend(e)}E.Z.success("Alerts updated successfully")},eE=e=>{ex(e),eh(!0)},eA=async()=>{if(eg&&l)try{if(ev(!0),await (0,A.deleteCallback)(l,eg.name),E.Z.success("Callback ".concat(eg.name," deleted successfully")),r&&s){let e=await (0,A.getCallbacksCall)(l,r,s);_(e.callbacks)}eh(!1),ex(null)}catch(e){console.error("Failed to delete callback:",e),E.Z.fromBackend(e)}finally{ev(!1)}};return l?(0,a.jsxs)("div",{className:"w-full mx-4",children:[(0,a.jsx)(i.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,a.jsxs)(o.Z,{children:[(0,a.jsxs)(u.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(d.Z,{value:"1",children:"Logging Callbacks"}),(0,a.jsx)(d.Z,{value:"2",children:"Alerting Types"}),(0,a.jsx)(d.Z,{value:"3",children:"Alerting Settings"}),(0,a.jsx)(d.Z,{value:"4",children:"Email Alerts"})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(m.Z,{children:(0,a.jsx)(Y,{callbacks:C,availableCallbacks:X,onAdd:()=>G(!0),onEdit:e=>{eu(e),ed(!0)},onDelete:e=>eE(e),onTest:async e=>{try{await (0,A.serviceHealthCheck)(l,e.name),E.Z.success("Health check triggered")}catch(e){E.Z.fromBackend((0,$.O)(e))}}})}),(0,a.jsx)(m.Z,{children:(0,a.jsxs)(n.Z,{children:[(0,a.jsxs)(y.Z,{className:"my-2",children:["Alerts are only supported for Slack Webhook URLs. Get your webhook urls from"," ",(0,a.jsx)("a",{href:"https://api.slack.com/messaging/webhooks",target:"_blank",style:{color:"blue"},children:"here"})]}),(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(j.Z,{children:(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(b.Z,{}),(0,a.jsx)(b.Z,{}),(0,a.jsx)(b.Z,{children:"Slack Webhook URL"})]})}),(0,a.jsx)(x.Z,{children:Object.entries(eZ).map((e,l)=>{let[s,n]=e;return(0,a.jsxs)(p.Z,{children:[(0,a.jsx)(f.Z,{children:"region_outage_alerts"==s?Z?(0,a.jsx)(c.Z,{id:"switch",name:"switch",checked:eC(s),onChange:()=>ek(s)}):(0,a.jsx)(t.Z,{className:"flex items-center justify-center",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})}):(0,a.jsx)(c.Z,{id:"switch",name:"switch",checked:eC(s),onChange:()=>ek(s)})}),(0,a.jsx)(f.Z,{children:(0,a.jsx)(y.Z,{children:n})}),(0,a.jsx)(f.Z,{children:(0,a.jsx)(v.Z,{name:s,type:"password",defaultValue:W&&W[s]?W[s]:B})})]},l)})})]}),(0,a.jsx)(t.Z,{size:"xs",className:"mt-2",onClick:eN,children:"Save Changes"}),(0,a.jsx)(t.Z,{onClick:async()=>{try{await (0,A.serviceHealthCheck)(l,"slack"),E.Z.success("Alert test triggered. Test request to slack made - check logs/alerts on slack to verify")}catch(e){E.Z.fromBackend((0,$.O)(e))}},className:"mx-2",children:"Test Alerts"})]})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(z,{accessToken:l,premiumUser:Z})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(I,{accessToken:l,premiumUser:Z,alerts:O})})]})]})}),(0,a.jsxs)(w.Z,{title:"Add Logging Callback",open:J,width:800,onCancel:()=>{G(!1),U(null),er([])},footer:null,children:[(0,a.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/logging",className:"mb-8 mt-4",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: Logging"]}),(0,a.jsxs)(S.Z,{form:R,onFinish:ew,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsx)(et,{callbackConfigs:K,selectedCallback:M,onCallbackChange:e=>{U(e),er(en(e,K))}}),(0,a.jsx)(ea,{params:es,callbackConfigs:K,selectedCallback:M}),(0,a.jsxs)("div",{className:"flex justify-end space-x-3 pt-6 mt-6 border-t border-gray-200",children:[(0,a.jsx)(N.ZP,{onClick:()=>{G(!1),U(null),er([]),R.resetFields()},disabled:eb,children:"Cancel"}),(0,a.jsx)(N.ZP,{htmlType:"submit",loading:eb,disabled:eb,children:eb?"Adding...":"Add Callback"})]})]})]}),(0,a.jsx)(w.Z,{open:ec,width:800,title:"Edit Callback Settings",onCancel:()=>{ed(!1),eu(null),P.resetFields()},footer:null,children:(0,a.jsxs)(S.Z,{form:P,onFinish:eS,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[eo&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(et,{callbackConfigs:K,selectedCallback:eo.name,onCallbackChange:()=>{},disabled:!0}),(0,a.jsx)(ea,{params:en(eo.name,K,eo.variables),callbackConfigs:K,selectedCallback:eo.name})]}),(0,a.jsxs)("div",{className:"flex justify-end space-x-3 pt-6 mt-6 border-t border-gray-200",children:[(0,a.jsx)(N.ZP,{onClick:()=>{ed(!1),eu(null),P.resetFields()},disabled:ef,children:"Cancel"}),(0,a.jsx)(N.ZP,{onClick:()=>{P.submit()},loading:ef,disabled:ef,children:ef?"Saving...":"Save Changes"})]})]})}),(0,a.jsx)(ee.Z,{isOpen:em,title:"Delete Callback",message:"Are you sure you want to delete this callback? This action cannot be undone.",resourceInformationTitle:"Callback Information",resourceInformation:[{label:"Callback Name",value:null==eg?void 0:eg.name},{label:"Mode",value:(null==eg?void 0:eg.mode)||"success"}],onCancel:()=>{eh(!1),ex(null)},onOk:eA,confirmLoading:ey})]}):null}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9349-61f99afd33bbc9e3.js b/litellm/proxy/_experimental/out/_next/static/chunks/9349-2a551af80b6b2fbc.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/9349-61f99afd33bbc9e3.js rename to litellm/proxy/_experimental/out/_next/static/chunks/9349-2a551af80b6b2fbc.js index 7b003917ced..0314cdefa9b 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/9349-61f99afd33bbc9e3.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/9349-2a551af80b6b2fbc.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9349],{75105:function(e,t,n){n.d(t,{Z:function(){return ea}});var r=n(5853),a=n(2265),o=n(47625),i=n(93765),l=n(87602),s=n(84735),c=n(86757),u=n.n(c),d=n(95645),p=n.n(d),f=n(77571),m=n.n(f),h=n(82559),y=n.n(h),v=n(21652),b=n.n(v),g=n(57165),k=n(81889),x=n(9841),w=n(58772),A=n(34067),E=n(16630),O=n(85355),j=n(82944),P=["layout","type","stroke","connectNulls","isRange","ref"],L=["key"];function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function D(){return(D=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!b()(l,r)||!b()(s,a))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(r,a,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,r=t.dot,o=t.points,i=t.className,s=t.top,c=t.left,u=t.xAxis,d=t.yAxis,p=t.width,f=t.height,h=t.isAnimationActive,y=t.id;if(n||!o||!o.length)return null;var v=this.state.isAnimationFinished,b=1===o.length,g=(0,l.Z)("recharts-area",i),k=u&&u.allowDataOverflow,A=d&&d.allowDataOverflow,E=k||A,O=m()(y)?this.id:y,P=null!==(e=(0,j.L6)(r,!1))&&void 0!==e?e:{r:3,strokeWidth:2},L=P.r,S=P.strokeWidth,C=((0,j.jf)(r)?r:{}).clipDot,D=void 0===C||C,N=2*(void 0===L?3:L)+(void 0===S?2:S);return a.createElement(x.m,{className:g},k||A?a.createElement("defs",null,a.createElement("clipPath",{id:"clipPath-".concat(O)},a.createElement("rect",{x:k?c:c-p/2,y:A?s:s-f/2,width:k?p:2*p,height:A?f:2*f})),!D&&a.createElement("clipPath",{id:"clipPath-dots-".concat(O)},a.createElement("rect",{x:c-N/2,y:s-N/2,width:p+N,height:f+N}))):null,b?null:this.renderArea(E,O),(r||b)&&this.renderDots(E,D,O),(!h||v)&&w.e.renderCallByParent(this.props,o))}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}:e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null}}],t&&T(r.prototype,t),n&&T(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(a.PureComponent);R(I,"displayName","Area"),R(I,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!A.x.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),R(I,"getBaseValue",function(e,t,n,r){var a=e.layout,o=e.baseValue,i=t.props.baseValue,l=null!=i?i:o;if((0,E.hj)(l)&&"number"==typeof l)return l;var s="horizontal"===a?r:n,c=s.scale.domain();if("number"===s.type){var u=Math.max(c[0],c[1]),d=Math.min(c[0],c[1]);return"dataMin"===l?d:"dataMax"===l?u:u<0?u:Math.max(Math.min(c[0],c[1]),0)}return"dataMin"===l?c[0]:"dataMax"===l?c[1]:c[0]}),R(I,"getComposedData",function(e){var t,n=e.props,r=e.item,a=e.xAxis,o=e.yAxis,i=e.xAxisTicks,l=e.yAxisTicks,s=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,p=e.displayedData,f=e.offset,m=n.layout,h=u&&u.length,y=I.getBaseValue(n,r,a,o),v="horizontal"===m,b=!1,g=p.map(function(e,t){h?n=u[d+t]:Array.isArray(n=(0,O.F$)(e,c))?b=!0:n=[y,n];var n,r=null==n[1]||h&&null==(0,O.F$)(e,c);return v?{x:(0,O.Hv)({axis:a,ticks:i,bandSize:s,entry:e,index:t}),y:r?null:o.scale(n[1]),value:n,payload:e}:{x:r?null:a.scale(n[1]),y:(0,O.Hv)({axis:o,ticks:l,bandSize:s,entry:e,index:t}),value:n,payload:e}});return t=h||b?g.map(function(e){var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:null!=t&&null!=e.y?o.scale(t):null}:{x:null!=t?a.scale(t):null,y:e.y}}):v?o.scale(y):a.scale(y),M({points:g,baseLine:t,layout:m,isRange:b},f)}),R(I,"renderDotItem",function(e,t){var n;if(a.isValidElement(e))n=a.cloneElement(e,t);else if(u()(e))n=e(t);else{var r=(0,l.Z)("recharts-area-dot","boolean"!=typeof e?e.className:""),o=t.key,i=C(t,L);n=a.createElement(k.o,D({},i,{key:o,className:r}))}return n});var Z=n(97059),_=n(62994),V=n(25311),z=(0,i.z)({chartName:"AreaChart",GraphicalChild:I,axisComponents:[{axisType:"xAxis",AxisComp:Z.K},{axisType:"yAxis",AxisComp:_.B}],formatAxisMap:V.t9}),G=n(56940),H=n(26680),q=n(8147),$=n(22190),X=n(54061),U=n(65278),Y=n(98593),J=n(92666),Q=n(32644),ee=n(7084),et=n(26898),en=n(13241),er=n(1153);let ea=a.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:l,stack:s=!1,colors:c=et.s,valueFormatter:u=er.Cj,startEndOnly:d=!1,showXAxis:p=!0,showYAxis:f=!0,yAxisWidth:m=56,intervalType:h="equidistantPreserveStart",showAnimation:y=!1,animationDuration:v=900,showTooltip:b=!0,showLegend:g=!0,showGridLines:x=!0,showGradient:w=!0,autoMinValue:A=!1,curveType:E="linear",minValue:O,maxValue:j,connectNulls:P=!1,allowDecimals:L=!0,noDataText:S,className:C,onValueChange:D,enableLegendSlider:N=!1,customTooltip:M,rotateLabelX:T,padding:B=(p||f)&&(!d||f)?{left:20,right:20}:{left:0,right:0},tickGap:W=5,xAxisLabel:K,yAxisLabel:R}=e,F=(0,r._T)(e,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","padding","tickGap","xAxisLabel","yAxisLabel"]),[V,ea]=(0,a.useState)(60),[eo,ei]=(0,a.useState)(void 0),[el,es]=(0,a.useState)(void 0),ec=(0,Q.me)(i,c),eu=(0,Q.i4)(A,O,j),ed=!!D;function ep(e){ed&&(e===el&&!eo||(0,Q.FB)(n,e)&&eo&&eo.dataKey===e?(es(void 0),null==D||D(null)):(es(e),null==D||D({eventType:"category",categoryClicked:e})),ei(void 0))}return a.createElement("div",Object.assign({ref:t,className:(0,en.q)("w-full h-80",C)},F),a.createElement(o.h,{className:"h-full w-full"},(null==n?void 0:n.length)?a.createElement(z,{data:n,onClick:ed&&(el||eo)?()=>{ei(void 0),es(void 0),null==D||D(null)}:void 0,margin:{bottom:K?30:void 0,left:R?20:void 0,right:R?5:void 0,top:5}},x?a.createElement(G.q,{className:(0,en.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,a.createElement(Z.K,{padding:B,hide:!p,dataKey:l,tick:{transform:"translate(0, 6)"},ticks:d?[n[0][l],n[n.length-1][l]]:void 0,fill:"",stroke:"",className:(0,en.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:d?"preserveStartEnd":h,tickLine:!1,axisLine:!1,minTickGap:W,angle:null==T?void 0:T.angle,dy:null==T?void 0:T.verticalShift,height:null==T?void 0:T.xAxisHeight},K&&a.createElement(H._,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},K)),a.createElement(_.B,{width:m,hide:!f,axisLine:!1,tickLine:!1,type:"number",domain:eu,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,en.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:u,allowDecimals:L},R&&a.createElement(H._,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},R)),a.createElement(q.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:b?e=>{let{active:t,payload:n,label:r}=e;return M?a.createElement(M,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=ec.get(e.dataKey))&&void 0!==t?t:ee.fr.Gray})}),active:t,label:r}):a.createElement(Y.ZP,{active:t,payload:n,label:r,valueFormatter:u,categoryColors:ec})}:a.createElement(a.Fragment,null),position:{y:0}}),g?a.createElement($.D,{verticalAlign:"top",height:V,content:e=>{let{payload:t}=e;return(0,U.Z)({payload:t},ec,ea,el,ed?e=>ep(e):void 0,N)}}):null,i.map(e=>{var t,n,r;let o=(null!==(t=ec.get(e))&&void 0!==t?t:ee.fr.Gray).replace("#","");return a.createElement("defs",{key:e},w?a.createElement("linearGradient",{className:(0,er.bM)(null!==(n=ec.get(e))&&void 0!==n?n:ee.fr.Gray,et.K.text).textColor,id:o,x1:"0",y1:"0",x2:"0",y2:"1"},a.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:eo||el&&el!==e?.15:.4}),a.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):a.createElement("linearGradient",{className:(0,er.bM)(null!==(r=ec.get(e))&&void 0!==r?r:ee.fr.Gray,et.K.text).textColor,id:o,x1:"0",y1:"0",x2:"0",y2:"1"},a.createElement("stop",{stopColor:"currentColor",stopOpacity:eo||el&&el!==e?.1:.3})))}),i.map(e=>{var t,r;let o=(null!==(t=ec.get(e))&&void 0!==t?t:ee.fr.Gray).replace("#","");return a.createElement(I,{className:(0,er.bM)(null!==(r=ec.get(e))&&void 0!==r?r:ee.fr.Gray,et.K.text).strokeColor,strokeOpacity:eo||el&&el!==e?.3:1,activeDot:e=>{var t;let{cx:r,cy:o,stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,dataKey:u}=e;return a.createElement(k.o,{className:(0,en.q)("stroke-tremor-background dark:stroke-dark-tremor-background",D?"cursor-pointer":"",(0,er.bM)(null!==(t=ec.get(u))&&void 0!==t?t:ee.fr.Gray,et.K.text).fillColor),cx:r,cy:o,r:5,fill:"",stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,onClick:(t,r)=>{r.stopPropagation(),ed&&(e.index===(null==eo?void 0:eo.index)&&e.dataKey===(null==eo?void 0:eo.dataKey)||(0,Q.FB)(n,e.dataKey)&&el&&el===e.dataKey?(es(void 0),ei(void 0),null==D||D(null)):(es(e.dataKey),ei({index:e.index,dataKey:e.dataKey}),null==D||D(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var r;let{stroke:o,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,cx:c,cy:u,dataKey:d,index:p}=t;return(0,Q.FB)(n,e)&&!(eo||el&&el!==e)||(null==eo?void 0:eo.index)===p&&(null==eo?void 0:eo.dataKey)===e?a.createElement(k.o,{key:p,cx:c,cy:u,r:5,stroke:o,fill:"",strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,className:(0,en.q)("stroke-tremor-background dark:stroke-dark-tremor-background",D?"cursor-pointer":"",(0,er.bM)(null!==(r=ec.get(d))&&void 0!==r?r:ee.fr.Gray,et.K.text).fillColor)}):a.createElement(a.Fragment,{key:p})},key:e,name:e,type:E,dataKey:e,stroke:"",fill:"url(#".concat(o,")"),strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:y,animationDuration:v,stackId:s?"a":void 0,connectNulls:P})}),D?i.map(e=>a.createElement(X.x,{className:(0,en.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:E,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:P,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;ep(n)}})):null):a.createElement(J.Z,{noDataText:S})))});ea.displayName="AreaChart"},32489:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},54061:function(e,t,n){n.d(t,{x:function(){return W}});var r=n(2265),a=n(84735),o=n(86757),i=n.n(o),l=n(77571),s=n.n(l),c=n(21652),u=n.n(c),d=n(87602),p=n(57165),f=n(81889),m=n(9841),h=n(58772),y=n(13137),v=n(16630),b=n(82944),g=n(34067),k=n(85355),x=["type","layout","connectNulls","ref"],w=["key"];function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function O(){return(O=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ni){s=[].concat(L(r.slice(0,c)),[i-u]);break}var d=s.length%2==0?[0,l]:[l];return[].concat(L(o.repeat(r,Math.floor(t/a))),L(s),d).map(function(e){return"".concat(e,"px")}).join(", ")}),T(e,"id",(0,v.EL)("recharts-line-")),T(e,"pathRef",function(t){e.mainCurve=t}),T(e,"handleAnimationEnd",function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),T(e,"handleAnimationStart",function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(o,e),t=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,a=n.points,o=n.xAxis,i=n.yAxis,l=n.layout,s=n.children,c=(0,b.NN)(s,y.W);if(!c)return null;var u=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:(0,k.F$)(e.payload,t)}};return r.createElement(m.m,{clipPath:e?"url(#clipPath-".concat(t,")"):null},c.map(function(e){return r.cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:a,xAxis:o,yAxis:i,layout:l,dataPointFormatter:u})}))}},{key:"renderDots",value:function(e,t,n){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,i=a.dot,l=a.points,s=a.dataKey,c=(0,b.L6)(this.props,!1),u=(0,b.L6)(i,!0),d=l.map(function(e,t){var n=P(P(P({key:"dot-".concat(t),r:3},c),u),{},{index:t,cx:e.x,cy:e.y,value:e.value,dataKey:s,payload:e.payload,points:l});return o.renderDotItem(i,n)}),p={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(n,")"):null};return r.createElement(m.m,O({className:"recharts-line-dots",key:"dots"},p),d)}},{key:"renderCurveStatically",value:function(e,t,n,a){var o=this.props,i=o.type,l=o.layout,s=o.connectNulls,c=(o.ref,E(o,x)),u=P(P(P({},(0,b.L6)(c,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(n,")"):null,points:e},a),{},{type:i,layout:l,connectNulls:s});return r.createElement(p.H,O({},u,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var n=this,o=this.props,i=o.points,l=o.strokeDasharray,s=o.isAnimationActive,c=o.animationBegin,u=o.animationDuration,d=o.animationEasing,p=o.animationId,f=o.animateNewValues,m=o.width,h=o.height,y=this.state,b=y.prevPoints,g=y.totalLength;return r.createElement(a.ZP,{begin:c,duration:u,isActive:s,easing:d,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var a,o=r.t;if(b){var s=b.length/i.length,c=i.map(function(e,t){var n=Math.floor(t*s);if(b[n]){var r=b[n],a=(0,v.k4)(r.x,e.x),i=(0,v.k4)(r.y,e.y);return P(P({},e),{},{x:a(o),y:i(o)})}if(f){var l=(0,v.k4)(2*m,e.x),c=(0,v.k4)(h/2,e.y);return P(P({},e),{},{x:l(o),y:c(o)})}return P(P({},e),{},{x:e.x,y:e.y})});return n.renderCurveStatically(c,e,t)}var u=(0,v.k4)(0,g)(o);if(l){var d="".concat(l).split(/[,\s]+/gim).map(function(e){return parseFloat(e)});a=n.getStrokeDasharray(u,g,d)}else a=n.generateSimpleStrokeDasharray(g,u);return n.renderCurveStatically(i,e,t,{strokeDasharray:a})})}},{key:"renderCurve",value:function(e,t){var n=this.props,r=n.points,a=n.isAnimationActive,o=this.state,i=o.prevPoints,l=o.totalLength;return a&&r&&r.length&&(!i&&l>0||!u()(i,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,a=t.dot,o=t.points,i=t.className,l=t.xAxis,c=t.yAxis,u=t.top,p=t.left,f=t.width,y=t.height,v=t.isAnimationActive,g=t.id;if(n||!o||!o.length)return null;var k=this.state.isAnimationFinished,x=1===o.length,w=(0,d.Z)("recharts-line",i),A=l&&l.allowDataOverflow,E=c&&c.allowDataOverflow,O=A||E,j=s()(g)?this.id:g,P=null!==(e=(0,b.L6)(a,!1))&&void 0!==e?e:{r:3,strokeWidth:2},L=P.r,S=P.strokeWidth,C=((0,b.jf)(a)?a:{}).clipDot,D=void 0===C||C,N=2*(void 0===L?3:L)+(void 0===S?2:S);return r.createElement(m.m,{className:w},A||E?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(j)},r.createElement("rect",{x:A?p:p-f/2,y:E?u:u-y/2,width:A?f:2*f,height:E?y:2*y})),!D&&r.createElement("clipPath",{id:"clipPath-dots-".concat(j)},r.createElement("rect",{x:p-N/2,y:u-N/2,width:f+N,height:y+N}))):null,!x&&this.renderCurve(O,j),this.renderErrorBar(O,j),(x||a)&&this.renderDots(O,D,j),(!v||k)&&h.e.renderCallByParent(this.props,o))}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var n=e.length%2!=0?[].concat(L(e),[0]):e,r=[],a=0;a=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function D(){return(D=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!b()(l,r)||!b()(s,a))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(r,a,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,r=t.dot,o=t.points,i=t.className,s=t.top,c=t.left,u=t.xAxis,d=t.yAxis,p=t.width,f=t.height,h=t.isAnimationActive,y=t.id;if(n||!o||!o.length)return null;var v=this.state.isAnimationFinished,b=1===o.length,g=(0,l.Z)("recharts-area",i),k=u&&u.allowDataOverflow,A=d&&d.allowDataOverflow,E=k||A,O=m()(y)?this.id:y,P=null!==(e=(0,j.L6)(r,!1))&&void 0!==e?e:{r:3,strokeWidth:2},L=P.r,S=P.strokeWidth,C=((0,j.jf)(r)?r:{}).clipDot,D=void 0===C||C,N=2*(void 0===L?3:L)+(void 0===S?2:S);return a.createElement(x.m,{className:g},k||A?a.createElement("defs",null,a.createElement("clipPath",{id:"clipPath-".concat(O)},a.createElement("rect",{x:k?c:c-p/2,y:A?s:s-f/2,width:k?p:2*p,height:A?f:2*f})),!D&&a.createElement("clipPath",{id:"clipPath-dots-".concat(O)},a.createElement("rect",{x:c-N/2,y:s-N/2,width:p+N,height:f+N}))):null,b?null:this.renderArea(E,O),(r||b)&&this.renderDots(E,D,O),(!h||v)&&w.e.renderCallByParent(this.props,o))}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}:e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null}}],t&&T(r.prototype,t),n&&T(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(a.PureComponent);R(I,"displayName","Area"),R(I,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!A.x.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),R(I,"getBaseValue",function(e,t,n,r){var a=e.layout,o=e.baseValue,i=t.props.baseValue,l=null!=i?i:o;if((0,E.hj)(l)&&"number"==typeof l)return l;var s="horizontal"===a?r:n,c=s.scale.domain();if("number"===s.type){var u=Math.max(c[0],c[1]),d=Math.min(c[0],c[1]);return"dataMin"===l?d:"dataMax"===l?u:u<0?u:Math.max(Math.min(c[0],c[1]),0)}return"dataMin"===l?c[0]:"dataMax"===l?c[1]:c[0]}),R(I,"getComposedData",function(e){var t,n=e.props,r=e.item,a=e.xAxis,o=e.yAxis,i=e.xAxisTicks,l=e.yAxisTicks,s=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,p=e.displayedData,f=e.offset,m=n.layout,h=u&&u.length,y=I.getBaseValue(n,r,a,o),v="horizontal"===m,b=!1,g=p.map(function(e,t){h?n=u[d+t]:Array.isArray(n=(0,O.F$)(e,c))?b=!0:n=[y,n];var n,r=null==n[1]||h&&null==(0,O.F$)(e,c);return v?{x:(0,O.Hv)({axis:a,ticks:i,bandSize:s,entry:e,index:t}),y:r?null:o.scale(n[1]),value:n,payload:e}:{x:r?null:a.scale(n[1]),y:(0,O.Hv)({axis:o,ticks:l,bandSize:s,entry:e,index:t}),value:n,payload:e}});return t=h||b?g.map(function(e){var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:null!=t&&null!=e.y?o.scale(t):null}:{x:null!=t?a.scale(t):null,y:e.y}}):v?o.scale(y):a.scale(y),M({points:g,baseLine:t,layout:m,isRange:b},f)}),R(I,"renderDotItem",function(e,t){var n;if(a.isValidElement(e))n=a.cloneElement(e,t);else if(u()(e))n=e(t);else{var r=(0,l.Z)("recharts-area-dot","boolean"!=typeof e?e.className:""),o=t.key,i=C(t,L);n=a.createElement(k.o,D({},i,{key:o,className:r}))}return n});var Z=n(97059),_=n(62994),V=n(25311),z=(0,i.z)({chartName:"AreaChart",GraphicalChild:I,axisComponents:[{axisType:"xAxis",AxisComp:Z.K},{axisType:"yAxis",AxisComp:_.B}],formatAxisMap:V.t9}),G=n(56940),H=n(26680),q=n(8147),$=n(22190),X=n(54061),U=n(65278),Y=n(98593),J=n(92666),Q=n(32644),ee=n(7084),et=n(26898),en=n(13241),er=n(1153);let ea=a.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:l,stack:s=!1,colors:c=et.s,valueFormatter:u=er.Cj,startEndOnly:d=!1,showXAxis:p=!0,showYAxis:f=!0,yAxisWidth:m=56,intervalType:h="equidistantPreserveStart",showAnimation:y=!1,animationDuration:v=900,showTooltip:b=!0,showLegend:g=!0,showGridLines:x=!0,showGradient:w=!0,autoMinValue:A=!1,curveType:E="linear",minValue:O,maxValue:j,connectNulls:P=!1,allowDecimals:L=!0,noDataText:S,className:C,onValueChange:D,enableLegendSlider:N=!1,customTooltip:M,rotateLabelX:T,padding:B=(p||f)&&(!d||f)?{left:20,right:20}:{left:0,right:0},tickGap:W=5,xAxisLabel:K,yAxisLabel:R}=e,F=(0,r._T)(e,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","padding","tickGap","xAxisLabel","yAxisLabel"]),[V,ea]=(0,a.useState)(60),[eo,ei]=(0,a.useState)(void 0),[el,es]=(0,a.useState)(void 0),ec=(0,Q.me)(i,c),eu=(0,Q.i4)(A,O,j),ed=!!D;function ep(e){ed&&(e===el&&!eo||(0,Q.FB)(n,e)&&eo&&eo.dataKey===e?(es(void 0),null==D||D(null)):(es(e),null==D||D({eventType:"category",categoryClicked:e})),ei(void 0))}return a.createElement("div",Object.assign({ref:t,className:(0,en.q)("w-full h-80",C)},F),a.createElement(o.h,{className:"h-full w-full"},(null==n?void 0:n.length)?a.createElement(z,{data:n,onClick:ed&&(el||eo)?()=>{ei(void 0),es(void 0),null==D||D(null)}:void 0,margin:{bottom:K?30:void 0,left:R?20:void 0,right:R?5:void 0,top:5}},x?a.createElement(G.q,{className:(0,en.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,a.createElement(Z.K,{padding:B,hide:!p,dataKey:l,tick:{transform:"translate(0, 6)"},ticks:d?[n[0][l],n[n.length-1][l]]:void 0,fill:"",stroke:"",className:(0,en.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:d?"preserveStartEnd":h,tickLine:!1,axisLine:!1,minTickGap:W,angle:null==T?void 0:T.angle,dy:null==T?void 0:T.verticalShift,height:null==T?void 0:T.xAxisHeight},K&&a.createElement(H._,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},K)),a.createElement(_.B,{width:m,hide:!f,axisLine:!1,tickLine:!1,type:"number",domain:eu,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,en.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:u,allowDecimals:L},R&&a.createElement(H._,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},R)),a.createElement(q.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:b?e=>{let{active:t,payload:n,label:r}=e;return M?a.createElement(M,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=ec.get(e.dataKey))&&void 0!==t?t:ee.fr.Gray})}),active:t,label:r}):a.createElement(Y.ZP,{active:t,payload:n,label:r,valueFormatter:u,categoryColors:ec})}:a.createElement(a.Fragment,null),position:{y:0}}),g?a.createElement($.D,{verticalAlign:"top",height:V,content:e=>{let{payload:t}=e;return(0,U.Z)({payload:t},ec,ea,el,ed?e=>ep(e):void 0,N)}}):null,i.map(e=>{var t,n,r;let o=(null!==(t=ec.get(e))&&void 0!==t?t:ee.fr.Gray).replace("#","");return a.createElement("defs",{key:e},w?a.createElement("linearGradient",{className:(0,er.bM)(null!==(n=ec.get(e))&&void 0!==n?n:ee.fr.Gray,et.K.text).textColor,id:o,x1:"0",y1:"0",x2:"0",y2:"1"},a.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:eo||el&&el!==e?.15:.4}),a.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):a.createElement("linearGradient",{className:(0,er.bM)(null!==(r=ec.get(e))&&void 0!==r?r:ee.fr.Gray,et.K.text).textColor,id:o,x1:"0",y1:"0",x2:"0",y2:"1"},a.createElement("stop",{stopColor:"currentColor",stopOpacity:eo||el&&el!==e?.1:.3})))}),i.map(e=>{var t,r;let o=(null!==(t=ec.get(e))&&void 0!==t?t:ee.fr.Gray).replace("#","");return a.createElement(I,{className:(0,er.bM)(null!==(r=ec.get(e))&&void 0!==r?r:ee.fr.Gray,et.K.text).strokeColor,strokeOpacity:eo||el&&el!==e?.3:1,activeDot:e=>{var t;let{cx:r,cy:o,stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,dataKey:u}=e;return a.createElement(k.o,{className:(0,en.q)("stroke-tremor-background dark:stroke-dark-tremor-background",D?"cursor-pointer":"",(0,er.bM)(null!==(t=ec.get(u))&&void 0!==t?t:ee.fr.Gray,et.K.text).fillColor),cx:r,cy:o,r:5,fill:"",stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,onClick:(t,r)=>{r.stopPropagation(),ed&&(e.index===(null==eo?void 0:eo.index)&&e.dataKey===(null==eo?void 0:eo.dataKey)||(0,Q.FB)(n,e.dataKey)&&el&&el===e.dataKey?(es(void 0),ei(void 0),null==D||D(null)):(es(e.dataKey),ei({index:e.index,dataKey:e.dataKey}),null==D||D(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var r;let{stroke:o,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,cx:c,cy:u,dataKey:d,index:p}=t;return(0,Q.FB)(n,e)&&!(eo||el&&el!==e)||(null==eo?void 0:eo.index)===p&&(null==eo?void 0:eo.dataKey)===e?a.createElement(k.o,{key:p,cx:c,cy:u,r:5,stroke:o,fill:"",strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,className:(0,en.q)("stroke-tremor-background dark:stroke-dark-tremor-background",D?"cursor-pointer":"",(0,er.bM)(null!==(r=ec.get(d))&&void 0!==r?r:ee.fr.Gray,et.K.text).fillColor)}):a.createElement(a.Fragment,{key:p})},key:e,name:e,type:E,dataKey:e,stroke:"",fill:"url(#".concat(o,")"),strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:y,animationDuration:v,stackId:s?"a":void 0,connectNulls:P})}),D?i.map(e=>a.createElement(X.x,{className:(0,en.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:E,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:P,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;ep(n)}})):null):a.createElement(J.Z,{noDataText:S})))});ea.displayName="AreaChart"},32489:function(e,t,n){n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},54061:function(e,t,n){n.d(t,{x:function(){return W}});var r=n(2265),a=n(84735),o=n(86757),i=n.n(o),l=n(77571),s=n.n(l),c=n(21652),u=n.n(c),d=n(61994),p=n(57165),f=n(81889),m=n(9841),h=n(58772),y=n(13137),v=n(16630),b=n(82944),g=n(34067),k=n(85355),x=["type","layout","connectNulls","ref"],w=["key"];function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function O(){return(O=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ni){s=[].concat(L(r.slice(0,c)),[i-u]);break}var d=s.length%2==0?[0,l]:[l];return[].concat(L(o.repeat(r,Math.floor(t/a))),L(s),d).map(function(e){return"".concat(e,"px")}).join(", ")}),T(e,"id",(0,v.EL)("recharts-line-")),T(e,"pathRef",function(t){e.mainCurve=t}),T(e,"handleAnimationEnd",function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),T(e,"handleAnimationStart",function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(o,e),t=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,a=n.points,o=n.xAxis,i=n.yAxis,l=n.layout,s=n.children,c=(0,b.NN)(s,y.W);if(!c)return null;var u=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:(0,k.F$)(e.payload,t)}};return r.createElement(m.m,{clipPath:e?"url(#clipPath-".concat(t,")"):null},c.map(function(e){return r.cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:a,xAxis:o,yAxis:i,layout:l,dataPointFormatter:u})}))}},{key:"renderDots",value:function(e,t,n){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,i=a.dot,l=a.points,s=a.dataKey,c=(0,b.L6)(this.props,!1),u=(0,b.L6)(i,!0),d=l.map(function(e,t){var n=P(P(P({key:"dot-".concat(t),r:3},c),u),{},{index:t,cx:e.x,cy:e.y,value:e.value,dataKey:s,payload:e.payload,points:l});return o.renderDotItem(i,n)}),p={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(n,")"):null};return r.createElement(m.m,O({className:"recharts-line-dots",key:"dots"},p),d)}},{key:"renderCurveStatically",value:function(e,t,n,a){var o=this.props,i=o.type,l=o.layout,s=o.connectNulls,c=(o.ref,E(o,x)),u=P(P(P({},(0,b.L6)(c,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(n,")"):null,points:e},a),{},{type:i,layout:l,connectNulls:s});return r.createElement(p.H,O({},u,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var n=this,o=this.props,i=o.points,l=o.strokeDasharray,s=o.isAnimationActive,c=o.animationBegin,u=o.animationDuration,d=o.animationEasing,p=o.animationId,f=o.animateNewValues,m=o.width,h=o.height,y=this.state,b=y.prevPoints,g=y.totalLength;return r.createElement(a.ZP,{begin:c,duration:u,isActive:s,easing:d,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var a,o=r.t;if(b){var s=b.length/i.length,c=i.map(function(e,t){var n=Math.floor(t*s);if(b[n]){var r=b[n],a=(0,v.k4)(r.x,e.x),i=(0,v.k4)(r.y,e.y);return P(P({},e),{},{x:a(o),y:i(o)})}if(f){var l=(0,v.k4)(2*m,e.x),c=(0,v.k4)(h/2,e.y);return P(P({},e),{},{x:l(o),y:c(o)})}return P(P({},e),{},{x:e.x,y:e.y})});return n.renderCurveStatically(c,e,t)}var u=(0,v.k4)(0,g)(o);if(l){var d="".concat(l).split(/[,\s]+/gim).map(function(e){return parseFloat(e)});a=n.getStrokeDasharray(u,g,d)}else a=n.generateSimpleStrokeDasharray(g,u);return n.renderCurveStatically(i,e,t,{strokeDasharray:a})})}},{key:"renderCurve",value:function(e,t){var n=this.props,r=n.points,a=n.isAnimationActive,o=this.state,i=o.prevPoints,l=o.totalLength;return a&&r&&r.length&&(!i&&l>0||!u()(i,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,a=t.dot,o=t.points,i=t.className,l=t.xAxis,c=t.yAxis,u=t.top,p=t.left,f=t.width,y=t.height,v=t.isAnimationActive,g=t.id;if(n||!o||!o.length)return null;var k=this.state.isAnimationFinished,x=1===o.length,w=(0,d.Z)("recharts-line",i),A=l&&l.allowDataOverflow,E=c&&c.allowDataOverflow,O=A||E,j=s()(g)?this.id:g,P=null!==(e=(0,b.L6)(a,!1))&&void 0!==e?e:{r:3,strokeWidth:2},L=P.r,S=P.strokeWidth,C=((0,b.jf)(a)?a:{}).clipDot,D=void 0===C||C,N=2*(void 0===L?3:L)+(void 0===S?2:S);return r.createElement(m.m,{className:w},A||E?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(j)},r.createElement("rect",{x:A?p:p-f/2,y:E?u:u-y/2,width:A?f:2*f,height:E?y:2*y})),!D&&r.createElement("clipPath",{id:"clipPath-dots-".concat(j)},r.createElement("rect",{x:p-N/2,y:u-N/2,width:f+N,height:y+N}))):null,!x&&this.renderCurve(O,j),this.renderErrorBar(O,j),(x||a)&&this.renderDots(O,D,j),(!v||k)&&h.e.renderCallByParent(this.props,o))}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var n=e.length%2!=0?[].concat(L(e),[0]):e,r=[],a=0;a=60&&240>=Math.round(e.h)?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function i(e,t,n){var r;return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(100*r)/100)}function c(e,t,n){return Math.round(100*Math.max(0,Math.min(1,n?e.v+.05*t:e.v-.15*t)))/100}function l(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],l=new r.t(e),s=l.toHsv(),u=5;u>0;u-=1){var d=new r.t({h:a(s,u,!0),s:i(s,u,!0),v:c(s,u,!0)});n.push(d)}n.push(l);for(var f=1;f<=4;f+=1){var p=new r.t({h:a(s,f),s:i(s,f),v:c(s,f)});n.push(p)}return"dark"===t.theme?o.map(function(e){var o=e.index,a=e.amount;return new r.t(t.backgroundColor||"#141414").mix(n[o],a).toHexString()}):n.map(function(e){return e.toHexString()})}var s={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},u=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];u.primary=u[5];var d=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];d.primary=d[5];var f=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];f.primary=f[5];var p=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];p.primary=p[5];var m=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];m.primary=m[5];var g=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];g.primary=g[5];var v=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];v.primary=v[5];var h=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];h.primary=h[5];var b=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];b.primary=b[5];var y=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];y.primary=y[5];var x=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];x.primary=x[5];var w=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];w.primary=w[5];var E=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];E.primary=E[5];var C={red:u,volcano:d,orange:f,gold:p,yellow:m,lime:g,green:v,cyan:h,blue:b,geekblue:y,purple:x,magenta:w,grey:E},Z=["#2a1215","#431418","#58181c","#791a1f","#a61d24","#d32029","#e84749","#f37370","#f89f9a","#fac8c3"];Z.primary=Z[5];var S=["#2b1611","#441d12","#592716","#7c3118","#aa3e19","#d84a1b","#e87040","#f3956a","#f8b692","#fad4bc"];S.primary=S[5];var O=["#2b1d11","#442a11","#593815","#7c4a15","#aa6215","#d87a16","#e89a3c","#f3b765","#f8cf8d","#fae3b7"];O.primary=O[5];var k=["#2b2111","#443111","#594214","#7c5914","#aa7714","#d89614","#e8b339","#f3cc62","#f8df8b","#faedb5"];k.primary=k[5];var j=["#2b2611","#443b11","#595014","#7c6e14","#aa9514","#d8bd14","#e8d639","#f3ea62","#f8f48b","#fafab5"];j.primary=j[5];var I=["#1f2611","#2e3c10","#3e4f13","#536d13","#6f9412","#8bbb11","#a9d134","#c9e75d","#e4f88b","#f0fab5"];I.primary=I[5];var M=["#162312","#1d3712","#274916","#306317","#3c8618","#49aa19","#6abe39","#8fd460","#b2e58b","#d5f2bb"];M.primary=M[5];var R=["#112123","#113536","#144848","#146262","#138585","#13a8a8","#33bcb7","#58d1c9","#84e2d8","#b2f1e8"];R.primary=R[5];var N=["#111a2c","#112545","#15325b","#15417e","#1554ad","#1668dc","#3c89e8","#65a9f3","#8dc5f8","#b7dcfa"];N.primary=N[5];var P=["#131629","#161d40","#1c2755","#203175","#263ea0","#2b4acb","#5273e0","#7f9ef3","#a8c1f8","#d2e0fa"];P.primary=P[5];var F=["#1a1325","#24163a","#301c4d","#3e2069","#51258f","#642ab5","#854eca","#ab7ae0","#cda8f0","#ebd7fa"];F.primary=F[5];var T=["#291321","#40162f","#551c3b","#75204f","#a02669","#cb2b83","#e0529c","#f37fb7","#f8a8cc","#fad2e3"];T.primary=T[5];var A=["#151515","#1f1f1f","#2d2d2d","#393939","#494949","#5a5a5a","#6a6a6a","#7b7b7b","#888888","#969696"];A.primary=A[5]},71140:function(e,t,n){"use strict";n.d(t,{rb:function(){return N},IX:function(){return S}});var r=n(41154),o=n(26365),a=n(11993),i=n(31686),c=n(2265),l=n(93463),s=n(76405),u=n(25049),d=n(63496),f=n(41690),p=n(15900),m=(0,u.Z)(function e(){(0,s.Z)(this,e)}),g="CALC_UNIT",v=RegExp(g,"g");function h(e){return"number"==typeof e?"".concat(e).concat(g):e}var b=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,o){(0,s.Z)(this,n),i=t.call(this),(0,a.Z)((0,d.Z)(i),"result",""),(0,a.Z)((0,d.Z)(i),"unitlessCssVar",void 0),(0,a.Z)((0,d.Z)(i),"lowPriority",void 0);var i,c=(0,r.Z)(e);return i.unitlessCssVar=o,e instanceof n?i.result="(".concat(e.result,")"):"number"===c?i.result=h(e):"string"===c&&(i.result=e),i}return(0,u.Z)(n,[{key:"add",value:function(e){return e instanceof n?this.result="".concat(this.result," + ").concat(e.getResult()):("number"==typeof e||"string"==typeof e)&&(this.result="".concat(this.result," + ").concat(h(e))),this.lowPriority=!0,this}},{key:"sub",value:function(e){return e instanceof n?this.result="".concat(this.result," - ").concat(e.getResult()):("number"==typeof e||"string"==typeof e)&&(this.result="".concat(this.result," - ").concat(h(e))),this.lowPriority=!0,this}},{key:"mul",value:function(e){return this.lowPriority&&(this.result="(".concat(this.result,")")),e instanceof n?this.result="".concat(this.result," * ").concat(e.getResult(!0)):("number"==typeof e||"string"==typeof e)&&(this.result="".concat(this.result," * ").concat(e)),this.lowPriority=!1,this}},{key:"div",value:function(e){return this.lowPriority&&(this.result="(".concat(this.result,")")),e instanceof n?this.result="".concat(this.result," / ").concat(e.getResult(!0)):("number"==typeof e||"string"==typeof e)&&(this.result="".concat(this.result," / ").concat(e)),this.lowPriority=!1,this}},{key:"getResult",value:function(e){return this.lowPriority||e?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(e){var t=this,n=(e||{}).unit,r=!0;return("boolean"==typeof n?r=n:Array.from(this.unitlessCssVar).some(function(e){return t.result.includes(e)})&&(r=!1),this.result=this.result.replace(v,r?"px":""),void 0!==this.lowPriority)?"calc(".concat(this.result,")"):this.result}}]),n}(m),y=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r;return(0,s.Z)(this,n),r=t.call(this),(0,a.Z)((0,d.Z)(r),"result",0),e instanceof n?r.result=e.result:"number"==typeof e&&(r.result=e),r}return(0,u.Z)(n,[{key:"add",value:function(e){return e instanceof n?this.result+=e.result:"number"==typeof e&&(this.result+=e),this}},{key:"sub",value:function(e){return e instanceof n?this.result-=e.result:"number"==typeof e&&(this.result-=e),this}},{key:"mul",value:function(e){return e instanceof n?this.result*=e.result:"number"==typeof e&&(this.result*=e),this}},{key:"div",value:function(e){return e instanceof n?this.result/=e.result:"number"==typeof e&&(this.result/=e),this}},{key:"equal",value:function(){return this.result}}]),n}(m),x=function(e,t){var n="css"===e?b:y;return function(e){return new n(e,t)}},w=function(e,t){return"".concat([t,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};n(74126);var E=function(e,t,n,r){var a=(0,i.Z)({},t[e]);null!=r&&r.deprecatedTokens&&r.deprecatedTokens.forEach(function(e){var t,n=(0,o.Z)(e,2),r=n[0],i=n[1];(null!=a&&a[r]||null!=a&&a[i])&&(null!==(t=a[i])&&void 0!==t||(a[i]=null==a?void 0:a[r]))});var c=(0,i.Z)((0,i.Z)({},n),a);return Object.keys(c).forEach(function(e){c[e]===t[e]&&delete c[e]}),c},C="undefined"!=typeof CSSINJS_STATISTIC,Z=!0;function S(){for(var e=arguments.length,t=Array(e),n=0;n1e4){var t=Date.now();this.lastAccessBeat.forEach(function(n,r){t-n>6e5&&(e.map.delete(r),e.lastAccessBeat.delete(r))}),this.accessBeat=0}}}]),e}()),R=function(){return{}},N=function(e){var t=e.useCSP,n=void 0===t?R:t,s=e.useToken,u=e.usePrefix,d=e.getResetStyles,f=e.getCommonStyle,p=e.getCompUnitless;function m(t,a,p){var m=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},g=Array.isArray(t)?t:[t,t],v=(0,o.Z)(g,1)[0],h=g.join("-"),b=e.layer||{name:"antd"};return function(e){var t,o,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,y=s(),C=y.theme,Z=y.realToken,O=y.hashId,k=y.token,R=y.cssVar,N=u(),P=N.rootPrefixCls,F=N.iconPrefixCls,T=n(),A=R?"css":"js",_=(t=function(){var e=new Set;return R&&Object.keys(m.unitless||{}).forEach(function(t){e.add((0,l.ks)(t,R.prefix)),e.add((0,l.ks)(t,w(v,R.prefix)))}),x(A,e)},o=[A,v,null==R?void 0:R.prefix],c.useMemo(function(){var e=M.get(o);if(e)return e;var n=t();return M.set(o,n),n},o)),B="js"===A?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:e,n=S(e,t),r=(0,o.Z)(n,2)[1],a=O(t),i=(0,o.Z)(a,2);return[i[0],r,i[1]]}},genSubStyleComponent:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=m(e,t,n,(0,i.Z)({resetStyle:!1,order:-998},r));return function(e){var t=e.prefixCls,n=e.rootCls,r=void 0===n?t:n;return o(t,r),null}},genComponentStyleHook:m}}},93463:function(e,t,n){"use strict";n.d(t,{E4:function(){return eF},uP:function(){return y},jG:function(){return k},ks:function(){return A},bf:function(){return F},CI:function(){return eP},fp:function(){return G},xy:function(){return eR}});var r,o=n(11993),a=n(26365),i=n(83145),c=n(31686),l=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))*1540483477+((t>>>16)*59797<<16),t^=t>>>24,n=(65535&t)*1540483477+((t>>>16)*59797<<16)^(65535&n)*1540483477+((n>>>16)*59797<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n^=255&e.charCodeAt(r),n=(65535&n)*1540483477+((n>>>16)*59797<<16)}return n^=n>>>13,(((n=(65535&n)*1540483477+((n>>>16)*59797<<16))^n>>>15)>>>0).toString(36)},s=n(21717),u=n(2265),d=n.t(u,2);n(6397),n(16671);var f=n(76405),p=n(25049);function m(e){return e.join("%")}var g=function(){function e(t){(0,f.Z)(this,e),(0,o.Z)(this,"instanceId",void 0),(0,o.Z)(this,"cache",new Map),(0,o.Z)(this,"extracted",new Set),this.instanceId=t}return(0,p.Z)(e,[{key:"get",value:function(e){return this.opGet(m(e))}},{key:"opGet",value:function(e){return this.cache.get(e)||null}},{key:"update",value:function(e,t){return this.opUpdate(m(e),t)}},{key:"opUpdate",value:function(e,t){var n=t(this.cache.get(e));null===n?this.cache.delete(e):this.cache.set(e,n)}}]),e}(),v="data-token-hash",h="data-css-hash",b="__cssinjs_instance__",y=u.createContext({hashPriority:"low",cache:function(){var e=Math.random().toString(12).slice(2);if("undefined"!=typeof document&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(h,"]"))||[],n=document.head.firstChild;Array.from(t).forEach(function(t){t[b]=t[b]||e,t[b]===e&&document.head.insertBefore(t,n)});var r={};Array.from(document.querySelectorAll("style[".concat(h,"]"))).forEach(function(t){var n,o=t.getAttribute(h);r[o]?t[b]===e&&(null===(n=t.parentNode)||void 0===n||n.removeChild(t)):r[o]=!0})}return new g(e)}(),defaultCache:!0}),x=n(41154),w=n(94981),E=function(){function e(){(0,f.Z)(this,e),(0,o.Z)(this,"cache",void 0),(0,o.Z)(this,"keys",void 0),(0,o.Z)(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return(0,p.Z)(e,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o={map:this.cache};return e.forEach(function(e){if(o){var t;o=null===(t=o)||void 0===t||null===(t=t.map)||void 0===t?void 0:t.get(e)}else o=void 0}),null!==(t=o)&&void 0!==t&&t.value&&r&&(o.value[1]=this.cacheCallTimes++),null===(n=o)||void 0===n?void 0:n.value}},{key:"get",value:function(e){var t;return null===(t=this.internalGet(e,!0))||void 0===t?void 0:t[0]}},{key:"has",value:function(e){return!!this.internalGet(e)}},{key:"set",value:function(t,n){var r=this;if(!this.has(t)){if(this.size()+1>e.MAX_CACHE_SIZE+e.MAX_CACHE_OFFSET){var o=this.keys.reduce(function(e,t){var n=(0,a.Z)(e,2)[1];return r.internalGet(t)[1]0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function."),Z+=1}return(0,p.Z)(e,[{key:"getDerivativeToken",value:function(e){return this.derivatives.reduce(function(t,n){return n(e,t)},void 0)}}]),e}(),O=new E;function k(e){var t=Array.isArray(e)?e:[e];return O.has(t)||O.set(t,new S(t)),O.get(t)}var j=new WeakMap,I={},M=new WeakMap;function R(e){var t=M.get(e)||"";return t||(Object.keys(e).forEach(function(n){var r=e[n];t+=n,r instanceof S?t+=r.id:r&&"object"===(0,x.Z)(r)?t+=R(r):t+=r}),t=l(t),M.set(e,t)),t}function N(e,t){return l("".concat(t,"_").concat(R(e)))}"random-".concat(Date.now(),"-").concat(Math.random()).replace(/\./g,"");var P=(0,w.Z)();function F(e){return"number"==typeof e?"".concat(e,"px"):e}function T(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(a)return e;var i=(0,c.Z)((0,c.Z)({},r),{},(0,o.Z)((0,o.Z)({},v,t),h,n)),l=Object.keys(i).map(function(e){var t=i[e];return t?"".concat(e,'="').concat(t,'"'):null}).filter(function(e){return e}).join(" ");return"")}var A=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"--".concat(t?"".concat(t,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},_=function(e,t,n){var r,o={},i={};return Object.entries(e).forEach(function(e){var t=(0,a.Z)(e,2),r=t[0],c=t[1];if(null!=n&&null!==(l=n.preserve)&&void 0!==l&&l[r])i[r]=c;else if(("string"==typeof c||"number"==typeof c)&&!(null!=n&&null!==(s=n.ignore)&&void 0!==s&&s[r])){var l,s,u,d=A(r,null==n?void 0:n.prefix);o[d]="number"!=typeof c||null!=n&&null!==(u=n.unitless)&&void 0!==u&&u[r]?String(c):"".concat(c,"px"),i[r]="var(".concat(d,")")}}),[i,(r={scope:null==n?void 0:n.scope},Object.keys(o).length?".".concat(t).concat(null!=r&&r.scope?".".concat(r.scope):"","{").concat(Object.entries(o).map(function(e){var t=(0,a.Z)(e,2),n=t[0],r=t[1];return"".concat(n,":").concat(r,";")}).join(""),"}"):"")]},B=n(27380),H=(0,c.Z)({},d).useInsertionEffect,z=H?function(e,t,n){return H(function(){return e(),t()},n)}:function(e,t,n){u.useMemo(e,n),(0,B.Z)(function(){return t(!0)},n)},L=void 0!==(0,c.Z)({},d).useInsertionEffect?function(e){var t=[],n=!1;return u.useEffect(function(){return n=!1,function(){n=!0,t.length&&t.forEach(function(e){return e()})}},e),function(e){n||t.push(e)}}:function(){return function(e){e()}};function D(e,t,n,r,o){var c=u.useContext(y).cache,l=m([e].concat((0,i.Z)(t))),s=L([l]),d=function(e){c.opUpdate(l,function(t){var r=(0,a.Z)(t||[void 0,void 0],2),o=r[0],i=[void 0===o?0:o,r[1]||n()];return e?e(i):i})};u.useMemo(function(){d()},[l]);var f=c.opGet(l)[1];return z(function(){null==o||o(f)},function(e){return d(function(t){var n=(0,a.Z)(t,2),r=n[0],i=n[1];return e&&0===r&&(null==o||o(f)),[r+1,i]}),function(){c.opUpdate(l,function(t){var n=(0,a.Z)(t||[],2),o=n[0],i=void 0===o?0:o,u=n[1];return 0==i-1?(s(function(){(e||!c.opGet(l))&&(null==r||r(u,!1))}),null):[i-1,u]})}},[l]),f}var W={},V=new Map,q=function(e,t,n,r){var o=n.getDerivativeToken(e),a=(0,c.Z)((0,c.Z)({},o),t);return r&&(a=r(a)),a},X="token";function G(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(0,u.useContext)(y),o=r.cache.instanceId,d=r.container,f=n.salt,p=void 0===f?"":f,m=n.override,g=void 0===m?W:m,x=n.formatToken,w=n.getComputedToken,E=n.cssVar,C=function(e,t){for(var n=j,r=0;r0&&n.forEach(function(e){"undefined"!=typeof document&&document.querySelectorAll("style[".concat(v,'="').concat(e,'"]')).forEach(function(e){if(e[b]===o){var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)}}),V.delete(e)})},function(e){var t=(0,a.Z)(e,4),n=t[0],r=t[3];if(E&&r){var i=(0,s.hq)(r,l("css-variables-".concat(n._themeKey)),{mark:h,prepend:"queue",attachTo:d,priority:-999});i[b]=o,i.setAttribute(v,n._themeKey)}})}var U=n(1119),$={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},K="comm",Y="rule",Q="decl",J=Math.abs,ee=String.fromCharCode;function et(e,t,n){return e.replace(t,n)}function en(e,t){return 0|e.charCodeAt(t)}function er(e,t,n){return e.slice(t,n)}function eo(e){return e.length}function ea(e,t){return t.push(e),e}function ei(e,t){for(var n="",r=0;r0?p[b]+" "+y:et(y,/&\f/g,p[b])).trim())&&(l[h++]=x);return em(e,t,n,0===o?Y:c,l,s,u,d)}function ex(e,t,n,r,o){return em(e,t,n,Q,er(e,0,r),er(e,r+1,-1),r,o)}var ew="data-ant-cssinjs-cache-path",eE="_FILE_STYLE__",eC=!0,eZ="_multi_value_";function eS(e){var t,n,r;return ei((r=function e(t,n,r,o,a,i,c,l,s){for(var u,d,f,p=0,m=0,g=c,v=0,h=0,b=0,y=1,x=1,w=1,E=0,C="",Z=a,S=i,O=o,k=C;x;)switch(b=E,E=eg()){case 40:if(108!=b&&58==en(k,g-1)){-1!=(d=k+=et(eb(E),"&","&\f"),f=J(p?l[p-1]:0),d.indexOf("&\f",f))&&(w=-1);break}case 34:case 39:case 91:k+=eb(E);break;case 9:case 10:case 13:case 32:k+=function(e){for(;ef=ev();)if(ef<33)eg();else break;return eh(e)>2||eh(ef)>3?"":" "}(b);break;case 92:k+=function(e,t){for(var n;--t&&eg()&&!(ef<48)&&!(ef>102)&&(!(ef>57)||!(ef<65))&&(!(ef>70)||!(ef<97)););return n=ed+(t<6&&32==ev()&&32==eg()),er(ep,e,n)}(ed-1,7);continue;case 47:switch(ev()){case 42:case 47:ea(em(u=function(e,t){for(;eg();)if(e+ef===57)break;else if(e+ef===84&&47===ev())break;return"/*"+er(ep,t,ed-1)+"*"+ee(47===e?e:eg())}(eg(),ed),n,r,K,ee(ef),er(u,2,-2),0,s),s),(5==eh(b||1)||5==eh(ev()||1))&&eo(k)&&" "!==er(k,-1,void 0)&&(k+=" ");break;default:k+="/"}break;case 123*y:l[p++]=eo(k)*w;case 125*y:case 59:case 0:switch(E){case 0:case 125:x=0;case 59+m:-1==w&&(k=et(k,/\f/g,"")),h>0&&(eo(k)-g||0===y&&47===b)&&ea(h>32?ex(k+";",o,r,g-1,s):ex(et(k," ","")+";",o,r,g-2,s),s);break;case 59:k+=";";default:if(ea(O=ey(k,n,r,p,m,a,l,C,Z=[],S=[],g,i),i),123===E){if(0===m)e(k,n,O,O,Z,i,g,l,S);else{switch(v){case 99:if(110===en(k,3))break;case 108:if(97===en(k,2))break;default:m=0;case 100:case 109:case 115:}m?e(t,O,O,o&&ea(ey(t,O,O,0,0,a,l,C,a,Z=[],g,S),S),a,S,g,l,o?Z:S):e(k,O,O,O,[""],S,0,l,S)}}}p=m=h=0,y=w=1,C=k="",g=c;break;case 58:g=1+eo(k),h=b;default:if(y<1){if(123==E)--y;else if(125==E&&0==y++&&125==(ef=ed>0?en(ep,--ed):0,es--,10===ef&&(es=1,el--),ef))continue}switch(k+=ee(E),E*y){case 38:w=m>0?1:(k+="\f",-1);break;case 44:l[p++]=(eo(k)-1)*w,w=1;break;case 64:45===ev()&&(k+=eb(eg())),v=ev(),m=g=eo(C=k+=function(e){for(;!eh(ev());)eg();return er(ep,e,ed)}(ed)),E++;break;case 45:45===b&&2==eo(k)&&(y=0)}}return i}("",null,null,null,[""],(n=t=e,el=es=1,eu=eo(ep=n),ed=0,t=[]),0,[0],t),ep="",r),ec).replace(/\{%%%\:[^;];}/g,";")}function eO(e,t,n){if(!t)return e;var r=".".concat(t),o="low"===n?":where(".concat(r,")"):r;return e.split(",").map(function(e){var t,n=e.trim().split(/\s+/),r=n[0]||"",a=(null===(t=r.match(/^\w+/))||void 0===t?void 0:t[0])||"";return[r="".concat(a).concat(o).concat(r.slice(a.length))].concat((0,i.Z)(n.slice(1))).join(" ")}).join(",")}var ek=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{root:!0,parentSelectors:[]},o=r.root,l=r.injectHash,s=r.parentSelectors,u=n.hashId,d=n.layer,f=(n.path,n.hashPriority),p=n.transformers,m=void 0===p?[]:p;n.linters;var g="",v={};function h(t){var r=t.getName(u);if(!v[r]){var o=e(t.style,n,{root:!1,parentSelectors:s}),i=(0,a.Z)(o,1)[0];v[r]="@keyframes ".concat(t.getName(u)).concat(i)}}return(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.forEach(function(t){Array.isArray(t)?e(t,n):t&&n.push(t)}),n})(Array.isArray(t)?t:[t]).forEach(function(t){var r="string"!=typeof t||o?t:{};if("string"==typeof r)g+="".concat(r,"\n");else if(r._keyframe)h(r);else{var d=m.reduce(function(e,t){var n;return(null==t||null===(n=t.visit)||void 0===n?void 0:n.call(t,e))||e},r);Object.keys(d).forEach(function(t){var r=d[t];if("object"!==(0,x.Z)(r)||!r||"animationName"===t&&r._keyframe||"object"===(0,x.Z)(r)&&r&&("_skip_check_"in r||eZ in r)){function p(e,t){var n=e.replace(/[A-Z]/g,function(e){return"-".concat(e.toLowerCase())}),r=t;$[e]||"number"!=typeof r||0===r||(r="".concat(r,"px")),"animationName"===e&&null!=t&&t._keyframe&&(h(t),r=t.getName(u)),g+="".concat(n,":").concat(r,";")}var m,b=null!==(m=null==r?void 0:r.value)&&void 0!==m?m:r;"object"===(0,x.Z)(r)&&null!=r&&r[eZ]&&Array.isArray(b)?b.forEach(function(e){p(t,e)}):p(t,b)}else{var y=!1,w=t.trim(),E=!1;(o||l)&&u?w.startsWith("@")?y=!0:w="&"===w?eO("",u,f):eO(t,u,f):o&&!u&&("&"===w||""===w)&&(w="",E=!0);var C=e(r,n,{root:E,injectHash:y,parentSelectors:[].concat((0,i.Z)(s),[w])}),Z=(0,a.Z)(C,2),S=Z[0],O=Z[1];v=(0,c.Z)((0,c.Z)({},v),O),g+="".concat(w).concat(S)}})}}),o?d&&(g&&(g="@layer ".concat(d.name," {").concat(g,"}")),d.dependencies&&(v["@layer ".concat(d.name)]=d.dependencies.map(function(e){return"@layer ".concat(e,", ").concat(d.name,";")}).join("\n"))):g="{".concat(g,"}"),[g,v]};function ej(e,t){return l("".concat(e.join("%")).concat(t))}function eI(){return null}var eM="style";function eR(e,t){var n=e.token,l=e.path,d=e.hashId,f=e.layer,p=e.nonce,m=e.clientOnly,g=e.order,x=void 0===g?0:g,E=u.useContext(y),C=E.autoClear,Z=(E.mock,E.defaultCache),S=E.hashPriority,O=E.container,k=E.ssrInline,j=E.transformers,I=E.linters,M=E.cache,R=E.layer,N=n._tokenKey,F=[N];R&&F.push("layer"),F.push.apply(F,(0,i.Z)(l));var T=D(eM,F,function(){var e=F.join("|");if(!function(){if(!r&&(r={},(0,w.Z)())){var e,t=document.createElement("div");t.className=ew,t.style.position="fixed",t.style.visibility="hidden",t.style.top="-9999px",document.body.appendChild(t);var n=getComputedStyle(t).content||"";(n=n.replace(/^"/,"").replace(/"$/,"")).split(";").forEach(function(e){var t=e.split(":"),n=(0,a.Z)(t,2),o=n[0],i=n[1];r[o]=i});var o=document.querySelector("style[".concat(ew,"]"));o&&(eC=!1,null===(e=o.parentNode)||void 0===e||e.removeChild(o)),document.body.removeChild(t)}}(),r[e]){var n=function(e){var t=r[e],n=null;if(t&&(0,w.Z)()){if(eC)n=eE;else{var o=document.querySelector("style[".concat(h,'="').concat(r[e],'"]'));o?n=o.innerHTML:delete r[e]}}return[n,t]}(e),o=(0,a.Z)(n,2),i=o[0],c=o[1];if(i)return[i,N,c,{},m,x]}var s=ek(t(),{hashId:d,hashPriority:S,layer:R?f:void 0,path:l.join("-"),transformers:j,linters:I}),u=(0,a.Z)(s,2),p=u[0],g=u[1],v=eS(p),b=ej(F,v);return[v,N,b,g,m,x]},function(e,t){var n=(0,a.Z)(e,3)[2];(t||C)&&P&&(0,s.jL)(n,{mark:h,attachTo:O})},function(e){var t=(0,a.Z)(e,4),n=t[0],r=(t[1],t[2]),o=t[3];if(P&&n!==eE){var i={mark:h,prepend:!R&&"queue",attachTo:O,priority:x},l="function"==typeof p?p():p;l&&(i.csp={nonce:l});var u=[],d=[];Object.keys(o).forEach(function(e){e.startsWith("@layer")?u.push(e):d.push(e)}),u.forEach(function(e){(0,s.hq)(eS(o[e]),"_layer-".concat(e),(0,c.Z)((0,c.Z)({},i),{},{prepend:!0}))});var f=(0,s.hq)(n,r,i);f[b]=M.instanceId,f.setAttribute(v,N),d.forEach(function(e){(0,s.hq)(eS(o[e]),"_effect-".concat(e),i)})}}),A=(0,a.Z)(T,3),_=A[0],B=A[1],H=A[2];return function(e){var t;return t=k&&!P&&Z?u.createElement("style",(0,U.Z)({},(0,o.Z)((0,o.Z)({},v,B),h,H),{dangerouslySetInnerHTML:{__html:_}})):u.createElement(eI,null),u.createElement(u.Fragment,null,t,e)}}var eN="cssVar",eP=function(e,t){var n=e.key,r=e.prefix,o=e.unitless,c=e.ignore,l=e.token,d=e.scope,f=void 0===d?"":d,p=(0,u.useContext)(y),m=p.cache.instanceId,g=p.container,x=l._tokenKey,w=[].concat((0,i.Z)(e.path),[n,f,x]);return D(eN,w,function(){var e=_(t(),n,{prefix:r,unitless:o,ignore:c,scope:f}),i=(0,a.Z)(e,2),l=i[0],s=i[1],u=ej(w,s);return[l,s,u,n]},function(e){var t=(0,a.Z)(e,3)[2];P&&(0,s.jL)(t,{mark:h,attachTo:g})},function(e){var t=(0,a.Z)(e,3),r=t[1],o=t[2];if(r){var i=(0,s.hq)(r,o,{mark:h,prepend:"queue",attachTo:g,priority:-999});i[b]=m,i.setAttribute(v,n)}})};(0,o.Z)((0,o.Z)((0,o.Z)({},eM,function(e,t,n){var r=(0,a.Z)(e,6),o=r[0],i=r[1],c=r[2],l=r[3],s=r[4],u=r[5],d=(n||{}).plain;if(s)return null;var f=o,p={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)};return f=T(o,i,c,p,d),l&&Object.keys(l).forEach(function(e){if(!t[e]){t[e]=!0;var n=T(eS(l[e]),i,"_effect-".concat(e),p,d);e.startsWith("@layer")?f=n+f:f+=n}}),[u,c,f]}),X,function(e,t,n){var r=(0,a.Z)(e,5),o=r[2],i=r[3],c=r[4],l=(n||{}).plain;if(!i)return null;var s=o._tokenKey,u=T(i,c,s,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},l);return[-999,s,u]}),eN,function(e,t,n){var r=(0,a.Z)(e,4),o=r[1],i=r[2],c=r[3],l=(n||{}).plain;if(!o)return null;var s=T(o,c,i,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},l);return[-999,i,s]});var eF=function(){function e(t,n){(0,f.Z)(this,e),(0,o.Z)(this,"name",void 0),(0,o.Z)(this,"style",void 0),(0,o.Z)(this,"_keyframe",!0),this.name=t,this.style=n}return(0,p.Z)(e,[{key:"getName",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?"".concat(e,"-").concat(this.name):this.name}}]),e}();function eT(e){return e.notSplit=!0,e}eT(["borderTop","borderBottom"]),eT(["borderTop"]),eT(["borderBottom"]),eT(["borderLeft","borderRight"]),eT(["borderLeft"]),eT(["borderRight"])},54558:function(e,t,n){"use strict";n.d(t,{t:function(){return l}});var r=n(11993);let o=Math.round;function a(e,t){let n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map(e=>parseFloat(e));for(let e=0;e<3;e+=1)r[e]=t(r[e]||0,n[e]||"",e);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}let i=(e,t,n)=>0===n?e:e/100;function c(e,t){let n=t||255;return e>n?n:e<0?0:e}class l{constructor(e){function t(t){return t[0]in e&&t[1]in e&&t[2]in e}if((0,r.Z)(this,"isValid",!0),(0,r.Z)(this,"r",0),(0,r.Z)(this,"g",0),(0,r.Z)(this,"b",0),(0,r.Z)(this,"a",1),(0,r.Z)(this,"_h",void 0),(0,r.Z)(this,"_s",void 0),(0,r.Z)(this,"_l",void 0),(0,r.Z)(this,"_v",void 0),(0,r.Z)(this,"_max",void 0),(0,r.Z)(this,"_min",void 0),(0,r.Z)(this,"_brightness",void 0),e){if("string"==typeof e){let t=e.trim();function n(e){return t.startsWith(e)}/^#?[A-F\d]{3,8}$/i.test(t)?this.fromHexString(t):n("rgb")?this.fromRgbString(t):n("hsl")?this.fromHslString(t):(n("hsv")||n("hsb"))&&this.fromHsvString(t)}else if(e instanceof l)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(t("rgb"))this.r=c(e.r),this.g=c(e.g),this.b=c(e.b),this.a="number"==typeof e.a?c(e.a,1):1;else if(t("hsl"))this.fromHsl(e);else if(t("hsv"))this.fromHsv(e);else throw Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e))}}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){let t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(e){let t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}return .2126*e(this.r)+.7152*e(this.g)+.0722*e(this.b)}getHue(){if(void 0===this._h){let e=this.getMax()-this.getMin();0===e?this._h=0:this._h=o(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g1&&(r=1),this._c({h:t,s:n,l:r,a:this.a})}mix(e,t=50){let n=this._c(e),r=t/100,a=e=>(n[e]-this[e])*r+this[e],i={r:o(a("r")),g:o(a("g")),b:o(a("b")),a:o(100*a("a"))/100};return this._c(i)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){let t=this._c(e),n=this.a+t.a*(1-this.a),r=e=>o((this[e]*this.a+t[e]*t.a*(1-this.a))/n);return this._c({r:r("r"),g:r("g"),b:r("b"),a:n})}isDark(){return 128>this.getBrightness()}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#",t=(this.r||0).toString(16);e+=2===t.length?t:"0"+t;let n=(this.g||0).toString(16);e+=2===n.length?n:"0"+n;let r=(this.b||0).toString(16);if(e+=2===r.length?r:"0"+r,"number"==typeof this.a&&this.a>=0&&this.a<1){let t=o(255*this.a).toString(16);e+=2===t.length?t:"0"+t}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){let e=this.getHue(),t=o(100*this.getSaturation()),n=o(100*this.getLightness());return 1!==this.a?`hsla(${e},${t}%,${n}%,${this.a})`:`hsl(${e},${t}%,${n}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return 1!==this.a?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,t,n){let r=this.clone();return r[e]=c(t,n),r}_c(e){return new this.constructor(e)}getMax(){return void 0===this._max&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return void 0===this._min&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){let t=e.replace("#","");function n(e,n){return parseInt(t[e]+t[n||e],16)}t.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=t[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=t[6]?n(6,7)/255:1)}fromHsl({h:e,s:t,l:n,a:r}){if(this._h=e%360,this._s=t,this._l=n,this.a="number"==typeof r?r:1,t<=0){let e=o(255*n);this.r=e,this.g=e,this.b=e}let a=0,i=0,c=0,l=e/60,s=(1-Math.abs(2*n-1))*t,u=s*(1-Math.abs(l%2-1));l>=0&&l<1?(a=s,i=u):l>=1&&l<2?(a=u,i=s):l>=2&&l<3?(i=s,c=u):l>=3&&l<4?(i=u,c=s):l>=4&&l<5?(a=u,c=s):l>=5&&l<6&&(a=s,c=u);let d=n-s/2;this.r=o((a+d)*255),this.g=o((i+d)*255),this.b=o((c+d)*255)}fromHsv({h:e,s:t,v:n,a:r}){this._h=e%360,this._s=t,this._v=n,this.a="number"==typeof r?r:1;let a=o(255*n);if(this.r=a,this.g=a,this.b=a,t<=0)return;let i=e/60,c=Math.floor(i),l=i-c,s=o(n*(1-t)*255),u=o(n*(1-t*l)*255),d=o(n*(1-t*(1-l))*255);switch(c){case 0:this.g=d,this.b=s;break;case 1:this.r=u,this.b=s;break;case 2:this.r=s,this.b=d;break;case 3:this.r=s,this.g=u;break;case 4:this.r=d,this.g=s;break;default:this.g=s,this.b=u}}fromHsvString(e){let t=a(e,i);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){let t=a(e,i);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){let t=a(e,(e,t)=>t.includes("%")?o(e/100*255):e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}}},55015:function(e,t,n){"use strict";n.d(t,{Z:function(){return j}});var r=n(1119),o=n(26365),a=n(11993),i=n(6989),c=n(2265),l=n(36760),s=n.n(l),u=n(57943),d=n(20902),f=n(31686),p=n(41154),m=n(21717),g=n(13211),v=n(32559);function h(e){return"object"===(0,p.Z)(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===(0,p.Z)(e.icon)||"function"==typeof e.icon)}function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];return"class"===n?(t.className=r,delete t.class):(delete t[n],t[n.replace(/-(.)/g,function(e,t){return t.toUpperCase()})]=r),t},{})}function y(e){return(0,u.R_)(e)[0]}function x(e){return e?Array.isArray(e)?e:[e]:[]}var w=function(e){var t=(0,c.useContext)(d.Z),n=t.csp,r=t.prefixCls,o=t.layer,a="\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";r&&(a=a.replace(/anticon/g,r)),o&&(a="@layer ".concat(o," {\n").concat(a,"\n}")),(0,c.useEffect)(function(){var t=e.current,r=(0,g.A)(t);(0,m.hq)(a,"@ant-design-icons",{prepend:!o,csp:n,attachTo:r})},[])},E=["icon","className","onClick","style","primaryColor","secondaryColor"],C={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1},Z=function(e){var t,n,r=e.icon,o=e.className,a=e.onClick,l=e.style,s=e.primaryColor,u=e.secondaryColor,d=(0,i.Z)(e,E),p=c.useRef(),m=C;if(s&&(m={primaryColor:s,secondaryColor:u||y(s)}),w(p),t=h(r),n="icon should be icon definiton, but got ".concat(r),(0,v.ZP)(t,"[@ant-design/icons] ".concat(n)),!h(r))return null;var g=r;return g&&"function"==typeof g.icon&&(g=(0,f.Z)((0,f.Z)({},g),{},{icon:g.icon(m.primaryColor,m.secondaryColor)})),function e(t,n,r){return r?c.createElement(t.tag,(0,f.Z)((0,f.Z)({key:n},b(t.attrs)),r),(t.children||[]).map(function(r,o){return e(r,"".concat(n,"-").concat(t.tag,"-").concat(o))})):c.createElement(t.tag,(0,f.Z)({key:n},b(t.attrs)),(t.children||[]).map(function(r,o){return e(r,"".concat(n,"-").concat(t.tag,"-").concat(o))}))}(g.icon,"svg-".concat(g.name),(0,f.Z)((0,f.Z)({className:o,onClick:a,style:l,"data-icon":g.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},d),{},{ref:p}))};function S(e){var t=x(e),n=(0,o.Z)(t,2),r=n[0],a=n[1];return Z.setTwoToneColors({primaryColor:r,secondaryColor:a})}Z.displayName="IconReact",Z.getTwoToneColors=function(){return(0,f.Z)({},C)},Z.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;C.primaryColor=t,C.secondaryColor=n||y(t),C.calculated=!!n};var O=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];S(u.iN.primary);var k=c.forwardRef(function(e,t){var n=e.className,l=e.icon,u=e.spin,f=e.rotate,p=e.tabIndex,m=e.onClick,g=e.twoToneColor,v=(0,i.Z)(e,O),h=c.useContext(d.Z),b=h.prefixCls,y=void 0===b?"anticon":b,w=h.rootClassName,E=s()(w,y,(0,a.Z)((0,a.Z)({},"".concat(y,"-").concat(l.name),!!l.name),"".concat(y,"-spin"),!!u||"loading"===l.name),n),C=p;void 0===C&&m&&(C=-1);var S=x(g),k=(0,o.Z)(S,2),j=k[0],I=k[1];return c.createElement("span",(0,r.Z)({role:"img","aria-label":l.name},v,{ref:t,tabIndex:C,onClick:m,className:E}),c.createElement(Z,{icon:l,primaryColor:j,secondaryColor:I,style:f?{msTransform:"rotate(".concat(f,"deg)"),transform:"rotate(".concat(f,"deg)")}:void 0}))});k.displayName="AntdIcon",k.getTwoToneColor=function(){var e=Z.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},k.setTwoToneColor=S;var j=k},20902:function(e,t,n){"use strict";var r=(0,n(2265).createContext)({});t.Z=r},8900:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},9738:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},39725:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},49638:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},70464:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},54537:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},97416:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},6520:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},55726:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},15424:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},61935:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},67187:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},29436:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},75669:function(e,t,n){"use strict";n.d(t,{Il:function(){return v}}),n(2265);var r,o=n(76405),a=n(25049),i=n(41690),c=n(15900),l=n(31686),s=n(6989),u=n(41154),d=n(54558),f=["b"],p=["v"],m=function(e){return Math.round(Number(e||0))},g=function(e){if(e instanceof d.t)return e;if(e&&"object"===(0,u.Z)(e)&&"h"in e&&"b"in e){var t=e.b,n=(0,s.Z)(e,f);return(0,l.Z)((0,l.Z)({},n),{},{v:t})}return"string"==typeof e&&/hsb/.test(e)?e.replace(/hsb/,"hsv"):e},v=function(e){(0,i.Z)(n,e);var t=(0,c.Z)(n);function n(e){return(0,o.Z)(this,n),t.call(this,g(e))}return(0,a.Z)(n,[{key:"toHsbString",value:function(){var e=this.toHsb(),t=m(100*e.s),n=m(100*e.b),r=m(e.h),o=e.a,a="hsb(".concat(r,", ").concat(t,"%, ").concat(n,"%)"),i="hsba(".concat(r,", ").concat(t,"%, ").concat(n,"%, ").concat(o.toFixed(0===o?0:2),")");return 1===o?a:i}},{key:"toHsb",value:function(){var e=this.toHsv(),t=e.v,n=(0,s.Z)(e,p);return(0,l.Z)((0,l.Z)({},n),{},{b:t,a:this.a})}}]),n}(d.t);(r="#1677ff")instanceof v||new v(r),n(36760),n(74126)},28036:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(26365),o=n(2265),a=n(54887),i=n(94981);n(32559);var c=n(28791),l=o.createContext(null),s=n(83145),u=n(27380),d=[],f=n(21717),p=n(3208),m="rc-util-locker-".concat(Date.now()),g=0,v=function(e){return!1!==e&&((0,i.Z)()&&e?"string"==typeof e?document.querySelector(e):"function"==typeof e?e():e:null)},h=o.forwardRef(function(e,t){var n,h,b,y=e.open,x=e.autoLock,w=e.getContainer,E=(e.debug,e.autoDestroy),C=void 0===E||E,Z=e.children,S=o.useState(y),O=(0,r.Z)(S,2),k=O[0],j=O[1],I=k||y;o.useEffect(function(){(C||y)&&j(y)},[y,C]);var M=o.useState(function(){return v(w)}),R=(0,r.Z)(M,2),N=R[0],P=R[1];o.useEffect(function(){var e=v(w);P(null!=e?e:null)});var F=function(e,t){var n=o.useState(function(){return(0,i.Z)()?document.createElement("div"):null}),a=(0,r.Z)(n,1)[0],c=o.useRef(!1),f=o.useContext(l),p=o.useState(d),m=(0,r.Z)(p,2),g=m[0],v=m[1],h=f||(c.current?void 0:function(e){v(function(t){return[e].concat((0,s.Z)(t))})});function b(){a.parentElement||document.body.appendChild(a),c.current=!0}function y(){var e;null===(e=a.parentElement)||void 0===e||e.removeChild(a),c.current=!1}return(0,u.Z)(function(){return e?f?f(b):b():y(),y},[e]),(0,u.Z)(function(){g.length&&(g.forEach(function(e){return e()}),v(d))},[g]),[a,h]}(I&&!N,0),T=(0,r.Z)(F,2),A=T[0],_=T[1],B=null!=N?N:A;n=!!(x&&y&&(0,i.Z)()&&(B===A||B===document.body)),h=o.useState(function(){return g+=1,"".concat(m,"_").concat(g)}),b=(0,r.Z)(h,1)[0],(0,u.Z)(function(){if(n){var e=(0,p.o)(document.body).width,t=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth;(0,f.hq)("\nhtml body {\n overflow-y: hidden;\n ".concat(t?"width: calc(100% - ".concat(e,"px);"):"","\n}"),b)}else(0,f.jL)(b);return function(){(0,f.jL)(b)}},[n,b]);var H=null;Z&&(0,c.Yr)(Z)&&t&&(H=Z.ref);var z=(0,c.x1)(H,t);if(!I||!(0,i.Z)()||void 0===N)return null;var L=!1===B,D=Z;return t&&(D=o.cloneElement(Z,{ref:z})),o.createElement(l.Provider,{value:_},L?D:(0,a.createPortal)(D,B))})},97821:function(e,t,n){"use strict";n.d(t,{Z:function(){return L}});var r=n(31686),o=n(26365),a=n(6989),i=n(28036),c=n(36760),l=n.n(c),s=n(31474),u=n(2868),d=n(13211),f=n(58525),p=n(92491),m=n(27380),g=n(79267),v=n(2265),h=n(1119),b=n(66632),y=n(28791);function x(e){var t=e.prefixCls,n=e.align,r=e.arrow,o=e.arrowPos,a=r||{},i=a.className,c=a.content,s=o.x,u=o.y,d=v.useRef();if(!n||!n.points)return null;var f={position:"absolute"};if(!1!==n.autoArrow){var p=n.points[0],m=n.points[1],g=p[0],h=p[1],b=m[0],y=m[1];g!==b&&["t","b"].includes(g)?"t"===g?f.top=0:f.bottom=0:f.top=void 0===u?0:u,h!==y&&["l","r"].includes(h)?"l"===h?f.left=0:f.right=0:f.left=void 0===s?0:s}return v.createElement("div",{ref:d,className:l()("".concat(t,"-arrow"),i),style:f},c)}function w(e){var t=e.prefixCls,n=e.open,r=e.zIndex,o=e.mask,a=e.motion;return o?v.createElement(b.ZP,(0,h.Z)({},a,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(e){var n=e.className;return v.createElement("div",{style:{zIndex:r},className:l()("".concat(t,"-mask"),n)})}):null}var E=v.memo(function(e){return e.children},function(e,t){return t.cache}),C=v.forwardRef(function(e,t){var n=e.popup,a=e.className,i=e.prefixCls,c=e.style,u=e.target,d=e.onVisibleChanged,f=e.open,p=e.keepDom,g=e.fresh,C=e.onClick,Z=e.mask,S=e.arrow,O=e.arrowPos,k=e.align,j=e.motion,I=e.maskMotion,M=e.forceRender,R=e.getPopupContainer,N=e.autoDestroy,P=e.portal,F=e.zIndex,T=e.onMouseEnter,A=e.onMouseLeave,_=e.onPointerEnter,B=e.onPointerDownCapture,H=e.ready,z=e.offsetX,L=e.offsetY,D=e.offsetR,W=e.offsetB,V=e.onAlign,q=e.onPrepare,X=e.stretch,G=e.targetWidth,U=e.targetHeight,$="function"==typeof n?n():n,K=f||p,Y=(null==R?void 0:R.length)>0,Q=v.useState(!R||!Y),J=(0,o.Z)(Q,2),ee=J[0],et=J[1];if((0,m.Z)(function(){!ee&&Y&&u&&et(!0)},[ee,Y,u]),!ee)return null;var en="auto",er={left:"-1000vw",top:"-1000vh",right:en,bottom:en};if(H||!f){var eo,ea=k.points,ei=k.dynamicInset||(null===(eo=k._experimental)||void 0===eo?void 0:eo.dynamicInset),ec=ei&&"r"===ea[0][1],el=ei&&"b"===ea[0][0];ec?(er.right=D,er.left=en):(er.left=z,er.right=en),el?(er.bottom=W,er.top=en):(er.top=L,er.bottom=en)}var es={};return X&&(X.includes("height")&&U?es.height=U:X.includes("minHeight")&&U&&(es.minHeight=U),X.includes("width")&&G?es.width=G:X.includes("minWidth")&&G&&(es.minWidth=G)),f||(es.pointerEvents="none"),v.createElement(P,{open:M||K,getContainer:R&&function(){return R(u)},autoDestroy:N},v.createElement(w,{prefixCls:i,open:f,zIndex:F,mask:Z,motion:I}),v.createElement(s.Z,{onResize:V,disabled:!f},function(e){return v.createElement(b.ZP,(0,h.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:M,leavedClassName:"".concat(i,"-hidden")},j,{onAppearPrepare:q,onEnterPrepare:q,visible:f,onVisibleChanged:function(e){var t;null==j||null===(t=j.onVisibleChanged)||void 0===t||t.call(j,e),d(e)}}),function(n,o){var s=n.className,u=n.style,d=l()(i,s,a);return v.createElement("div",{ref:(0,y.sQ)(e,t,o),className:d,style:(0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)({"--arrow-x":"".concat(O.x||0,"px"),"--arrow-y":"".concat(O.y||0,"px")},er),es),u),{},{boxSizing:"border-box",zIndex:F},c),onMouseEnter:T,onMouseLeave:A,onPointerEnter:_,onClick:C,onPointerDownCapture:B},S&&v.createElement(x,{prefixCls:i,arrow:S,arrowPos:O,align:k}),v.createElement(E,{cache:!f&&!g},$))})}))}),Z=v.forwardRef(function(e,t){var n=e.children,r=e.getTriggerDOMNode,o=(0,y.Yr)(n),a=v.useCallback(function(e){(0,y.mH)(t,r?r(e):e)},[r]),i=(0,y.x1)(a,(0,y.C4)(n));return o?v.cloneElement(n,{ref:i}):n}),S=v.createContext(null);function O(e){return e?Array.isArray(e)?e:[e]:[]}var k=n(2857);function j(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function I(e){return e.ownerDocument.defaultView}function M(e){for(var t=[],n=null==e?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var o=I(n).getComputedStyle(n);[o.overflowX,o.overflowY,o.overflow].some(function(e){return r.includes(e)})&&t.push(n),n=n.parentElement}return t}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isNaN(e)?t:e}function N(e){return R(parseFloat(e),0)}function P(e,t){var n=(0,r.Z)({},e);return(t||[]).forEach(function(e){if(!(e instanceof HTMLBodyElement||e instanceof HTMLHtmlElement)){var t=I(e).getComputedStyle(e),r=t.overflow,o=t.overflowClipMargin,a=t.borderTopWidth,i=t.borderBottomWidth,c=t.borderLeftWidth,l=t.borderRightWidth,s=e.getBoundingClientRect(),u=e.offsetHeight,d=e.clientHeight,f=e.offsetWidth,p=e.clientWidth,m=N(a),g=N(i),v=N(c),h=N(l),b=R(Math.round(s.width/f*1e3)/1e3),y=R(Math.round(s.height/u*1e3)/1e3),x=m*y,w=v*b,E=0,C=0;if("clip"===r){var Z=N(o);E=Z*b,C=Z*y}var S=s.x+w-E,O=s.y+x-C,k=S+s.width+2*E-w-h*b-(f-p-v-h)*b,j=O+s.height+2*C-x-g*y-(u-d-m-g)*y;n.left=Math.max(n.left,S),n.top=Math.max(n.top,O),n.right=Math.min(n.right,k),n.bottom=Math.min(n.bottom,j)}}),n}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n="".concat(t),r=n.match(/^(.*)\%$/);return r?parseFloat(r[1])/100*e:parseFloat(n)}function T(e,t){var n=(0,o.Z)(t||[],2),r=n[0],a=n[1];return[F(e.width,r),F(e.height,a)]}function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[e[0],e[1]]}function _(e,t){var n,r=t[0],o=t[1];return n="t"===r?e.y:"b"===r?e.y+e.height:e.y+e.height/2,{x:"l"===o?e.x:"r"===o?e.x+e.width:e.x+e.width/2,y:n}}function B(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map(function(e,r){return r===t?n[e]||"c":e}).join("")}var H=n(83145);n(32559);var z=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"],L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.Z;return v.forwardRef(function(t,n){var i,c,h,b,y,x,w,E,N,F,L,D,W,V,q,X,G,U=t.prefixCls,$=void 0===U?"rc-trigger-popup":U,K=t.children,Y=t.action,Q=t.showAction,J=t.hideAction,ee=t.popupVisible,et=t.defaultPopupVisible,en=t.onPopupVisibleChange,er=t.afterPopupVisibleChange,eo=t.mouseEnterDelay,ea=t.mouseLeaveDelay,ei=void 0===ea?.1:ea,ec=t.focusDelay,el=t.blurDelay,es=t.mask,eu=t.maskClosable,ed=t.getPopupContainer,ef=t.forceRender,ep=t.autoDestroy,em=t.destroyPopupOnHide,eg=t.popup,ev=t.popupClassName,eh=t.popupStyle,eb=t.popupPlacement,ey=t.builtinPlacements,ex=void 0===ey?{}:ey,ew=t.popupAlign,eE=t.zIndex,eC=t.stretch,eZ=t.getPopupClassNameFromAlign,eS=t.fresh,eO=t.alignPoint,ek=t.onPopupClick,ej=t.onPopupAlign,eI=t.arrow,eM=t.popupMotion,eR=t.maskMotion,eN=t.popupTransitionName,eP=t.popupAnimation,eF=t.maskTransitionName,eT=t.maskAnimation,eA=t.className,e_=t.getTriggerDOMNode,eB=(0,a.Z)(t,z),eH=v.useState(!1),ez=(0,o.Z)(eH,2),eL=ez[0],eD=ez[1];(0,m.Z)(function(){eD((0,g.Z)())},[]);var eW=v.useRef({}),eV=v.useContext(S),eq=v.useMemo(function(){return{registerSubPopup:function(e,t){eW.current[e]=t,null==eV||eV.registerSubPopup(e,t)}}},[eV]),eX=(0,p.Z)(),eG=v.useState(null),eU=(0,o.Z)(eG,2),e$=eU[0],eK=eU[1],eY=v.useRef(null),eQ=(0,f.Z)(function(e){eY.current=e,(0,u.Sh)(e)&&e$!==e&&eK(e),null==eV||eV.registerSubPopup(eX,e)}),eJ=v.useState(null),e0=(0,o.Z)(eJ,2),e1=e0[0],e2=e0[1],e6=v.useRef(null),e5=(0,f.Z)(function(e){(0,u.Sh)(e)&&e1!==e&&(e2(e),e6.current=e)}),e4=v.Children.only(K),e3=(null==e4?void 0:e4.props)||{},e7={},e9=(0,f.Z)(function(e){var t,n;return(null==e1?void 0:e1.contains(e))||(null===(t=(0,d.A)(e1))||void 0===t?void 0:t.host)===e||e===e1||(null==e$?void 0:e$.contains(e))||(null===(n=(0,d.A)(e$))||void 0===n?void 0:n.host)===e||e===e$||Object.values(eW.current).some(function(t){return(null==t?void 0:t.contains(e))||e===t})}),e8=j($,eM,eP,eN),te=j($,eR,eT,eF),tt=v.useState(et||!1),tn=(0,o.Z)(tt,2),tr=tn[0],to=tn[1],ta=null!=ee?ee:tr,ti=(0,f.Z)(function(e){void 0===ee&&to(e)});(0,m.Z)(function(){to(ee||!1)},[ee]);var tc=v.useRef(ta);tc.current=ta;var tl=v.useRef([]);tl.current=[];var ts=(0,f.Z)(function(e){var t;ti(e),(null!==(t=tl.current[tl.current.length-1])&&void 0!==t?t:ta)!==e&&(tl.current.push(e),null==en||en(e))}),tu=v.useRef(),td=function(){clearTimeout(tu.current)},tf=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;td(),0===t?ts(e):tu.current=setTimeout(function(){ts(e)},1e3*t)};v.useEffect(function(){return td},[]);var tp=v.useState(!1),tm=(0,o.Z)(tp,2),tg=tm[0],tv=tm[1];(0,m.Z)(function(e){(!e||ta)&&tv(!0)},[ta]);var th=v.useState(null),tb=(0,o.Z)(th,2),ty=tb[0],tx=tb[1],tw=v.useState(null),tE=(0,o.Z)(tw,2),tC=tE[0],tZ=tE[1],tS=function(e){tZ([e.clientX,e.clientY])},tO=(i=eO&&null!==tC?tC:e1,c=v.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:ex[eb]||{}}),b=(h=(0,o.Z)(c,2))[0],y=h[1],x=v.useRef(0),w=v.useMemo(function(){return e$?M(e$):[]},[e$]),E=v.useRef({}),ta||(E.current={}),N=(0,f.Z)(function(){if(e$&&i&&ta){var e=e$.ownerDocument,t=I(e$),n=t.getComputedStyle(e$).position,a=e$.style.left,c=e$.style.top,l=e$.style.right,s=e$.style.bottom,d=e$.style.overflow,f=(0,r.Z)((0,r.Z)({},ex[eb]),ew),p=e.createElement("div");if(null===(b=e$.parentElement)||void 0===b||b.appendChild(p),p.style.left="".concat(e$.offsetLeft,"px"),p.style.top="".concat(e$.offsetTop,"px"),p.style.position=n,p.style.height="".concat(e$.offsetHeight,"px"),p.style.width="".concat(e$.offsetWidth,"px"),e$.style.left="0",e$.style.top="0",e$.style.right="auto",e$.style.bottom="auto",e$.style.overflow="hidden",Array.isArray(i))S={x:i[0],y:i[1],width:0,height:0};else{var m,g,v,h,b,x,C,Z,S,O,j,M=i.getBoundingClientRect();M.x=null!==(O=M.x)&&void 0!==O?O:M.left,M.y=null!==(j=M.y)&&void 0!==j?j:M.top,S={x:M.x,y:M.y,width:M.width,height:M.height}}var N=e$.getBoundingClientRect(),F=t.getComputedStyle(e$),H=F.height,z=F.width;N.x=null!==(x=N.x)&&void 0!==x?x:N.left,N.y=null!==(C=N.y)&&void 0!==C?C:N.top;var L=e.documentElement,D=L.clientWidth,W=L.clientHeight,V=L.scrollWidth,q=L.scrollHeight,X=L.scrollTop,G=L.scrollLeft,U=N.height,$=N.width,K=S.height,Y=S.width,Q=f.htmlRegion,J="visible",ee="visibleFirst";"scroll"!==Q&&Q!==ee&&(Q=J);var et=Q===ee,en=P({left:-G,top:-X,right:V-G,bottom:q-X},w),er=P({left:0,top:0,right:D,bottom:W},w),eo=Q===J?er:en,ea=et?er:eo;e$.style.left="auto",e$.style.top="auto",e$.style.right="0",e$.style.bottom="0";var ei=e$.getBoundingClientRect();e$.style.left=a,e$.style.top=c,e$.style.right=l,e$.style.bottom=s,e$.style.overflow=d,null===(Z=e$.parentElement)||void 0===Z||Z.removeChild(p);var ec=R(Math.round($/parseFloat(z)*1e3)/1e3),el=R(Math.round(U/parseFloat(H)*1e3)/1e3);if(!(0===ec||0===el||(0,u.Sh)(i)&&!(0,k.Z)(i))){var es=f.offset,eu=f.targetOffset,ed=T(N,es),ef=(0,o.Z)(ed,2),ep=ef[0],em=ef[1],eg=T(S,eu),ev=(0,o.Z)(eg,2),eh=ev[0],ey=ev[1];S.x-=eh,S.y-=ey;var eE=f.points||[],eC=(0,o.Z)(eE,2),eZ=eC[0],eS=A(eC[1]),eO=A(eZ),ek=_(S,eS),eI=_(N,eO),eM=(0,r.Z)({},f),eR=ek.x-eI.x+ep,eN=ek.y-eI.y+em,eP=tc(eR,eN),eF=tc(eR,eN,er),eT=_(S,["t","l"]),eA=_(N,["t","l"]),e_=_(S,["b","r"]),eB=_(N,["b","r"]),eH=f.overflow||{},ez=eH.adjustX,eL=eH.adjustY,eD=eH.shiftX,eW=eH.shiftY,eV=function(e){return"boolean"==typeof e?e:e>=0};tl();var eq=eV(eL),eX=eO[0]===eS[0];if(eq&&"t"===eO[0]&&(g>ea.bottom||E.current.bt)){var eG=eN;eX?eG-=U-K:eG=eT.y-eB.y-em;var eU=tc(eR,eG),eK=tc(eR,eG,er);eU>eP||eU===eP&&(!et||eK>=eF)?(E.current.bt=!0,eN=eG,em=-em,eM.points=[B(eO,0),B(eS,0)]):E.current.bt=!1}if(eq&&"b"===eO[0]&&(meP||eQ===eP&&(!et||eJ>=eF)?(E.current.tb=!0,eN=eY,em=-em,eM.points=[B(eO,0),B(eS,0)]):E.current.tb=!1}var e0=eV(ez),e1=eO[1]===eS[1];if(e0&&"l"===eO[1]&&(h>ea.right||E.current.rl)){var e2=eR;e1?e2-=$-Y:e2=eT.x-eB.x-ep;var e6=tc(e2,eN),e5=tc(e2,eN,er);e6>eP||e6===eP&&(!et||e5>=eF)?(E.current.rl=!0,eR=e2,ep=-ep,eM.points=[B(eO,1),B(eS,1)]):E.current.rl=!1}if(e0&&"r"===eO[1]&&(veP||e3===eP&&(!et||e7>=eF)?(E.current.lr=!0,eR=e4,ep=-ep,eM.points=[B(eO,1),B(eS,1)]):E.current.lr=!1}tl();var e9=!0===eD?0:eD;"number"==typeof e9&&(ver.right&&(eR-=h-er.right-ep,S.x>er.right-e9&&(eR+=S.x-er.right+e9)));var e8=!0===eW?0:eW;"number"==typeof e8&&(mer.bottom&&(eN-=g-er.bottom-em,S.y>er.bottom-e8&&(eN+=S.y-er.bottom+e8)));var te=N.x+eR,tt=N.y+eN,tn=S.x,tr=S.y;null==ej||ej(e$,eM);var to=ei.right-N.x-(eR+N.width),ti=ei.bottom-N.y-(eN+N.height);1===ec&&(eR=Math.round(eR),to=Math.round(to)),1===el&&(eN=Math.round(eN),ti=Math.round(ti)),y({ready:!0,offsetX:eR/ec,offsetY:eN/el,offsetR:to/ec,offsetB:ti/el,arrowX:((Math.max(te,tn)+Math.min(te+$,tn+Y))/2-te)/ec,arrowY:((Math.max(tt,tr)+Math.min(tt+U,tr+K))/2-tt)/el,scaleX:ec,scaleY:el,align:eM})}function tc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eo,r=N.x+e,o=N.y+t,a=Math.max(r,n.left),i=Math.max(o,n.top);return Math.max(0,(Math.min(r+$,n.right)-a)*(Math.min(o+U,n.bottom)-i))}function tl(){g=(m=N.y+eN)+U,h=(v=N.x+eR)+$}}}),F=function(){y(function(e){return(0,r.Z)((0,r.Z)({},e),{},{ready:!1})})},(0,m.Z)(F,[eb]),(0,m.Z)(function(){ta||F()},[ta]),[b.ready,b.offsetX,b.offsetY,b.offsetR,b.offsetB,b.arrowX,b.arrowY,b.scaleX,b.scaleY,b.align,function(){x.current+=1;var e=x.current;Promise.resolve().then(function(){x.current===e&&N()})}]),tk=(0,o.Z)(tO,11),tj=tk[0],tI=tk[1],tM=tk[2],tR=tk[3],tN=tk[4],tP=tk[5],tF=tk[6],tT=tk[7],tA=tk[8],t_=tk[9],tB=tk[10],tH=(L=void 0===Y?"hover":Y,v.useMemo(function(){var e=O(null!=Q?Q:L),t=O(null!=J?J:L),n=new Set(e),r=new Set(t);return eL&&(n.has("hover")&&(n.delete("hover"),n.add("click")),r.has("hover")&&(r.delete("hover"),r.add("click"))),[n,r]},[eL,L,Q,J])),tz=(0,o.Z)(tH,2),tL=tz[0],tD=tz[1],tW=tL.has("click"),tV=tD.has("click")||tD.has("contextMenu"),tq=(0,f.Z)(function(){tg||tB()});D=function(){tc.current&&eO&&tV&&tf(!1)},(0,m.Z)(function(){if(ta&&e1&&e$){var e=M(e1),t=M(e$),n=I(e$),r=new Set([n].concat((0,H.Z)(e),(0,H.Z)(t)));function o(){tq(),D()}return r.forEach(function(e){e.addEventListener("scroll",o,{passive:!0})}),n.addEventListener("resize",o,{passive:!0}),tq(),function(){r.forEach(function(e){e.removeEventListener("scroll",o),n.removeEventListener("resize",o)})}}},[ta,e1,e$]),(0,m.Z)(function(){tq()},[tC,eb]),(0,m.Z)(function(){ta&&!(null!=ex&&ex[eb])&&tq()},[JSON.stringify(ew)]);var tX=v.useMemo(function(){var e=function(e,t,n,r){for(var o=n.points,a=Object.keys(e),i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}(null===(c=e[l])||void 0===c?void 0:c.points,o,r))return"".concat(t,"-placement-").concat(l)}return""}(ex,$,t_,eO);return l()(e,null==eZ?void 0:eZ(t_))},[t_,eZ,ex,$,eO]);v.useImperativeHandle(n,function(){return{nativeElement:e6.current,popupElement:eY.current,forceAlign:tq}});var tG=v.useState(0),tU=(0,o.Z)(tG,2),t$=tU[0],tK=tU[1],tY=v.useState(0),tQ=(0,o.Z)(tY,2),tJ=tQ[0],t0=tQ[1],t1=function(){if(eC&&e1){var e=e1.getBoundingClientRect();tK(e.width),t0(e.height)}};function t2(e,t,n,r){e7[e]=function(o){var a;null==r||r(o),tf(t,n);for(var i=arguments.length,c=Array(i>1?i-1:0),l=1;l1?n-1:0),o=1;o1?n-1:0),o=1;o{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))},i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))},c=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};var l=n(96398),s=n(13241),u=n(1153);let d=o.forwardRef((e,t)=>{let{value:n,defaultValue:d,type:f,placeholder:p="Type...",icon:m,error:g=!1,errorMessage:v,disabled:h=!1,stepper:b,makeInputClassName:y,className:x,onChange:w,onValueChange:E,autoFocus:C,pattern:Z}=e,S=(0,r._T)(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus","pattern"]),[O,k]=(0,o.useState)(C||!1),[j,I]=(0,o.useState)(!1),M=(0,o.useCallback)(()=>I(!j),[j,I]),R=(0,o.useRef)(null),N=(0,l.Uh)(n||d);return o.useEffect(()=>{let e=()=>k(!0),t=()=>k(!1),n=R.current;return n&&(n.addEventListener("focus",e),n.addEventListener("blur",t),C&&n.focus()),()=>{n&&(n.removeEventListener("focus",e),n.removeEventListener("blur",t))}},[C]),o.createElement(o.Fragment,null,o.createElement("div",{className:(0,s.q)(y("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",(0,l.um)(N,h,g),O&&(0,s.q)("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),x)},m?o.createElement(m,{className:(0,s.q)(y("icon"),"shrink-0 h-5 w-5 mx-2.5 absolute left-0 flex items-center","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,o.createElement("input",Object.assign({ref:(0,u.lq)([R,t]),defaultValue:d,value:n,type:j?"text":f,className:(0,s.q)(y("input"),"w-full bg-transparent focus:outline-none focus:ring-0 border-none text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none","password"===f?g?"pr-16":"pr-12":g?"pr-8":"pr-3",m?"pl-10":"pl-3",h?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:p,disabled:h,"data-testid":"base-input",onChange:e=>{null==w||w(e),null==E||E(e.target.value)},pattern:Z},S)),"password"!==f||h?null:o.createElement("button",{className:(0,s.q)(y("toggleButton"),"absolute inset-y-0 right-0 flex items-center px-2.5 rounded-lg"),type:"button",onClick:()=>M(),"aria-label":j?"Hide password":"Show Password"},j?o.createElement(c,{className:(0,s.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):o.createElement(i,{className:(0,s.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),g?o.createElement(a,{className:(0,s.q)(y("errorIcon"),"text-red-500 shrink-0 h-5 w-5 absolute right-0 flex items-center","password"===f?"mr-10":"number"===f?b?"mr-20":"mr-3":"mx-2.5")}):null,null!=b?b:null),g&&v?o.createElement("p",{className:(0,s.q)(y("errorMessage"),"text-sm text-red-500 mt-1")},v):null)});d.displayName="BaseInput"},49566:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(5853),o=n(2265);n(13241);var a=n(1153),i=n(69262);let c=(0,a.fn)("TextInput"),l=o.forwardRef((e,t)=>{let{type:n="text"}=e,a=(0,r._T)(e,["type"]);return o.createElement(i.Z,Object.assign({ref:t,type:n,makeInputClassName:c},a))});l.displayName="TextInput"},96398:function(e,t,n){"use strict";n.d(t,{Uh:function(){return s},n0:function(){return c},qg:function(){return a},sl:function(){return i},um:function(){return l}});var r=n(13241),o=n(2265);let a=e=>["string","number"].includes(typeof e)?e:e instanceof Array?e.map(a).join(""):"object"==typeof e&&e?a(e.props.children):void 0;function i(e){let t=new Map;return o.Children.map(e,e=>{var n;t.set(e.props.value,null!==(n=a(e))&&void 0!==n?n:e.props.value)}),t}function c(e,t){return o.Children.map(t,t=>{var n;if((null!==(n=a(t))&&void 0!==n?n:t.props.value).toLowerCase().includes(e.toLowerCase()))return t})}let l=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,r.q)(t?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!t&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",t&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",n&&"text-red-500 placeholder:text-red-500 dark:text-red-500 dark:placeholder:text-red-500",n?"border-red-500 dark:border-red-500":"border-tremor-border dark:border-dark-tremor-border")};function s(e){return null!=e&&""!==e}},391:function(e,t,n){"use strict";var r=n(2265),o=n(39109),a=n(77685);t.Z=e=>{let{space:t,form:n,children:i}=e;if(null==i)return null;let c=i;return n&&(c=r.createElement(o.Ux,{override:!0,status:!0},c)),t&&(c=r.createElement(a.BR,null,c)),c}},93942:function(e,t,n){"use strict";n.d(t,{i:function(){return c}});var r=n(2265),o=n(50506),a=n(18310),i=n(71744);function c(e){return t=>r.createElement(a.ZP,{theme:{token:{motion:!1,zIndexPopupBase:0}}},r.createElement(e,Object.assign({},t)))}t.Z=(e,t,n,a,l)=>c(c=>{let{prefixCls:s,style:u}=c,d=r.useRef(null),[f,p]=r.useState(0),[m,g]=r.useState(0),[v,h]=(0,o.Z)(!1,{value:c.open}),{getPrefixCls:b}=r.useContext(i.E_),y=b(a||"select",s);r.useEffect(()=>{if(h(!0),"undefined"!=typeof ResizeObserver){let e=new ResizeObserver(e=>{let t=e[0].target;p(t.offsetHeight+8),g(t.offsetWidth)}),t=setInterval(()=>{var n;let r=l?".".concat(l(y)):".".concat(y,"-dropdown"),o=null===(n=d.current)||void 0===n?void 0:n.querySelector(r);o&&(clearInterval(t),e.observe(o))},10);return()=>{clearInterval(t),e.disconnect()}}},[y]);let x=Object.assign(Object.assign({},c),{style:Object.assign(Object.assign({},u),{margin:0}),open:v,visible:v,getPopupContainer:()=>d.current});return n&&(x=n(x)),t&&Object.assign(x,{[t]:{overflow:{adjustX:!1,adjustY:!1}}}),r.createElement("div",{ref:d,style:{paddingBottom:f,position:"relative",minWidth:m}},r.createElement(e,Object.assign({},x)))})},93350:function(e,t,n){"use strict";n.d(t,{o2:function(){return c},yT:function(){return l}});var r=n(83145),o=n(53454);let a=o.i.map(e=>"".concat(e,"-inverse")),i=["success","processing","error","default","warning"];function c(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return t?[].concat((0,r.Z)(a),(0,r.Z)(o.i)).includes(e):o.i.includes(e)}function l(e){return i.includes(e)}},94611:function(e,t,n){"use strict";var r=n(2265),o=n(39725);t.Z=e=>{let t;return"object"==typeof e&&(null==e?void 0:e.clearIcon)?t=e:e&&(t={clearIcon:r.createElement(o.Z,null)}),t}},51646:function(e,t,n){"use strict";n.d(t,{N:function(){return o}});var r=n(2265);let o=()=>r.useReducer(e=>e+1,0)},62236:function(e,t,n){"use strict";n.d(t,{Cn:function(){return s},u6:function(){return i}});var r=n(2265),o=n(84951),a=n(95140);let i=1e3,c={Modal:100,Drawer:100,Popover:100,Popconfirm:100,Tooltip:100,Tour:100,FloatButton:100},l={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1},s=(e,t)=>{let n;let[,i]=(0,o.ZP)(),s=r.useContext(a.Z);if(void 0!==t)n=[t,t];else{let r=null!=s?s:0;e in c?r+=(s?0:i.zIndexPopupBase)+c[e]:r+=l[e],n=[void 0===s?t:r,r]}return n}},16774:function(e,t,n){"use strict";n.d(t,{h:function(){return o},x:function(){return r}});let r=(e,t)=>{void 0!==(null==e?void 0:e.addEventListener)?e.addEventListener("change",t):void 0!==(null==e?void 0:e.addListener)&&e.addListener(t)},o=(e,t)=>{void 0!==(null==e?void 0:e.removeEventListener)?e.removeEventListener("change",t):void 0!==(null==e?void 0:e.removeListener)&&e.removeListener(t)}},68710:function(e,t,n){"use strict";n.d(t,{m:function(){return l}});var r=n(71744);let o=()=>({height:0,opacity:0}),a=e=>{let{scrollHeight:t}=e;return{height:t,opacity:1}},i=e=>({height:e?e.offsetHeight:0}),c=(e,t)=>(null==t?void 0:t.deadline)===!0||"height"===t.propertyName,l=(e,t,n)=>void 0!==n?n:"".concat(e,"-").concat(t);t.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.Rf;return{motionName:"".concat(e,"-motion-collapse"),onAppearStart:o,onEnterStart:o,onAppearActive:a,onEnterActive:a,onLeaveStart:i,onLeaveActive:o,onAppearEnd:c,onEnterEnd:c,onLeaveEnd:c,motionDeadline:500}}},92736:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(88260);let o={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},a={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},i=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function c(e){let{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:c,offset:l,borderRadius:s,visibleFirst:u}=e,d=t/2,f={},p=(0,r.wZ)({contentRadius:s,limitVerticalRadius:!0});return Object.keys(o).forEach(e=>{let r=Object.assign(Object.assign({},c&&a[e]||o[e]),{offset:[0,0],dynamicInset:!0});switch(f[e]=r,i.has(e)&&(r.autoArrow=!1),e){case"top":case"topLeft":case"topRight":r.offset[1]=-d-l;break;case"bottom":case"bottomLeft":case"bottomRight":r.offset[1]=d+l;break;case"left":case"leftTop":case"leftBottom":r.offset[0]=-d-l;break;case"right":case"rightTop":case"rightBottom":r.offset[0]=d+l}if(c)switch(e){case"topLeft":case"bottomLeft":r.offset[0]=-p.arrowOffsetHorizontal-d;break;case"topRight":case"bottomRight":r.offset[0]=p.arrowOffsetHorizontal+d;break;case"leftTop":case"rightTop":r.offset[1]=-(2*p.arrowOffsetHorizontal)+d;break;case"leftBottom":case"rightBottom":r.offset[1]=2*p.arrowOffsetHorizontal-d}r.overflow=function(e,t,n,r){if(!1===r)return{adjustX:!1,adjustY:!1};let o={};switch(e){case"top":case"bottom":o.shiftX=2*t.arrowOffsetHorizontal+n,o.shiftY=!0,o.adjustY=!0;break;case"left":case"right":o.shiftY=2*t.arrowOffsetVertical+n,o.shiftX=!0,o.adjustX=!0}let a=Object.assign(Object.assign({},o),r&&"object"==typeof r?r:{});return a.shiftX||(a.adjustX=!0),a.shiftY||(a.adjustY=!0),a}(e,p,t,n),u&&(r.htmlRegion="visibleFirst")}),f}},19722:function(e,t,n){"use strict";n.d(t,{M2:function(){return o},Tm:function(){return i},wm:function(){return a}});var r=n(2265);function o(e){return e&&r.isValidElement(e)&&e.type===r.Fragment}let a=(e,t,n)=>r.isValidElement(e)?r.cloneElement(e,"function"==typeof n?n(e.props||{}):n):t;function i(e,t){return a(e,e,t)}},6543:function(e,t,n){"use strict";n.d(t,{c4:function(){return i},m9:function(){return s}});var r=n(2265),o=n(84951),a=n(16774);let i=["xxl","xl","lg","md","sm","xs"],c=e=>({xs:"(max-width: ".concat(e.screenXSMax,"px)"),sm:"(min-width: ".concat(e.screenSM,"px)"),md:"(min-width: ".concat(e.screenMD,"px)"),lg:"(min-width: ".concat(e.screenLG,"px)"),xl:"(min-width: ".concat(e.screenXL,"px)"),xxl:"(min-width: ".concat(e.screenXXL,"px)")}),l=e=>{let t=[].concat(i).reverse();return t.forEach((n,r)=>{let o=n.toUpperCase(),a="screen".concat(o,"Min"),i="screen".concat(o);if(!(e[a]<=e[i]))throw Error("".concat(a,"<=").concat(i," fails : !(").concat(e[a],"<=").concat(e[i],")"));if(r{if(t){for(let n of i)if(e[n]&&(null==t?void 0:t[n])!==void 0)return t[n]}};t.ZP=()=>{let[,e]=(0,o.ZP)(),t=c(l(e));return r.useMemo(()=>{let e=new Map,n=-1,r={};return{responsiveMap:t,matchHandlers:{},dispatch:t=>(r=t,e.forEach(e=>e(r)),e.size>=1),subscribe(t){return e.size||this.register(),n+=1,e.set(n,t),t(r),n},unsubscribe(t){e.delete(t),e.size||this.unregister()},register(){Object.entries(t).forEach(e=>{let[t,n]=e,o=e=>{let{matches:n}=e;this.dispatch(Object.assign(Object.assign({},r),{[t]:n}))},i=window.matchMedia(n);(0,a.x)(i,o),this.matchHandlers[n]={mql:i,listener:o},o(i)})},unregister(){Object.values(t).forEach(e=>{let t=this.matchHandlers[e];(0,a.h)(null==t?void 0:t.mql,null==t?void 0:t.listener)}),e.clear()}}},[t])}},12757:function(e,t,n){"use strict";n.d(t,{F:function(){return i},Z:function(){return a}});var r=n(36760),o=n.n(r);function a(e,t,n){return o()({["".concat(e,"-status-success")]:"success"===t,["".concat(e,"-status-warning")]:"warning"===t,["".concat(e,"-status-error")]:"error"===t,["".concat(e,"-status-validating")]:"validating"===t,["".concat(e,"-has-feedback")]:n})}let i=(e,t)=>t||e},13613:function(e,t,n){"use strict";n.d(t,{G8:function(){return a},ln:function(){return i}});var r=n(2265);function o(){}n(32559);let a=r.createContext({}),i=()=>{let e=()=>{};return e.deprecated=o,e}},6694:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(2265),o=n(36760),a=n.n(o),i=n(2857),c=n(28791),l=n(71744),s=n(19722),u=(0,n(99320).A1)("Wave",e=>{let{componentCls:t,colorPrimary:n}=e;return{[t]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:"var(--wave-color, ".concat(n,")"),boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:["box-shadow 0.4s ".concat(e.motionEaseOutCirc),"opacity 2s ".concat(e.motionEaseOutCirc)].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:["box-shadow ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut),"opacity ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut)].join(",")}}}}}),d=n(58525),f=n(53346),p=n(84951),m=n(34709),g=n(66632),v=n(66061);function h(e){return e&&"#fff"!==e&&"#ffffff"!==e&&"rgb(255, 255, 255)"!==e&&"rgba(255, 255, 255, 1)"!==e&&!/rgba\((?:\d*, ){3}0\)/.test(e)&&"transparent"!==e&&"canvastext"!==e}function b(e){return Number.isNaN(e)?0:e}let y=e=>{let{className:t,target:n,component:o,registerUnmount:i}=e,l=r.useRef(null),s=r.useRef(null);r.useEffect(()=>{s.current=i()},[]);let[u,d]=r.useState(null),[p,v]=r.useState([]),[y,x]=r.useState(0),[w,E]=r.useState(0),[C,Z]=r.useState(0),[S,O]=r.useState(0),[k,j]=r.useState(!1),I={left:y,top:w,width:C,height:S,borderRadius:p.map(e=>"".concat(e,"px")).join(" ")};function M(){let e=getComputedStyle(n);d(function(e){var t;let{borderTopColor:n,borderColor:r,backgroundColor:o}=getComputedStyle(e);return null!==(t=[n,r,o].find(h))&&void 0!==t?t:null}(n));let t="static"===e.position,{borderLeftWidth:r,borderTopWidth:o}=e;x(t?n.offsetLeft:b(-Number.parseFloat(r))),E(t?n.offsetTop:b(-Number.parseFloat(o))),Z(n.offsetWidth),O(n.offsetHeight);let{borderTopLeftRadius:a,borderTopRightRadius:i,borderBottomLeftRadius:c,borderBottomRightRadius:l}=e;v([a,i,l,c].map(e=>b(Number.parseFloat(e))))}if(u&&(I["--wave-color"]=u),r.useEffect(()=>{if(n){let e;let t=(0,f.Z)(()=>{M(),j(!0)});return"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(M)).observe(n),()=>{f.Z.cancel(t),null==e||e.disconnect()}}},[n]),!k)return null;let R=("Checkbox"===o||"Radio"===o)&&(null==n?void 0:n.classList.contains(m.A));return r.createElement(g.ZP,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(e,t)=>{var n,r;if(t.deadline||"opacity"===t.propertyName){let e=null===(n=l.current)||void 0===n?void 0:n.parentElement;null===(r=s.current)||void 0===r||r.call(s).then(()=>{null==e||e.remove()})}return!1}},(e,n)=>{let{className:o}=e;return r.createElement("div",{ref:(0,c.sQ)(l,n),className:a()(t,o,{"wave-quick":R}),style:I})})};var x=(e,t)=>{var n;let{component:o}=t;if("Checkbox"===o&&!(null===(n=e.querySelector("input"))||void 0===n?void 0:n.checked))return;let a=document.createElement("div");a.style.position="absolute",a.style.left="0px",a.style.top="0px",null==e||e.insertBefore(a,null==e?void 0:e.firstChild);let i=(0,v.q)(),c=null;c=i(r.createElement(y,Object.assign({},t,{target:e,registerUnmount:function(){return c}})),a)},w=(e,t,n)=>{let{wave:o}=r.useContext(l.E_),[,a,i]=(0,p.ZP)(),c=(0,d.Z)(r=>{let c=e.current;if((null==o?void 0:o.disabled)||!c)return;let l=c.querySelector(".".concat(m.A))||c,{showEffect:s}=o||{};(s||x)(l,{className:t,token:a,component:n,event:r,hashId:i})}),s=r.useRef(null);return e=>{f.Z.cancel(s.current),s.current=(0,f.Z)(()=>{c(e)})}},E=e=>{let{children:t,disabled:n,component:o}=e,{getPrefixCls:d}=(0,r.useContext)(l.E_),f=(0,r.useRef)(null),p=d("wave"),[,m]=u(p),g=w(f,a()(p,m),o);if(r.useEffect(()=>{let e=f.current;if(!e||e.nodeType!==window.Node.ELEMENT_NODE||n)return;let t=t=>{!(0,i.Z)(t.target)||!e.getAttribute||e.getAttribute("disabled")||e.disabled||e.className.includes("disabled")&&!e.className.includes("disabled:")||"true"===e.getAttribute("aria-disabled")||e.className.includes("-leave")||g(t)};return e.addEventListener("click",t,!0),()=>{e.removeEventListener("click",t,!0)}},[n]),!r.isValidElement(t))return null!=t?t:null;let v=(0,c.Yr)(t)?(0,c.sQ)((0,c.C4)(t),f):f;return(0,s.Tm)(t,{ref:v})}},34709:function(e,t,n){"use strict";n.d(t,{A:function(){return o}});var r=n(71744);let o="".concat(r.Rf,"-wave-target")},95140:function(e,t,n){"use strict";let r=n(2265).createContext(void 0);t.Z=r},52402:function(e,t,n){"use strict";n.d(t,{J:function(){return r}});let r=n(2265).createContext({})},51248:function(e,t,n){"use strict";n.d(t,{Dn:function(){return d},aG:function(){return l},hU:function(){return f},nx:function(){return s}});var r=n(83145),o=n(2265),a=n(19722),i=n(53454);let c=/^[\u4E00-\u9FA5]{2}$/,l=c.test.bind(c);function s(e){return"danger"===e?{danger:!0}:{type:e}}function u(e){return"string"==typeof e}function d(e){return"text"===e||"link"===e}function f(e,t){let n=!1,r=[];return o.Children.forEach(e,e=>{let t=typeof e,o="string"===t||"number"===t;if(n&&o){let t=r.length-1,n=r[t];r[t]="".concat(n).concat(e)}else r.push(e);n=o}),o.Children.map(r,e=>(function(e,t){if(null==e)return;let n=t?" ":"";return"string"!=typeof e&&"number"!=typeof e&&u(e.type)&&l(e.props.children)?(0,a.Tm)(e,{children:e.props.children.split("").join(n)}):u(e)?l(e)?o.createElement("span",null,e.split("").join(n)):o.createElement("span",null,e):(0,a.M2)(e)?o.createElement("span",null,e):e})(e,t))}["default","primary","danger"].concat((0,r.Z)(i.i))},5545:function(e,t,n){"use strict";n.d(t,{ZP:function(){return eh}});var r=n(2265),o=n(36760),a=n.n(o),i=n(27380),c=n(18694),l=n(28791),s=n(6694),u=n(71744),d=n(86586),f=n(33759),p=n(77685),m=n(84951),g=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let v=r.createContext(void 0);var h=n(51248),b=n(61935),y=n(66632);let x=(0,r.forwardRef)((e,t)=>{let{className:n,style:o,children:i,prefixCls:c}=e,l=a()("".concat(c,"-icon"),n);return r.createElement("span",{ref:t,className:l,style:o},i)}),w=(0,r.forwardRef)((e,t)=>{let{prefixCls:n,className:o,style:i,iconClassName:c}=e,l=a()("".concat(n,"-loading-icon"),o);return r.createElement(x,{prefixCls:n,className:l,style:i,ref:t},r.createElement(b.Z,{className:c}))}),E=()=>({width:0,opacity:0,transform:"scale(0)"}),C=e=>({width:e.scrollWidth,opacity:1,transform:"scale(1)"});var Z=e=>{let{prefixCls:t,loading:n,existIcon:o,className:i,style:c,mount:l}=e;return o?r.createElement(w,{prefixCls:t,className:i,style:c}):r.createElement(y.ZP,{visible:!!n,motionName:"".concat(t,"-loading-icon-motion"),motionAppear:!l,motionEnter:!l,motionLeave:!l,removeOnLeave:!0,onAppearStart:E,onAppearActive:C,onEnterStart:E,onEnterActive:C,onLeaveStart:C,onLeaveActive:E},(e,n)=>{let{className:o,style:l}=e,s=Object.assign(Object.assign({},c),l);return r.createElement(w,{prefixCls:t,className:a()(i,o),style:s,ref:n})})},S=n(93463),O=n(12918),k=n(53454),j=n(71140),I=n(99320);let M=(e,t)=>({["> span, > ".concat(e)]:{"&:not(:last-child)":{["&, & > ".concat(e)]:{"&:not(:disabled)":{borderInlineEndColor:t}}},"&:not(:first-child)":{["&, & > ".concat(e)]:{"&:not(:disabled)":{borderInlineStartColor:t}}}}});var R=e=>{let{componentCls:t,fontSize:n,lineWidth:r,groupBorderColor:o,colorErrorHover:a}=e;return{["".concat(t,"-group")]:[{position:"relative",display:"inline-flex",["> span, > ".concat(t)]:{"&:not(:last-child)":{["&, & > ".concat(t)]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:e.calc(r).mul(-1).equal(),["&, & > ".concat(t)]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[t]:{position:"relative",zIndex:1,"&:hover, &:focus, &:active":{zIndex:2},"&[disabled]":{zIndex:0}},["".concat(t,"-icon-only")]:{fontSize:n}},M("".concat(t,"-primary"),o),M("".concat(t,"-danger"),a)]}},N=n(11357),P=n(75669);n(50506);let F=(e,t)=>{let{r:n,g:r,b:o,a}=e.toRgb(),i=new P.Il(e.toRgbString()).onBackground(t).toHsv();return a<=.5?i.v>.5:.299*n+.587*r+.114*o>192};var T=n(1319),A=n(17431);let _=e=>{let{paddingInline:t,onlyIconSize:n}=e;return(0,j.IX)(e,{buttonPaddingHorizontal:t,buttonPaddingVertical:0,buttonIconOnlyFontSize:n})},B=e=>{var t,n,r,o,a,i;let c=null!==(t=e.contentFontSize)&&void 0!==t?t:e.fontSize,l=null!==(n=e.contentFontSizeSM)&&void 0!==n?n:e.fontSize,s=null!==(r=e.contentFontSizeLG)&&void 0!==r?r:e.fontSizeLG,u=null!==(o=e.contentLineHeight)&&void 0!==o?o:(0,T.D)(c),d=null!==(a=e.contentLineHeightSM)&&void 0!==a?a:(0,T.D)(l),f=null!==(i=e.contentLineHeightLG)&&void 0!==i?i:(0,T.D)(s),p=F(new N.y9(e.colorBgSolid),"#fff")?"#000":"#fff";return Object.assign(Object.assign({},k.i.reduce((t,n)=>Object.assign(Object.assign({},t),{["".concat(n,"ShadowColor")]:"0 ".concat((0,S.bf)(e.controlOutlineWidth)," 0 ").concat((0,A.Z)(e["".concat(n,"1")],e.colorBgContainer))}),{})),{fontWeight:400,iconGap:e.marginXS,defaultShadow:"0 ".concat(e.controlOutlineWidth,"px 0 ").concat(e.controlTmpOutline),primaryShadow:"0 ".concat(e.controlOutlineWidth,"px 0 ").concat(e.controlOutline),dangerShadow:"0 ".concat(e.controlOutlineWidth,"px 0 ").concat(e.colorErrorOutline),primaryColor:e.colorTextLightSolid,dangerColor:e.colorTextLightSolid,borderColorDisabled:e.colorBorder,defaultGhostColor:e.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:e.colorBgContainer,paddingInline:e.paddingContentHorizontal-e.lineWidth,paddingInlineLG:e.paddingContentHorizontal-e.lineWidth,paddingInlineSM:8-e.lineWidth,onlyIconSize:"inherit",onlyIconSizeSM:"inherit",onlyIconSizeLG:"inherit",groupBorderColor:e.colorPrimaryHover,linkHoverBg:"transparent",textTextColor:e.colorText,textTextHoverColor:e.colorText,textTextActiveColor:e.colorText,textHoverBg:e.colorFillTertiary,defaultColor:e.colorText,defaultBg:e.colorBgContainer,defaultBorderColor:e.colorBorder,defaultBorderColorDisabled:e.colorBorder,defaultHoverBg:e.colorBgContainer,defaultHoverColor:e.colorPrimaryHover,defaultHoverBorderColor:e.colorPrimaryHover,defaultActiveBg:e.colorBgContainer,defaultActiveColor:e.colorPrimaryActive,defaultActiveBorderColor:e.colorPrimaryActive,solidTextColor:p,contentFontSize:c,contentFontSizeSM:l,contentFontSizeLG:s,contentLineHeight:u,contentLineHeightSM:d,contentLineHeightLG:f,paddingBlock:Math.max((e.controlHeight-c*u)/2-e.lineWidth,0),paddingBlockSM:Math.max((e.controlHeightSM-l*d)/2-e.lineWidth,0),paddingBlockLG:Math.max((e.controlHeightLG-s*f)/2-e.lineWidth,0)})},H=e=>{let{componentCls:t,iconCls:n,fontWeight:r,opacityLoading:o,motionDurationSlow:a,motionEaseInOut:i,iconGap:c,calc:l}=e;return{[t]:{outline:"none",position:"relative",display:"inline-flex",gap:c,alignItems:"center",justifyContent:"center",fontWeight:r,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:"".concat((0,S.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),cursor:"pointer",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseInOut),userSelect:"none",touchAction:"manipulation",color:e.colorText,"&:disabled > *":{pointerEvents:"none"},["".concat(t,"-icon > svg")]:(0,O.Ro)(),"> a":{color:"currentColor"},"&:not(:disabled)":(0,O.Qy)(e),["&".concat(t,"-two-chinese-chars::first-letter")]:{letterSpacing:"0.34em"},["&".concat(t,"-two-chinese-chars > *:not(").concat(n,")")]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},["&".concat(t,"-icon-only")]:{paddingInline:0,["&".concat(t,"-compact-item")]:{flex:"none"}},["&".concat(t,"-loading")]:{opacity:o,cursor:"default"},["".concat(t,"-loading-icon")]:{transition:["width","opacity","margin"].map(e=>"".concat(e," ").concat(a," ").concat(i)).join(",")},["&:not(".concat(t,"-icon-end)")]:{["".concat(t,"-loading-icon-motion")]:{"&-appear-start, &-enter-start":{marginInlineEnd:l(c).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineEnd:0},"&-leave-start":{marginInlineEnd:0},"&-leave-active":{marginInlineEnd:l(c).mul(-1).equal()}}},"&-icon-end":{flexDirection:"row-reverse",["".concat(t,"-loading-icon-motion")]:{"&-appear-start, &-enter-start":{marginInlineStart:l(c).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineStart:0},"&-leave-start":{marginInlineStart:0},"&-leave-active":{marginInlineStart:l(c).mul(-1).equal()}}}}}},z=(e,t,n)=>({["&:not(:disabled):not(".concat(e,"-disabled)")]:{"&:hover":t,"&:active":n}}),L=e=>({minWidth:e.controlHeight,paddingInline:0,borderRadius:"50%"}),D=e=>({cursor:"not-allowed",borderColor:e.borderColorDisabled,color:e.colorTextDisabled,background:e.colorBgContainerDisabled,boxShadow:"none"}),W=(e,t,n,r,o,a,i,c)=>({["&".concat(e,"-background-ghost")]:Object.assign(Object.assign({color:n||void 0,background:t,borderColor:r||void 0,boxShadow:"none"},z(e,Object.assign({background:t},i),Object.assign({background:t},c))),{"&:disabled":{cursor:"not-allowed",color:o||void 0,borderColor:a||void 0}})}),V=e=>({["&:disabled, &".concat(e.componentCls,"-disabled")]:Object.assign({},D(e))}),q=e=>({["&:disabled, &".concat(e.componentCls,"-disabled")]:{cursor:"not-allowed",color:e.colorTextDisabled}}),X=(e,t,n,r)=>Object.assign(Object.assign({},(r&&["link","text"].includes(r)?q:V)(e)),z(e.componentCls,t,n)),G=(e,t,n,r,o)=>({["&".concat(e.componentCls,"-variant-solid")]:Object.assign({color:t,background:n},X(e,r,o))}),U=(e,t,n,r,o)=>({["&".concat(e.componentCls,"-variant-outlined, &").concat(e.componentCls,"-variant-dashed")]:Object.assign({borderColor:t,background:n},X(e,r,o))}),$=e=>({["&".concat(e.componentCls,"-variant-dashed")]:{borderStyle:"dashed"}}),K=(e,t,n,r)=>({["&".concat(e.componentCls,"-variant-filled")]:Object.assign({boxShadow:"none",background:t},X(e,n,r))}),Y=(e,t,n,r,o)=>({["&".concat(e.componentCls,"-variant-").concat(n)]:Object.assign({color:t,boxShadow:"none"},X(e,r,o,n))}),Q=e=>{let{componentCls:t}=e;return k.i.reduce((n,r)=>{let o=e["".concat(r,"6")],a=e["".concat(r,"1")],i=e["".concat(r,"5")],c=e["".concat(r,"2")],l=e["".concat(r,"3")],s=e["".concat(r,"7")];return Object.assign(Object.assign({},n),{["&".concat(t,"-color-").concat(r)]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:o,boxShadow:e["".concat(r,"ShadowColor")]},G(e,e.colorTextLightSolid,o,{background:i},{background:s})),U(e,o,e.colorBgContainer,{color:i,borderColor:i,background:e.colorBgContainer},{color:s,borderColor:s,background:e.colorBgContainer})),$(e)),K(e,a,{color:o,background:c},{color:o,background:l})),Y(e,o,"link",{color:i},{color:s})),Y(e,o,"text",{color:i,background:a},{color:s,background:l}))})},{})},J=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.defaultColor,boxShadow:e.defaultShadow},G(e,e.solidTextColor,e.colorBgSolid,{color:e.solidTextColor,background:e.colorBgSolidHover},{color:e.solidTextColor,background:e.colorBgSolidActive})),$(e)),K(e,e.colorFillTertiary,{color:e.defaultColor,background:e.colorFillSecondary},{color:e.defaultColor,background:e.colorFill})),W(e.componentCls,e.ghostBg,e.defaultGhostColor,e.defaultGhostBorderColor,e.colorTextDisabled,e.colorBorder)),Y(e,e.textTextColor,"link",{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),ee=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorPrimary,boxShadow:e.primaryShadow},U(e,e.colorPrimary,e.colorBgContainer,{color:e.colorPrimaryTextHover,borderColor:e.colorPrimaryHover,background:e.colorBgContainer},{color:e.colorPrimaryTextActive,borderColor:e.colorPrimaryActive,background:e.colorBgContainer})),$(e)),K(e,e.colorPrimaryBg,{color:e.colorPrimary,background:e.colorPrimaryBgHover},{color:e.colorPrimary,background:e.colorPrimaryBorder})),Y(e,e.colorPrimaryText,"text",{color:e.colorPrimaryTextHover,background:e.colorPrimaryBg},{color:e.colorPrimaryTextActive,background:e.colorPrimaryBorder})),Y(e,e.colorPrimaryText,"link",{color:e.colorPrimaryTextHover,background:e.linkHoverBg},{color:e.colorPrimaryTextActive})),W(e.componentCls,e.ghostBg,e.colorPrimary,e.colorPrimary,e.colorTextDisabled,e.colorBorder,{color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),et=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorError,boxShadow:e.dangerShadow},G(e,e.dangerColor,e.colorError,{background:e.colorErrorHover},{background:e.colorErrorActive})),U(e,e.colorError,e.colorBgContainer,{color:e.colorErrorHover,borderColor:e.colorErrorBorderHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),$(e)),K(e,e.colorErrorBg,{color:e.colorError,background:e.colorErrorBgFilledHover},{color:e.colorError,background:e.colorErrorBgActive})),Y(e,e.colorError,"text",{color:e.colorErrorHover,background:e.colorErrorBg},{color:e.colorErrorHover,background:e.colorErrorBgActive})),Y(e,e.colorError,"link",{color:e.colorErrorHover},{color:e.colorErrorActive})),W(e.componentCls,e.ghostBg,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder,{color:e.colorErrorHover,borderColor:e.colorErrorHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),en=e=>Object.assign(Object.assign({},Y(e,e.colorLink,"link",{color:e.colorLinkHover},{color:e.colorLinkActive})),W(e.componentCls,e.ghostBg,e.colorInfo,e.colorInfo,e.colorTextDisabled,e.colorBorder,{color:e.colorInfoHover,borderColor:e.colorInfoHover},{color:e.colorInfoActive,borderColor:e.colorInfoActive})),er=e=>{let{componentCls:t}=e;return Object.assign({["".concat(t,"-color-default")]:J(e),["".concat(t,"-color-primary")]:ee(e),["".concat(t,"-color-dangerous")]:et(e),["".concat(t,"-color-link")]:en(e)},Q(e))},eo=e=>Object.assign(Object.assign(Object.assign(Object.assign({},U(e,e.defaultBorderColor,e.defaultBg,{color:e.defaultHoverColor,borderColor:e.defaultHoverBorderColor,background:e.defaultHoverBg},{color:e.defaultActiveColor,borderColor:e.defaultActiveBorderColor,background:e.defaultActiveBg})),Y(e,e.textTextColor,"text",{color:e.textTextHoverColor,background:e.textHoverBg},{color:e.textTextActiveColor,background:e.colorBgTextActive})),G(e,e.primaryColor,e.colorPrimary,{background:e.colorPrimaryHover,color:e.primaryColor},{background:e.colorPrimaryActive,color:e.primaryColor})),Y(e,e.colorLink,"link",{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),ea=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",{componentCls:n,controlHeight:r,fontSize:o,borderRadius:a,buttonPaddingHorizontal:i,iconCls:c,buttonPaddingVertical:l,buttonIconOnlyFontSize:s}=e;return[{[t]:{fontSize:o,height:r,padding:"".concat((0,S.bf)(l)," ").concat((0,S.bf)(i)),borderRadius:a,["&".concat(n,"-icon-only")]:{width:r,[c]:{fontSize:s}}}},{["".concat(n).concat(n,"-circle").concat(t)]:L(e)},{["".concat(n).concat(n,"-round").concat(t)]:{borderRadius:e.controlHeight,["&:not(".concat(n,"-icon-only)")]:{paddingInline:e.buttonPaddingHorizontal}}}]},ei=e=>ea((0,j.IX)(e,{fontSize:e.contentFontSize}),e.componentCls),ec=e=>ea((0,j.IX)(e,{controlHeight:e.controlHeightSM,fontSize:e.contentFontSizeSM,padding:e.paddingXS,buttonPaddingHorizontal:e.paddingInlineSM,buttonPaddingVertical:0,borderRadius:e.borderRadiusSM,buttonIconOnlyFontSize:e.onlyIconSizeSM}),"".concat(e.componentCls,"-sm")),el=e=>ea((0,j.IX)(e,{controlHeight:e.controlHeightLG,fontSize:e.contentFontSizeLG,buttonPaddingHorizontal:e.paddingInlineLG,buttonPaddingVertical:0,borderRadius:e.borderRadiusLG,buttonIconOnlyFontSize:e.onlyIconSizeLG}),"".concat(e.componentCls,"-lg")),es=e=>{let{componentCls:t}=e;return{[t]:{["&".concat(t,"-block")]:{width:"100%"}}}};var eu=(0,I.I$)("Button",e=>{let t=_(e);return[H(t),ei(t),ec(t),el(t),es(t),er(t),eo(t),R(t)]},B,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}}),ed=n(17691);let ef=e=>{let{componentCls:t,colorPrimaryHover:n,lineWidth:r,calc:o}=e,a=o(r).mul(-1).equal(),i=e=>{let o="".concat(t,"-compact").concat(e?"-vertical":"","-item").concat(t,"-primary:not([disabled])");return{["".concat(o," + ").concat(o,"::before")]:{position:"absolute",top:e?a:0,insetInlineStart:e?0:a,backgroundColor:n,content:'""',width:e?"100%":r,height:e?r:"100%"}}};return Object.assign(Object.assign({},i()),i(!0))};var ep=(0,I.bk)(["Button","compact"],e=>{let t=_(e);return[(0,ed.c)(t),function(e){var t,n;let r="".concat(e.componentCls,"-compact-vertical");return{[r]:Object.assign(Object.assign({},(t=e.componentCls,{["&-item:not(".concat(r,"-last-item)")]:{marginBottom:e.calc(e.lineWidth).mul(-1).equal()},["&-item:not(".concat(t,"-status-success)")]:{zIndex:2},"&-item":{"&:hover,&:focus,&:active":{zIndex:3},"&[disabled]":{zIndex:0}}})),(n=e.componentCls,{["&-item:not(".concat(r,"-first-item):not(").concat(r,"-last-item)")]:{borderRadius:0},["&-item".concat(r,"-first-item:not(").concat(r,"-last-item)")]:{["&, &".concat(n,"-sm, &").concat(n,"-lg")]:{borderEndEndRadius:0,borderEndStartRadius:0}},["&-item".concat(r,"-last-item:not(").concat(r,"-first-item)")]:{["&, &".concat(n,"-sm, &").concat(n,"-lg")]:{borderStartStartRadius:0,borderStartEndRadius:0}}}))}}(t),ef(t)]},B),em=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eg={default:["default","outlined"],primary:["primary","solid"],dashed:["default","dashed"],link:["link","link"],text:["default","text"]},ev=r.forwardRef((e,t)=>{var n,o;let{loading:m=!1,prefixCls:g,color:b,variant:y,type:w,danger:E=!1,shape:C,size:S,styles:O,disabled:k,className:j,rootClassName:I,children:M,icon:R,iconPosition:N="start",ghost:P=!1,block:F=!1,htmlType:T="button",classNames:A,style:_={},autoInsertSpace:B,autoFocus:H}=e,z=em(e,["loading","prefixCls","color","variant","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","iconPosition","ghost","block","htmlType","classNames","style","autoInsertSpace","autoFocus"]),L=w||"default",{button:D}=r.useContext(u.E_),W=C||(null==D?void 0:D.shape)||"default",[V,q]=(0,r.useMemo)(()=>{if(b&&y)return[b,y];if(w||E){let e=eg[L]||[];return E?["danger",e[1]]:e}return(null==D?void 0:D.color)&&(null==D?void 0:D.variant)?[D.color,D.variant]:["default","outlined"]},[b,y,w,E,null==D?void 0:D.color,null==D?void 0:D.variant,L]),X="danger"===V?"dangerous":V,{getPrefixCls:G,direction:U,autoInsertSpace:$,className:K,style:Y,classNames:Q,styles:J}=(0,u.dj)("button"),ee=null===(n=null!=B?B:$)||void 0===n||n,et=G("btn",g),[en,er,eo]=eu(et),ea=(0,r.useContext)(d.Z),ei=null!=k?k:ea,ec=(0,r.useContext)(v),el=(0,r.useMemo)(()=>(function(e){if("object"==typeof e&&e){let t=null==e?void 0:e.delay;return{loading:(t=Number.isNaN(t)||"number"!=typeof t?0:t)<=0,delay:t}}return{loading:!!e,delay:0}})(m),[m]),[es,ed]=(0,r.useState)(el.loading),[ef,ev]=(0,r.useState)(!1),eh=(0,r.useRef)(null),eb=(0,l.x1)(t,eh),ey=1===r.Children.count(M)&&!R&&!(0,h.Dn)(q),ex=(0,r.useRef)(!0);r.useEffect(()=>(ex.current=!1,()=>{ex.current=!0}),[]),(0,i.Z)(()=>{let e=null;return el.delay>0?e=setTimeout(()=>{e=null,ed(!0)},el.delay):ed(el.loading),function(){e&&(clearTimeout(e),e=null)}},[el.delay,el.loading]),(0,r.useEffect)(()=>{if(!eh.current||!ee)return;let e=eh.current.textContent||"";ey&&(0,h.aG)(e)?ef||ev(!0):ef&&ev(!1)}),(0,r.useEffect)(()=>{H&&eh.current&&eh.current.focus()},[]);let ew=r.useCallback(t=>{var n;if(es||ei){t.preventDefault();return}null===(n=e.onClick)||void 0===n||n.call(e,t)},[e.onClick,es,ei]),{compactSize:eE,compactItemClassnames:eC}=(0,p.ri)(et,U),eZ=(0,f.Z)(e=>{var t,n;return null!==(n=null!==(t=null!=S?S:eE)&&void 0!==t?t:ec)&&void 0!==n?n:e}),eS=eZ&&null!==(o=({large:"lg",small:"sm",middle:void 0})[eZ])&&void 0!==o?o:"",eO=es?"loading":R,ek=(0,c.Z)(z,["navigate"]),ej=a()(et,er,eo,{["".concat(et,"-").concat(W)]:"default"!==W&&W,["".concat(et,"-").concat(L)]:L,["".concat(et,"-dangerous")]:E,["".concat(et,"-color-").concat(X)]:X,["".concat(et,"-variant-").concat(q)]:q,["".concat(et,"-").concat(eS)]:eS,["".concat(et,"-icon-only")]:!M&&0!==M&&!!eO,["".concat(et,"-background-ghost")]:P&&!(0,h.Dn)(q),["".concat(et,"-loading")]:es,["".concat(et,"-two-chinese-chars")]:ef&&ee&&!es,["".concat(et,"-block")]:F,["".concat(et,"-rtl")]:"rtl"===U,["".concat(et,"-icon-end")]:"end"===N},eC,j,I,K),eI=Object.assign(Object.assign({},Y),_),eM=a()(null==A?void 0:A.icon,Q.icon),eR=Object.assign(Object.assign({},(null==O?void 0:O.icon)||{}),J.icon||{}),eN=R&&!es?r.createElement(x,{prefixCls:et,className:eM,style:eR},R):m&&"object"==typeof m&&m.icon?r.createElement(x,{prefixCls:et,className:eM,style:eR},m.icon):r.createElement(Z,{existIcon:!!R,prefixCls:et,loading:es,mount:ex.current}),eP=M||0===M?(0,h.hU)(M,ey&&ee):null;if(void 0!==ek.href)return en(r.createElement("a",Object.assign({},ek,{className:a()(ej,{["".concat(et,"-disabled")]:ei}),href:ei?void 0:ek.href,style:eI,onClick:ew,ref:eb,tabIndex:ei?-1:0,"aria-disabled":ei}),eN,eP));let eF=r.createElement("button",Object.assign({},z,{type:T,className:ej,style:eI,onClick:ew,disabled:ei,ref:eb}),eN,eP,eC&&r.createElement(ep,{prefixCls:et}));return(0,h.Dn)(q)||(eF=r.createElement(s.Z,{component:"Button",disabled:es},eF)),en(eF)});ev.Group=e=>{let{getPrefixCls:t,direction:n}=r.useContext(u.E_),{prefixCls:o,size:i,className:c}=e,l=g(e,["prefixCls","size","className"]),s=t("btn-group",o),[,,d]=(0,m.ZP)(),f=r.useMemo(()=>{switch(i){case"large":return"lg";case"small":return"sm";default:return""}},[i]),p=a()(s,{["".concat(s,"-").concat(f)]:f,["".concat(s,"-rtl")]:"rtl"===n},c,d);return r.createElement(v.Provider,{value:i},r.createElement("div",Object.assign({},l,{className:p})))},ev.__ANT_BUTTON=!0;var eh=ev},11357:function(e,t,n){"use strict";n.d(t,{y9:function(){return l}});var r=n(76405),o=n(25049),a=n(75669);let i=(e,t)=>(null==e?void 0:e.replace(/[^\w/]/g,"").slice(0,t?8:6))||"",c=(e,t)=>e?i(e,t):"",l=(0,o.Z)(function e(t){var n;if((0,r.Z)(this,e),this.cleared=!1,t instanceof e){this.metaColor=t.metaColor.clone(),this.colors=null===(n=t.colors)||void 0===n?void 0:n.map(t=>({color:new e(t.color),percent:t.percent})),this.cleared=t.cleared;return}let o=Array.isArray(t);o&&t.length?(this.colors=t.map(t=>{let{color:n,percent:r}=t;return{color:new e(n),percent:r}}),this.metaColor=new a.Il(this.colors[0].color.metaColor)):this.metaColor=new a.Il(o?"":t),t&&(!o||this.colors)||(this.metaColor=this.metaColor.setA(0),this.cleared=!0)},[{key:"toHsb",value:function(){return this.metaColor.toHsb()}},{key:"toHsbString",value:function(){return this.metaColor.toHsbString()}},{key:"toHex",value:function(){return c(this.toHexString(),this.metaColor.a<1)}},{key:"toHexString",value:function(){return this.metaColor.toHexString()}},{key:"toRgb",value:function(){return this.metaColor.toRgb()}},{key:"toRgbString",value:function(){return this.metaColor.toRgbString()}},{key:"isGradient",value:function(){return!!this.colors&&!this.cleared}},{key:"getColors",value:function(){return this.colors||[{color:this,percent:0}]}},{key:"toCssString",value:function(){let{colors:e}=this;if(e){let t=e.map(e=>"".concat(e.color.toRgbString()," ").concat(e.percent,"%")).join(", ");return"linear-gradient(90deg, ".concat(t,")")}return this.metaColor.toRgbString()}},{key:"equals",value:function(e){return!!e&&this.isGradient()===e.isGradient()&&(this.isGradient()?this.colors.length===e.colors.length&&this.colors.every((t,n)=>{let r=e.colors[n];return t.percent===r.percent&&t.color.equals(r.color)}):this.toHexString()===e.toHexString())}}])},86586:function(e,t,n){"use strict";n.d(t,{n:function(){return a}});var r=n(2265);let o=r.createContext(!1),a=e=>{let{children:t,disabled:n}=e,a=r.useContext(o);return r.createElement(o.Provider,{value:null!=n?n:a},t)};t.Z=o},59189:function(e,t,n){"use strict";n.d(t,{q:function(){return a}});var r=n(2265);let o=r.createContext(void 0),a=e=>{let{children:t,size:n}=e,a=r.useContext(o);return r.createElement(o.Provider,{value:n||a},t)};t.Z=o},66061:function(e,t,n){"use strict";n.d(t,{q:function(){return b}}),n(2265);var r,o=n(54887),a=n.t(o,2),i=n(75143),c=n(54580),l=n(41154),s=(0,n(31686).Z)({},a),u=s.version,d=s.render,f=s.unmountComponentAtNode;try{Number((u||"").split(".")[0])>=18&&(r=s.createRoot)}catch(e){}function p(e){var t=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&"object"===(0,l.Z)(t)&&(t.usingClientEntryPoint=e)}var m="__rc_react_root__";function g(){return(g=(0,c.Z)((0,i.Z)().mark(function e(t){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve().then(function(){var e;null===(e=t[m])||void 0===e||e.unmount(),delete t[m]}));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function v(){return(v=(0,c.Z)((0,i.Z)().mark(function e(t){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(void 0!==r)){e.next=2;break}return e.abrupt("return",function(e){return g.apply(this,arguments)}(t));case 2:f(t);case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}let h=(e,t)=>(!function(e,t){var n;if(r){p(!0),n=t[m]||r(t),p(!1),n.render(e),t[m]=n;return}null==d||d(e,t)}(e,t),()=>(function(e){return v.apply(this,arguments)})(t));function b(e){return e&&(h=e),h}},71744:function(e,t,n){"use strict";n.d(t,{E_:function(){return c},Rf:function(){return o},dj:function(){return u},oR:function(){return a},tr:function(){return i}});var r=n(2265);let o="ant",a="anticon",i=["outlined","borderless","filled","underlined"],c=r.createContext({getPrefixCls:(e,t)=>t||(e?"".concat(o,"-").concat(e):o),iconPrefixCls:a}),{Consumer:l}=c,s={};function u(e){let t=r.useContext(c),{getPrefixCls:n,direction:o,getPopupContainer:a}=t;return Object.assign(Object.assign({classNames:s,styles:s},t[e]),{getPrefixCls:n,direction:o,getPopupContainer:a})}},91086:function(e,t,n){"use strict";var r=n(2265),o=n(71744),a=n(85180);t.Z=e=>{let{componentName:t}=e,{getPrefixCls:n}=(0,r.useContext)(o.E_),i=n("empty");switch(t){case"Table":case"List":return r.createElement(a.Z,{image:a.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return r.createElement(a.Z,{image:a.Z.PRESENTED_IMAGE_SIMPLE,className:"".concat(i,"-small")});case"Table.filter":return null;default:return r.createElement(a.Z,null)}}},64024:function(e,t,n){"use strict";var r=n(84951);t.Z=e=>{let[,,,,t]=(0,r.ZP)();return t?"".concat(e,"-css-var"):""}},33759:function(e,t,n){"use strict";var r=n(2265),o=n(59189);t.Z=e=>{let t=r.useContext(o.Z);return r.useMemo(()=>e?"string"==typeof e?null!=e?e:t:"function"==typeof e?e(t):t:t,[e,t])}},18310:function(e,t,n){"use strict";let r,o,a,i;n.d(t,{ZP:function(){return G},w6:function(){return V}});var c=n(2265),l=n.t(c,2),s=n(93463),u=n(20902),d=n(6397),f=n(23789),p=n(13613),m=n(77360),g=n(92246),v=n(91325),h=e=>{let{locale:t={},children:n,_ANT_MARK__:r}=e;c.useEffect(()=>(0,g.f)(null==t?void 0:t.Modal),[t]);let o=c.useMemo(()=>Object.assign(Object.assign({},t),{exist:!0}),[t]);return c.createElement(v.Z.Provider,{value:o},n)},b=n(37381),y=n(57862),x=n(25119),w=n(70774),E=n(71744),C=n(57943),Z=n(54558),S=n(94981),O=n(21717);let k="-ant-".concat(Date.now(),"-").concat(Math.random());var j=n(86586),I=n(59189),M=n(16671);let{useId:R}=Object.assign({},l);var N=void 0===R?()=>"":R,P=n(66632),F=n(84951);let T=c.createContext(!0);function A(e){let t=c.useContext(T),{children:n}=e,[,r]=(0,F.ZP)(),{motion:o}=r,a=c.useRef(!1);return(a.current||(a.current=t!==o),a.current)?c.createElement(T.Provider,{value:o},c.createElement(P.zt,{motion:o},n)):n}var _=()=>null,B=n(12918),H=(e,t)=>{let[n,r]=(0,F.ZP)();return(0,s.xy)({theme:n,token:r,hashId:"",path:["ant-design-icons",e],nonce:()=>null==t?void 0:t.nonce,layer:{name:"antd"}},()=>(0,B.JT)(e))},z=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let L=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];function D(){return r||E.Rf}function W(){return o||E.oR}let V=()=>({getPrefixCls:(e,t)=>t||(e?"".concat(D(),"-").concat(e):D()),getIconPrefixCls:W,getRootPrefixCls:()=>r||D(),getTheme:()=>a,holderRender:i}),q=e=>{let{children:t,csp:n,autoInsertSpaceInButton:r,alert:o,anchor:a,form:i,locale:l,componentSize:g,direction:v,space:C,splitter:Z,virtual:S,dropdownMatchSelectWidth:O,popupMatchSelectWidth:k,popupOverflow:R,legacyLocale:P,parentContext:F,iconPrefixCls:T,theme:B,componentDisabled:D,segmented:W,statistic:V,spin:q,calendar:X,carousel:G,cascader:U,collapse:$,typography:K,checkbox:Y,descriptions:Q,divider:J,drawer:ee,skeleton:et,steps:en,image:er,layout:eo,list:ea,mentions:ei,modal:ec,progress:el,result:es,slider:eu,breadcrumb:ed,menu:ef,pagination:ep,input:em,textArea:eg,empty:ev,badge:eh,radio:eb,rate:ey,switch:ex,transfer:ew,avatar:eE,message:eC,tag:eZ,table:eS,card:eO,tabs:ek,timeline:ej,timePicker:eI,upload:eM,notification:eR,tree:eN,colorPicker:eP,datePicker:eF,rangePicker:eT,flex:eA,wave:e_,dropdown:eB,warning:eH,tour:ez,tooltip:eL,popover:eD,popconfirm:eW,floatButton:eV,floatButtonGroup:eq,variant:eX,inputNumber:eG,treeSelect:eU}=e,e$=c.useCallback((t,n)=>{let{prefixCls:r}=e;if(n)return n;let o=r||F.getPrefixCls("");return t?"".concat(o,"-").concat(t):o},[F.getPrefixCls,e.prefixCls]),eK=T||F.iconPrefixCls||E.oR,eY=n||F.csp;H(eK,eY);let eQ=function(e,t,n){var r;(0,p.ln)("ConfigProvider");let o=e||{},a=!1!==o.inherit&&t?t:Object.assign(Object.assign({},x.u_),{hashed:null!==(r=null==t?void 0:t.hashed)&&void 0!==r?r:x.u_.hashed,cssVar:null==t?void 0:t.cssVar}),i=N();return(0,d.Z)(()=>{var r,c;if(!e)return t;let l=Object.assign({},a.components);Object.keys(e.components||{}).forEach(t=>{l[t]=Object.assign(Object.assign({},l[t]),e.components[t])});let s="css-var-".concat(i.replace(/:/g,"")),u=(null!==(r=o.cssVar)&&void 0!==r?r:a.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:null==n?void 0:n.prefixCls},"object"==typeof a.cssVar?a.cssVar:{}),"object"==typeof o.cssVar?o.cssVar:{}),{key:"object"==typeof o.cssVar&&(null===(c=o.cssVar)||void 0===c?void 0:c.key)||s});return Object.assign(Object.assign(Object.assign({},a),o),{token:Object.assign(Object.assign({},a.token),o.token),components:l,cssVar:u})},[o,a],(e,t)=>e.some((e,n)=>{let r=t[n];return!(0,M.Z)(e,r,!0)}))}(B,F.theme,{prefixCls:e$("")}),eJ={csp:eY,autoInsertSpaceInButton:r,alert:o,anchor:a,locale:l||P,direction:v,space:C,splitter:Z,virtual:S,popupMatchSelectWidth:null!=k?k:O,popupOverflow:R,getPrefixCls:e$,iconPrefixCls:eK,theme:eQ,segmented:W,statistic:V,spin:q,calendar:X,carousel:G,cascader:U,collapse:$,typography:K,checkbox:Y,descriptions:Q,divider:J,drawer:ee,skeleton:et,steps:en,image:er,input:em,textArea:eg,layout:eo,list:ea,mentions:ei,modal:ec,progress:el,result:es,slider:eu,breadcrumb:ed,menu:ef,pagination:ep,empty:ev,badge:eh,radio:eb,rate:ey,switch:ex,transfer:ew,avatar:eE,message:eC,tag:eZ,table:eS,card:eO,tabs:ek,timeline:ej,timePicker:eI,upload:eM,notification:eR,tree:eN,colorPicker:eP,datePicker:eF,rangePicker:eT,flex:eA,wave:e_,dropdown:eB,warning:eH,tour:ez,tooltip:eL,popover:eD,popconfirm:eW,floatButton:eV,floatButtonGroup:eq,variant:eX,inputNumber:eG,treeSelect:eU},e0=Object.assign({},F);Object.keys(eJ).forEach(e=>{void 0!==eJ[e]&&(e0[e]=eJ[e])}),L.forEach(t=>{let n=e[t];n&&(e0[t]=n)}),void 0!==r&&(e0.button=Object.assign({autoInsertSpace:r},e0.button));let e1=(0,d.Z)(()=>e0,e0,(e,t)=>{let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length||n.some(n=>e[n]!==t[n])}),{layer:e2}=c.useContext(s.uP),e6=c.useMemo(()=>({prefixCls:eK,csp:eY,layer:e2?"antd":void 0}),[eK,eY,e2]),e5=c.createElement(c.Fragment,null,c.createElement(_,{dropdownMatchSelectWidth:O}),t),e4=c.useMemo(()=>{var e,t,n,r;return(0,f.T)((null===(e=b.Z.Form)||void 0===e?void 0:e.defaultValidateMessages)||{},(null===(n=null===(t=e1.locale)||void 0===t?void 0:t.Form)||void 0===n?void 0:n.defaultValidateMessages)||{},(null===(r=e1.form)||void 0===r?void 0:r.validateMessages)||{},(null==i?void 0:i.validateMessages)||{})},[e1,null==i?void 0:i.validateMessages]);Object.keys(e4).length>0&&(e5=c.createElement(m.Z.Provider,{value:e4},e5)),l&&(e5=c.createElement(h,{locale:l,_ANT_MARK__:"internalMark"},e5)),(eK||eY)&&(e5=c.createElement(u.Z.Provider,{value:e6},e5)),g&&(e5=c.createElement(I.q,{size:g},e5)),e5=c.createElement(A,null,e5);let e3=c.useMemo(()=>{let e=eQ||{},{algorithm:t,token:n,components:r,cssVar:o}=e,a=z(e,["algorithm","token","components","cssVar"]),i=t&&(!Array.isArray(t)||t.length>0)?(0,s.jG)(t):y.Z,c={};Object.entries(r||{}).forEach(e=>{let[t,n]=e,r=Object.assign({},n);"algorithm"in r&&(!0===r.algorithm?r.theme=i:(Array.isArray(r.algorithm)||"function"==typeof r.algorithm)&&(r.theme=(0,s.jG)(r.algorithm)),delete r.algorithm),c[t]=r});let l=Object.assign(Object.assign({},w.Z),n);return Object.assign(Object.assign({},a),{theme:i,token:l,components:c,override:Object.assign({override:l},c),cssVar:o})},[eQ]);return B&&(e5=c.createElement(x.Mj.Provider,{value:e3},e5)),e1.warning&&(e5=c.createElement(p.G8.Provider,{value:e1.warning},e5)),void 0!==D&&(e5=c.createElement(j.n,{disabled:D},e5)),c.createElement(E.E_.Provider,{value:e1},e5)},X=e=>{let t=c.useContext(E.E_),n=c.useContext(v.Z);return c.createElement(q,Object.assign({parentContext:t,legacyLocale:n},e))};X.ConfigContext=E.E_,X.SizeContext=I.Z,X.config=e=>{let{prefixCls:t,iconPrefixCls:n,theme:c,holderRender:l}=e;void 0!==t&&(r=t),void 0!==n&&(o=n),"holderRender"in e&&(i=l),c&&(Object.keys(c).some(e=>e.endsWith("Color"))?function(e,t){let n=function(e,t){let n={},r=(e,t)=>{let n=e.clone();return(n=(null==t?void 0:t(n))||n).toRgbString()},o=(e,t)=>{let o=new Z.t(e),a=(0,C.R_)(o.toRgbString());n["".concat(t,"-color")]=r(o),n["".concat(t,"-color-disabled")]=a[1],n["".concat(t,"-color-hover")]=a[4],n["".concat(t,"-color-active")]=a[6],n["".concat(t,"-color-outline")]=o.clone().setA(.2).toRgbString(),n["".concat(t,"-color-deprecated-bg")]=a[0],n["".concat(t,"-color-deprecated-border")]=a[2]};if(t.primaryColor){o(t.primaryColor,"primary");let e=new Z.t(t.primaryColor),a=(0,C.R_)(e.toRgbString());a.forEach((e,t)=>{n["primary-".concat(t+1)]=e}),n["primary-color-deprecated-l-35"]=r(e,e=>e.lighten(35)),n["primary-color-deprecated-l-20"]=r(e,e=>e.lighten(20)),n["primary-color-deprecated-t-20"]=r(e,e=>e.tint(20)),n["primary-color-deprecated-t-50"]=r(e,e=>e.tint(50)),n["primary-color-deprecated-f-12"]=r(e,e=>e.setA(.12*e.a));let i=new Z.t(a[0]);n["primary-color-active-deprecated-f-30"]=r(i,e=>e.setA(.3*e.a)),n["primary-color-active-deprecated-d-02"]=r(i,e=>e.darken(2))}t.successColor&&o(t.successColor,"success"),t.warningColor&&o(t.warningColor,"warning"),t.errorColor&&o(t.errorColor,"error"),t.infoColor&&o(t.infoColor,"info");let a=Object.keys(n).map(t=>"--".concat(e,"-").concat(t,": ").concat(n[t],";"));return"\n :root {\n ".concat(a.join("\n"),"\n }\n ").trim()}(e,t);(0,S.Z)()&&(0,O.hq)(n,"".concat(k,"-dynamic-theme"))}(D(),c):a=c)},X.useConfig=function(){return{componentDisabled:(0,c.useContext)(j.Z),componentSize:(0,c.useContext)(I.Z)}},Object.defineProperty(X,"SizeContext",{get:()=>I.Z});var G=X},85180:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),c=n(55274),l=n(54558),s=n(84951),u=n(99320),d=n(71140);let f=e=>{let{componentCls:t,margin:n,marginXS:r,marginXL:o,fontSize:a,lineHeight:i}=e;return{[t]:{marginInline:r,fontSize:a,lineHeight:i,textAlign:"center",["".concat(t,"-image")]:{height:e.emptyImgHeight,marginBottom:r,opacity:e.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},["".concat(t,"-description")]:{color:e.colorTextDescription},["".concat(t,"-footer")]:{marginTop:n},"&-normal":{marginBlock:o,color:e.colorTextDescription,["".concat(t,"-description")]:{color:e.colorTextDescription},["".concat(t,"-image")]:{height:e.emptyImgHeightMD}},"&-small":{marginBlock:r,color:e.colorTextDescription,["".concat(t,"-image")]:{height:e.emptyImgHeightSM}}}}};var p=(0,u.I$)("Empty",e=>{let{componentCls:t,controlHeightLG:n,calc:r}=e;return f((0,d.IX)(e,{emptyImgCls:"".concat(t,"-img"),emptyImgHeight:r(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:r(n).mul(.875).equal()}))}),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 o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let g=r.createElement(()=>{let[,e]=(0,s.ZP)(),[t]=(0,c.Z)("Empty"),n=new l.t(e.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return r.createElement("svg",{style:n,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},r.createElement("title",null,(null==t?void 0:t.description)||"Empty"),r.createElement("g",{fill:"none",fillRule:"evenodd"},r.createElement("g",{transform:"translate(24 31.67)"},r.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),r.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),r.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),r.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),r.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),r.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),r.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},r.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),r.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},null),v=r.createElement(()=>{let[,e]=(0,s.ZP)(),[t]=(0,c.Z)("Empty"),{colorFill:n,colorFillTertiary:o,colorFillQuaternary:a,colorBgContainer:i}=e,{borderColor:u,shadowColor:d,contentColor:f}=(0,r.useMemo)(()=>({borderColor:new l.t(n).onBackground(i).toHexString(),shadowColor:new l.t(o).onBackground(i).toHexString(),contentColor:new l.t(a).onBackground(i).toHexString()}),[n,o,a,i]);return r.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},r.createElement("title",null,(null==t?void 0:t.description)||"Empty"),r.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},r.createElement("ellipse",{fill:d,cx:"32",cy:"33",rx:"32",ry:"7"}),r.createElement("g",{fillRule:"nonzero",stroke:u},r.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),r.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:f}))))},null),h=e=>{var t;let{className:n,rootClassName:o,prefixCls:l,image:s,description:u,children:d,imageStyle:f,style:h,classNames:b,styles:y}=e,x=m(e,["className","rootClassName","prefixCls","image","description","children","imageStyle","style","classNames","styles"]),{getPrefixCls:w,direction:E,className:C,style:Z,classNames:S,styles:O,image:k}=(0,i.dj)("empty"),j=w("empty",l),[I,M,R]=p(j),[N]=(0,c.Z)("Empty"),P=void 0!==u?u:null==N?void 0:N.description,F=null!==(t=null!=s?s:k)&&void 0!==t?t:g,T=null;return T="string"==typeof F?r.createElement("img",{draggable:!1,alt:"string"==typeof P?P:"empty",src:F}):F,I(r.createElement("div",Object.assign({className:a()(M,R,j,C,{["".concat(j,"-normal")]:F===v,["".concat(j,"-rtl")]:"rtl"===E},n,o,S.root,null==b?void 0:b.root),style:Object.assign(Object.assign(Object.assign(Object.assign({},O.root),Z),null==y?void 0:y.root),h)},x),r.createElement("div",{className:a()("".concat(j,"-image"),S.image,null==b?void 0:b.image),style:Object.assign(Object.assign(Object.assign({},f),O.image),null==y?void 0:y.image)},T),P&&r.createElement("div",{className:a()("".concat(j,"-description"),S.description,null==b?void 0:b.description),style:Object.assign(Object.assign({},O.description),null==y?void 0:y.description)},P),d&&r.createElement("div",{className:a()("".concat(j,"-footer"),S.footer,null==b?void 0:b.footer),style:Object.assign(Object.assign({},O.footer),null==y?void 0:y.footer)},d)))};h.PRESENTED_IMAGE_DEFAULT=g,h.PRESENTED_IMAGE_SIMPLE=v;var b=h},14605:function(e,t,n){"use strict";var r=n(83145),o=n(2265),a=n(36760),i=n.n(a),c=n(66632),l=n(68710),s=n(64024),u=n(39109),d=n(4064),f=n(47713);let p=[];function m(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{key:"string"==typeof e?e:"".concat(t,"-").concat(r),error:e,errorStatus:n}}t.Z=e=>{let{help:t,helpStatus:n,errors:a=p,warnings:g=p,className:v,fieldId:h,onVisibleChanged:b}=e,{prefixCls:y}=o.useContext(u.Rk),x="".concat(y,"-item-explain"),w=(0,s.Z)(y),[E,C,Z]=(0,f.ZP)(y,w),S=o.useMemo(()=>(0,l.Z)(y),[y]),O=(0,d.Z)(a),k=(0,d.Z)(g),j=o.useMemo(()=>null!=t?[m(t,"help",n)]:[].concat((0,r.Z)(O.map((e,t)=>m(e,"error","error",t))),(0,r.Z)(k.map((e,t)=>m(e,"warning","warning",t)))),[t,n,O,k]),I=o.useMemo(()=>{let e={};return j.forEach(t=>{let{key:n}=t;e[n]=(e[n]||0)+1}),j.map((t,n)=>Object.assign(Object.assign({},t),{key:e[t.key]>1?"".concat(t.key,"-fallback-").concat(n):t.key}))},[j]),M={};return h&&(M.id="".concat(h,"_help")),E(o.createElement(c.ZP,{motionDeadline:S.motionDeadline,motionName:"".concat(y,"-show-help"),visible:!!I.length,onVisibleChanged:b},e=>{let{className:t,style:n}=e;return o.createElement("div",Object.assign({},M,{className:i()(x,t,Z,w,v,C),style:n}),o.createElement(c.V4,Object.assign({keys:I},(0,l.Z)(y),{motionName:"".concat(y,"-show-help-item"),component:!1}),e=>{let{key:t,error:n,errorStatus:r,className:a,style:c}=e;return o.createElement("div",{key:t,className:i()(a,{["".concat(x,"-").concat(r)]:r}),style:c},n)}))}))}},2740:function(e,t,n){"use strict";n.d(t,{Z:function(){return K}});var r=n(83145),o=n(2265),a=n(36760),i=n.n(a),c=n(87379),l=n(69819),s=n(28791),u=n(19722),d=n(13613),f=n(71744),p=n(64024),m=n(39109),g=n(45287);let v=()=>{let{status:e,errors:t=[],warnings:n=[]}=o.useContext(m.aM);return{status:e,errors:t,warnings:n}};v.Context=m.aM;var h=n(53346),b=n(47713),y=n(13861),x=n(2857),w=n(27380),E=n(18694),C=n(77774),Z=n(74126),S=n(54998),O=n(14605),k=n(99320);let j=e=>{let{formItemCls:t}=e;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{["".concat(t,"-control")]:{display:"flex"}}}};var I=(0,k.bk)(["Form","item-item"],(e,t)=>{let{rootPrefixCls:n}=t;return j((0,b.B4)(e,n))}),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 o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},R=e=>{let{prefixCls:t,status:n,labelCol:r,wrapperCol:a,children:c,errors:l,warnings:s,_internalItemRender:u,extra:d,help:f,fieldId:p,marginBottom:g,onErrorVisibleChanged:v,label:h}=e,b="".concat(t,"-item"),y=o.useContext(m.q3),x=o.useMemo(()=>{let e=Object.assign({},a||y.wrapperCol||{});return null!==h||r||a||!y.labelCol||[void 0,"xs","sm","md","lg","xl","xxl"].forEach(t=>{let n=t?[t]:[],r=(0,Z.U2)(y.labelCol,n),o="object"==typeof r?r:{},a=(0,Z.U2)(e,n);"span"in o&&!("offset"in("object"==typeof a?a:{}))&&o.span<24&&(e=(0,Z.t8)(e,[].concat(n,["offset"]),o.span))}),e},[a,y.wrapperCol,y.labelCol,h,r]),E=i()("".concat(b,"-control"),x.className),C=o.useMemo(()=>{let{labelCol:e,wrapperCol:t}=y;return M(y,["labelCol","wrapperCol"])},[y]),k=o.useRef(null),[j,R]=o.useState(0);(0,w.Z)(()=>{d&&k.current?R(k.current.clientHeight):R(0)},[d]);let N=o.createElement("div",{className:"".concat(b,"-control-input")},o.createElement("div",{className:"".concat(b,"-control-input-content")},c)),P=o.useMemo(()=>({prefixCls:t,status:n}),[t,n]),F=null!==g||l.length||s.length?o.createElement(m.Rk.Provider,{value:P},o.createElement(O.Z,{fieldId:p,errors:l,warnings:s,help:f,helpStatus:n,className:"".concat(b,"-explain-connected"),onVisibleChanged:v})):null,T={};p&&(T.id="".concat(p,"_extra"));let A=d?o.createElement("div",Object.assign({},T,{className:"".concat(b,"-extra"),ref:k}),d):null,_=F||A?o.createElement("div",{className:"".concat(b,"-additional"),style:g?{minHeight:g+j}:{}},F,A):null,B=u&&"pro_table_render"===u.mark&&u.render?u.render(e,{input:N,errorList:F,extra:A}):o.createElement(o.Fragment,null,N,_);return o.createElement(m.q3.Provider,{value:C},o.createElement(S.Z,Object.assign({},x,{className:E}),B),o.createElement(I,{prefixCls:t}))},N=n(67187),P=n(55274),F=n(37381),T=n(99981),A=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},_=e=>{var t;let n,{prefixCls:r,label:a,htmlFor:c,labelCol:l,labelAlign:s,colon:u,required:d,requiredMark:f,tooltip:p,vertical:g}=e,[v]=(0,P.Z)("Form"),{labelAlign:h,labelCol:b,labelWrap:y,colon:x}=o.useContext(m.q3);if(!a)return null;let w=l||b||{},E="".concat(r,"-item-label"),C=i()(E,"left"===(s||h)&&"".concat(E,"-left"),w.className,{["".concat(E,"-wrap")]:!!y}),Z=a,O=!0===u||!1!==x&&!1!==u;O&&!g&&"string"==typeof a&&a.trim()&&(Z=a.replace(/[:|:]\s*$/,""));let k=null==p?null:"object"!=typeof p||(0,o.isValidElement)(p)?{title:p}:p;if(k){let{icon:e=o.createElement(N.Z,null)}=k,t=A(k,["icon"]),n=o.createElement(T.Z,Object.assign({},t),o.cloneElement(e,{className:"".concat(r,"-item-tooltip"),title:"",onClick:e=>{e.preventDefault()},tabIndex:null}));Z=o.createElement(o.Fragment,null,Z,n)}let j="optional"===f,I="function"==typeof f;I?Z=f(Z,{required:!!d}):j&&!d&&(Z=o.createElement(o.Fragment,null,Z,o.createElement("span",{className:"".concat(r,"-item-optional"),title:""},(null==v?void 0:v.optional)||(null===(t=F.Z.Form)||void 0===t?void 0:t.optional)))),!1===f?n="hidden":(j||I)&&(n="optional");let M=i()({["".concat(r,"-item-required")]:d,["".concat(r,"-item-required-mark-").concat(n)]:n,["".concat(r,"-item-no-colon")]:!O});return o.createElement(S.Z,Object.assign({},w,{className:C}),o.createElement("label",{htmlFor:c,className:M,title:"string"==typeof a?a:""},Z))},B=n(4064),H=n(8900),z=n(39725),L=n(54537),D=n(61935);let W={success:H.Z,warning:L.Z,error:z.Z,validating:D.Z};function V(e){let{children:t,errors:n,warnings:r,hasFeedback:a,validateStatus:c,prefixCls:l,meta:s,noStyle:u,name:d}=e,f="".concat(l,"-item"),{feedbackIcons:p}=o.useContext(m.q3),g=(0,y.lR)(n,r,s,null,!!a,c),{isFormItemInput:v,status:h,hasFeedback:b,feedbackIcon:x,name:w}=o.useContext(m.aM),E=o.useMemo(()=>{var e;let t;if(a){let c=!0!==a&&a.icons||p,l=g&&(null===(e=null==c?void 0:c({status:g,errors:n,warnings:r}))||void 0===e?void 0:e[g]),s=g?W[g]:null;t=!1!==l&&s?o.createElement("span",{className:i()("".concat(f,"-feedback-icon"),"".concat(f,"-feedback-icon-").concat(g))},l||o.createElement(s,null)):null}let c={status:g||"",errors:n,warnings:r,hasFeedback:!!a,feedbackIcon:t,isFormItemInput:!0,name:d};return u&&(c.status=(null!=g?g:h)||"",c.isFormItemInput=v,c.hasFeedback=!!(null!=a?a:b),c.feedbackIcon=void 0!==a?c.feedbackIcon:x,c.name=null!=d?d:w),c},[g,a,u,v,h]);return o.createElement(m.aM.Provider,{value:E},t)}var q=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function X(e){let{prefixCls:t,className:n,rootClassName:r,style:a,help:c,errors:l,warnings:s,validateStatus:u,meta:d,hasFeedback:f,hidden:p,children:g,fieldId:v,required:h,isRequired:b,onSubItemMetaChange:Z,layout:S,name:O}=e,k=q(e,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange","layout","name"]),j="".concat(t,"-item"),{requiredMark:I,layout:M}=o.useContext(m.q3),N=S||M,P="vertical"===N,F=o.useRef(null),T=(0,B.Z)(l),A=(0,B.Z)(s),H=null!=c,z=!!(H||l.length||s.length),L=!!F.current&&(0,x.Z)(F.current),[D,W]=o.useState(null);(0,w.Z)(()=>{z&&F.current&&W(Number.parseInt(getComputedStyle(F.current).marginBottom,10))},[z,L]);let X=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=e?T:d.errors,n=e?A:d.warnings;return(0,y.lR)(t,n,d,"",!!f,u)}(),G=i()(j,n,r,{["".concat(j,"-with-help")]:H||T.length||A.length,["".concat(j,"-has-feedback")]:X&&f,["".concat(j,"-has-success")]:"success"===X,["".concat(j,"-has-warning")]:"warning"===X,["".concat(j,"-has-error")]:"error"===X,["".concat(j,"-is-validating")]:"validating"===X,["".concat(j,"-hidden")]:p,["".concat(j,"-").concat(N)]:N});return o.createElement("div",{className:G,style:a,ref:F},o.createElement(C.Z,Object.assign({className:"".concat(j,"-row")},(0,E.Z)(k,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),o.createElement(_,Object.assign({htmlFor:v},e,{requiredMark:I,required:null!=h?h:b,prefixCls:t,vertical:P})),o.createElement(R,Object.assign({},e,d,{errors:T,warnings:A,prefixCls:t,status:X,help:c,marginBottom:D,onErrorVisibleChanged:e=>{e||W(null)}}),o.createElement(m.qI.Provider,{value:Z},o.createElement(V,{prefixCls:t,meta:d,errors:d.errors,warnings:d.warnings,hasFeedback:f,validateStatus:X,name:O},g)))),!!D&&o.createElement("div",{className:"".concat(j,"-margin-offset"),style:{marginBottom:-D}}))}let G=o.memo(e=>{let{children:t}=e;return t},(e,t)=>(function(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>{let r=e[n],o=t[n];return r===o||"function"==typeof r||"function"==typeof o})})(e.control,t.control)&&e.update===t.update&&e.childProps.length===t.childProps.length&&e.childProps.every((e,n)=>e===t.childProps[n]));function U(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}let $=function(e){let{name:t,noStyle:n,className:a,dependencies:v,prefixCls:x,shouldUpdate:w,rules:E,children:C,required:Z,label:S,messageVariables:O,trigger:k="onChange",validateTrigger:j,hidden:I,help:M,layout:R}=e,{getPrefixCls:N}=o.useContext(f.E_),{name:P}=o.useContext(m.q3),F=function(e){if("function"==typeof e)return e;let t=(0,g.Z)(e);return t.length<=1?t[0]:t}(C),T="function"==typeof F,A=o.useContext(m.qI),{validateTrigger:_}=o.useContext(c.zb),B=void 0!==j?j:_,H=null!=t,z=N("form",x),L=(0,p.Z)(z),[D,W,q]=(0,b.ZP)(z,L);(0,d.ln)("Form.Item");let $=o.useContext(c.ZM),K=o.useRef(null),[Y,Q]=function(e){let[t,n]=o.useState(e),r=o.useRef(null),a=o.useRef([]),i=o.useRef(!1);return o.useEffect(()=>(i.current=!1,()=>{i.current=!0,h.Z.cancel(r.current),r.current=null}),[]),[t,function(e){i.current||(null===r.current&&(a.current=[],r.current=(0,h.Z)(()=>{r.current=null,n(e=>{let t=e;return a.current.forEach(e=>{t=e(t)}),t})})),a.current.push(e))}]}({}),[J,ee]=(0,l.Z)(()=>U()),et=(e,t)=>{Q(n=>{let o=Object.assign({},n),a=[].concat((0,r.Z)(e.name.slice(0,-1)),(0,r.Z)(t)).join("__SPLIT__");return e.destroy?delete o[a]:o[a]=e,o})},[en,er]=o.useMemo(()=>{let e=(0,r.Z)(J.errors),t=(0,r.Z)(J.warnings);return Object.values(Y).forEach(n=>{e.push.apply(e,(0,r.Z)(n.errors||[])),t.push.apply(t,(0,r.Z)(n.warnings||[]))}),[e,t]},[Y,J.errors,J.warnings]),eo=function(){let{itemRef:e}=o.useContext(m.q3),t=o.useRef({});return function(n,r){let o=r&&"object"==typeof r&&(0,s.C4)(r),a=n.join("_");return(t.current.name!==a||t.current.originRef!==o)&&(t.current.name=a,t.current.originRef=o,t.current.ref=(0,s.sQ)(e(n),o)),t.current.ref}}();function ea(r,c,l){return n&&!I?o.createElement(V,{prefixCls:z,hasFeedback:e.hasFeedback,validateStatus:e.validateStatus,meta:J,errors:en,warnings:er,noStyle:!0,name:t},r):o.createElement(X,Object.assign({key:"row"},e,{className:i()(a,q,L,W),prefixCls:z,fieldId:c,isRequired:l,errors:en,warnings:er,meta:J,onSubItemMetaChange:et,layout:R,name:t}),r)}if(!H&&!T&&!v)return D(ea(F));let ei={};return"string"==typeof S?ei.label=S:t&&(ei.label=String(t)),O&&(ei=Object.assign(Object.assign({},ei),O)),D(o.createElement(c.gN,Object.assign({},e,{messageVariables:ei,trigger:k,validateTrigger:B,onMetaChange:e=>{let t=null==$?void 0:$.getKey(e.name);if(ee(e.destroy?U():e,!0),n&&!1!==M&&A){let n=e.name;if(e.destroy)n=K.current||n;else if(void 0!==t){let[e,o]=t;n=[e].concat((0,r.Z)(o)),K.current=n}A(e,n)}}}),(n,a,i)=>{let c=(0,y.qo)(t).length&&a?a.name:[],l=(0,y.dD)(c,P),d=void 0!==Z?Z:!!(null==E?void 0:E.some(e=>{if(e&&"object"==typeof e&&e.required&&!e.warningOnly)return!0;if("function"==typeof e){let t=e(i);return(null==t?void 0:t.required)&&!(null==t?void 0:t.warningOnly)}return!1})),f=Object.assign({},n),p=null;if(Array.isArray(F)&&H)p=F;else if(T&&(!(w||v)||H));else if(!v||T||H){if(o.isValidElement(F)){let t=Object.assign(Object.assign({},F.props),f);if(t.id||(t.id=l),M||en.length>0||er.length>0||e.extra){let n=[];(M||en.length>0)&&n.push("".concat(l,"_help")),e.extra&&n.push("".concat(l,"_extra")),t["aria-describedby"]=n.join(" ")}en.length>0&&(t["aria-invalid"]="true"),d&&(t["aria-required"]="true"),(0,s.Yr)(F)&&(t.ref=eo(c,F)),new Set([].concat((0,r.Z)((0,y.qo)(k)),(0,r.Z)((0,y.qo)(B)))).forEach(e=>{t[e]=function(){for(var t,n,r,o=arguments.length,a=Array(o),i=0;i{}}),c=r.createContext(null),l=e=>{let t=(0,a.Z)(e,["prefixCls"]);return r.createElement(o.RV,Object.assign({},t))},s=r.createContext({prefixCls:""}),u=r.createContext({}),d=e=>{let{children:t,status:n,override:o}=e,a=r.useContext(u),i=r.useMemo(()=>{let e=Object.assign({},a);return o&&delete e.isFormItemInput,n&&(delete e.status,delete e.hasFeedback,delete e.feedbackIcon),e},[n,o,a]);return r.createElement(u.Provider,{value:i},t)},f=r.createContext(void 0)},4064:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);function o(e){let[t,n]=r.useState(e);return r.useEffect(()=>{let t=setTimeout(()=>{n(e)},e.length?0:10);return()=>{clearTimeout(t)}},[e]),t}},29487:function(e,t,n){"use strict";n.d(t,{Z:function(){return h},S:function(){return g}});var r=n(2265),o=n(87379),a=n(2868);let i=e=>"object"==typeof e&&null!=e&&1===e.nodeType,c=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,l=(e,t)=>{if(e.clientHeight{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeightat||a>e&&i=t&&c>=n?a-e-r:i>t&&cn?i-t+o:0,u=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t},d=(e,t)=>{var n,r,o,a;if("undefined"==typeof document)return[];let{scrollMode:c,block:d,inline:f,boundary:p,skipOverflowHiddenElements:m}=t,g="function"==typeof p?p:e=>e!==p;if(!i(e))throw TypeError("Invalid target");let v=document.scrollingElement||document.documentElement,h=[],b=e;for(;i(b)&&g(b);){if((b=u(b))===v){h.push(b);break}null!=b&&b===document.body&&l(b)&&!l(document.documentElement)||null!=b&&l(b,m)&&h.push(b)}let y=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,x=null!=(a=null==(o=window.visualViewport)?void 0:o.height)?a:innerHeight,{scrollX:w,scrollY:E}=window,{height:C,width:Z,top:S,right:O,bottom:k,left:j}=e.getBoundingClientRect(),{top:I,right:M,bottom:R,left:N}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),P="start"===d||"nearest"===d?S-I:"end"===d?k+R:S+C/2-I+R,F="center"===f?j+Z/2-N+M:"end"===f?O+M:j-N,T=[];for(let e=0;e=0&&j>=0&&k<=x&&O<=y&&(t===v&&!l(t)||S>=o&&k<=i&&j>=u&&O<=a))break;let p=getComputedStyle(t),m=parseInt(p.borderLeftWidth,10),g=parseInt(p.borderTopWidth,10),b=parseInt(p.borderRightWidth,10),I=parseInt(p.borderBottomWidth,10),M=0,R=0,N="offsetWidth"in t?t.offsetWidth-t.clientWidth-m-b:0,A="offsetHeight"in t?t.offsetHeight-t.clientHeight-g-I:0,_="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,B="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(v===t)M="start"===d?P:"end"===d?P-x:"nearest"===d?s(E,E+x,x,g,I,E+P,E+P+C,C):P-x/2,R="start"===f?F:"center"===f?F-y/2:"end"===f?F-y:s(w,w+y,y,m,b,w+F,w+F+Z,Z),M=Math.max(0,M+E),R=Math.max(0,R+w);else{M="start"===d?P-o-g:"end"===d?P-i+I+A:"nearest"===d?s(o,i,n,g,I+A,P,P+C,C):P-(o+n/2)+A/2,R="start"===f?F-u-m:"center"===f?F-(u+r/2)+N/2:"end"===f?F-a+b+N:s(u,a,r,m,b+N,F,F+Z,Z);let{scrollLeft:e,scrollTop:c}=t;M=0===B?0:Math.max(0,Math.min(c+M/B,t.scrollHeight-n/B+A)),R=0===_?0:Math.max(0,Math.min(e+R/_,t.scrollWidth-r/_+N)),P+=c-M,F+=e-R}T.push({el:t,top:M,left:R})}return T},f=e=>!1===e?{block:"end",inline:"nearest"}:e===Object(e)&&0!==Object.keys(e).length?e:{block:"start",inline:"nearest"};var p=n(13861),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 o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function g(e){return(0,p.qo)(e).join("_")}function v(e,t){let n=t.getFieldInstance(e),r=(0,a.bn)(n);if(r)return r;let o=(0,p.dD)((0,p.qo)(e),t.__INTERNAL__.name);if(o)return document.getElementById(o)}function h(e){let[t]=(0,o.cI)(),n=r.useRef({}),a=r.useMemo(()=>null!=e?e:Object.assign(Object.assign({},t),{__INTERNAL__:{itemRef:e=>t=>{let r=g(e);t?n.current[r]=t:delete n.current[r]}},scrollToField:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{focus:n}=t,r=m(t,["focus"]),o=v(e,a);o&&(!function(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if("object"==typeof t&&"function"==typeof t.behavior)return t.behavior(d(e,t));let r="boolean"==typeof t||null==t?void 0:t.behavior;for(let{el:o,top:a,left:i}of d(e,f(t))){let e=a-n.top+n.bottom,t=i-n.left+n.right;o.scroll({top:e,left:t,behavior:r})}}(o,Object.assign({scrollMode:"if-needed",block:"nearest"},r)),n&&a.focusField(e))},focusField:e=>{var t,n;let r=a.getFieldInstance(e);"function"==typeof(null==r?void 0:r.focus)?r.focus():null===(n=null===(t=v(e,a))||void 0===t?void 0:t.focus)||void 0===n||n.call(t)},getFieldInstance:e=>{let t=g(e);return n.current[t]}}),[e,t]);return[a]}},56250:function(e,t,n){"use strict";var r=n(2265),o=n(71744),a=n(39109);t.Z=(e,t,n)=>{var i,c;let l;let{variant:s,[e]:u}=r.useContext(o.E_),d=r.useContext(a.pg),f=null==u?void 0:u.variant;l=void 0!==t?t:!1===n?"borderless":null!==(c=null!==(i=null!=d?d:f)&&void 0!==i?i:s)&&void 0!==c?c:"outlined";let p=o.tr.includes(l);return[l,p]}},10032:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(39109),o=n(14605),a=n(2265),i=n(36760),c=n.n(i),l=n(87379),s=n(71744),u=n(86586),d=n(64024),f=n(33759),p=n(59189),m=n(29487),g=n(47713),v=n(77360),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 o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let b=a.forwardRef((e,t)=>{let n=a.useContext(u.Z),{getPrefixCls:o,direction:i,requiredMark:b,colon:y,scrollToFirstError:x,className:w,style:E}=(0,s.dj)("form"),{prefixCls:C,className:Z,rootClassName:S,size:O,disabled:k=n,form:j,colon:I,labelAlign:M,labelWrap:R,labelCol:N,wrapperCol:P,hideRequiredMark:F,layout:T="horizontal",scrollToFirstError:A,requiredMark:_,onFinishFailed:B,name:H,style:z,feedbackIcons:L,variant:D}=e,W=h(e,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons","variant"]),V=(0,f.Z)(O),q=a.useContext(v.Z),X=a.useMemo(()=>void 0!==_?_:!F&&(void 0===b||b),[F,_,b]),G=null!=I?I:y,U=o("form",C),$=(0,d.Z)(U),[K,Y,Q]=(0,g.ZP)(U,$),J=c()(U,"".concat(U,"-").concat(T),{["".concat(U,"-hide-required-mark")]:!1===X,["".concat(U,"-rtl")]:"rtl"===i,["".concat(U,"-").concat(V)]:V},Q,$,Y,w,Z,S),[ee]=(0,m.Z)(j),{__INTERNAL__:et}=ee;et.name=H;let en=a.useMemo(()=>({name:H,labelAlign:M,labelCol:N,labelWrap:R,wrapperCol:P,layout:T,colon:G,requiredMark:X,itemRef:et.itemRef,form:ee,feedbackIcons:L}),[H,M,N,P,T,G,X,ee,L]),er=a.useRef(null);a.useImperativeHandle(t,()=>{var e;return Object.assign(Object.assign({},ee),{nativeElement:null===(e=er.current)||void 0===e?void 0:e.nativeElement})});let eo=(e,t)=>{if(e){let n={block:"nearest"};"object"==typeof e&&(n=Object.assign(Object.assign({},n),e)),ee.scrollToField(t,n)}};return K(a.createElement(r.pg.Provider,{value:D},a.createElement(u.n,{disabled:k},a.createElement(p.Z.Provider,{value:V},a.createElement(r.RV,{validateMessages:q},a.createElement(r.q3.Provider,{value:en},a.createElement(r.Ux,{status:!0},a.createElement(l.ZP,Object.assign({id:H},W,{name:H,onFinishFailed:e=>{if(null==B||B(e),e.errorFields.length){let t=e.errorFields[0].name;if(void 0!==A){eo(A,t);return}void 0!==x&&eo(x,t)}},form:ee,ref:er,style:Object.assign(Object.assign({},E),z),className:J})))))))))});var y=n(2740),x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};b.Item=y.Z,b.List=e=>{var{prefixCls:t,children:n}=e,o=x(e,["prefixCls","children"]);let{getPrefixCls:i}=a.useContext(s.E_),c=i("form",t),u=a.useMemo(()=>({prefixCls:c,status:"error"}),[c]);return a.createElement(l.aV,Object.assign({},o),(e,t,o)=>a.createElement(r.Rk.Provider,{value:u},n(e.map(e=>Object.assign(Object.assign({},e),{fieldKey:e.key})),t,{errors:o.errors,warnings:o.warnings})))},b.ErrorList=o.Z,b.useForm=m.Z,b.useFormInstance=function(){let{form:e}=a.useContext(r.q3);return e},b.useWatch=l.qo,b.Provider=r.RV,b.create=()=>{};var w=b},47713:function(e,t,n){"use strict";n.d(t,{ZP:function(){return x},B4:function(){return y}});var r=n(93463),o=n(12918),a=n(691),i=n(63074),c=n(71140),l=n(99320),s=e=>{let{componentCls:t}=e,n="".concat(t,"-show-help"),r="".concat(t,"-show-help-item");return{[n]:{transition:"opacity ".concat(e.motionDurationFast," ").concat(e.motionEaseInOut),"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[r]:{overflow:"hidden",transition:"height ".concat(e.motionDurationFast," ").concat(e.motionEaseInOut,",\n opacity ").concat(e.motionDurationFast," ").concat(e.motionEaseInOut,",\n transform ").concat(e.motionDurationFast," ").concat(e.motionEaseInOut," !important"),["&".concat(r,"-appear, &").concat(r,"-enter")]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},["&".concat(r,"-leave-active")]:{transform:"translateY(-5px)"}}}}};let u=e=>({legend:{display:"block",width:"100%",marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:"0 0 0 ".concat((0,r.bf)(e.controlOutlineWidth)," ").concat(e.controlOutline)},output:{display:"block",paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),d=(e,t)=>{let{formItemCls:n}=e;return{[n]:{["".concat(n,"-label > label")]:{height:t},["".concat(n,"-control-input")]:{minHeight:t}}}},f=e=>{let{componentCls:t}=e;return{[e.componentCls]:Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),u(e)),{["".concat(t,"-text")]:{display:"inline-block",paddingInlineEnd:e.paddingSM},"&-small":Object.assign({},d(e,e.controlHeightSM)),"&-large":Object.assign({},d(e,e.controlHeightLG))})}},p=e=>{let{formItemCls:t,iconCls:n,rootPrefixCls:r,antCls:i,labelRequiredMarkColor:c,labelColor:l,labelFontSize:s,labelHeight:u,labelColonMarginInlineStart:d,labelColonMarginInlineEnd:f,itemMarginBottom:p}=e;return{[t]:Object.assign(Object.assign({},(0,o.Wf)(e)),{marginBottom:p,verticalAlign:"top","&-with-help":{transition:"none"},["&-hidden,\n &-hidden".concat(i,"-row")]:{display:"none"},"&-has-warning":{["".concat(t,"-split")]:{color:e.colorError}},"&-has-error":{["".concat(t,"-split")]:{color:e.colorWarning}},["".concat(t,"-label")]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:e.lineHeight,whiteSpace:"unset","> label":{verticalAlign:"middle",textWrap:"balance"}},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:u,color:l,fontSize:s,["> ".concat(n)]:{fontSize:e.fontSize,verticalAlign:"top"},["&".concat(t,"-required")]:{"&::before":{display:"inline-block",marginInlineEnd:e.marginXXS,color:c,fontSize:e.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"'},["&".concat(t,"-required-mark-hidden, &").concat(t,"-required-mark-optional")]:{"&::before":{display:"none"}}},["".concat(t,"-optional")]:{display:"inline-block",marginInlineStart:e.marginXXS,color:e.colorTextDescription,["&".concat(t,"-required-mark-hidden")]:{display:"none"}},["".concat(t,"-tooltip")]:{color:e.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:e.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:d,marginInlineEnd:f},["&".concat(t,"-no-colon::after")]:{content:'"\\a0"'}}},["".concat(t,"-control")]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,["&:first-child:not([class^=\"'".concat(r,"-col-'\"]):not([class*=\"' ").concat(r,"-col-'\"])")]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:e.controlHeight,"&-content":{flex:"auto",maxWidth:"100%",["&:has(> ".concat(i,"-switch:only-child, > ").concat(i,"-rate:only-child)")]:{display:"flex",alignItems:"center"}}}},[t]:{"&-additional":{display:"flex",flexDirection:"column"},"&-explain, &-extra":{clear:"both",color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:e.controlHeightSM,transition:"color ".concat(e.motionDurationMid," ").concat(e.motionEaseOut)},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},["&-with-help ".concat(t,"-explain")]:{height:"auto",opacity:1},["".concat(t,"-feedback-icon")]:{fontSize:e.fontSize,textAlign:"center",visibility:"visible",animationName:a.kr,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:"none","&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},m=e=>({padding:e.verticalLabelPadding,margin:e.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),g=e=>{let{antCls:t,formItemCls:n}=e;return{["".concat(n,"-horizontal")]:{["".concat(n,"-label")]:{flexGrow:0},["".concat(n,"-control")]:{flex:"1 1 0",minWidth:0},["".concat(n,"-label[class$='-24'], ").concat(n,"-label[class*='-24 ']")]:{["& + ".concat(n,"-control")]:{minWidth:"unset"}},["".concat(t,"-col-24").concat(n,"-label,\n ").concat(t,"-col-xl-24").concat(n,"-label")]:m(e)}}},v=e=>{let{componentCls:t,formItemCls:n,inlineItemMarginBottom:r}=e;return{["".concat(t,"-inline")]:{display:"flex",flexWrap:"wrap",["".concat(n,"-inline")]:{flex:"none",marginInlineEnd:e.margin,marginBottom:r,"&-row":{flexWrap:"nowrap"},["> ".concat(n,"-label,\n > ").concat(n,"-control")]:{display:"inline-block",verticalAlign:"top"},["> ".concat(n,"-label")]:{flex:"none"},["".concat(t,"-text")]:{display:"inline-block"},["".concat(n,"-has-feedback")]:{display:"inline-block"}}}}},h=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{["".concat(n," ").concat(n,"-label")]:m(e),["".concat(t,":not(").concat(t,"-inline)")]:{[n]:{flexWrap:"wrap",["".concat(n,"-label, ").concat(n,"-control")]:{['&:not([class*=" '.concat(r,'-col-xs"])')]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},b=e=>{let{componentCls:t,formItemCls:n,antCls:o}=e;return{["".concat(n,"-vertical")]:{["".concat(n,"-row")]:{flexDirection:"column"},["".concat(n,"-label > label")]:{height:"auto"},["".concat(n,"-control")]:{width:"100%"},["".concat(n,"-label,\n ").concat(o,"-col-24").concat(n,"-label,\n ").concat(o,"-col-xl-24").concat(n,"-label")]:m(e)},["@media (max-width: ".concat((0,r.bf)(e.screenXSMax),")")]:[h(e),{[t]:{["".concat(n,":not(").concat(n,"-horizontal)")]:{["".concat(o,"-col-xs-24").concat(n,"-label")]:m(e)}}}],["@media (max-width: ".concat((0,r.bf)(e.screenSMMax),")")]:{[t]:{["".concat(n,":not(").concat(n,"-horizontal)")]:{["".concat(o,"-col-sm-24").concat(n,"-label")]:m(e)}}},["@media (max-width: ".concat((0,r.bf)(e.screenMDMax),")")]:{[t]:{["".concat(n,":not(").concat(n,"-horizontal)")]:{["".concat(o,"-col-md-24").concat(n,"-label")]:m(e)}}},["@media (max-width: ".concat((0,r.bf)(e.screenLGMax),")")]:{[t]:{["".concat(n,":not(").concat(n,"-horizontal)")]:{["".concat(o,"-col-lg-24").concat(n,"-label")]:m(e)}}}}},y=(e,t)=>(0,c.IX)(e,{formItemCls:"".concat(e.componentCls,"-item"),rootPrefixCls:t});var x=(0,l.I$)("Form",(e,t)=>{let{rootPrefixCls:n}=t,r=y(e,n);return[f(r),p(r),s(r),g(r),v(r),b(r),(0,i.Z)(r),a.kr]},e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:"0 0 ".concat(e.paddingXS,"px"),verticalLabelMargin:0,inlineItemMarginBottom:0}),{order:-1e3})},13861:function(e,t,n){"use strict";n.d(t,{dD:function(){return a},lR:function(){return i},qo:function(){return o}});let r=["parentNode"];function o(e){return void 0===e||!1===e?[]:Array.isArray(e)?e:[e]}function a(e,t){if(!e.length)return;let n=e.join("_");return t?"".concat(t,"_").concat(n):r.includes(n)?"".concat("form_item","_").concat(n):n}function i(e,t,n,r,o,a){let i=r;return void 0!==a?i=a:n.validating?i="validating":e.length?i="error":t.length?i="warning":(n.touched||o&&n.validated)&&(i="success"),i}},77360:function(e,t,n){"use strict";var r=n(2265);t.Z=(0,r.createContext)(void 0)},62807:function(e,t,n){"use strict";let r=(0,n(2265).createContext)({});t.Z=r},54998:function(e,t,n){"use strict";var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),c=n(62807),l=n(96776),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 o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function u(e){return"auto"===e?"1 1 auto":"number"==typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}let d=["xs","sm","md","lg","xl","xxl"],f=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:o}=r.useContext(i.E_),{gutter:f,wrap:p}=r.useContext(c.Z),{prefixCls:m,span:g,order:v,offset:h,push:b,pull:y,className:x,children:w,flex:E,style:C}=e,Z=s(e,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),S=n("col",m),[O,k,j]=(0,l.cG)(S),I={},M={};d.forEach(t=>{let n={},r=e[t];"number"==typeof r?n.span=r:"object"==typeof r&&(n=r||{}),delete Z[t],M=Object.assign(Object.assign({},M),{["".concat(S,"-").concat(t,"-").concat(n.span)]:void 0!==n.span,["".concat(S,"-").concat(t,"-order-").concat(n.order)]:n.order||0===n.order,["".concat(S,"-").concat(t,"-offset-").concat(n.offset)]:n.offset||0===n.offset,["".concat(S,"-").concat(t,"-push-").concat(n.push)]:n.push||0===n.push,["".concat(S,"-").concat(t,"-pull-").concat(n.pull)]:n.pull||0===n.pull,["".concat(S,"-rtl")]:"rtl"===o}),n.flex&&(M["".concat(S,"-").concat(t,"-flex")]=!0,I["--".concat(S,"-").concat(t,"-flex")]=u(n.flex))});let R=a()(S,{["".concat(S,"-").concat(g)]:void 0!==g,["".concat(S,"-order-").concat(v)]:v,["".concat(S,"-offset-").concat(h)]:h,["".concat(S,"-push-").concat(b)]:b,["".concat(S,"-pull-").concat(y)]:y},x,M,k,j),N={};if(null==f?void 0:f[0]){let e="number"==typeof f[0]?"".concat(f[0]/2,"px"):"calc(".concat(f[0]," / 2)");N.paddingLeft=e,N.paddingRight=e}return E&&(N.flex=u(E),!1!==p||N.minWidth||(N.minWidth=0)),O(r.createElement("div",Object.assign({},Z,{style:Object.assign(Object.assign(Object.assign({},N),C),I),className:R,ref:t}),w))});t.Z=f},28617:function(e,t,n){"use strict";var r=n(2265),o=n(27380),a=n(51646),i=n(6543);t.Z=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,r.useRef)(t),[,c]=(0,a.N)(),l=(0,i.ZP)();return(0,o.Z)(()=>{let t=l.subscribe(t=>{n.current=t,e&&c()});return()=>l.unsubscribe(t)},[]),n.current}},77774:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(2265),o=n(36760),a=n.n(o),i=n(6543),c=n(71744),l=n(28617),s=n(62807),u=n(96776),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 o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function f(e,t){let[n,o]=r.useState("string"==typeof e?e:""),a=()=>{if("string"==typeof e&&o(e),"object"==typeof e)for(let n=0;n{a()},[JSON.stringify(e),t]),n}var p=r.forwardRef((e,t)=>{let{prefixCls:n,justify:o,align:p,className:m,style:g,children:v,gutter:h=0,wrap:b}=e,y=d(e,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:x,direction:w}=r.useContext(c.E_),E=(0,l.Z)(!0,null),C=f(p,E),Z=f(o,E),S=x("row",n),[O,k,j]=(0,u.VM)(S),I=function(e,t){let n=[void 0,void 0],r=Array.isArray(e)?e:[e,void 0],o=t||{xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0};return r.forEach((e,t)=>{if("object"==typeof e&&null!==e)for(let r=0;r({gutter:[N,P],wrap:b}),[N,P,b]);return O(r.createElement(s.Z.Provider,{value:F},r.createElement("div",Object.assign({},y,{className:M,style:Object.assign(Object.assign({},R),g),ref:t}),v)))})},96776:function(e,t,n){"use strict";n.d(t,{VM:function(){return u},cG:function(){return f},hd:function(){return d}});var r=n(93463),o=n(99320),a=n(71140);let i=e=>{let{componentCls:t}=e;return{[t]:{position:"relative",maxWidth:"100%",minHeight:1}}},c=(e,t)=>{let{prefixCls:n,componentCls:r,gridColumns:o}=e,a={};for(let e=o;e>=0;e--)0===e?(a["".concat(r).concat(t,"-").concat(e)]={display:"none"},a["".concat(r,"-push-").concat(e)]={insetInlineStart:"auto"},a["".concat(r,"-pull-").concat(e)]={insetInlineEnd:"auto"},a["".concat(r).concat(t,"-push-").concat(e)]={insetInlineStart:"auto"},a["".concat(r).concat(t,"-pull-").concat(e)]={insetInlineEnd:"auto"},a["".concat(r).concat(t,"-offset-").concat(e)]={marginInlineStart:0},a["".concat(r).concat(t,"-order-").concat(e)]={order:0}):(a["".concat(r).concat(t,"-").concat(e)]=[{"--ant-display":"block",display:"block"},{display:"var(--ant-display)",flex:"0 0 ".concat(e/o*100,"%"),maxWidth:"".concat(e/o*100,"%")}],a["".concat(r).concat(t,"-push-").concat(e)]={insetInlineStart:"".concat(e/o*100,"%")},a["".concat(r).concat(t,"-pull-").concat(e)]={insetInlineEnd:"".concat(e/o*100,"%")},a["".concat(r).concat(t,"-offset-").concat(e)]={marginInlineStart:"".concat(e/o*100,"%")},a["".concat(r).concat(t,"-order-").concat(e)]={order:e});return a["".concat(r).concat(t,"-flex")]={flex:"var(--".concat(n).concat(t,"-flex)")},a},l=(e,t)=>c(e,t),s=(e,t,n)=>({["@media (min-width: ".concat((0,r.bf)(t),")")]:Object.assign({},l(e,n))}),u=(0,o.I$)("Grid",e=>{let{componentCls:t}=e;return{[t]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},()=>({})),d=e=>({xs:e.screenXSMin,sm:e.screenSMMin,md:e.screenMDMin,lg:e.screenLGMin,xl:e.screenXLMin,xxl:e.screenXXLMin}),f=(0,o.I$)("Grid",e=>{let t=(0,a.IX)(e,{gridColumns:24}),n=d(t);return delete n.xs,[i(t),l(t,""),l(t,"-xs"),Object.keys(n).map(e=>s(t,n[e],"-".concat(e))).reduce((e,t)=>Object.assign(Object.assign({},e),t),{})]},()=>({}))},19015:function(e,t,n){"use strict";n.d(t,{Z:function(){return ev}});var r=n(2265),o=n(70464),a=n(1119),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},c=n(55015),l=r.forwardRef(function(e,t){return r.createElement(c.Z,(0,a.Z)({},e,{ref:t,icon:i}))}),s=n(36760),u=n.n(s),d=n(11993),f=n(41154),p=n(26365),m=n(6989),g=n(76405),v=n(25049);function h(){return"function"==typeof BigInt}function b(e){return!e&&0!==e&&!Number.isNaN(e)||!String(e).trim()}function y(e){var t=e.trim(),n=t.startsWith("-");n&&(t=t.slice(1)),(t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,"")).startsWith(".")&&(t="0".concat(t));var r=t||"0",o=r.split("."),a=o[0]||"0",i=o[1]||"0";"0"===a&&"0"===i&&(n=!1);var c=n?"-":"";return{negative:n,negativeStr:c,trimStr:r,integerStr:a,decimalStr:i,fullStr:"".concat(c).concat(r)}}function x(e){var t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function w(e){var t=String(e);if(x(e)){var n=Number(t.slice(t.indexOf("e-")+2)),r=t.match(/\.(\d+)/);return null!=r&&r[1]&&(n+=r[1].length),n}return t.includes(".")&&C(t)?t.length-t.indexOf(".")-1:0}function E(e){var t=String(e);if(x(e)){if(e>Number.MAX_SAFE_INTEGER)return String(h()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(e=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":y("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),e}(),S=function(){function e(t){if((0,g.Z)(this,e),(0,d.Z)(this,"origin",""),(0,d.Z)(this,"number",void 0),(0,d.Z)(this,"empty",void 0),b(t)){this.empty=!0;return}this.origin=String(t),this.number=Number(t)}return(0,v.Z)(e,[{key:"negate",value:function(){return new e(-this.toNumber())}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=Number(t);if(Number.isNaN(n))return this;var r=this.number+n;if(r>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(rNumber.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(r=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":E(this.number):this.origin}}]),e}();function O(e){return h()?new Z(e):new S(e)}function k(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(""===e)return"";var o=y(e),a=o.negativeStr,i=o.integerStr,c=o.decimalStr,l="".concat(t).concat(c),s="".concat(a).concat(i);if(n>=0){var u=Number(c[n]);return u>=5&&!r?k(O(e).add("".concat(a,"0.").concat("0".repeat(n)).concat(10-u)).toString(),t,n,r):0===n?s:"".concat(s).concat(t).concat(c.padEnd(n,"0").slice(0,n))}return".0"===l?s:"".concat(s).concat(l)}var j=n(2027),I=n(27380),M=n(28791),R=n(32559),N=n(79267),P=function(){var e=(0,r.useState)(!1),t=(0,p.Z)(e,2),n=t[0],o=t[1];return(0,I.Z)(function(){o((0,N.Z)())},[]),n},F=n(53346);function T(e){var t=e.prefixCls,n=e.upNode,o=e.downNode,i=e.upDisabled,c=e.downDisabled,l=e.onStep,s=r.useRef(),f=r.useRef([]),p=r.useRef();p.current=l;var m=function(){clearTimeout(s.current)},g=function(e,t){e.preventDefault(),m(),p.current(t),s.current=setTimeout(function e(){p.current(t),s.current=setTimeout(e,200)},600)};if(r.useEffect(function(){return function(){m(),f.current.forEach(function(e){return F.Z.cancel(e)})}},[]),P())return null;var v="".concat(t,"-handler"),h=u()(v,"".concat(v,"-up"),(0,d.Z)({},"".concat(v,"-up-disabled"),i)),b=u()(v,"".concat(v,"-down"),(0,d.Z)({},"".concat(v,"-down-disabled"),c)),y=function(){return f.current.push((0,F.Z)(m))},x={unselectable:"on",role:"button",onMouseUp:y,onMouseLeave:y};return r.createElement("div",{className:"".concat(v,"-wrap")},r.createElement("span",(0,a.Z)({},x,{onMouseDown:function(e){g(e,!0)},"aria-label":"Increase Value","aria-disabled":i,className:h}),n||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-up-inner")})),r.createElement("span",(0,a.Z)({},x,{onMouseDown:function(e){g(e,!1)},"aria-label":"Decrease Value","aria-disabled":c,className:b}),o||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-down-inner")})))}function A(e){var t="number"==typeof e?E(e):y(e).fullStr;return t.includes(".")?y(t.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:e+"0"}var _=n(55041),B=function(){var e=(0,r.useRef)(0),t=function(){F.Z.cancel(e.current)};return(0,r.useEffect)(function(){return t},[]),function(n){t(),e.current=(0,F.Z)(function(){n()})}},H=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","changeOnWheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur","domRef"],z=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],L=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},D=function(e){var t=O(e);return t.isInvalidate()?null:t},W=r.forwardRef(function(e,t){var n,o,i=e.prefixCls,c=e.className,l=e.style,s=e.min,g=e.max,v=e.step,h=void 0===v?1:v,b=e.defaultValue,y=e.value,x=e.disabled,Z=e.readOnly,S=e.upHandler,j=e.downHandler,N=e.keyboard,P=e.changeOnWheel,F=void 0!==P&&P,_=e.controls,z=(e.classNames,e.stringMode),W=e.parser,V=e.formatter,q=e.precision,X=e.decimalSeparator,G=e.onChange,U=e.onInput,$=e.onPressEnter,K=e.onStep,Y=e.changeOnBlur,Q=void 0===Y||Y,J=e.domRef,ee=(0,m.Z)(e,H),et="".concat(i,"-input"),en=r.useRef(null),er=r.useState(!1),eo=(0,p.Z)(er,2),ea=eo[0],ei=eo[1],ec=r.useRef(!1),el=r.useRef(!1),es=r.useRef(!1),eu=r.useState(function(){return O(null!=y?y:b)}),ed=(0,p.Z)(eu,2),ef=ed[0],ep=ed[1],em=r.useCallback(function(e,t){return t?void 0:q>=0?q:Math.max(w(e),w(h))},[q,h]),eg=r.useCallback(function(e){var t=String(e);if(W)return W(t);var n=t;return X&&(n=n.replace(X,".")),n.replace(/[^\w.-]+/g,"")},[W,X]),ev=r.useRef(""),eh=r.useCallback(function(e,t){if(V)return V(e,{userTyping:t,input:String(ev.current)});var n="number"==typeof e?E(e):e;if(!t){var r=em(n,t);C(n)&&(X||r>=0)&&(n=k(n,X||".",r))}return n},[V,em,X]),eb=r.useState(function(){var e=null!=b?b:y;return ef.isInvalidate()&&["string","number"].includes((0,f.Z)(e))?Number.isNaN(e)?"":e:eh(ef.toString(),!1)}),ey=(0,p.Z)(eb,2),ex=ey[0],ew=ey[1];function eE(e,t){ew(eh(e.isInvalidate()?e.toString(!1):e.toString(!t),t))}ev.current=ex;var eC=r.useMemo(function(){return D(g)},[g,q]),eZ=r.useMemo(function(){return D(s)},[s,q]),eS=r.useMemo(function(){return!(!eC||!ef||ef.isInvalidate())&&eC.lessEquals(ef)},[eC,ef]),eO=r.useMemo(function(){return!(!eZ||!ef||ef.isInvalidate())&&ef.lessEquals(eZ)},[eZ,ef]),ek=(n=en.current,o=(0,r.useRef)(null),[function(){try{var e=n.selectionStart,t=n.selectionEnd,r=n.value,a=r.substring(0,e),i=r.substring(t);o.current={start:e,end:t,value:r,beforeTxt:a,afterTxt:i}}catch(e){}},function(){if(n&&o.current&&ea)try{var e=n.value,t=o.current,r=t.beforeTxt,a=t.afterTxt,i=t.start,c=e.length;if(e.startsWith(r))c=r.length;else if(e.endsWith(a))c=e.length-o.current.afterTxt.length;else{var l=r[i-1],s=e.indexOf(l,i-1);-1!==s&&(c=s+1)}n.setSelectionRange(c,c)}catch(e){(0,R.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(e.message))}}]),ej=(0,p.Z)(ek,2),eI=ej[0],eM=ej[1],eR=function(e){return eC&&!e.lessEquals(eC)?eC:eZ&&!eZ.lessEquals(e)?eZ:null},eN=function(e){return!eR(e)},eP=function(e,t){var n=e,r=eN(n)||n.isEmpty();if(n.isEmpty()||t||(n=eR(n)||n,r=!0),!Z&&!x&&r){var o,a=n.toString(),i=em(a,t);return i>=0&&!eN(n=O(k(a,".",i)))&&(n=O(k(a,".",i,!0))),n.equals(ef)||(o=n,void 0===y&&ep(o),null==G||G(n.isEmpty()?null:L(z,n)),void 0===y&&eE(n,t)),n}return ef},eF=B(),eT=function e(t){if(eI(),ev.current=t,ew(t),!el.current){var n=O(eg(t));n.isNaN()||eP(n,!0)}null==U||U(t),eF(function(){var n=t;W||(n=t.replace(/。/g,".")),n!==t&&e(n)})},eA=function(e){if((!e||!eS)&&(e||!eO)){ec.current=!1;var t,n=O(es.current?A(h):h);e||(n=n.negate());var r=eP((ef||O(0)).add(n.toString()),!1);null==K||K(L(z,r),{offset:es.current?A(h):h,type:e?"up":"down"}),null===(t=en.current)||void 0===t||t.focus()}},e_=function(e){var t,n=O(eg(ex));t=n.isNaN()?eP(ef,e):eP(n,e),void 0!==y?eE(ef,!1):t.isNaN()||eE(t,!1)};return r.useEffect(function(){if(F&&ea){var e=function(e){eA(e.deltaY<0),e.preventDefault()},t=en.current;if(t)return t.addEventListener("wheel",e,{passive:!1}),function(){return t.removeEventListener("wheel",e)}}}),(0,I.o)(function(){ef.isInvalidate()||eE(ef,!1)},[q,V]),(0,I.o)(function(){var e=O(y);ep(e);var t=O(eg(ex));e.equals(t)&&ec.current&&!V||eE(e,ec.current)},[y]),(0,I.o)(function(){V&&eM()},[ex]),r.createElement("div",{ref:J,className:u()(i,c,(0,d.Z)((0,d.Z)((0,d.Z)((0,d.Z)((0,d.Z)({},"".concat(i,"-focused"),ea),"".concat(i,"-disabled"),x),"".concat(i,"-readonly"),Z),"".concat(i,"-not-a-number"),ef.isNaN()),"".concat(i,"-out-of-range"),!ef.isInvalidate()&&!eN(ef))),style:l,onFocus:function(){ei(!0)},onBlur:function(){Q&&e_(!1),ei(!1),ec.current=!1},onKeyDown:function(e){var t=e.key,n=e.shiftKey;ec.current=!0,es.current=n,"Enter"===t&&(el.current||(ec.current=!1),e_(!1),null==$||$(e)),!1!==N&&!el.current&&["Up","ArrowUp","Down","ArrowDown"].includes(t)&&(eA("Up"===t||"ArrowUp"===t),e.preventDefault())},onKeyUp:function(){ec.current=!1,es.current=!1},onCompositionStart:function(){el.current=!0},onCompositionEnd:function(){el.current=!1,eT(en.current.value)},onBeforeInput:function(){ec.current=!0}},(void 0===_||_)&&r.createElement(T,{prefixCls:i,upNode:S,downNode:j,upDisabled:eS,downDisabled:eO,onStep:eA}),r.createElement("div",{className:"".concat(et,"-wrap")},r.createElement("input",(0,a.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":s,"aria-valuemax":g,"aria-valuenow":ef.isInvalidate()?null:ef.toString(),step:h},ee,{ref:(0,M.sQ)(en,t),className:et,value:ex,onChange:function(e){eT(e.target.value)},disabled:x,readOnly:Z}))))}),V=r.forwardRef(function(e,t){var n=e.disabled,o=e.style,i=e.prefixCls,c=void 0===i?"rc-input-number":i,l=e.value,s=e.prefix,u=e.suffix,d=e.addonBefore,f=e.addonAfter,p=e.className,g=e.classNames,v=(0,m.Z)(e,z),h=r.useRef(null),b=r.useRef(null),y=r.useRef(null),x=function(e){y.current&&(0,_.nH)(y.current,e)};return r.useImperativeHandle(t,function(){var e,t;return e=y.current,t={focus:x,nativeElement:h.current.nativeElement||b.current},"undefined"!=typeof Proxy&&e?new Proxy(e,{get:function(e,n){if(t[n])return t[n];var r=e[n];return"function"==typeof r?r.bind(e):r}}):e}),r.createElement(j.Q,{className:p,triggerFocus:x,prefixCls:c,value:l,disabled:n,style:o,prefix:s,suffix:u,addonAfter:f,addonBefore:d,classNames:g,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"},ref:h},r.createElement(W,(0,a.Z)({prefixCls:c,disabled:n,ref:y,domRef:b,className:null==g?void 0:g.input},v)))}),q=n(391),X=n(12757),G=n(71744),U=n(18310),$=n(86586),K=n(64024),Y=n(33759),Q=n(39109),J=n(56250),ee=n(77685),et=n(93463),en=n(31282),er=n(37433),eo=n(65265),ea=n(12918),ei=n(17691),ec=n(99320),el=n(71140),es=n(54558);let eu=(e,t)=>{let{componentCls:n,borderRadiusSM:r,borderRadiusLG:o}=e,a="lg"===t?o:r;return{["&-".concat(t)]:{["".concat(n,"-handler-wrap")]:{borderStartEndRadius:a,borderEndEndRadius:a},["".concat(n,"-handler-up")]:{borderStartEndRadius:a},["".concat(n,"-handler-down")]:{borderEndEndRadius:a}}}},ed=e=>{let{componentCls:t,lineWidth:n,lineType:r,borderRadius:o,inputFontSizeSM:a,inputFontSizeLG:i,controlHeightLG:c,controlHeightSM:l,colorError:s,paddingInlineSM:u,paddingBlockSM:d,paddingBlockLG:f,paddingInlineLG:p,colorIcon:m,motionDurationMid:g,handleHoverColor:v,handleOpacity:h,paddingInline:b,paddingBlock:y,handleBg:x,handleActiveBg:w,colorTextDisabled:E,borderRadiusSM:C,borderRadiusLG:Z,controlWidth:S,handleBorderColor:O,filledHandleBg:k,lineHeightLG:j,calc:I}=e;return[{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,ea.Wf)(e)),(0,en.ik)(e)),{display:"inline-block",width:S,margin:0,padding:0,borderRadius:o}),(0,eo.qG)(e,{["".concat(t,"-handler-wrap")]:{background:x,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,et.bf)(n)," ").concat(r," ").concat(O)}}})),(0,eo.H8)(e,{["".concat(t,"-handler-wrap")]:{background:k,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,et.bf)(n)," ").concat(r," ").concat(O)}},"&:focus-within":{["".concat(t,"-handler-wrap")]:{background:x}}})),(0,eo.vc)(e,{["".concat(t,"-handler-wrap")]:{background:x,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,et.bf)(n)," ").concat(r," ").concat(O)}}})),(0,eo.Mu)(e)),{"&-rtl":{direction:"rtl",["".concat(t,"-input")]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:i,lineHeight:j,borderRadius:Z,["input".concat(t,"-input")]:{height:I(c).sub(I(n).mul(2)).equal(),padding:"".concat((0,et.bf)(f)," ").concat((0,et.bf)(p))}},"&-sm":{padding:0,fontSize:a,borderRadius:C,["input".concat(t,"-input")]:{height:I(l).sub(I(n).mul(2)).equal(),padding:"".concat((0,et.bf)(d)," ").concat((0,et.bf)(u))}},"&-out-of-range":{["".concat(t,"-input-wrap")]:{input:{color:s}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,ea.Wf)(e)),(0,en.s7)(e)),{"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",textAlign:"start",verticalAlign:"top",["".concat(t,"-affix-wrapper")]:{width:"100%"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:Z,fontSize:e.fontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:C}}},(0,eo.ir)(e)),(0,eo.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})}),["&-disabled ".concat(t,"-input")]:{cursor:"not-allowed"},[t]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,ea.Wf)(e)),{width:"100%",padding:"".concat((0,et.bf)(y)," ").concat((0,et.bf)(b)),textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:o,outline:0,transition:"all ".concat(g," linear"),appearance:"textfield",fontSize:"inherit"}),(0,en.nz)(e.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,appearance:"none"}})},["&:hover ".concat(t,"-handler-wrap, &-focused ").concat(t,"-handler-wrap")]:{width:e.handleWidth,opacity:1}})},{[t]:Object.assign(Object.assign(Object.assign({["".concat(t,"-handler-wrap")]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:e.handleVisibleWidth,opacity:h,height:"100%",borderStartStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o,borderEndStartRadius:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:"all ".concat(g),overflow:"hidden",["".concat(t,"-handler")]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{marginInlineEnd:0,fontSize:e.handleFontSize}}},["".concat(t,"-handler")]:{height:"50%",overflow:"hidden",color:m,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:"".concat((0,et.bf)(n)," ").concat(r," ").concat(O),transition:"all ".concat(g," linear"),"&:active":{background:w},"&:hover":{height:"60%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{color:v}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,ea.Ro)()),{color:m,transition:"all ".concat(g," linear"),userSelect:"none"})},["".concat(t,"-handler-up")]:{borderStartEndRadius:o},["".concat(t,"-handler-down")]:{borderEndEndRadius:o}},eu(e,"lg")),eu(e,"sm")),{"&-disabled, &-readonly":{["".concat(t,"-handler-wrap")]:{display:"none"},["".concat(t,"-input")]:{color:"inherit"}},["\n ".concat(t,"-handler-up-disabled,\n ").concat(t,"-handler-down-disabled\n ")]:{cursor:"not-allowed"},["\n ".concat(t,"-handler-up-disabled:hover &-handler-up-inner,\n ").concat(t,"-handler-down-disabled:hover &-handler-down-inner\n ")]:{color:E}})}]},ef=e=>{let{componentCls:t,paddingBlock:n,paddingInline:r,inputAffixPadding:o,controlWidth:a,borderRadiusLG:i,borderRadiusSM:c,paddingInlineLG:l,paddingInlineSM:s,paddingBlockLG:u,paddingBlockSM:d,motionDurationMid:f}=e;return{["".concat(t,"-affix-wrapper")]:Object.assign(Object.assign({["input".concat(t,"-input")]:{padding:"".concat((0,et.bf)(n)," 0")}},(0,en.ik)(e)),{position:"relative",display:"inline-flex",alignItems:"center",width:a,padding:0,paddingInlineStart:r,"&-lg":{borderRadius:i,paddingInlineStart:l,["input".concat(t,"-input")]:{padding:"".concat((0,et.bf)(u)," 0")}},"&-sm":{borderRadius:c,paddingInlineStart:s,["input".concat(t,"-input")]:{padding:"".concat((0,et.bf)(d)," 0")}},["&:not(".concat(t,"-disabled):hover")]:{zIndex:1},"&-focused, &:focus":{zIndex:1},["&-disabled > ".concat(t,"-disabled")]:{background:"transparent"},["> div".concat(t)]:{width:"100%",border:"none",outline:"none",["&".concat(t,"-focused")]:{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},["".concat(t,"-handler-wrap")]:{zIndex:2},[t]:{position:"static",color:"inherit","&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:o},"&-suffix":{insetBlockStart:0,insetInlineEnd:0,height:"100%",marginInlineEnd:r,marginInlineStart:o,transition:"margin ".concat(f)}},["&:hover ".concat(t,"-handler-wrap, &-focused ").concat(t,"-handler-wrap")]:{width:e.handleWidth,opacity:1},["&:not(".concat(t,"-affix-wrapper-without-controls):hover ").concat(t,"-suffix")]:{marginInlineEnd:e.calc(e.handleWidth).add(r).equal()}}),["".concat(t,"-underlined")]:{borderRadius:0}}};var ep=(0,ec.I$)("InputNumber",e=>{let t=(0,el.IX)(e,(0,er.e)(e));return[ed(t),ef(t),(0,ei.c)(t)]},e=>{var t;let n=null!==(t=e.handleVisible)&&void 0!==t?t:"auto",r=e.controlHeightSM-2*e.lineWidth;return Object.assign(Object.assign({},(0,er.T)(e)),{controlWidth:90,handleWidth:r,handleFontSize:e.fontSize/2,handleVisible:n,handleActiveBg:e.colorFillAlter,handleBg:e.colorBgContainer,filledHandleBg:new es.t(e.colorFillSecondary).onBackground(e.colorBgContainer).toHexString(),handleHoverColor:e.colorPrimary,handleBorderColor:e.colorBorder,handleOpacity:!0===n?1:0,handleVisibleWidth:!0===n?r:0})},{unitless:{handleOpacity:!0},resetFont:!1}),em=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eg=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:a}=r.useContext(G.E_),i=r.useRef(null);r.useImperativeHandle(t,()=>i.current);let{className:c,rootClassName:s,size:d,disabled:f,prefixCls:p,addonBefore:m,addonAfter:g,prefix:v,suffix:h,bordered:b,readOnly:y,status:x,controls:w,variant:E}=e,C=em(e,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","suffix","bordered","readOnly","status","controls","variant"]),Z=n("input-number",p),S=(0,K.Z)(Z),[O,k,j]=ep(Z,S),{compactSize:I,compactItemClassnames:M}=(0,ee.ri)(Z,a),R=r.createElement(l,{className:"".concat(Z,"-handler-up-inner")}),N=r.createElement(o.Z,{className:"".concat(Z,"-handler-down-inner")});"object"==typeof w&&(R=void 0===w.upIcon?R:r.createElement("span",{className:"".concat(Z,"-handler-up-inner")},w.upIcon),N=void 0===w.downIcon?N:r.createElement("span",{className:"".concat(Z,"-handler-down-inner")},w.downIcon));let{hasFeedback:P,status:F,isFormItemInput:T,feedbackIcon:A}=r.useContext(Q.aM),_=(0,X.F)(F,x),B=(0,Y.Z)(e=>{var t;return null!==(t=null!=d?d:I)&&void 0!==t?t:e}),H=r.useContext($.Z),z=null!=f?f:H,[L,D]=(0,J.Z)("inputNumber",E,b),W=P&&r.createElement(r.Fragment,null,A),U=u()({["".concat(Z,"-lg")]:"large"===B,["".concat(Z,"-sm")]:"small"===B,["".concat(Z,"-rtl")]:"rtl"===a,["".concat(Z,"-in-form-item")]:T},k),et="".concat(Z,"-group");return O(r.createElement(V,Object.assign({ref:i,disabled:z,className:u()(j,S,c,s,M),upHandler:R,downHandler:N,prefixCls:Z,readOnly:y,controls:"boolean"==typeof w?w:void 0,prefix:v,suffix:W||h,addonBefore:m&&r.createElement(q.Z,{form:!0,space:!0},m),addonAfter:g&&r.createElement(q.Z,{form:!0,space:!0},g),classNames:{input:U,variant:u()({["".concat(Z,"-").concat(L)]:D},(0,X.Z)(Z,_,P)),affixWrapper:u()({["".concat(Z,"-affix-wrapper-sm")]:"small"===B,["".concat(Z,"-affix-wrapper-lg")]:"large"===B,["".concat(Z,"-affix-wrapper-rtl")]:"rtl"===a,["".concat(Z,"-affix-wrapper-without-controls")]:!1===w||z||y},k),wrapper:u()({["".concat(et,"-rtl")]:"rtl"===a},k),groupWrapper:u()({["".concat(Z,"-group-wrapper-sm")]:"small"===B,["".concat(Z,"-group-wrapper-lg")]:"large"===B,["".concat(Z,"-group-wrapper-rtl")]:"rtl"===a,["".concat(Z,"-group-wrapper-").concat(L)]:D},(0,X.Z)("".concat(Z,"-group-wrapper"),_,P),k)}},C)))});eg._InternalPanelDoNotUseOrYouWillBeFired=e=>r.createElement(U.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},r.createElement(eg,Object.assign({},e)));var ev=eg},39454:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(2265),o=n(36760),a=n.n(o),i=n(2027),c=n(28791),l=n(391),s=n(94611),u=n(12757),d=n(71744),f=n(86586),p=n(64024),m=n(33759),g=n(39109),v=n(56250),h=n(77685),b=n(39164),y=n(31282),x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},w=(0,r.forwardRef)((e,t)=>{let{prefixCls:n,bordered:o=!0,status:w,size:E,disabled:C,onBlur:Z,onFocus:S,suffix:O,allowClear:k,addonAfter:j,addonBefore:I,className:M,style:R,styles:N,rootClassName:P,onChange:F,classNames:T,variant:A}=e,_=x(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:B,direction:H,allowClear:z,autoComplete:L,className:D,style:W,classNames:V,styles:q}=(0,d.dj)("input"),X=B("input",n),G=(0,r.useRef)(null),U=(0,p.Z)(X),[$,K,Y]=(0,y.TI)(X,P),[Q]=(0,y.ZP)(X,U),{compactSize:J,compactItemClassnames:ee}=(0,h.ri)(X,H),et=(0,m.Z)(e=>{var t;return null!==(t=null!=E?E:J)&&void 0!==t?t:e}),en=r.useContext(f.Z),{status:er,hasFeedback:eo,feedbackIcon:ea}=(0,r.useContext)(g.aM),ei=(0,u.F)(er,w),ec=!!(e.prefix||e.suffix||e.allowClear||e.showCount)||!!eo;(0,r.useRef)(ec);let el=(0,b.Z)(G,!0),es=(eo||O)&&r.createElement(r.Fragment,null,O,eo&&ea),eu=(0,s.Z)(null!=k?k:z),[ed,ef]=(0,v.Z)("input",A,o);return $(Q(r.createElement(i.Z,Object.assign({ref:(0,c.sQ)(t,G),prefixCls:X,autoComplete:L},_,{disabled:null!=C?C:en,onBlur:e=>{el(),null==Z||Z(e)},onFocus:e=>{el(),null==S||S(e)},style:Object.assign(Object.assign({},W),R),styles:Object.assign(Object.assign({},q),N),suffix:es,allowClear:eu,className:a()(M,P,Y,U,ee,D),onChange:e=>{el(),null==F||F(e)},addonBefore:I&&r.createElement(l.Z,{form:!0,space:!0},I),addonAfter:j&&r.createElement(l.Z,{form:!0,space:!0},j),classNames:Object.assign(Object.assign(Object.assign({},T),V),{input:a()({["".concat(X,"-sm")]:"small"===et,["".concat(X,"-lg")]:"large"===et,["".concat(X,"-rtl")]:"rtl"===H},null==T?void 0:T.input,V.input,K),variant:a()({["".concat(X,"-").concat(ed)]:ef},(0,u.Z)(X,ei)),affixWrapper:a()({["".concat(X,"-affix-wrapper-sm")]:"small"===et,["".concat(X,"-affix-wrapper-lg")]:"large"===et,["".concat(X,"-affix-wrapper-rtl")]:"rtl"===H},K),wrapper:a()({["".concat(X,"-group-rtl")]:"rtl"===H},K),groupWrapper:a()({["".concat(X,"-group-wrapper-sm")]:"small"===et,["".concat(X,"-group-wrapper-lg")]:"large"===et,["".concat(X,"-group-wrapper-rtl")]:"rtl"===H,["".concat(X,"-group-wrapper-").concat(ed)]:ef},(0,u.Z)("".concat(X,"-group-wrapper"),ei,eo),K)})}))))})},34766:function(e,t,n){"use strict";n.d(t,{Z:function(){return W}});var r,o=n(2265),a=n(36760),i=n.n(a),c=n(1119),l=n(11993),s=n(31686),u=n(83145),d=n(26365),f=n(6989),p=n(2027),m=n(96032),g=n(55041),v=n(50506),h=n(41154),b=n(31474),y=n(27380),x=n(53346),w=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],E={},C=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Z=o.forwardRef(function(e,t){var n=e.prefixCls,a=e.defaultValue,u=e.value,p=e.autoSize,m=e.onResize,g=e.className,Z=e.style,S=e.disabled,O=e.onChange,k=(e.onInternalAutoSize,(0,f.Z)(e,C)),j=(0,v.Z)(a,{value:u,postState:function(e){return null!=e?e:""}}),I=(0,d.Z)(j,2),M=I[0],R=I[1],N=o.useRef();o.useImperativeHandle(t,function(){return{textArea:N.current}});var P=o.useMemo(function(){return p&&"object"===(0,h.Z)(p)?[p.minRows,p.maxRows]:[]},[p]),F=(0,d.Z)(P,2),T=F[0],A=F[1],_=!!p,B=o.useState(2),H=(0,d.Z)(B,2),z=H[0],L=H[1],D=o.useState(),W=(0,d.Z)(D,2),V=W[0],q=W[1],X=function(){L(0)};(0,y.Z)(function(){_&&X()},[u,T,A,_]),(0,y.Z)(function(){if(0===z)L(1);else if(1===z){var e=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;r||((r=document.createElement("textarea")).setAttribute("tab-index","-1"),r.setAttribute("aria-hidden","true"),r.setAttribute("name","hiddenTextarea"),document.body.appendChild(r)),e.getAttribute("wrap")?r.setAttribute("wrap",e.getAttribute("wrap")):r.removeAttribute("wrap");var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&E[n])return E[n];var r=window.getComputedStyle(e),o=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),a=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),i=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),c={sizingStyle:w.map(function(e){return"".concat(e,":").concat(r.getPropertyValue(e))}).join(";"),paddingSize:a,borderSize:i,boxSizing:o};return t&&n&&(E[n]=c),c}(e,n),c=i.paddingSize,l=i.borderSize,s=i.boxSizing,u=i.sizingStyle;r.setAttribute("style","".concat(u,";").concat("\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n")),r.value=e.value||e.placeholder||"";var d=void 0,f=void 0,p=r.scrollHeight;if("border-box"===s?p+=l:"content-box"===s&&(p-=c),null!==o||null!==a){r.value=" ";var m=r.scrollHeight-c;null!==o&&(d=m*o,"border-box"===s&&(d=d+c+l),p=Math.max(d,p)),null!==a&&(f=m*a,"border-box"===s&&(f=f+c+l),t=p>f?"":"hidden",p=Math.min(f,p))}var g={height:p,overflowY:t,resize:"none"};return d&&(g.minHeight=d),f&&(g.maxHeight=f),g}(N.current,!1,T,A);L(2),q(e)}},[z]);var G=o.useRef(),U=function(){x.Z.cancel(G.current)};o.useEffect(function(){return U},[]);var $=(0,s.Z)((0,s.Z)({},Z),_?V:null);return(0===z||1===z)&&($.overflowY="hidden",$.overflowX="hidden"),o.createElement(b.Z,{onResize:function(e){2===z&&(null==m||m(e),p&&(U(),G.current=(0,x.Z)(function(){X()})))},disabled:!(p||m)},o.createElement("textarea",(0,c.Z)({},k,{ref:N,style:$,className:i()(n,g,(0,l.Z)({},"".concat(n,"-disabled"),S)),disabled:S,value:M,onChange:function(e){R(e.target.value),null==O||O(e)}})))}),S=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],O=o.forwardRef(function(e,t){var n,r,a=e.defaultValue,h=e.value,b=e.onFocus,y=e.onBlur,x=e.onChange,w=e.allowClear,E=e.maxLength,C=e.onCompositionStart,O=e.onCompositionEnd,k=e.suffix,j=e.prefixCls,I=void 0===j?"rc-textarea":j,M=e.showCount,R=e.count,N=e.className,P=e.style,F=e.disabled,T=e.hidden,A=e.classNames,_=e.styles,B=e.onResize,H=e.onClear,z=e.onPressEnter,L=e.readOnly,D=e.autoSize,W=e.onKeyDown,V=(0,f.Z)(e,S),q=(0,v.Z)(a,{value:h,defaultValue:a}),X=(0,d.Z)(q,2),G=X[0],U=X[1],$=null==G?"":String(G),K=o.useState(!1),Y=(0,d.Z)(K,2),Q=Y[0],J=Y[1],ee=o.useRef(!1),et=o.useState(null),en=(0,d.Z)(et,2),er=en[0],eo=en[1],ea=(0,o.useRef)(null),ei=(0,o.useRef)(null),ec=function(){var e;return null===(e=ei.current)||void 0===e?void 0:e.textArea},el=function(){ec().focus()};(0,o.useImperativeHandle)(t,function(){var e;return{resizableTextArea:ei.current,focus:el,blur:function(){ec().blur()},nativeElement:(null===(e=ea.current)||void 0===e?void 0:e.nativeElement)||ec()}}),(0,o.useEffect)(function(){J(function(e){return!F&&e})},[F]);var es=o.useState(null),eu=(0,d.Z)(es,2),ed=eu[0],ef=eu[1];o.useEffect(function(){if(ed){var e;(e=ec()).setSelectionRange.apply(e,(0,u.Z)(ed))}},[ed]);var ep=(0,m.Z)(R,M),em=null!==(n=ep.max)&&void 0!==n?n:E,eg=Number(em)>0,ev=ep.strategy($),eh=!!em&&ev>em,eb=function(e,t){var n=t;!ee.current&&ep.exceedFormatter&&ep.max&&ep.strategy(t)>ep.max&&(n=ep.exceedFormatter(t,{max:ep.max}),t!==n&&ef([ec().selectionStart||0,ec().selectionEnd||0])),U(n),(0,g.rJ)(e.currentTarget,e,x,n)},ey=k;ep.show&&(r=ep.showFormatter?ep.showFormatter({value:$,count:ev,maxLength:em}):"".concat(ev).concat(eg?" / ".concat(em):""),ey=o.createElement(o.Fragment,null,ey,o.createElement("span",{className:i()("".concat(I,"-data-count"),null==A?void 0:A.count),style:null==_?void 0:_.count},r)));var ex=!D&&!M&&!w;return o.createElement(p.Q,{ref:ea,value:$,allowClear:w,handleReset:function(e){U(""),el(),(0,g.rJ)(ec(),e,x)},suffix:ey,prefixCls:I,classNames:(0,s.Z)((0,s.Z)({},A),{},{affixWrapper:i()(null==A?void 0:A.affixWrapper,(0,l.Z)((0,l.Z)({},"".concat(I,"-show-count"),M),"".concat(I,"-textarea-allow-clear"),w))}),disabled:F,focused:Q,className:i()(N,eh&&"".concat(I,"-out-of-range")),style:(0,s.Z)((0,s.Z)({},P),er&&!ex?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof r?r:void 0}},hidden:T,readOnly:L,onClear:H},o.createElement(Z,(0,c.Z)({},V,{autoSize:D,maxLength:E,onKeyDown:function(e){"Enter"===e.key&&z&&z(e),null==W||W(e)},onChange:function(e){eb(e,e.target.value)},onFocus:function(e){J(!0),null==b||b(e)},onBlur:function(e){J(!1),null==y||y(e)},onCompositionStart:function(e){ee.current=!0,null==C||C(e)},onCompositionEnd:function(e){ee.current=!1,eb(e,e.currentTarget.value),null==O||O(e)},className:i()(null==A?void 0:A.textarea),style:(0,s.Z)((0,s.Z)({},null==_?void 0:_.textarea),{},{resize:null==P?void 0:P.resize}),disabled:F,prefixCls:I,onResize:function(e){var t;null==B||B(e),null!==(t=ec())&&void 0!==t&&t.style.height&&eo(!0)},ref:ei,readOnly:L})))}),k=n(94611),j=n(12757),I=n(71744),M=n(86586),R=n(64024),N=n(33759),P=n(39109),F=n(56250),T=n(77685),A=n(31282),_=n(99320),B=n(71140),H=n(37433);let z=e=>{let{componentCls:t,paddingLG:n}=e,r="".concat(t,"-textarea");return{["textarea".concat(t)]:{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:"all ".concat(e.motionDurationSlow),resize:"vertical",["&".concat(t,"-mouse-active")]:{transition:"all ".concat(e.motionDurationSlow,", height 0s, width 0s")}},["".concat(t,"-textarea-affix-wrapper-resize-dirty")]:{width:"auto"},[r]:{position:"relative","&-show-count":{["".concat(t,"-data-count")]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},["\n &-allow-clear > ".concat(t,",\n &-affix-wrapper").concat(r,"-has-feedback ").concat(t,"\n ")]:{paddingInlineEnd:n},["&-affix-wrapper".concat(t,"-affix-wrapper")]:{padding:0,["> textarea".concat(t)]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},["".concat(t,"-suffix")]:{margin:0,"> *:not(:last-child)":{marginInline:0},["".concat(t,"-clear-icon")]:{position:"absolute",insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},["".concat(r,"-suffix")]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},["&-affix-wrapper".concat(t,"-affix-wrapper-rtl")]:{["".concat(t,"-suffix")]:{["".concat(t,"-data-count")]:{direction:"ltr",insetInlineStart:0}}},["&-affix-wrapper".concat(t,"-affix-wrapper-sm")]:{["".concat(t,"-suffix")]:{["".concat(t,"-clear-icon")]:{insetInlineEnd:e.paddingInlineSM}}}}}};var L=(0,_.I$)(["Input","TextArea"],e=>z((0,B.IX)(e,(0,H.e)(e))),H.T,{resetFont:!1}),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 o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},W=(0,o.forwardRef)((e,t)=>{var n;let{prefixCls:r,bordered:a=!0,size:c,disabled:l,status:s,allowClear:u,classNames:d,rootClassName:f,className:p,style:m,styles:v,variant:h,showCount:b,onMouseDown:y,onResize:x}=e,w=D(e,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","style","styles","variant","showCount","onMouseDown","onResize"]),{getPrefixCls:E,direction:C,allowClear:Z,autoComplete:S,className:_,style:B,classNames:H,styles:z}=(0,I.dj)("textArea"),W=o.useContext(M.Z),{status:V,hasFeedback:q,feedbackIcon:X}=o.useContext(P.aM),G=(0,j.F)(V,s),U=o.useRef(null);o.useImperativeHandle(t,()=>{var e;return{resizableTextArea:null===(e=U.current)||void 0===e?void 0:e.resizableTextArea,focus:e=>{var t,n;(0,g.nH)(null===(n=null===(t=U.current)||void 0===t?void 0:t.resizableTextArea)||void 0===n?void 0:n.textArea,e)},blur:()=>{var e;return null===(e=U.current)||void 0===e?void 0:e.blur()}}});let $=E("input",r),K=(0,R.Z)($),[Y,Q,J]=(0,A.TI)($,f),[ee]=L($,K),{compactSize:et,compactItemClassnames:en}=(0,T.ri)($,C),er=(0,N.Z)(e=>{var t;return null!==(t=null!=c?c:et)&&void 0!==t?t:e}),[eo,ea]=(0,F.Z)("textArea",h,a),ei=(0,k.Z)(null!=u?u:Z),[ec,el]=o.useState(!1),[es,eu]=o.useState(!1);return Y(ee(o.createElement(O,Object.assign({autoComplete:S},w,{style:Object.assign(Object.assign({},B),m),styles:Object.assign(Object.assign({},z),v),disabled:null!=l?l:W,allowClear:ei,className:i()(J,K,p,f,en,_,es&&"".concat($,"-textarea-affix-wrapper-resize-dirty")),classNames:Object.assign(Object.assign(Object.assign({},d),H),{textarea:i()({["".concat($,"-sm")]:"small"===er,["".concat($,"-lg")]:"large"===er},Q,null==d?void 0:d.textarea,H.textarea,ec&&"".concat($,"-mouse-active")),variant:i()({["".concat($,"-").concat(eo)]:ea},(0,j.Z)($,G)),affixWrapper:i()("".concat($,"-textarea-affix-wrapper"),{["".concat($,"-affix-wrapper-rtl")]:"rtl"===C,["".concat($,"-affix-wrapper-sm")]:"small"===er,["".concat($,"-affix-wrapper-lg")]:"large"===er,["".concat($,"-textarea-show-count")]:b||(null===(n=e.count)||void 0===n?void 0:n.show)},Q)}),prefixCls:$,suffix:q&&o.createElement("span",{className:"".concat($,"-textarea-suffix")},X),showCount:b,ref:U,onResize:e=>{var t,n;if(null==x||x(e),ec&&"function"==typeof getComputedStyle){let e=null===(n=null===(t=U.current)||void 0===t?void 0:t.nativeElement)||void 0===n?void 0:n.querySelector("textarea");e&&"both"===getComputedStyle(e).resize&&eu(!0)}},onMouseDown:e=>{el(!0),null==y||y(e);let t=()=>{el(!1),document.removeEventListener("mouseup",t)};document.addEventListener("mouseup",t)}}))))})},39164:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);function o(e,t){let n=(0,r.useRef)([]),o=()=>{n.current.push(setTimeout(()=>{var t,n,r,o;(null===(t=e.current)||void 0===t?void 0:t.input)&&(null===(n=e.current)||void 0===n?void 0:n.input.getAttribute("type"))==="password"&&(null===(r=e.current)||void 0===r?void 0:r.input.hasAttribute("value"))&&(null===(o=e.current)||void 0===o||o.input.removeAttribute("value"))}))};return(0,r.useEffect)(()=>(t&&o(),()=>n.current.forEach(e=>{e&&clearTimeout(e)})),[]),o}},4260:function(e,t,n){"use strict";n.d(t,{default:function(){return q}});var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),c=n(39109),l=n(31282),s=n(39454),u=n(83145),d=n(58525),f=n(18242),p=n(12757),m=n(33759),g=n(99320),v=n(71140),h=n(37433);let b=e=>{let{componentCls:t,paddingXS:n}=e;return{[t]:{display:"inline-flex",alignItems:"center",flexWrap:"nowrap",columnGap:n,["".concat(t,"-input-wrapper")]:{position:"relative",["".concat(t,"-mask-icon")]:{position:"absolute",zIndex:"1",top:"50%",right:"50%",transform:"translate(50%, -50%)",pointerEvents:"none"},["".concat(t,"-mask-input")]:{color:"transparent",caretColor:e.colorText},["".concat(t,"-mask-input[type=number]::-webkit-inner-spin-button")]:{"-webkit-appearance":"none",margin:0},["".concat(t,"-mask-input[type=number]")]:{"-moz-appearance":"textfield"}},"&-rtl":{direction:"rtl"},["".concat(t,"-input")]:{textAlign:"center",paddingInline:e.paddingXXS},["&".concat(t,"-sm ").concat(t,"-input")]:{paddingInline:e.calc(e.paddingXXS).div(2).equal()},["&".concat(t,"-lg ").concat(t,"-input")]:{paddingInline:e.paddingXS}}}};var y=(0,g.I$)(["Input","OTP"],e=>b((0,v.IX)(e,(0,h.e)(e))),h.T),x=n(53346),w=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let E=r.forwardRef((e,t)=>{let{className:n,value:o,onChange:c,onActiveChange:l,index:u,mask:d}=e,f=w(e,["className","value","onChange","onActiveChange","index","mask"]),{getPrefixCls:p}=r.useContext(i.E_),m=p("otp"),g="string"==typeof d?d:o,v=r.useRef(null);r.useImperativeHandle(t,()=>v.current);let h=()=>{(0,x.Z)(()=>{var e;let t=null===(e=v.current)||void 0===e?void 0:e.input;document.activeElement===t&&t&&t.select()})};return r.createElement("span",{className:"".concat(m,"-input-wrapper"),role:"presentation"},d&&""!==o&&void 0!==o&&r.createElement("span",{className:"".concat(m,"-mask-icon"),"aria-hidden":"true"},g),r.createElement(s.Z,Object.assign({"aria-label":"OTP Input ".concat(u+1),type:!0===d?"password":"text"},f,{ref:v,value:o,onInput:e=>{c(u,e.target.value)},onFocus:h,onKeyDown:e=>{let{key:t,ctrlKey:n,metaKey:r}=e;"ArrowLeft"===t?l(u-1):"ArrowRight"===t?l(u+1):"z"===t&&(n||r)?e.preventDefault():"Backspace"!==t||o||l(u-1),h()},onMouseDown:h,onMouseUp:h,className:a()(n,{["".concat(m,"-mask-input")]:d})})))});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 o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function Z(e){return(e||"").split("")}let S=e=>{let{index:t,prefixCls:n,separator:o}=e,a="function"==typeof o?o(t):o;return a?r.createElement("span",{className:"".concat(n,"-separator")},a):null},O=r.forwardRef((e,t)=>{let{prefixCls:n,length:o=6,size:l,defaultValue:s,value:g,onChange:v,formatter:h,separator:b,variant:x,disabled:w,status:O,autoFocus:k,mask:j,type:I,onInput:M,inputMode:R}=e,N=C(e,["prefixCls","length","size","defaultValue","value","onChange","formatter","separator","variant","disabled","status","autoFocus","mask","type","onInput","inputMode"]),{getPrefixCls:P,direction:F}=r.useContext(i.E_),T=P("otp",n),A=(0,f.Z)(N,{aria:!0,data:!0,attr:!0}),[_,B,H]=y(T),z=(0,m.Z)(e=>null!=l?l:e),L=r.useContext(c.aM),D=(0,p.F)(L.status,O),W=r.useMemo(()=>Object.assign(Object.assign({},L),{status:D,hasFeedback:!1,feedbackIcon:null}),[L,D]),V=r.useRef(null),q=r.useRef({});r.useImperativeHandle(t,()=>({focus:()=>{var e;null===(e=q.current[0])||void 0===e||e.focus()},blur:()=>{var e;for(let t=0;th?h(e):e,[G,U]=r.useState(()=>Z(X(s||"")));r.useEffect(()=>{void 0!==g&&U(Z(g))},[g]);let $=(0,d.Z)(e=>{U(e),M&&M(e),v&&e.length===o&&e.every(e=>e)&&e.some((e,t)=>G[t]!==e)&&v(e.join(""))}),K=(0,d.Z)((e,t)=>{let n=(0,u.Z)(G);for(let t=0;t=0&&!n[e];e-=1)n.pop();return n=Z(X(n.map(e=>e||" ").join(""))).map((e,t)=>" "!==e||n[t]?e:n[t])}),Y=(e,t)=>{var n;let r=K(e,t),a=Math.min(e+t.length,o-1);a!==e&&void 0!==r[e]&&(null===(n=q.current[a])||void 0===n||n.focus()),$(r)},Q=e=>{var t;null===(t=q.current[e])||void 0===t||t.focus()},J={variant:x,disabled:w,status:D,mask:j,type:I,inputMode:R};return _(r.createElement("div",Object.assign({},A,{ref:V,className:a()(T,{["".concat(T,"-sm")]:"small"===z,["".concat(T,"-lg")]:"large"===z,["".concat(T,"-rtl")]:"rtl"===F},H,B),role:"group"}),r.createElement(c.aM.Provider,{value:W},Array.from({length:o}).map((e,t)=>{let n="otp-".concat(t),a=G[t]||"";return r.createElement(r.Fragment,{key:n},r.createElement(E,Object.assign({ref:e=>{q.current[t]=e},index:t,size:z,htmlSize:1,className:"".concat(T,"-input"),onChange:Y,value:a,onActiveChange:Q,autoFocus:0===t&&k},J)),tt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let F=e=>e?r.createElement(j.Z,null):r.createElement(k.Z,null),T={click:"onClick",hover:"onMouseOver"},A=r.forwardRef((e,t)=>{let{disabled:n,action:o="click",visibilityToggle:c=!0,iconRender:l=F,suffix:u}=e,d=r.useContext(R.Z),f=null!=n?n:d,p="object"==typeof c&&void 0!==c.visible,[m,g]=(0,r.useState)(()=>!!p&&c.visible),v=(0,r.useRef)(null);r.useEffect(()=>{p&&g(c.visible)},[p,c]);let h=(0,N.Z)(v),b=()=>{var e;if(f)return;m&&h();let t=!m;g(t),"object"==typeof c&&(null===(e=c.onVisibleChange)||void 0===e||e.call(c,t))},{className:y,prefixCls:x,inputPrefixCls:w,size:E}=e,C=P(e,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:Z}=r.useContext(i.E_),S=Z("input",w),O=Z("input-password",x),k=c&&(e=>{let t=T[o]||"",n=l(m);return r.cloneElement(r.isValidElement(n)?n:r.createElement("span",null,n),{[t]:b,className:"".concat(e,"-icon"),key:"passwordIcon",onMouseDown:e=>{e.preventDefault()},onMouseUp:e=>{e.preventDefault()}})})(O),j=a()(O,y,{["".concat(O,"-").concat(E)]:!!E}),A=Object.assign(Object.assign({},(0,I.Z)(C,["suffix","iconRender","visibilityToggle"])),{type:m?"text":"password",className:j,prefixCls:S,suffix:r.createElement(r.Fragment,null,k,u)});return E&&(A.size=E),r.createElement(s.Z,Object.assign({ref:(0,M.sQ)(t,v)},A))});var _=n(29436),B=n(19722),H=n(5545),z=n(77685),L=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let D=r.forwardRef((e,t)=>{let n;let{prefixCls:o,inputPrefixCls:c,className:l,size:u,suffix:d,enterButton:f=!1,addonAfter:p,loading:g,disabled:v,onSearch:h,onChange:b,onCompositionStart:y,onCompositionEnd:x,variant:w,onPressEnter:E}=e,C=L(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd","variant","onPressEnter"]),{getPrefixCls:Z,direction:S}=r.useContext(i.E_),O=r.useRef(!1),k=Z("input-search",o),j=Z("input",c),{compactSize:I}=(0,z.ri)(k,S),R=(0,m.Z)(e=>{var t;return null!==(t=null!=u?u:I)&&void 0!==t?t:e}),N=r.useRef(null),P=e=>{var t;document.activeElement===(null===(t=N.current)||void 0===t?void 0:t.input)&&e.preventDefault()},F=e=>{var t,n;h&&h(null===(n=null===(t=N.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e,{source:"input"})},T="boolean"==typeof f?r.createElement(_.Z,null):null,A="".concat(k,"-button"),D=f||{},W=D.type&&!0===D.type.__ANT_BUTTON;n=W||"button"===D.type?(0,B.Tm)(D,Object.assign({onMouseDown:P,onClick:e=>{var t,n;null===(n=null===(t=null==D?void 0:D.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),F(e)},key:"enterButton"},W?{className:A,size:R}:{})):r.createElement(H.ZP,{className:A,color:f?"primary":"default",size:R,disabled:v,key:"enterButton",onMouseDown:P,onClick:F,loading:g,icon:T,variant:"borderless"===w||"filled"===w||"underlined"===w?"text":f?"solid":void 0},f),p&&(n=[n,(0,B.Tm)(p,{key:"addonAfter"})]);let V=a()(k,{["".concat(k,"-rtl")]:"rtl"===S,["".concat(k,"-").concat(R)]:!!R,["".concat(k,"-with-button")]:!!f},l),q=Object.assign(Object.assign({},C),{className:V,prefixCls:j,type:"search",size:R,variant:w,onPressEnter:e=>{O.current||g||(null==E||E(e),F(e))},onCompositionStart:e=>{O.current=!0,null==y||y(e)},onCompositionEnd:e=>{O.current=!1,null==x||x(e)},addonAfter:n,suffix:d,onChange:e=>{(null==e?void 0:e.target)&&"click"===e.type&&h&&h(e.target.value,e,{source:"clear"}),null==b||b(e)},disabled:v});return r.createElement(s.Z,Object.assign({ref:(0,M.sQ)(N,t)},q))});var W=n(34766);let V=s.Z;V.Group=e=>{let{getPrefixCls:t,direction:n}=(0,r.useContext)(i.E_),{prefixCls:o,className:s}=e,u=t("input-group",o),d=t("input"),[f,p,m]=(0,l.ZP)(d),g=a()(u,m,{["".concat(u,"-lg")]:"large"===e.size,["".concat(u,"-sm")]:"small"===e.size,["".concat(u,"-compact")]:e.compact,["".concat(u,"-rtl")]:"rtl"===n},p,s),v=(0,r.useContext)(c.aM),h=(0,r.useMemo)(()=>Object.assign(Object.assign({},v),{isFormItemInput:!1}),[v]);return f(r.createElement("span",{className:g,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},r.createElement(c.aM.Provider,{value:h},e.children)))},V.Search=D,V.TextArea=W.Z,V.Password=A,V.OTP=O;var q=V},31282:function(e,t,n){"use strict";n.d(t,{TI:function(){return w},ik:function(){return p},nz:function(){return u},s7:function(){return m},x0:function(){return f}});var r=n(93463),o=n(12918),a=n(17691),i=n(99320),c=n(71140),l=n(37433),s=n(65265);let u=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),d=e=>{let{paddingBlockLG:t,lineHeightLG:n,borderRadiusLG:o,paddingInlineLG:a}=e;return{padding:"".concat((0,r.bf)(t)," ").concat((0,r.bf)(a)),fontSize:e.inputFontSizeLG,lineHeight:n,borderRadius:o}},f=e=>({padding:"".concat((0,r.bf)(e.paddingBlockSM)," ").concat((0,r.bf)(e.paddingInlineSM)),fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),p=e=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:"".concat((0,r.bf)(e.paddingBlock)," ").concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationMid)},u(e.colorTextPlaceholder)),{"&-lg":Object.assign({},d(e)),"&-sm":Object.assign({},f(e)),"&-rtl, &-textarea-rtl":{direction:"rtl"}}),m=e=>{let{componentCls:t,antCls:n}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},["&-lg ".concat(t,", &-lg > ").concat(t,"-group-addon")]:Object.assign({},d(e)),["&-sm ".concat(t,", &-sm > ").concat(t,"-group-addon")]:Object.assign({},f(e)),["&-lg ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightLG},["&-sm ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightSM},["> ".concat(t)]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},["".concat(t,"-group")]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:"0 ".concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationSlow),lineHeight:1,["".concat(n,"-select")]:{margin:"".concat((0,r.bf)(e.calc(e.paddingBlock).add(1).mul(-1).equal())," ").concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),["&".concat(n,"-select-single:not(").concat(n,"-select-customize-input):not(").concat(n,"-pagination-size-changer)")]:{["".concat(n,"-select-selector")]:{backgroundColor:"inherit",border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),boxShadow:"none"}}},["".concat(n,"-cascader-picker")]:{margin:"-9px ".concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),backgroundColor:"transparent",["".concat(n,"-cascader-input")]:{textAlign:"start",border:0,boxShadow:"none"}}}},[t]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,["".concat(t,"-search-with-button &")]:{zIndex:0}}},["> ".concat(t,":first-child, ").concat(t,"-group-addon:first-child")]:{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,"-affix-wrapper")]:{["&:not(:first-child) ".concat(t)]:{borderStartStartRadius:0,borderEndStartRadius:0},["&:not(:last-child) ".concat(t)]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,":last-child, ").concat(t,"-group-addon:last-child")]:{borderStartStartRadius:0,borderEndStartRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["".concat(t,"-affix-wrapper")]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(t,"-search &")]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},["&:not(:first-child), ".concat(t,"-search &:not(:first-child)")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["&".concat(t,"-group-compact")]:Object.assign(Object.assign({display:"block"},(0,o.dF)()),{["".concat(t,"-group-addon, ").concat(t,"-group-wrap, > ").concat(t)]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover, &:focus":{zIndex:1}}},"& > *":{display:"inline-flex",float:"none",verticalAlign:"top",borderRadius:0},["\n & > ".concat(t,"-affix-wrapper,\n & > ").concat(t,"-number-affix-wrapper,\n & > ").concat(n,"-picker-range\n ")]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},[t]:{float:"none"},["& > ".concat(n,"-select > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete ").concat(t,",\n & > ").concat(n,"-cascader-picker ").concat(t,",\n & > ").concat(t,"-group-wrapper ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover, &:focus":{zIndex:1}},["& > ".concat(n,"-select-focused")]:{zIndex:1},["& > ".concat(n,"-select > ").concat(n,"-select-arrow")]:{zIndex:1},["& > *:first-child,\n & > ".concat(n,"-select:first-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete:first-child ").concat(t,",\n & > ").concat(n,"-cascader-picker:first-child ").concat(t)]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},["& > *:last-child,\n & > ".concat(n,"-select:last-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-cascader-picker:last-child ").concat(t,",\n & > ").concat(n,"-cascader-picker-focused:last-child ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},["& > ".concat(n,"-select-auto-complete ").concat(t)]:{verticalAlign:"top"},["".concat(t,"-group-wrapper + ").concat(t,"-group-wrapper")]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),["".concat(t,"-affix-wrapper")]:{borderRadius:0}},["".concat(t,"-group-wrapper:not(:last-child)")]:{["&".concat(t,"-search > ").concat(t,"-group")]:{["& > ".concat(t,"-group-addon > ").concat(t,"-search-button")]:{borderRadius:0},["& > ".concat(t)]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}})}},g=e=>{let{componentCls:t,controlHeightSM:n,lineWidth:r,calc:a}=e,i=a(n).sub(a(r).mul(2)).sub(16).div(2).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),p(e)),(0,s.qG)(e)),(0,s.H8)(e)),(0,s.Mu)(e)),(0,s.vc)(e)),{'&[type="color"]':{height:e.controlHeight,["&".concat(t,"-lg")]:{height:e.controlHeightLG},["&".concat(t,"-sm")]:{height:n,paddingTop:i,paddingBottom:i}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{appearance:"none"}})}},v=e=>{let{componentCls:t}=e;return{["".concat(t,"-clear-icon")]:{margin:0,padding:0,lineHeight:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),border:"none",outline:"none",backgroundColor:"transparent","&:hover":{color:e.colorIcon},"&:active":{color:e.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:"0 ".concat((0,r.bf)(e.inputAffixPadding))}}}},h=e=>{let{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:o,colorIcon:a,colorIconHover:i,iconCls:c}=e,l="".concat(t,"-affix-wrapper"),s="".concat(t,"-affix-wrapper-disabled");return{[l]:Object.assign(Object.assign(Object.assign(Object.assign({},p(e)),{display:"inline-flex",["&:not(".concat(t,"-disabled):hover")]:{zIndex:1,["".concat(t,"-search-with-button &")]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},["> input".concat(t)]:{padding:0},["> input".concat(t,", > textarea").concat(t)]:{fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[t]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r,direction:"ltr"},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),v(e)),{["".concat(c).concat(t,"-password-icon")]:{color:a,cursor:"pointer",transition:"all ".concat(o),"&:hover":{color:i}}}),["".concat(t,"-underlined")]:{borderRadius:0},[s]:{["".concat(c).concat(t,"-password-icon")]:{color:a,cursor:"not-allowed","&:hover":{color:a}}}}},b=e=>{let{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{["".concat(t,"-group")]:Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),m(e)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:r}}},(0,s.ir)(e)),(0,s.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,"-affix-wrapper")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-item")]:{["".concat(t,"-affix-wrapper")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},y=e=>{let{componentCls:t,antCls:n}=e,r="".concat(t,"-search");return{[r]:{[t]:{"&:not([disabled]):hover, &:not([disabled]):focus":{["+ ".concat(t,"-group-addon ").concat(r,"-button:not(").concat(n,"-btn-color-primary):not(").concat(n,"-btn-variant-text)")]:{borderInlineStartColor:e.colorPrimaryHover}}},["".concat(t,"-affix-wrapper")]:{height:e.controlHeight,borderRadius:0},["".concat(t,"-lg")]:{lineHeight:e.calc(e.lineHeightLG).sub(2e-4).equal()},["> ".concat(t,"-group")]:{["> ".concat(t,"-group-addon:last-child")]:{insetInlineStart:-1,padding:0,border:0,["".concat(r,"-button")]:{marginInlineEnd:-1,borderStartStartRadius:0,borderEndStartRadius:0,boxShadow:"none"},["".concat(r,"-button:not(").concat(n,"-btn-color-primary)")]:{color:e.colorTextDescription,"&:not([disabled]):hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},["&".concat(n,"-btn-loading::before")]:{inset:0}}}},["".concat(r,"-button")]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},"&-large":{["".concat(t,"-affix-wrapper, ").concat(r,"-button")]:{height:e.controlHeightLG}},"&-small":{["".concat(t,"-affix-wrapper, ").concat(r,"-button")]:{height:e.controlHeightSM}},"&-rtl":{direction:"rtl"},["&".concat(t,"-compact-item")]:{["&:not(".concat(t,"-compact-last-item)")]:{["".concat(t,"-group-addon")]:{["".concat(t,"-search-button")]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderRadius:0}}},["&:not(".concat(t,"-compact-first-item)")]:{["".concat(t,",").concat(t,"-affix-wrapper")]:{borderRadius:0}},["> ".concat(t,"-group-addon ").concat(t,"-search-button,\n > ").concat(t,",\n ").concat(t,"-affix-wrapper")]:{"&:hover, &:focus, &:active":{zIndex:2}},["> ".concat(t,"-affix-wrapper-focused")]:{zIndex:2}}}}},x=e=>{let{componentCls:t}=e;return{["".concat(t,"-out-of-range")]:{["&, & input, & textarea, ".concat(t,"-show-count-suffix, ").concat(t,"-data-count")]:{color:e.colorError}}}},w=(0,i.I$)(["Input","Shared"],e=>{let t=(0,c.IX)(e,(0,l.e)(e));return[g(t),h(t)]},l.T,{resetFont:!1});t.ZP=(0,i.I$)(["Input","Component"],e=>{let t=(0,c.IX)(e,(0,l.e)(e));return[b(t),y(t),x(t),(0,a.c)(t)]},l.T,{resetFont:!1})},37433:function(e,t,n){"use strict";n.d(t,{T:function(){return a},e:function(){return o}});var r=n(71140);function o(e){return(0,r.IX)(e,{inputAffixPadding:e.paddingXXS})}let a=e=>{let{controlHeight:t,fontSize:n,lineHeight:r,lineWidth:o,controlHeightSM:a,controlHeightLG:i,fontSizeLG:c,lineHeightLG:l,paddingSM:s,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:f,colorPrimaryHover:p,colorPrimary:m,controlOutlineWidth:g,controlOutline:v,colorErrorOutline:h,colorWarningOutline:b,colorBgContainer:y,inputFontSize:x,inputFontSizeLG:w,inputFontSizeSM:E}=e,C=x||n,Z=E||C,S=w||c;return{paddingBlock:Math.max(Math.round((t-C*r)/2*10)/10-o,0),paddingBlockSM:Math.max(Math.round((a-Z*r)/2*10)/10-o,0),paddingBlockLG:Math.max(Math.ceil((i-S*l)/2*10)/10-o,0),paddingInline:s-o,paddingInlineSM:u-o,paddingInlineLG:d-o,addonBg:f,activeBorderColor:m,hoverBorderColor:p,activeShadow:"0 0 0 ".concat(g,"px ").concat(v),errorActiveShadow:"0 0 0 ".concat(g,"px ").concat(h),warningActiveShadow:"0 0 0 ".concat(g,"px ").concat(b),hoverBg:y,activeBg:y,inputFontSize:C,inputFontSizeLG:S,inputFontSizeSM:Z}}},65265:function(e,t,n){"use strict";n.d(t,{$U:function(){return c},H8:function(){return g},Mu:function(){return f},S5:function(){return h},Xy:function(){return i},ir:function(){return d},qG:function(){return s},vc:function(){return x}});var r=n(93463),o=n(71140);let a=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),i=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":Object.assign({},a((0,o.IX)(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled})))}),c=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),l=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},c(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}}),["&".concat(e.componentCls,"-status-").concat(t.status).concat(e.componentCls,"-disabled")]:{borderColor:t.borderColor}}),s=(e,t)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},c(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),l(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),l(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),u=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),d=e=>({"&-outlined":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.addonBg,border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},u(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText})),u(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group-addon")]:Object.assign({},i(e))}})}),f=(e,t)=>{let{componentCls:n}=e;return{"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},["&".concat(n,"-disabled, &[disabled]")]:{color:e.colorTextDisabled,cursor:"not-allowed"},["&".concat(n,"-status-error")]:{"&, & input, & textarea":{color:e.colorError}},["&".concat(n,"-status-warning")]:{"&, & input, & textarea":{color:e.colorWarning}}},t)}},p=(e,t)=>{var n;return{background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:null!==(n=null==t?void 0:t.inputColor)&&void 0!==n?n:"unset"},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}},m=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},p(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}})}),g=(e,t)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),m(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError})),m(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning})),t)}),v=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{background:t.addonBg,color:t.addonColor}}}),h=e=>({"&-filled":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group-addon")]:{background:e.colorFillTertiary,"&:last-child":{position:"static"}}},v(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText})),v(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:last-child":{borderInlineEnd:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)}}}})}),b=(e,t)=>({background:e.colorBgContainer,borderWidth:"".concat((0,r.bf)(e.lineWidth)," 0"),borderStyle:"".concat(e.lineType," none"),borderColor:"transparent transparent ".concat(t.borderColor," transparent"),borderRadius:0,"&:hover":{borderColor:"transparent transparent ".concat(t.hoverBorderColor," transparent"),backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:"transparent transparent ".concat(t.activeBorderColor," transparent"),outline:0,backgroundColor:e.activeBg}}),y=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},b(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}}),["&".concat(e.componentCls,"-status-").concat(t.status).concat(e.componentCls,"-disabled")]:{borderColor:"transparent transparent ".concat(t.borderColor," transparent")}}),x=(e,t)=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},b(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:{color:e.colorTextDisabled,boxShadow:"none",cursor:"not-allowed","&:hover":{borderColor:"transparent transparent ".concat(e.colorBorder," transparent")}},"input[disabled], textarea[disabled]":{cursor:"not-allowed"}}),y(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),y(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)})},91325:function(e,t,n){"use strict";let r=(0,n(2265).createContext)(void 0);t.Z=r},37381:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(96257),o=n(31686),a=(0,o.Z)((0,o.Z)({},{yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0}),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",week:"Week",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"}),i={placeholder:"Select time",rangePlaceholder:["Start time","End time"]};let c={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},a),timePickerLocale:Object.assign({},i)},l="${label} is not a valid ${type}";var s={locale:"en",Pagination:r.Z,DatePicker:c,TimePicker:i,Calendar:c,global:{placeholder:"Please select",close:"Close"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckAll:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:l,method:l,array:l,object:l,number:l,date:l,boolean:l,integer:l,float:l,regexp:l,email:l,url:l,hex:l},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}}},55274:function(e,t,n){"use strict";var r=n(2265),o=n(91325),a=n(37381);t.Z=(e,t)=>{let n=r.useContext(o.Z);return[r.useMemo(()=>{var r;let o=t||a.Z[e],i=null!==(r=null==n?void 0:n[e])&&void 0!==r?r:{};return Object.assign(Object.assign({},"function"==typeof o?o():o),i||{})},[e,t,n]),r.useMemo(()=>{let e=null==n?void 0:n.locale;return(null==n?void 0:n.exist)&&!e?a.Z.locale:e},[n])]}},42264:function(e,t,n){"use strict";n.d(t,{ZP:function(){return X}});var r=n(83145),o=n(2265),a=n(52402),i=n(71744),c=n(18310),l=n(66061),s=n(8900),u=n(39725),d=n(54537),f=n(55726),p=n(61935),m=n(36760),g=n.n(m),v=n(49283),h=n(64024),b=n(93463),y=n(62236),x=n(12918),w=n(99320),E=n(71140);let C=e=>{let{componentCls:t,iconCls:n,boxShadow:r,colorText:o,colorSuccess:a,colorError:i,colorWarning:c,colorInfo:l,fontSizeLG:s,motionEaseInOutCirc:u,motionDurationSlow:d,marginXS:f,paddingXS:p,borderRadiusLG:m,zIndexPopup:g,contentPadding:v,contentBg:h}=e,y="".concat(t,"-notice"),w=new b.E4("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:p,transform:"translateY(0)",opacity:1}}),E=new b.E4("MessageMoveOut",{"0%":{maxHeight:e.height,padding:p,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),C={padding:p,textAlign:"center",["".concat(t,"-custom-content")]:{display:"flex",alignItems:"center"},["".concat(t,"-custom-content > ").concat(n)]:{marginInlineEnd:f,fontSize:s},["".concat(y,"-content")]:{display:"inline-block",padding:v,background:h,borderRadius:m,boxShadow:r,pointerEvents:"all"},["".concat(t,"-success > ").concat(n)]:{color:a},["".concat(t,"-error > ").concat(n)]:{color:i},["".concat(t,"-warning > ").concat(n)]:{color:c},["".concat(t,"-info > ").concat(n,",\n ").concat(t,"-loading > ").concat(n)]:{color:l}};return[{[t]:Object.assign(Object.assign({},(0,x.Wf)(e)),{color:o,position:"fixed",top:f,width:"100%",pointerEvents:"none",zIndex:g,["".concat(t,"-move-up")]:{animationFillMode:"forwards"},["\n ".concat(t,"-move-up-appear,\n ").concat(t,"-move-up-enter\n ")]:{animationName:w,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},["\n ".concat(t,"-move-up-appear").concat(t,"-move-up-appear-active,\n ").concat(t,"-move-up-enter").concat(t,"-move-up-enter-active\n ")]:{animationPlayState:"running"},["".concat(t,"-move-up-leave")]:{animationName:E,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},["".concat(t,"-move-up-leave").concat(t,"-move-up-leave-active")]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[t]:{["".concat(y,"-wrapper")]:Object.assign({},C)}},{["".concat(t,"-notice-pure-panel")]:Object.assign(Object.assign({},C),{padding:0,textAlign:"start"})}]};var Z=(0,w.I$)("Message",e=>C((0,E.IX)(e,{height:150})),e=>({zIndexPopup:e.zIndexPopupBase+y.u6+10,contentBg:e.colorBgElevated,contentPadding:"".concat((e.controlHeightLG-e.fontSize*e.lineHeight)/2,"px ").concat(e.paddingSM,"px")})),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 o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let O={info:o.createElement(f.Z,null),success:o.createElement(s.Z,null),error:o.createElement(u.Z,null),warning:o.createElement(d.Z,null),loading:o.createElement(p.Z,null)},k=e=>{let{prefixCls:t,type:n,icon:r,children:a}=e;return o.createElement("div",{className:g()("".concat(t,"-custom-content"),"".concat(t,"-").concat(n))},r||O[n],o.createElement("span",null,a))};var j=n(49638),I=n(13613);function M(e){let t;let n=new Promise(n=>{t=e(()=>{n(!0)})}),r=()=>{null==t||t()};return r.then=(e,t)=>n.then(e,t),r.promise=n,r}var R=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let N=e=>{let{children:t,prefixCls:n}=e,r=(0,h.Z)(n),[a,i,c]=Z(n,r);return a(o.createElement(v.JB,{classNames:{list:g()(i,c,r)}},t))},P=(e,t)=>{let{prefixCls:n,key:r}=t;return o.createElement(N,{prefixCls:n,key:r},e)},F=o.forwardRef((e,t)=>{let{top:n,prefixCls:r,getContainer:a,maxCount:c,duration:l=3,rtl:s,transitionName:u,onAllRemoved:d}=e,{getPrefixCls:f,getPopupContainer:p,message:m,direction:h}=o.useContext(i.E_),b=r||f("message"),y=o.createElement("span",{className:"".concat(b,"-close-x")},o.createElement(j.Z,{className:"".concat(b,"-close-icon")})),[x,w]=(0,v.lm)({prefixCls:b,style:()=>({left:"50%",transform:"translateX(-50%)",top:null!=n?n:8}),className:()=>g()({["".concat(b,"-rtl")]:null!=s?s:"rtl"===h}),motion:()=>({motionName:null!=u?u:"".concat(b,"-move-up")}),closable:!1,closeIcon:y,duration:l,getContainer:()=>(null==a?void 0:a())||(null==p?void 0:p())||document.body,maxCount:c,onAllRemoved:d,renderNotifications:P});return o.useImperativeHandle(t,()=>Object.assign(Object.assign({},x),{prefixCls:b,message:m})),w}),T=0;function A(e){let t=o.useRef(null);return(0,I.ln)("Message"),[o.useMemo(()=>{let e=e=>{var n;null===(n=t.current)||void 0===n||n.close(e)},n=n=>{if(!t.current){let e=()=>{};return e.then=()=>{},e}let{open:r,prefixCls:a,message:i}=t.current,c="".concat(a,"-notice"),{content:l,icon:s,type:u,key:d,className:f,style:p,onClose:m}=n,v=R(n,["content","icon","type","key","className","style","onClose"]),h=d;return null==h&&(T+=1,h="antd-message-".concat(T)),M(t=>(r(Object.assign(Object.assign({},v),{key:h,content:o.createElement(k,{prefixCls:a,type:u,icon:s},l),placement:"top",className:g()(u&&"".concat(c,"-").concat(u),f,null==i?void 0:i.className),style:Object.assign(Object.assign({},null==i?void 0:i.style),p),onClose:()=>{null==m||m(),t()}})),()=>{e(h)}))},r={open:n,destroy:n=>{var r;void 0!==n?e(n):null===(r=t.current)||void 0===r||r.destroy()}};return["info","success","warning","error","loading"].forEach(e=>{r[e]=(t,r,o)=>{let a,i,c;return a=t&&"object"==typeof t&&"content"in t?t:{content:t},"function"==typeof r?c=r:(i=r,c=o),n(Object.assign(Object.assign({onClose:c,duration:i},a),{type:e}))}}),r},[]),o.createElement(F,Object.assign({key:"message-holder"},e,{ref:t}))]}let _=null,B=e=>e(),H=[],z={};function L(){let{getContainer:e,duration:t,rtl:n,maxCount:r,top:o}=z,a=(null==e?void 0:e())||document.body;return{getContainer:()=>a,duration:t,rtl:n,maxCount:r,top:o}}let D=o.forwardRef((e,t)=>{let{messageConfig:n,sync:r}=e,{getPrefixCls:c}=(0,o.useContext)(i.E_),l=z.prefixCls||c("message"),s=(0,o.useContext)(a.J),[u,d]=A(Object.assign(Object.assign(Object.assign({},n),{prefixCls:l}),s.message));return o.useImperativeHandle(t,()=>{let e=Object.assign({},u);return Object.keys(e).forEach(t=>{e[t]=function(){for(var e=arguments.length,n=Array(e),o=0;o{let[n,r]=o.useState(L),a=()=>{r(L)};o.useEffect(a,[]);let i=(0,c.w6)(),l=i.getRootPrefixCls(),s=i.getIconPrefixCls(),u=i.getTheme(),d=o.createElement(D,{ref:t,sync:a,messageConfig:n});return o.createElement(c.ZP,{prefixCls:l,iconPrefixCls:s,theme:u},i.holderRender?i.holderRender(d):d)}),V=()=>{if(!_){let e=document.createDocumentFragment(),t={fragment:e};_=t,B(()=>{(0,l.q)()(o.createElement(W,{ref:e=>{let{instance:n,sync:r}=e||{};Promise.resolve().then(()=>{!t.instance&&n&&(t.instance=n,t.sync=r,V())})}}),e)});return}_.instance&&(H.forEach(e=>{let{type:t,skipped:n}=e;if(!n)switch(t){case"open":B(()=>{let t=_.instance.open(Object.assign(Object.assign({},z),e.config));null==t||t.then(e.resolve),e.setCloseFn(t)});break;case"destroy":B(()=>{null==_||_.instance.destroy(e.key)});break;default:B(()=>{var n;let o=(n=_.instance)[t].apply(n,(0,r.Z)(e.args));null==o||o.then(e.resolve),e.setCloseFn(o)})}}),H=[])},q={open:function(e){let t=M(t=>{let n;let r={type:"open",config:e,resolve:t,setCloseFn:e=>{n=e}};return H.push(r),()=>{n?B(()=>{n()}):r.skipped=!0}});return V(),t},destroy:e=>{H.push({type:"destroy",key:e}),V()},config:function(e){z=Object.assign(Object.assign({},z),e),B(()=>{var e;null===(e=null==_?void 0:_.sync)||void 0===e||e.call(_)})},useMessage:function(e){return A(e)},_InternalPanelDoNotUseOrYouWillBeFired:e=>{let{prefixCls:t,className:n,type:r,icon:a,content:c}=e,l=S(e,["prefixCls","className","type","icon","content"]),{getPrefixCls:s}=o.useContext(i.E_),u=t||s("message"),d=(0,h.Z)(u),[f,p,m]=Z(u,d);return f(o.createElement(v.qX,Object.assign({},l,{prefixCls:u,className:g()(n,p,"".concat(u,"-notice-pure-panel"),m,d),eventKey:"pure",duration:null,content:o.createElement(k,{prefixCls:u,type:r,icon:a},c)})))}};["success","info","warning","error","loading"].forEach(e=>{q[e]=function(){for(var t=arguments.length,n=Array(t),r=0;r{let r;let o={type:e,args:t,resolve:n,setCloseFn:e=>{r=e}};return H.push(o),()=>{r?B(()=>{r()}):o.skipped=!0}});return V(),n}(e,n)}});var X=q},92246:function(e,t,n){"use strict";n.d(t,{A:function(){return l},f:function(){return c}});var r=n(37381);let o=Object.assign({},r.Z.Modal),a=[],i=()=>a.reduce((e,t)=>Object.assign(Object.assign({},e),t),r.Z.Modal);function c(e){if(e){let t=Object.assign({},e);return a.push(t),o=i(),()=>{a=a.filter(e=>e!==t),o=i()}}o=Object.assign({},r.Z.Modal)}function l(){return o}},57271:function(e,t,n){"use strict";n.d(t,{ZP:function(){return er}});var r=n(2265),o=n(52402),a=n(71744),i=n(18310),c=n(66061),l=n(8900),s=n(39725),u=n(49638),d=n(54537),f=n(55726),p=n(61935),m=n(36760),g=n.n(m),v=n(49283),h=n(64024),b=n(93463),y=n(62236),x=n(12918),w=n(71140),E=n(99320),C=e=>{let{componentCls:t,notificationMarginEdge:n,animationMaxHeight:r}=e,o="".concat(t,"-notice"),a=new b.E4("antNotificationFadeIn",{"0%":{transform:"translate3d(100%, 0, 0)",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",opacity:1}}),i=new b.E4("antNotificationTopFadeIn",{"0%":{top:-r,opacity:0},"100%":{top:0,opacity:1}}),c=new b.E4("antNotificationBottomFadeIn",{"0%":{bottom:e.calc(r).mul(-1).equal(),opacity:0},"100%":{bottom:0,opacity:1}}),l=new b.E4("antNotificationLeftFadeIn",{"0%":{transform:"translate3d(-100%, 0, 0)",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",opacity:1}});return{[t]:{["&".concat(t,"-top, &").concat(t,"-bottom")]:{marginInline:0,[o]:{marginInline:"auto auto"}},["&".concat(t,"-top")]:{["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationName:i}},["&".concat(t,"-bottom")]:{["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationName:c}},["&".concat(t,"-topRight, &").concat(t,"-bottomRight")]:{["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationName:a}},["&".concat(t,"-topLeft, &").concat(t,"-bottomLeft")]:{marginRight:{value:0,_skip_check_:!0},marginLeft:{value:n,_skip_check_:!0},[o]:{marginInlineEnd:"auto",marginInlineStart:0},["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationName:l}}}}};let Z=["top","topLeft","topRight","bottom","bottomLeft","bottomRight"],S={topLeft:"left",topRight:"right",bottomLeft:"left",bottomRight:"right",top:"left",bottom:"left"},O=(e,t)=>{let{componentCls:n}=e;return{["".concat(n,"-").concat(t)]:{["&".concat(n,"-stack > ").concat(n,"-notice-wrapper")]:{[t.startsWith("top")?"top":"bottom"]:0,[S[t]]:{value:0,_skip_check_:!0}}}}},k=e=>{let t={};for(let n=1;n ".concat(e.componentCls,"-notice")]:{opacity:0,transition:"opacity ".concat(e.motionDurationMid)}};return Object.assign({["&:not(:nth-last-child(-n+".concat(e.notificationStackLayer,"))")]:{opacity:0,overflow:"hidden",color:"transparent",pointerEvents:"none"}},t)},j=e=>{let t={};for(let n=1;n{let{componentCls:t}=e;return Object.assign({["".concat(t,"-stack")]:{["& > ".concat(t,"-notice-wrapper")]:Object.assign({transition:"transform ".concat(e.motionDurationSlow,", backdrop-filter 0s"),willChange:"transform, opacity",position:"absolute"},k(e))},["".concat(t,"-stack:not(").concat(t,"-stack-expanded)")]:{["& > ".concat(t,"-notice-wrapper")]:Object.assign({},j(e))},["".concat(t,"-stack").concat(t,"-stack-expanded")]:{["& > ".concat(t,"-notice-wrapper")]:{"&:not(:nth-last-child(-n + 1))":{opacity:1,overflow:"unset",color:"inherit",pointerEvents:"auto",["& > ".concat(e.componentCls,"-notice")]:{opacity:1}},"&:after":{content:'""',position:"absolute",height:e.margin,width:"100%",insetInline:0,bottom:e.calc(e.margin).mul(-1).equal(),background:"transparent",pointerEvents:"auto"}}}},Z.map(t=>O(e,t)).reduce((e,t)=>Object.assign(Object.assign({},e),t),{}))};let M=e=>{let{iconCls:t,componentCls:n,boxShadow:r,fontSizeLG:o,notificationMarginBottom:a,borderRadiusLG:i,colorSuccess:c,colorInfo:l,colorWarning:s,colorError:u,colorTextHeading:d,notificationBg:f,notificationPadding:p,notificationMarginEdge:m,notificationProgressBg:g,notificationProgressHeight:v,fontSize:h,lineHeight:y,width:w,notificationIconSize:E,colorText:C,colorSuccessBg:Z,colorErrorBg:S,colorInfoBg:O,colorWarningBg:k}=e,j="".concat(n,"-notice");return{position:"relative",marginBottom:a,marginInlineStart:"auto",background:f,borderRadius:i,boxShadow:r,[j]:{padding:p,width:w,maxWidth:"calc(100vw - ".concat((0,b.bf)(e.calc(m).mul(2).equal()),")"),lineHeight:y,wordWrap:"break-word",borderRadius:i,overflow:"hidden","&-success":{background:Z},"&-error":{background:S},"&-info":{background:O},"&-warning":{background:k}},["".concat(j,"-message")]:{color:d,fontSize:o,lineHeight:e.lineHeightLG},["".concat(j,"-description")]:{fontSize:h,color:C,marginTop:e.marginXS},["".concat(j,"-closable ").concat(j,"-message")]:{paddingInlineEnd:e.paddingLG},["".concat(j,"-with-icon ").concat(j,"-message")]:{marginInlineStart:e.calc(e.marginSM).add(E).equal(),fontSize:o},["".concat(j,"-with-icon ").concat(j,"-description")]:{marginInlineStart:e.calc(e.marginSM).add(E).equal(),fontSize:h},["".concat(j,"-icon")]:{position:"absolute",fontSize:E,lineHeight:1,["&-success".concat(t)]:{color:c},["&-info".concat(t)]:{color:l},["&-warning".concat(t)]:{color:s},["&-error".concat(t)]:{color:u}},["".concat(j,"-close")]:Object.assign({position:"absolute",top:e.notificationPaddingVertical,insetInlineEnd:e.notificationPaddingHorizontal,color:e.colorIcon,outline:"none",width:e.notificationCloseButtonSize,height:e.notificationCloseButtonSize,borderRadius:e.borderRadiusSM,transition:"background-color ".concat(e.motionDurationMid,", color ").concat(e.motionDurationMid),display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none","&:hover":{color:e.colorIconHover,backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},(0,x.Qy)(e)),["".concat(j,"-progress")]:{position:"absolute",display:"block",appearance:"none",inlineSize:"calc(100% - ".concat((0,b.bf)(i)," * 2)"),left:{_skip_check_:!0,value:i},right:{_skip_check_:!0,value:i},bottom:0,blockSize:v,border:0,"&, &::-webkit-progress-bar":{borderRadius:i,backgroundColor:"rgba(0, 0, 0, 0.04)"},"&::-moz-progress-bar":{background:g},"&::-webkit-progress-value":{borderRadius:i,background:g}},["".concat(j,"-actions")]:{float:"right",marginTop:e.marginSM}}},R=e=>{let{componentCls:t,notificationMarginBottom:n,notificationMarginEdge:r,motionDurationMid:o,motionEaseInOut:a}=e,i="".concat(t,"-notice"),c=new b.E4("antNotificationFadeOut",{"0%":{maxHeight:e.animationMaxHeight,marginBottom:n},"100%":{maxHeight:0,marginBottom:0,paddingTop:0,paddingBottom:0,opacity:0}});return[{[t]:Object.assign(Object.assign({},(0,x.Wf)(e)),{position:"fixed",zIndex:e.zIndexPopup,marginRight:{value:r,_skip_check_:!0},["".concat(t,"-hook-holder")]:{position:"relative"},["".concat(t,"-fade-appear-prepare")]:{opacity:"0 !important"},["".concat(t,"-fade-enter, ").concat(t,"-fade-appear")]:{animationDuration:e.motionDurationMid,animationTimingFunction:a,animationFillMode:"both",opacity:0,animationPlayState:"paused"},["".concat(t,"-fade-leave")]:{animationTimingFunction:a,animationFillMode:"both",animationDuration:o,animationPlayState:"paused"},["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationPlayState:"running"},["".concat(t,"-fade-leave").concat(t,"-fade-leave-active")]:{animationName:c,animationPlayState:"running"},"&-rtl":{direction:"rtl",["".concat(i,"-actions")]:{float:"left"}}})},{[t]:{["".concat(i,"-wrapper")]:M(e)}}]},N=e=>({zIndexPopup:e.zIndexPopupBase+y.u6+50,width:384,colorSuccessBg:e.colorSuccessBg,colorErrorBg:e.colorErrorBg,colorInfoBg:e.colorInfoBg,colorWarningBg:e.colorWarningBg}),P=e=>{let t=e.paddingMD,n=e.paddingLG;return(0,w.IX)(e,{notificationBg:e.colorBgElevated,notificationPaddingVertical:t,notificationPaddingHorizontal:n,notificationIconSize:e.calc(e.fontSizeLG).mul(e.lineHeightLG).equal(),notificationCloseButtonSize:e.calc(e.controlHeightLG).mul(.55).equal(),notificationMarginBottom:e.margin,notificationPadding:"".concat((0,b.bf)(e.paddingMD)," ").concat((0,b.bf)(e.paddingContentHorizontalLG)),notificationMarginEdge:e.marginLG,animationMaxHeight:150,notificationStackLayer:3,notificationProgressHeight:2,notificationProgressBg:"linear-gradient(90deg, ".concat(e.colorPrimaryBorderHover,", ").concat(e.colorPrimary,")")})};var F=(0,E.I$)("Notification",e=>{let t=P(e);return[R(t),C(t),I(t)]},N),T=(0,E.bk)(["Notification","PurePanel"],e=>{let t="".concat(e.componentCls,"-notice"),n=P(e);return{["".concat(t,"-pure-panel")]:Object.assign(Object.assign({},M(n)),{width:n.width,maxWidth:"calc(100vw - ".concat((0,b.bf)(e.calc(n.notificationMarginEdge).mul(2).equal()),")"),margin:0})}},N),A=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function _(e,t){return null===t||!1===t?null:t||r.createElement(u.Z,{className:"".concat(e,"-close-icon")})}f.Z,l.Z,s.Z,d.Z,p.Z;let B={success:l.Z,info:f.Z,error:s.Z,warning:d.Z},H=e=>{let{prefixCls:t,icon:n,type:o,message:a,description:i,actions:c,role:l="alert"}=e,s=null;return n?s=r.createElement("span",{className:"".concat(t,"-icon")},n):o&&(s=r.createElement(B[o]||null,{className:g()("".concat(t,"-icon"),"".concat(t,"-icon-").concat(o))})),r.createElement("div",{className:g()({["".concat(t,"-with-icon")]:s}),role:l},s,r.createElement("div",{className:"".concat(t,"-message")},a),i&&r.createElement("div",{className:"".concat(t,"-description")},i),c&&r.createElement("div",{className:"".concat(t,"-actions")},c))};var z=n(13613),L=n(84951),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 o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let W=e=>{let{children:t,prefixCls:n}=e,o=(0,h.Z)(n),[a,i,c]=F(n,o);return a(r.createElement(v.JB,{classNames:{list:g()(i,c,o)}},t))},V=(e,t)=>{let{prefixCls:n,key:o}=t;return r.createElement(W,{prefixCls:n,key:o},e)},q=r.forwardRef((e,t)=>{let{top:n,bottom:o,prefixCls:i,getContainer:c,maxCount:l,rtl:s,onAllRemoved:u,stack:d,duration:f,pauseOnHover:p=!0,showProgress:m}=e,{getPrefixCls:h,getPopupContainer:b,notification:y,direction:x}=(0,r.useContext)(a.E_),[,w]=(0,L.ZP)(),E=i||h("notification"),[C,Z]=(0,v.lm)({prefixCls:E,style:e=>(function(e,t,n){let r;switch(e){case"top":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:t,bottom:"auto"};break;case"topLeft":r={left:0,top:t,bottom:"auto"};break;case"topRight":r={right:0,top:t,bottom:"auto"};break;case"bottom":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:n};break;case"bottomLeft":r={left:0,top:"auto",bottom:n};break;default:r={right:0,top:"auto",bottom:n}}return r})(e,null!=n?n:24,null!=o?o:24),className:()=>g()({["".concat(E,"-rtl")]:null!=s?s:"rtl"===x}),motion:()=>({motionName:"".concat(E,"-fade")}),closable:!0,closeIcon:_(E),duration:null!=f?f:4.5,getContainer:()=>(null==c?void 0:c())||(null==b?void 0:b())||document.body,maxCount:l,pauseOnHover:p,showProgress:m,onAllRemoved:u,renderNotifications:V,stack:!1!==d&&{threshold:"object"==typeof d?null==d?void 0:d.threshold:void 0,offset:8,gap:w.margin}});return r.useImperativeHandle(t,()=>Object.assign(Object.assign({},C),{prefixCls:E,notification:y})),Z});function X(e){let t=r.useRef(null);return(0,z.ln)("Notification"),[r.useMemo(()=>{let n=n=>{var o;if(!t.current)return;let{open:a,prefixCls:i,notification:c}=t.current,l="".concat(i,"-notice"),{message:s,description:u,icon:d,type:f,btn:p,actions:m,className:v,style:h,role:b="alert",closeIcon:y,closable:x}=n,w=D(n,["message","description","icon","type","btn","actions","className","style","role","closeIcon","closable"]),E=_(l,void 0!==y?y:void 0!==(null==e?void 0:e.closeIcon)?e.closeIcon:null==c?void 0:c.closeIcon);return a(Object.assign(Object.assign({placement:null!==(o=null==e?void 0:e.placement)&&void 0!==o?o:"topRight"},w),{content:r.createElement(H,{prefixCls:l,icon:d,type:f,message:s,description:u,actions:null!=m?m:p,role:b}),className:g()(f&&"".concat(l,"-").concat(f),v,null==c?void 0:c.className),style:Object.assign(Object.assign({},null==c?void 0:c.style),h),closeIcon:E,closable:null!=x?x:!!E}))},o={open:n,destroy:e=>{var n,r;void 0!==e?null===(n=t.current)||void 0===n||n.close(e):null===(r=t.current)||void 0===r||r.destroy()}};return["success","info","warning","error"].forEach(e=>{o[e]=t=>n(Object.assign(Object.assign({},t),{type:e}))}),o},[]),r.createElement(q,Object.assign({key:"notification-holder"},e,{ref:t}))]}let G=null,U=e=>e(),$=[],K={};function Y(){let{getContainer:e,rtl:t,maxCount:n,top:r,bottom:o,showProgress:a,pauseOnHover:i}=K,c=(null==e?void 0:e())||document.body;return{getContainer:()=>c,rtl:t,maxCount:n,top:r,bottom:o,showProgress:a,pauseOnHover:i}}let Q=r.forwardRef((e,t)=>{let{notificationConfig:n,sync:i}=e,{getPrefixCls:c}=(0,r.useContext)(a.E_),l=K.prefixCls||c("notification"),s=(0,r.useContext)(o.J),[u,d]=X(Object.assign(Object.assign(Object.assign({},n),{prefixCls:l}),s.notification));return r.useEffect(i,[]),r.useImperativeHandle(t,()=>{let e=Object.assign({},u);return Object.keys(e).forEach(t=>{e[t]=function(){for(var e=arguments.length,n=Array(e),r=0;r{let[n,o]=r.useState(Y),a=()=>{o(Y)};r.useEffect(a,[]);let c=(0,i.w6)(),l=c.getRootPrefixCls(),s=c.getIconPrefixCls(),u=c.getTheme(),d=r.createElement(Q,{ref:t,sync:a,notificationConfig:n});return r.createElement(i.ZP,{prefixCls:l,iconPrefixCls:s,theme:u},c.holderRender?c.holderRender(d):d)}),ee=()=>{if(!G){let e=document.createDocumentFragment(),t={fragment:e};G=t,U(()=>{(0,c.q)()(r.createElement(J,{ref:e=>{let{instance:n,sync:r}=e||{};Promise.resolve().then(()=>{!t.instance&&n&&(t.instance=n,t.sync=r,ee())})}}),e)});return}G.instance&&($.forEach(e=>{switch(e.type){case"open":U(()=>{G.instance.open(Object.assign(Object.assign({},K),e.config))});break;case"destroy":U(()=>{var t;null===(t=null==G?void 0:G.instance)||void 0===t||t.destroy(e.key)})}}),$=[])};function et(e){(0,i.w6)(),$.push({type:"open",config:e}),ee()}let en={open:et,destroy:e=>{$.push({type:"destroy",key:e}),ee()},config:function(e){K=Object.assign(Object.assign({},K),e),U(()=>{var e;null===(e=null==G?void 0:G.sync)||void 0===e||e.call(G)})},useNotification:function(e){return X(e)},_InternalPanelDoNotUseOrYouWillBeFired:e=>{let{prefixCls:t,className:n,icon:o,type:i,message:c,description:l,btn:s,actions:u,closable:d=!0,closeIcon:f,className:p}=e,m=A(e,["prefixCls","className","icon","type","message","description","btn","actions","closable","closeIcon","className"]),{getPrefixCls:b}=r.useContext(a.E_),y=t||b("notification"),x="".concat(y,"-notice"),w=(0,h.Z)(y),[E,C,Z]=F(y,w);return E(r.createElement("div",{className:g()("".concat(x,"-pure-panel"),C,n,Z,w)},r.createElement(T,{prefixCls:y}),r.createElement(v.qX,Object.assign({},m,{prefixCls:y,eventKey:"pure",duration:null,closable:d,className:g()({notificationClassName:p}),closeIcon:_(y,f),content:r.createElement(H,{prefixCls:x,icon:o,type:i,message:c,description:l,actions:null!=u?u:s})}))))}};["success","info","warning","error"].forEach(e=>{en[e]=t=>et(Object.assign(Object.assign({},t),{type:e}))});var er=en},37592:function(e,t,n){"use strict";n.d(t,{default:function(){return tf}});var r=n(2265),o=n(36760),a=n.n(o),i=n(1119),c=n(83145),l=n(11993),s=n(31686),u=n(26365),d=n(6989),f=n(41154),p=n(50506),m=n(32559),g=n(27380),v=n(79267),h=n(28791),b=function(e){var t=e.className,n=e.customizeIcon,o=e.customizeIconProps,i=e.children,c=e.onMouseDown,l=e.onClick,s="function"==typeof n?n(o):n;return r.createElement("span",{className:t,onMouseDown:function(e){e.preventDefault(),null==c||c(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:l,"aria-hidden":!0},void 0!==s?s:r.createElement("span",{className:a()(t.split(/\s+/).map(function(e){return"".concat(e,"-icon")}))},i))},y=function(e,t,n,o,a){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],c=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,s=r.useMemo(function(){return"object"===(0,f.Z)(o)?o.clearIcon:a||void 0},[o,a]);return{allowClear:r.useMemo(function(){return!i&&!!o&&(!!n.length||!!c)&&!("combobox"===l&&""===c)},[o,i,n.length,c,l]),clearIcon:r.createElement(b,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:s},"\xd7")}},x=r.createContext(null);function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,t=r.useRef(null),n=r.useRef(null);return r.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]),[function(){return t.current},function(r){(r||null===t.current)&&(t.current=r),window.clearTimeout(n.current),n.current=window.setTimeout(function(){t.current=null},e)}]}var E=n(95814),C=n(18242),Z=n(1699),S=function(e,t,n){var r=(0,s.Z)((0,s.Z)({},e),n?t:{});return Object.keys(t).forEach(function(n){var o=t[n];"function"==typeof o&&(r[n]=function(){for(var t,r=arguments.length,a=Array(r),i=0;ij&&(a="".concat(i.slice(0,j),"..."))}var c=function(t){t&&t.stopPropagation(),_(e)};return"function"==typeof T?eo(r,a,t,o,c):er(e,a,t,o,c)},renderRest:function(e){if(!c.length)return null;var t="function"==typeof F?F(e):F;return"function"==typeof T?eo(void 0,t,!1,!1,void 0,!0):er({title:t},t,!1)},suffix:ea,itemKey:N,maxCount:O});return r.createElement("span",{className:"".concat(ee,"-wrap")},ei,!c.length&&!et&&r.createElement("span",{className:"".concat(ee,"-placeholder")},m))},T=function(e){var t=e.inputElement,n=e.prefixCls,o=e.id,a=e.inputRef,i=e.disabled,c=e.autoFocus,l=e.autoComplete,s=e.activeDescendantId,d=e.mode,f=e.open,p=e.values,m=e.placeholder,g=e.tabIndex,v=e.showSearch,h=e.searchValue,b=e.activeValue,y=e.maxLength,x=e.onInputKeyDown,w=e.onInputMouseDown,E=e.onInputChange,Z=e.onInputPaste,S=e.onInputCompositionStart,O=e.onInputCompositionEnd,j=e.onInputBlur,I=e.title,M=r.useState(!1),N=(0,u.Z)(M,2),P=N[0],F=N[1],T="combobox"===d,A=T||v,_=p[0],B=h||"";T&&b&&!P&&(B=b),r.useEffect(function(){T&&F(!1)},[T,b]);var H=("combobox"===d||!!f||!!v)&&!!B,z=void 0===I?R(_):I,L=r.useMemo(function(){return _?null:r.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:H?{visibility:"hidden"}:void 0},m)},[_,H,m,n]);return r.createElement("span",{className:"".concat(n,"-selection-wrap")},r.createElement("span",{className:"".concat(n,"-selection-search")},r.createElement(k,{ref:a,prefixCls:n,id:o,open:f,inputElement:t,disabled:i,autoFocus:c,autoComplete:l,editable:A,activeDescendantId:s,value:B,onKeyDown:x,onMouseDown:w,onChange:function(e){F(!0),E(e)},onPaste:Z,onCompositionStart:S,onCompositionEnd:O,onBlur:j,tabIndex:g,attrs:(0,C.Z)(e,!0),maxLength:T?y:void 0})),!T&&_?r.createElement("span",{className:"".concat(n,"-selection-item"),title:z,style:H?{visibility:"hidden"}:void 0},_.label):null,L)},A=r.forwardRef(function(e,t){var n=(0,r.useRef)(null),o=(0,r.useRef)(!1),a=e.prefixCls,c=e.open,l=e.mode,s=e.showSearch,d=e.tokenWithEnter,f=e.disabled,p=e.prefix,m=e.autoClearSearchValue,g=e.onSearch,v=e.onSearchSubmit,h=e.onToggleOpen,b=e.onInputKeyDown,y=e.onInputBlur,x=e.domRef;r.useImperativeHandle(t,function(){return{focus:function(e){n.current.focus(e)},blur:function(){n.current.blur()}}});var C=w(0),Z=(0,u.Z)(C,2),S=Z[0],O=Z[1],k=(0,r.useRef)(null),j=function(e){!1!==g(e,!0,o.current)&&h(!0)},I={inputRef:n,onInputKeyDown:function(e){var t=e.which,r=n.current instanceof HTMLTextAreaElement;!r&&c&&(t===E.Z.UP||t===E.Z.DOWN)&&e.preventDefault(),b&&b(e),t!==E.Z.ENTER||"tags"!==l||o.current||c||null==v||v(e.target.value),r&&!c&&~[E.Z.UP,E.Z.DOWN,E.Z.LEFT,E.Z.RIGHT].indexOf(t)||!t||[E.Z.ESC,E.Z.SHIFT,E.Z.BACKSPACE,E.Z.TAB,E.Z.WIN_KEY,E.Z.ALT,E.Z.META,E.Z.WIN_KEY_RIGHT,E.Z.CTRL,E.Z.SEMICOLON,E.Z.EQUALS,E.Z.CAPS_LOCK,E.Z.CONTEXT_MENU,E.Z.F1,E.Z.F2,E.Z.F3,E.Z.F4,E.Z.F5,E.Z.F6,E.Z.F7,E.Z.F8,E.Z.F9,E.Z.F10,E.Z.F11,E.Z.F12].includes(t)||h(!0)},onInputMouseDown:function(){O(!0)},onInputChange:function(e){var t=e.target.value;if(d&&k.current&&/[\r\n]/.test(k.current)){var n=k.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,k.current)}k.current=null,j(t)},onInputPaste:function(e){var t=e.clipboardData,n=null==t?void 0:t.getData("text");k.current=n||""},onInputCompositionStart:function(){o.current=!0},onInputCompositionEnd:function(e){o.current=!1,"combobox"!==l&&j(e.target.value)},onInputBlur:y},M="multiple"===l||"tags"===l?r.createElement(F,(0,i.Z)({},e,I)):r.createElement(T,(0,i.Z)({},e,I));return r.createElement("div",{ref:x,className:"".concat(a,"-selector"),onClick:function(e){e.target!==n.current&&(void 0!==document.body.style.msTouchAction?setTimeout(function(){n.current.focus()}):n.current.focus())},onMouseDown:function(e){var t=S();e.target===n.current||t||"combobox"===l&&f||e.preventDefault(),("combobox"===l||s&&t)&&c||(c&&!1!==m&&g("",!0,!1),h())}},p&&r.createElement("div",{className:"".concat(a,"-prefix")},p),M)}),_=n(97821),B=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],H=function(e){var t=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"}}},z=r.forwardRef(function(e,t){var n=e.prefixCls,o=(e.disabled,e.visible),c=e.children,u=e.popupElement,f=e.animation,p=e.transitionName,m=e.dropdownStyle,g=e.dropdownClassName,v=e.direction,h=e.placement,b=e.builtinPlacements,y=e.dropdownMatchSelectWidth,x=e.dropdownRender,w=e.dropdownAlign,E=e.getPopupContainer,C=e.empty,Z=e.getTriggerDOMNode,S=e.onPopupVisibleChange,O=e.onPopupMouseEnter,k=(0,d.Z)(e,B),j="".concat(n,"-dropdown"),I=u;x&&(I=x(u));var M=r.useMemo(function(){return b||H(y)},[b,y]),R=f?"".concat(j,"-").concat(f):p,N="number"==typeof y,P=r.useMemo(function(){return N?null:!1===y?"minWidth":"width"},[y,N]),F=m;N&&(F=(0,s.Z)((0,s.Z)({},F),{},{width:y}));var T=r.useRef(null);return r.useImperativeHandle(t,function(){return{getPopupElement:function(){var e;return null===(e=T.current)||void 0===e?void 0:e.popupElement}}}),r.createElement(_.Z,(0,i.Z)({},k,{showAction:S?["click"]:[],hideAction:S?["click"]:[],popupPlacement:h||("rtl"===(void 0===v?"ltr":v)?"bottomRight":"bottomLeft"),builtinPlacements:M,prefixCls:j,popupTransitionName:R,popup:r.createElement("div",{onMouseEnter:O},I),ref:T,stretch:P,popupAlign:w,popupVisible:o,getPopupContainer:E,popupClassName:a()(g,(0,l.Z)({},"".concat(j,"-empty"),C)),popupStyle:F,getTriggerDOMNode:Z,onPopupVisibleChange:S}),c)}),L=n(87099);function D(e,t){var n,r=e.key;return("value"in e&&(n=e.value),null!=r)?r:void 0!==n?n:"rc-index-key-".concat(t)}function W(e){return void 0!==e&&!Number.isNaN(e)}function V(e,t){var n=e||{},r=n.label,o=n.value,a=n.options,i=n.groupLabel,c=r||(t?"children":"label");return{label:c,value:o||"value",options:a||"options",groupLabel:i||c}}function q(e){var t=(0,s.Z)({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return(0,m.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var X=function(e,t,n){if(!t||!t.length)return null;var r=!1,o=function e(t,n){var o=(0,L.Z)(n),a=o[0],i=o.slice(1);if(!a)return[t];var l=t.split(a);return r=r||l.length>1,l.reduce(function(t,n){return[].concat((0,c.Z)(t),(0,c.Z)(e(n,i)))},[]).filter(Boolean)}(e,t);return r?void 0!==n?o.slice(0,n):o:null},G=r.createContext(null);function U(e){var t=e.visible,n=e.values;return t?r.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(n.slice(0,50).map(function(e){var t=e.label,n=e.value;return["number","string"].includes((0,f.Z)(t))?t:n}).join(", ")),n.length>50?", ...":null):null}var $=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],K=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],Y=function(e){return"tags"===e||"multiple"===e},Q=r.forwardRef(function(e,t){var n,o,f,m,E,C,Z,S=e.id,O=e.prefixCls,k=e.className,j=e.showSearch,I=e.tagRender,M=e.direction,R=e.omitDomProps,N=e.displayValues,P=e.onDisplayValuesChange,F=e.emptyOptions,T=e.notFoundContent,_=void 0===T?"Not Found":T,B=e.onClear,H=e.mode,L=e.disabled,D=e.loading,V=e.getInputElement,q=e.getRawInputElement,Q=e.open,J=e.defaultOpen,ee=e.onDropdownVisibleChange,et=e.activeValue,en=e.onActiveValueChange,er=e.activeDescendantId,eo=e.searchValue,ea=e.autoClearSearchValue,ei=e.onSearch,ec=e.onSearchSplit,el=e.tokenSeparators,es=e.allowClear,eu=e.prefix,ed=e.suffixIcon,ef=e.clearIcon,ep=e.OptionList,em=e.animation,eg=e.transitionName,ev=e.dropdownStyle,eh=e.dropdownClassName,eb=e.dropdownMatchSelectWidth,ey=e.dropdownRender,ex=e.dropdownAlign,ew=e.placement,eE=e.builtinPlacements,eC=e.getPopupContainer,eZ=e.showAction,eS=void 0===eZ?[]:eZ,eO=e.onFocus,ek=e.onBlur,ej=e.onKeyUp,eI=e.onKeyDown,eM=e.onMouseDown,eR=(0,d.Z)(e,$),eN=Y(H),eP=(void 0!==j?j:eN)||"combobox"===H,eF=(0,s.Z)({},eR);K.forEach(function(e){delete eF[e]}),null==R||R.forEach(function(e){delete eF[e]});var eT=r.useState(!1),eA=(0,u.Z)(eT,2),e_=eA[0],eB=eA[1];r.useEffect(function(){eB((0,v.Z)())},[]);var eH=r.useRef(null),ez=r.useRef(null),eL=r.useRef(null),eD=r.useRef(null),eW=r.useRef(null),eV=r.useRef(!1),eq=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=r.useState(!1),n=(0,u.Z)(t,2),o=n[0],a=n[1],i=r.useRef(null),c=function(){window.clearTimeout(i.current)};return r.useEffect(function(){return c},[]),[o,function(t,n){c(),i.current=window.setTimeout(function(){a(t),n&&n()},e)},c]}(),eX=(0,u.Z)(eq,3),eG=eX[0],eU=eX[1],e$=eX[2];r.useImperativeHandle(t,function(){var e,t;return{focus:null===(e=eD.current)||void 0===e?void 0:e.focus,blur:null===(t=eD.current)||void 0===t?void 0:t.blur,scrollTo:function(e){var t;return null===(t=eW.current)||void 0===t?void 0:t.scrollTo(e)},nativeElement:eH.current||ez.current}});var eK=r.useMemo(function(){if("combobox"!==H)return eo;var e,t=null===(e=N[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""},[eo,H,N]),eY="combobox"===H&&"function"==typeof V&&V()||null,eQ="function"==typeof q&&q(),eJ=(0,h.x1)(ez,null==eQ||null===(m=eQ.props)||void 0===m?void 0:m.ref),e0=r.useState(!1),e1=(0,u.Z)(e0,2),e2=e1[0],e6=e1[1];(0,g.Z)(function(){e6(!0)},[]);var e5=(0,p.Z)(!1,{defaultValue:J,value:Q}),e4=(0,u.Z)(e5,2),e3=e4[0],e7=e4[1],e9=!!e2&&e3,e8=!_&&F;(L||e8&&e9&&"combobox"===H)&&(e9=!1);var te=!e8&&e9,tt=r.useCallback(function(e){var t=void 0!==e?e:!e9;L||(e7(t),e9!==t&&(null==ee||ee(t)))},[L,e9,e7,ee]),tn=r.useMemo(function(){return(el||[]).some(function(e){return["\n","\r\n"].includes(e)})},[el]),tr=r.useContext(G)||{},to=tr.maxCount,ta=tr.rawValues,ti=function(e,t,n){if(!(eN&&W(to))||!((null==ta?void 0:ta.size)>=to)){var r=!0,o=e;null==en||en(null);var a=X(e,el,W(to)?to-ta.size:void 0),i=n?null:a;return"combobox"!==H&&i&&(o="",null==ec||ec(i),tt(!1),r=!1),ei&&eK!==o&&ei(o,{source:t?"typing":"effect"}),r}};r.useEffect(function(){e9||eN||"combobox"===H||ti("",!1,!1)},[e9]),r.useEffect(function(){e3&&L&&e7(!1),L&&!eV.current&&eU(!1)},[L]);var tc=w(),tl=(0,u.Z)(tc,2),ts=tl[0],tu=tl[1],td=r.useRef(!1),tf=r.useRef(!1),tp=[];r.useEffect(function(){return function(){tp.forEach(function(e){return clearTimeout(e)}),tp.splice(0,tp.length)}},[]);var tm=r.useState({}),tg=(0,u.Z)(tm,2)[1];eQ&&(E=function(e){tt(e)}),n=function(){var e;return[eH.current,null===(e=eL.current)||void 0===e?void 0:e.getPopupElement()]},o=!!eQ,(f=r.useRef(null)).current={open:te,triggerOpen:tt,customizedTrigger:o},r.useEffect(function(){function e(e){if(null===(t=f.current)||void 0===t||!t.customizedTrigger){var t,r=e.target;r.shadowRoot&&e.composed&&(r=e.composedPath()[0]||r),f.current.open&&n().filter(function(e){return e}).every(function(e){return!e.contains(r)&&e!==r})&&f.current.triggerOpen(!1)}}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}},[]);var tv=r.useMemo(function(){return(0,s.Z)((0,s.Z)({},e),{},{notFoundContent:_,open:e9,triggerOpen:te,id:S,showSearch:eP,multiple:eN,toggleOpen:tt})},[e,_,te,e9,S,eP,eN,tt]),th=!!ed||D;th&&(C=r.createElement(b,{className:a()("".concat(O,"-arrow"),(0,l.Z)({},"".concat(O,"-arrow-loading"),D)),customizeIcon:ed,customizeIconProps:{loading:D,searchValue:eK,open:e9,focused:eG,showSearch:eP}}));var tb=y(O,function(){var e;null==B||B(),null===(e=eD.current)||void 0===e||e.focus(),P([],{type:"clear",values:N}),ti("",!1,!1)},N,es,ef,L,eK,H),ty=tb.allowClear,tx=tb.clearIcon,tw=r.createElement(ep,{ref:eW}),tE=a()(O,k,(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},"".concat(O,"-focused"),eG),"".concat(O,"-multiple"),eN),"".concat(O,"-single"),!eN),"".concat(O,"-allow-clear"),es),"".concat(O,"-show-arrow"),th),"".concat(O,"-disabled"),L),"".concat(O,"-loading"),D),"".concat(O,"-open"),e9),"".concat(O,"-customize-input"),eY),"".concat(O,"-show-search"),eP)),tC=r.createElement(z,{ref:eL,disabled:L,prefixCls:O,visible:te,popupElement:tw,animation:em,transitionName:eg,dropdownStyle:ev,dropdownClassName:eh,direction:M,dropdownMatchSelectWidth:eb,dropdownRender:ey,dropdownAlign:ex,placement:ew,builtinPlacements:eE,getPopupContainer:eC,empty:F,getTriggerDOMNode:function(e){return ez.current||e},onPopupVisibleChange:E,onPopupMouseEnter:function(){tg({})}},eQ?r.cloneElement(eQ,{ref:eJ}):r.createElement(A,(0,i.Z)({},e,{domRef:ez,prefixCls:O,inputElement:eY,ref:eD,id:S,prefix:eu,showSearch:eP,autoClearSearchValue:ea,mode:H,activeDescendantId:er,tagRender:I,values:N,open:e9,onToggleOpen:tt,activeValue:et,searchValue:eK,onSearch:ti,onSearchSubmit:function(e){e&&e.trim()&&ei(e,{source:"submit"})},onRemove:function(e){P(N.filter(function(t){return t!==e}),{type:"remove",values:[e]})},tokenWithEnter:tn,onInputBlur:function(){td.current=!1}})));return Z=eQ?tC:r.createElement("div",(0,i.Z)({className:tE},eF,{ref:eH,onMouseDown:function(e){var t,n=e.target,r=null===(t=eL.current)||void 0===t?void 0:t.getPopupElement();if(r&&r.contains(n)){var o=setTimeout(function(){var e,t=tp.indexOf(o);-1!==t&&tp.splice(t,1),e$(),e_||r.contains(document.activeElement)||null===(e=eD.current)||void 0===e||e.focus()});tp.push(o)}for(var a=arguments.length,i=Array(a>1?a-1:0),c=1;c=0;l-=1){var s=a[l];if(!s.disabled){a.splice(l,1),i=s;break}}i&&P(a,{type:"remove",values:[i]})}for(var u=arguments.length,d=Array(u>1?u-1:0),f=1;f1?n-1:0),o=1;o=Z},[p,Z,null==M?void 0:M.size]),L=function(e){e.preventDefault()},D=function(e){var t;null===(t=H.current)||void 0===t||t.scrollTo("number"==typeof e?{index:e}:e)},V=r.useCallback(function(e){return"combobox"!==m&&M.has(e)},[m,(0,c.Z)(M).toString(),M.size]),q=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=B.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];K(e);var n={source:t?"keyboard":"mouse"},r=B[e];if(!r){O(null,-1,n);return}O(r.value,e,n)};(0,r.useEffect)(function(){Y(!1!==k?q(0):-1)},[B.length,g]);var Q=r.useCallback(function(e){return"combobox"===m?String(e).toLowerCase()===g.toLowerCase():M.has(e)},[m,g,(0,c.Z)(M).toString(),M.size]);(0,r.useEffect)(function(){var e,t=setTimeout(function(){if(!p&&f&&1===M.size){var e=Array.from(M)[0],t=B.findIndex(function(t){var n=t.data;return g?String(n.value).startsWith(g):n.value===e});-1!==t&&(Y(t),D(t))}});return f&&(null===(e=H.current)||void 0===e||e.scrollTo(void 0)),function(){return clearTimeout(t)}},[f,g]);var J=function(e){void 0!==e&&j(e,{selected:!M.has(e)}),p||v(!1)};if(r.useImperativeHandle(t,function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case E.Z.N:case E.Z.P:case E.Z.UP:case E.Z.DOWN:var r=0;if(t===E.Z.UP?r=-1:t===E.Z.DOWN?r=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===E.Z.N?r=1:t===E.Z.P&&(r=-1)),0!==r){var o=q($+r,r);D(o),Y(o,!0)}break;case E.Z.TAB:case E.Z.ENTER:var a,i=B[$];!i||null!=i&&null!==(a=i.data)&&void 0!==a&&a.disabled||z?J(void 0):J(i.value),f&&e.preventDefault();break;case E.Z.ESC:v(!1),f&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){D(e)}}}),0===B.length)return r.createElement("div",{role:"listbox",id:"".concat(s,"_list"),className:"".concat(_,"-empty"),onMouseDown:L},h);var ee=Object.keys(R).map(function(e){return R[e]}),ei=function(e){return e.label};function ec(e,t){return{role:e.group?"presentation":"option",id:"".concat(s,"_list_").concat(t)}}var el=function(e){var t=B[e];if(!t)return null;var n=t.data||{},o=n.value,a=t.group,c=(0,C.Z)(n,!0),l=ei(t);return t?r.createElement("div",(0,i.Z)({"aria-label":"string"!=typeof l||a?null:l},c,{key:e},ec(t,e),{"aria-selected":Q(o)}),o):null},es={role:"listbox",id:"".concat(s,"_list")};return r.createElement(r.Fragment,null,N&&r.createElement("div",(0,i.Z)({},es,{style:{height:0,width:0,overflow:"hidden"}}),el($-1),el($),el($+1)),r.createElement(er.Z,{itemKey:"key",ref:H,data:B,height:F,itemHeight:T,fullHeight:!1,onMouseDown:L,onScroll:y,virtual:N,direction:P,innerProps:N?null:es},function(e,t){var n=e.group,o=e.groupOption,c=e.data,s=e.label,u=e.value,f=c.key;if(n){var p,m=null!==(p=c.title)&&void 0!==p?p:ea(s)?s.toString():void 0;return r.createElement("div",{className:a()(_,"".concat(_,"-group"),c.className),title:m},void 0!==s?s:f)}var g=c.disabled,v=c.title,h=(c.children,c.style),y=c.className,x=(0,d.Z)(c,eo),w=(0,en.Z)(x,ee),E=V(u),Z=g||!E&&z,S="".concat(_,"-option"),O=a()(_,S,y,(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},"".concat(S,"-grouped"),o),"".concat(S,"-active"),$===t&&!Z),"".concat(S,"-disabled"),Z),"".concat(S,"-selected"),E)),k=ei(e),j=!I||"function"==typeof I||E,M="number"==typeof k?k:k||u,R=ea(M)?M.toString():void 0;return void 0!==v&&(R=v),r.createElement("div",(0,i.Z)({},(0,C.Z)(w),N?{}:ec(e,t),{"aria-selected":Q(u),className:O,title:R,onMouseMove:function(){$===t||Z||Y(t)},onClick:function(){Z||J(u)},style:h}),r.createElement("div",{className:"".concat(S,"-content")},"function"==typeof A?A(e,{index:t}):M),r.isValidElement(I)||E,j&&r.createElement(b,{className:"".concat(_,"-option-state"),customizeIcon:I,customizeIconProps:{value:u,disabled:Z,isSelected:E}},E?"✓":null))}))}),ec=function(e,t){var n=r.useRef({values:new Map,options:new Map});return[r.useMemo(function(){var r=n.current,o=r.values,a=r.options,i=e.map(function(e){if(void 0===e.label){var t;return(0,s.Z)((0,s.Z)({},e),{},{label:null===(t=o.get(e.value))||void 0===t?void 0:t.label})}return e}),c=new Map,l=new Map;return i.forEach(function(e){c.set(e.value,e),l.set(e.value,t.get(e.value)||a.get(e.value))}),n.current.values=c,n.current.options=l,i},[e,t]),r.useCallback(function(e){return t.get(e)||n.current.options.get(e)},[t])]};function el(e,t){return j(e).join("").toUpperCase().includes(t)}var es=n(94981),eu=0,ed=(0,es.Z)(),ef=n(45287),ep=["children","value"],em=["children"];function eg(e){var t=r.useRef();return t.current=e,r.useCallback(function(){return t.current.apply(t,arguments)},[])}var ev=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],eh=["inputValue"],eb=r.forwardRef(function(e,t){var n,o,a,m,g,v=e.id,h=e.mode,b=e.prefixCls,y=e.backfill,x=e.fieldNames,w=e.inputValue,E=e.searchValue,C=e.onSearch,Z=e.autoClearSearchValue,S=void 0===Z||Z,O=e.onSelect,k=e.onDeselect,I=e.dropdownMatchSelectWidth,M=void 0===I||I,R=e.filterOption,N=e.filterSort,P=e.optionFilterProp,F=e.optionLabelProp,T=e.options,A=e.optionRender,_=e.children,B=e.defaultActiveFirstOption,H=e.menuItemSelectedIcon,z=e.virtual,L=e.direction,W=e.listHeight,X=void 0===W?200:W,U=e.listItemHeight,$=void 0===U?20:U,K=e.labelRender,J=e.value,ee=e.defaultValue,et=e.labelInValue,en=e.onChange,er=e.maxCount,eo=(0,d.Z)(e,ev),ea=(n=r.useState(),a=(o=(0,u.Z)(n,2))[0],m=o[1],r.useEffect(function(){var e;m("rc_select_".concat((ed?(e=eu,eu+=1):e="TEST_OR_SSR",e)))},[]),v||a),es=Y(h),eb=!!(!T&&_),ey=r.useMemo(function(){return(void 0!==R||"combobox"!==h)&&R},[R,h]),ex=r.useMemo(function(){return V(x,eb)},[JSON.stringify(x),eb]),ew=(0,p.Z)("",{value:void 0!==E?E:w,postState:function(e){return e||""}}),eE=(0,u.Z)(ew,2),eC=eE[0],eZ=eE[1],eS=r.useMemo(function(){var e=T;T||(e=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,ef.Z)(t).map(function(t,o){if(!r.isValidElement(t)||!t.type)return null;var a,i,c,l,u,f=t.type.isSelectOptGroup,p=t.key,m=t.props,g=m.children,v=(0,d.Z)(m,em);return n||!f?(a=t.key,c=(i=t.props).children,l=i.value,u=(0,d.Z)(i,ep),(0,s.Z)({key:a,value:void 0!==l?l:a,children:c},u)):(0,s.Z)((0,s.Z)({key:"__RC_SELECT_GRP__".concat(null===p?o:p,"__"),label:p},v),{},{options:e(g)})}).filter(function(e){return e})}(_));var t=new Map,n=new Map,o=function(e,t,n){n&&"string"==typeof n&&e.set(t[n],t)};return function e(r){for(var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=0;i0?e(t.options):t.options}):t})}(eD):eD},[eD,N,eC]),eV=r.useMemo(function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,o=[],a=V(n,!1),i=a.label,c=a.value,l=a.options,s=a.groupLabel;return!function e(t,n){Array.isArray(t)&&t.forEach(function(t){if(!n&&l in t){var a=t[s];void 0===a&&r&&(a=t.label),o.push({key:D(t,o.length),group:!0,data:t,label:a}),e(t[l],!0)}else{var u=t[c];o.push({key:D(t,o.length),groupOption:n,data:t,label:t[i],value:u})}})}(e,!1),o}(eW,{fieldNames:ex,childrenAsData:eb})},[eW,ex,eb]),eq=function(e){var t=eI(e);if(eP(t),en&&(t.length!==eA.length||t.some(function(e,t){var n;return(null===(n=eA[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)}))){var n=et?t:t.map(function(e){return e.value}),r=t.map(function(e){return q(e_(e.value))});en(es?n:n[0],es?r:r[0])}},eX=r.useState(null),eG=(0,u.Z)(eX,2),eU=eG[0],e$=eG[1],eK=r.useState(0),eY=(0,u.Z)(eK,2),eQ=eY[0],eJ=eY[1],e0=void 0!==B?B:"combobox"!==h,e1=r.useCallback(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.source;eJ(t),y&&"combobox"===h&&null!==e&&"keyboard"===(void 0===r?"keyboard":r)&&e$(String(e))},[y,h]),e2=function(e,t,n){var r=function(){var t,n=e_(e);return[et?{label:null==n?void 0:n[ex.label],value:e,key:null!==(t=null==n?void 0:n.key)&&void 0!==t?t:e}:e,q(n)]};if(t&&O){var o=r(),a=(0,u.Z)(o,2);O(a[0],a[1])}else if(!t&&k&&"clear"!==n){var i=r(),c=(0,u.Z)(i,2);k(c[0],c[1])}},e6=eg(function(e,t){var n=!es||t.selected;eq(n?es?[].concat((0,c.Z)(eA),[e]):[e]:eA.filter(function(t){return t.value!==e})),e2(e,n),"combobox"===h?e$(""):(!Y||S)&&(eZ(""),e$(""))}),e5=r.useMemo(function(){var e=!1!==z&&!1!==M;return(0,s.Z)((0,s.Z)({},eS),{},{flattenOptions:eV,onActiveValue:e1,defaultActiveFirstOption:e0,onSelect:e6,menuItemSelectedIcon:H,rawValues:eH,fieldNames:ex,virtual:e,direction:L,listHeight:X,listItemHeight:$,childrenAsData:eb,maxCount:er,optionRender:A})},[er,eS,eV,e1,e0,e6,H,eH,ex,z,M,L,X,$,eb,A]);return r.createElement(G.Provider,{value:e5},r.createElement(Q,(0,i.Z)({},eo,{id:ea,prefixCls:void 0===b?"rc-select":b,ref:t,omitDomProps:eh,mode:h,displayValues:eB,onDisplayValuesChange:function(e,t){eq(e);var n=t.type,r=t.values;("remove"===n||"clear"===n)&&r.forEach(function(e){e2(e.value,!1,n)})},direction:L,searchValue:eC,onSearch:function(e,t){if(eZ(e),e$(null),"submit"===t.source){var n=(e||"").trim();n&&(eq(Array.from(new Set([].concat((0,c.Z)(eH),[n])))),e2(n,!0),eZ(""));return}"blur"!==t.source&&("combobox"===h&&eq(e),null==C||C(e))},autoClearSearchValue:S,onSearchSplit:function(e){var t=e;"tags"!==h&&(t=e.map(function(e){var t=ek.get(e);return null==t?void 0:t.value}).filter(function(e){return void 0!==e}));var n=Array.from(new Set([].concat((0,c.Z)(eH),(0,c.Z)(t))));eq(n),n.forEach(function(e){e2(e,!0)})},dropdownMatchSelectWidth:M,OptionList:ei,emptyOptions:!eV.length,activeValue:eU,activeDescendantId:"".concat(ea,"_list_").concat(eQ)})))});eb.Option=ee,eb.OptGroup=J;var ey=n(62236),ex=n(68710),ew=n(93942),eE=n(12757),eC=n(71744),eZ=n(91086),eS=n(86586),eO=n(64024),ek=n(33759),ej=n(39109),eI=n(56250),eM=n(77685),eR=n(84951);let eN=e=>{let t={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:"scroll"===e?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},t),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},t),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},t),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},t),{points:["br","tr"],offset:[0,-4]})}};var eP=n(12918),eF=n(17691),eT=n(99320),eA=n(71140),e_=n(18544),eB=n(29382);let eH=e=>{let{optionHeight:t,optionFontSize:n,optionLineHeight:r,optionPadding:o}=e;return{position:"relative",display:"block",minHeight:t,padding:o,color:e.colorText,fontWeight:"normal",fontSize:n,lineHeight:r,boxSizing:"border-box"}};var ez=e=>{let{antCls:t,componentCls:n}=e,r="".concat(n,"-item"),o="&".concat(t,"-slide-up-enter").concat(t,"-slide-up-enter-active"),a="&".concat(t,"-slide-up-appear").concat(t,"-slide-up-appear-active"),i="&".concat(t,"-slide-up-leave").concat(t,"-slide-up-leave-active"),c="".concat(n,"-dropdown-placement-"),l="".concat(r,"-option-selected");return[{["".concat(n,"-dropdown")]:Object.assign(Object.assign({},(0,eP.Wf)(e)),{position:"absolute",top:-9999,zIndex:e.zIndexPopup,boxSizing:"border-box",padding:e.paddingXXS,overflow:"hidden",fontSize:e.fontSize,fontVariant:"initial",backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,["\n ".concat(o).concat(c,"bottomLeft,\n ").concat(a).concat(c,"bottomLeft\n ")]:{animationName:e_.fJ},["\n ".concat(o).concat(c,"topLeft,\n ").concat(a).concat(c,"topLeft,\n ").concat(o).concat(c,"topRight,\n ").concat(a).concat(c,"topRight\n ")]:{animationName:e_.Qt},["".concat(i).concat(c,"bottomLeft")]:{animationName:e_.Uw},["\n ".concat(i).concat(c,"topLeft,\n ").concat(i).concat(c,"topRight\n ")]:{animationName:e_.ly},"&-hidden":{display:"none"},[r]:Object.assign(Object.assign({},eH(e)),{cursor:"pointer",transition:"background ".concat(e.motionDurationSlow," ease"),borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},eP.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},["&-active:not(".concat(r,"-option-disabled)")]:{backgroundColor:e.optionActiveBg},["&-selected:not(".concat(r,"-option-disabled)")]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,["".concat(r,"-option-state")]:{color:e.colorPrimary}},"&-disabled":{["&".concat(r,"-option-selected")]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:e.calc(e.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},eH(e)),{color:e.colorTextDisabled})}),["".concat(l,":has(+ ").concat(l,")")]:{borderEndStartRadius:0,borderEndEndRadius:0,["& + ".concat(l)]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:"rtl"}})},(0,e_.oN)(e,"slide-up"),(0,e_.oN)(e,"slide-down"),(0,eB.Fm)(e,"move-up"),(0,eB.Fm)(e,"move-down")]},eL=n(93463);let eD=e=>{let{multipleSelectItemHeight:t,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:o}=e,a=e.max(e.calc(n).sub(r).equal(),0),i=e.max(e.calc(a).sub(o).equal(),0);return{basePadding:a,containerPadding:i,itemHeight:(0,eL.bf)(t),itemLineHeight:(0,eL.bf)(e.calc(t).sub(e.calc(e.lineWidth).mul(2)).equal())}},eW=e=>{let{multipleSelectItemHeight:t,selectHeight:n,lineWidth:r}=e;return e.calc(n).sub(t).div(2).sub(r).equal()},eV=e=>{let{componentCls:t,iconCls:n,borderRadiusSM:r,motionDurationSlow:o,paddingXS:a,multipleItemColorDisabled:i,multipleItemBorderColorDisabled:c,colorIcon:l,colorIconHover:s,INTERNAL_FIXED_ITEM_MARGIN:u}=e;return{["".concat(t,"-selection-overflow")]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"calc(100% - 4px)",display:"inline-flex"},["".concat(t,"-selection-item")]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:u,borderRadius:r,cursor:"default",transition:"font-size ".concat(o,", line-height ").concat(o,", height ").concat(o),marginInlineEnd:e.calc(u).mul(2).equal(),paddingInlineStart:a,paddingInlineEnd:e.calc(a).div(2).equal(),["".concat(t,"-disabled&")]:{color:i,borderColor:c,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:e.calc(a).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,eP.Ro)()),{display:"inline-flex",alignItems:"center",color:l,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",["> ".concat(n)]:{verticalAlign:"-0.2em"},"&:hover":{color:s}})}}}},eq=(e,t)=>{let{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:r}=e,o="".concat(n,"-selection-overflow"),a=e.multipleSelectItemHeight,i=eW(e),c=t?"".concat(n,"-").concat(t):"",l=eD(e);return{["".concat(n,"-multiple").concat(c)]:Object.assign(Object.assign({},eV(e)),{["".concat(n,"-selector")]:{display:"flex",alignItems:"center",width:"100%",height:"100%",paddingInline:l.basePadding,paddingBlock:l.containerPadding,borderRadius:e.borderRadius,["".concat(n,"-disabled&")]:{background:e.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:"".concat((0,eL.bf)(r)," 0"),lineHeight:(0,eL.bf)(a),visibility:"hidden",content:'"\\a0"'}},["".concat(n,"-selection-item")]:{height:l.itemHeight,lineHeight:(0,eL.bf)(l.itemLineHeight)},["".concat(n,"-selection-wrap")]:{alignSelf:"flex-start","&:after":{lineHeight:(0,eL.bf)(a),marginBlock:r}},["".concat(n,"-prefix")]:{marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(l.basePadding).equal()},["".concat(o,"-item + ").concat(o,"-item,\n ").concat(n,"-prefix + ").concat(n,"-selection-wrap\n ")]:{["".concat(n,"-selection-search")]:{marginInlineStart:0},["".concat(n,"-selection-placeholder")]:{insetInlineStart:0}},["".concat(o,"-item-suffix")]:{minHeight:l.itemHeight,marginBlock:r},["".concat(n,"-selection-search")]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(i).equal(),"\n &-input,\n &-mirror\n ":{height:a,fontFamily:e.fontFamily,lineHeight:(0,eL.bf)(a),transition:"all ".concat(e.motionDurationSlow)},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},["".concat(n,"-selection-placeholder")]:{position:"absolute",top:"50%",insetInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(l.basePadding).equal(),insetInlineEnd:e.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:"all ".concat(e.motionDurationSlow)}})}};function eX(e,t){let{componentCls:n}=e,r=t?"".concat(n,"-").concat(t):"",o={["".concat(n,"-multiple").concat(r)]:{fontSize:e.fontSize,["".concat(n,"-selector")]:{["".concat(n,"-show-search&")]:{cursor:"text"}},["\n &".concat(n,"-show-arrow ").concat(n,"-selector,\n &").concat(n,"-allow-clear ").concat(n,"-selector\n ")]:{paddingInlineEnd:e.calc(e.fontSizeIcon).add(e.controlPaddingHorizontal).equal()}}};return[eq(e,t),o]}var eG=e=>{let{componentCls:t}=e,n=(0,eA.IX)(e,{selectHeight:e.controlHeightSM,multipleSelectItemHeight:e.multipleItemHeightSM,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS}),r=(0,eA.IX)(e,{fontSize:e.fontSizeLG,selectHeight:e.controlHeightLG,multipleSelectItemHeight:e.multipleItemHeightLG,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius});return[eX(e),eX(n,"sm"),{["".concat(t,"-multiple").concat(t,"-sm")]:{["".concat(t,"-selection-placeholder")]:{insetInline:e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal()},["".concat(t,"-selection-search")]:{marginInlineStart:2}}},eX(r,"lg")]};function eU(e,t){let{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:o}=e,a=e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),i=t?"".concat(n,"-").concat(t):"";return{["".concat(n,"-single").concat(i)]:{fontSize:e.fontSize,height:e.controlHeight,["".concat(n,"-selector")]:Object.assign(Object.assign({},(0,eP.Wf)(e,!0)),{display:"flex",borderRadius:o,flex:"1 1 auto",["".concat(n,"-selection-wrap:after")]:{lineHeight:(0,eL.bf)(a)},["".concat(n,"-selection-search")]:{position:"absolute",inset:0,width:"100%","&-input":{width:"100%",WebkitAppearance:"textfield"}},["\n ".concat(n,"-selection-item,\n ").concat(n,"-selection-placeholder\n ")]:{display:"block",padding:0,lineHeight:(0,eL.bf)(a),transition:"all ".concat(e.motionDurationSlow,", visibility 0s"),alignSelf:"center"},["".concat(n,"-selection-placeholder")]:{transition:"none",pointerEvents:"none"},[["&:after","".concat(n,"-selection-item:empty:after"),"".concat(n,"-selection-placeholder:empty:after")].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),["\n &".concat(n,"-show-arrow ").concat(n,"-selection-item,\n &").concat(n,"-show-arrow ").concat(n,"-selection-search,\n &").concat(n,"-show-arrow ").concat(n,"-selection-placeholder\n ")]:{paddingInlineEnd:e.showArrowPaddingInlineEnd},["&".concat(n,"-open ").concat(n,"-selection-item")]:{color:e.colorTextPlaceholder},["&:not(".concat(n,"-customize-input)")]:{["".concat(n,"-selector")]:{width:"100%",height:"100%",alignItems:"center",padding:"0 ".concat((0,eL.bf)(r)),["".concat(n,"-selection-search-input")]:{height:a,fontSize:e.fontSize},"&:after":{lineHeight:(0,eL.bf)(a)}}},["&".concat(n,"-customize-input")]:{["".concat(n,"-selector")]:{"&:after":{display:"none"},["".concat(n,"-selection-search")]:{position:"static",width:"100%"},["".concat(n,"-selection-placeholder")]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:"0 ".concat((0,eL.bf)(r)),"&:after":{display:"none"}}}}}}}let e$=(e,t)=>{let{componentCls:n,antCls:r,controlOutlineWidth:o}=e;return{["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:{border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(t.borderColor),background:e.selectorBg},["&:not(".concat(n,"-disabled):not(").concat(n,"-customize-input):not(").concat(r,"-pagination-size-changer)")]:{["&:hover ".concat(n,"-selector")]:{borderColor:t.hoverBorderHover},["".concat(n,"-focused& ").concat(n,"-selector")]:{borderColor:t.activeBorderColor,boxShadow:"0 0 0 ".concat((0,eL.bf)(o)," ").concat(t.activeOutlineColor),outline:0},["".concat(n,"-prefix")]:{color:t.color}}}},eK=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status)]:Object.assign({},e$(e,t))}),eY=e=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},e$(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),eK(e,{status:"error",borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),eK(e,{status:"warning",borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.multipleItemBg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.multipleItemBorderColor)}})}),eQ=(e,t)=>{let{componentCls:n,antCls:r}=e;return{["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:{background:t.bg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),color:t.color},["&:not(".concat(n,"-disabled):not(").concat(n,"-customize-input):not(").concat(r,"-pagination-size-changer)")]:{["&:hover ".concat(n,"-selector")]:{background:t.hoverBg},["".concat(n,"-focused& ").concat(n,"-selector")]:{background:e.selectorBg,borderColor:t.activeBorderColor,outline:0}}}},eJ=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status)]:Object.assign({},eQ(e,t))}),e0=e=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},eQ(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor,color:e.colorText})),eJ(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,color:e.colorError})),eJ(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,color:e.colorWarning})),{["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{borderColor:e.colorBorder,background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.colorBgContainer,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)}})}),e1=e=>({"&-borderless":{["".concat(e.componentCls,"-selector")]:{background:"transparent",border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," transparent")},["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.multipleItemBg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.multipleItemBorderColor)},["&".concat(e.componentCls,"-status-error")]:{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-selection-item")]:{color:e.colorError}},["&".concat(e.componentCls,"-status-warning")]:{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-selection-item")]:{color:e.colorWarning}}}}),e2=(e,t)=>{let{componentCls:n,antCls:r}=e;return{["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:{borderWidth:"".concat((0,eL.bf)(e.lineWidth)," 0"),borderStyle:"".concat(e.lineType," none"),borderColor:"transparent transparent ".concat(t.borderColor," transparent"),background:e.selectorBg,borderRadius:0},["&:not(".concat(n,"-disabled):not(").concat(n,"-customize-input):not(").concat(r,"-pagination-size-changer)")]:{["&:hover ".concat(n,"-selector")]:{borderColor:"transparent transparent ".concat(t.hoverBorderHover," transparent")},["".concat(n,"-focused& ").concat(n,"-selector")]:{borderColor:"transparent transparent ".concat(t.activeBorderColor," transparent"),outline:0},["".concat(n,"-prefix")]:{color:t.color}}}},e6=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status)]:Object.assign({},e2(e,t))}),e5=e=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign({},e2(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),e6(e,{status:"error",borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),e6(e,{status:"warning",borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.multipleItemBg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.multipleItemBorderColor)}})});var e4=e=>({[e.componentCls]:Object.assign(Object.assign(Object.assign(Object.assign({},eY(e)),e0(e)),e1(e)),e5(e))});let e3=e=>{let{componentCls:t}=e;return{position:"relative",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseInOut),input:{cursor:"pointer"},["".concat(t,"-show-search&")]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},["".concat(t,"-disabled&")]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},e7=e=>{let{componentCls:t}=e;return{["".concat(t,"-selection-search-input")]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none",appearance:"none"}}}},e9=e=>{let{antCls:t,componentCls:n,inputPaddingHorizontalBase:r,iconCls:o}=e,a={["".concat(n,"-clear")]:{opacity:1,background:e.colorBgBase,borderRadius:"50%"}};return{[n]:Object.assign(Object.assign({},(0,eP.Wf)(e)),{position:"relative",display:"inline-flex",cursor:"pointer",["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:Object.assign(Object.assign({},e3(e)),e7(e)),["".concat(n,"-selection-item")]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},eP.vS),{["> ".concat(t,"-typography")]:{display:"inline"}}),["".concat(n,"-selection-placeholder")]:Object.assign(Object.assign({},eP.vS),{flex:1,color:e.colorTextPlaceholder,pointerEvents:"none"}),["".concat(n,"-arrow")]:Object.assign(Object.assign({},(0,eP.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:"opacity ".concat(e.motionDurationSlow," ease"),[o]:{verticalAlign:"top",transition:"transform ".concat(e.motionDurationSlow),"> svg":{verticalAlign:"top"},["&:not(".concat(n,"-suffix)")]:{pointerEvents:"auto"}},["".concat(n,"-disabled &")]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),["".concat(n,"-selection-wrap")]:{display:"flex",width:"100%",position:"relative",minWidth:0,"&:after":{content:'"\\a0"',width:0,overflow:"hidden"}},["".concat(n,"-prefix")]:{flex:"none",marginInlineEnd:e.selectAffixPadding},["".concat(n,"-clear")]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,zIndex:1,display:"inline-block",width:e.fontSizeIcon,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:"color ".concat(e.motionDurationMid," ease, opacity ").concat(e.motionDurationSlow," ease"),textRendering:"auto",transform:"translateZ(0)","&:before":{display:"block"},"&:hover":{color:e.colorIcon}},"@media(hover:none)":a,"&:hover":a}),["".concat(n,"-status")]:{"&-error, &-warning, &-success, &-validating":{["&".concat(n,"-has-feedback")]:{["".concat(n,"-clear")]:{insetInlineEnd:e.calc(r).add(e.fontSize).add(e.paddingXS).equal()}}}}}},e8=e=>{let{componentCls:t}=e;return[{[t]:{["&".concat(t,"-in-form-item")]:{width:"100%"}}},e9(e),function(e){let{componentCls:t}=e,n=e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal();return[eU(e),eU((0,eA.IX)(e,{controlHeight:e.controlHeightSM,borderRadius:e.borderRadiusSM}),"sm"),{["".concat(t,"-single").concat(t,"-sm")]:{["&:not(".concat(t,"-customize-input)")]:{["".concat(t,"-selector")]:{padding:"0 ".concat((0,eL.bf)(n))},["&".concat(t,"-show-arrow ").concat(t,"-selection-search")]:{insetInlineEnd:e.calc(n).add(e.calc(e.fontSize).mul(1.5)).equal()},["\n &".concat(t,"-show-arrow ").concat(t,"-selection-item,\n &").concat(t,"-show-arrow ").concat(t,"-selection-placeholder\n ")]:{paddingInlineEnd:e.calc(e.fontSize).mul(1.5).equal()}}}},eU((0,eA.IX)(e,{controlHeight:e.singleItemHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),"lg")]}(e),eG(e),ez(e),{["".concat(t,"-rtl")]:{direction:"rtl"}},(0,eF.c)(e,{borderElCls:"".concat(t,"-selector"),focusElCls:"".concat(t,"-focused")})]};var te=(0,eT.I$)("Select",(e,t)=>{let{rootPrefixCls:n}=t,r=(0,eA.IX)(e,{rootPrefixCls:n,inputPaddingHorizontalBase:e.calc(e.paddingSM).sub(1).equal(),multipleSelectItemHeight:e.multipleItemHeight,selectHeight:e.controlHeight});return[e8(r),e4(r)]},e=>{let{fontSize:t,lineHeight:n,lineWidth:r,controlHeight:o,controlHeightSM:a,controlHeightLG:i,paddingXXS:c,controlPaddingHorizontal:l,zIndexPopupBase:s,colorText:u,fontWeightStrong:d,controlItemBgActive:f,controlItemBgHover:p,colorBgContainer:m,colorFillSecondary:g,colorBgContainerDisabled:v,colorTextDisabled:h,colorPrimaryHover:b,colorPrimary:y,controlOutline:x}=e,w=2*c,E=2*r;return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(c/2),zIndexPopup:s+50,optionSelectedColor:u,optionSelectedFontWeight:d,optionSelectedBg:f,optionActiveBg:p,optionPadding:"".concat((o-t*n)/2,"px ").concat(l,"px"),optionFontSize:t,optionLineHeight:n,optionHeight:o,selectorBg:m,clearBg:m,singleItemHeightLG:i,multipleItemBg:g,multipleItemBorderColor:"transparent",multipleItemHeight:Math.min(o-w,o-E),multipleItemHeightSM:Math.min(a-w,a-E),multipleItemHeightLG:Math.min(i-w,i-E),multipleSelectorBgDisabled:v,multipleItemColorDisabled:h,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(1.25*e.fontSize),hoverBorderColor:b,activeBorderColor:y,activeOutlineColor:x,selectAffixPadding:c}},{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}}),tt=n(9738),tn=n(39725),tr=n(49638),to=n(70464),ta=n(61935),ti=n(29436),tc=n(391),tl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let ts="SECRET_COMBOBOX_MODE_DO_NOT_USE",tu=r.forwardRef((e,t)=>{var n,o,i,c,l,s,u,d;let f;let{prefixCls:p,bordered:m,className:g,rootClassName:v,getPopupContainer:h,popupClassName:b,dropdownClassName:y,listHeight:x=256,placement:w,listItemHeight:E,size:C,disabled:Z,notFoundContent:S,status:O,builtinPlacements:k,dropdownMatchSelectWidth:j,popupMatchSelectWidth:I,direction:M,style:R,allowClear:N,variant:P,dropdownStyle:F,transitionName:T,tagRender:A,maxCount:_,prefix:B,dropdownRender:H,popupRender:z,onDropdownVisibleChange:L,onOpenChange:D,styles:W,classNames:V}=e,q=tl(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount","prefix","dropdownRender","popupRender","onDropdownVisibleChange","onOpenChange","styles","classNames"]),{getPopupContainer:X,getPrefixCls:G,renderEmpty:U,direction:$,virtual:K,popupMatchSelectWidth:Y,popupOverflow:Q}=r.useContext(eC.E_),{showSearch:J,style:ee,styles:et,className:er,classNames:eo}=(0,eC.dj)("select"),[,ea]=(0,eR.ZP)(),ei=null!=E?E:null==ea?void 0:ea.controlHeight,ec=G("select",p),el=G(),es=null!=M?M:$,{compactSize:eu,compactItemClassnames:ed}=(0,eM.ri)(ec,es),[ef,ep]=(0,eI.Z)("select",P,m),em=(0,eO.Z)(ec),[eg,ev,eh]=te(ec,em),ew=r.useMemo(()=>{let{mode:t}=e;return"combobox"===t?void 0:t===ts?"combobox":t},[e.mode]),eP="multiple"===ew||"tags"===ew,eF=(s=e.suffixIcon,void 0!==(u=e.showArrow)?u:null!==s),eT=null!==(n=null!=I?I:j)&&void 0!==n?n:Y,eA=(null===(o=null==W?void 0:W.popup)||void 0===o?void 0:o.root)||(null===(i=et.popup)||void 0===i?void 0:i.root)||F,e_=(d=z||H,r.useMemo(()=>{if(d)return function(){for(var e=arguments.length,t=Array(e),n=0;nnull!==t||l||f?r.createElement(r.Fragment,null,!1!==u&&e,l&&d):null,v=null;if(void 0!==t)v=g(t);else if(i)v=g(r.createElement(ta.Z,{spin:!0}));else{let e="".concat(s,"-suffix");v=t=>{let{open:n,showSearch:o}=t;return n&&o?g(r.createElement(ti.Z,{className:e})):g(r.createElement(to.Z,{className:e}))}}let h=null;return h=void 0!==o?o:c?r.createElement(tt.Z,null):null,{clearIcon:m,suffixIcon:v,itemIcon:h,removeIcon:void 0!==a?a:r.createElement(tr.Z,null)}}(Object.assign(Object.assign({},q),{multiple:eP,hasFeedback:eH,feedbackIcon:eL,showSuffixIcon:eF,prefixCls:ec,componentName:"Select"})),eG=(0,en.Z)(q,["suffixIcon","itemIcon"]),eU=a()((null===(c=null==V?void 0:V.popup)||void 0===c?void 0:c.root)||(null===(l=null==eo?void 0:eo.popup)||void 0===l?void 0:l.root)||b||y,{["".concat(ec,"-dropdown-").concat(es)]:"rtl"===es},v,eo.root,null==V?void 0:V.root,eh,em,ev),e$=(0,ek.Z)(e=>{var t;return null!==(t=null!=C?C:eu)&&void 0!==t?t:e}),eK=r.useContext(eS.Z),eY=a()({["".concat(ec,"-lg")]:"large"===e$,["".concat(ec,"-sm")]:"small"===e$,["".concat(ec,"-rtl")]:"rtl"===es,["".concat(ec,"-").concat(ef)]:ep,["".concat(ec,"-in-form-item")]:ez},(0,eE.Z)(ec,eD,eH),ed,er,g,eo.root,null==V?void 0:V.root,v,eh,em,ev),eQ=r.useMemo(()=>void 0!==w?w:"rtl"===es?"bottomRight":"bottomLeft",[w,es]),[eJ]=(0,ey.Cn)("SelectLike",null==eA?void 0:eA.zIndex);return eg(r.createElement(eb,Object.assign({ref:t,virtual:K,showSearch:J},eG,{style:Object.assign(Object.assign(Object.assign(Object.assign({},et.root),null==W?void 0:W.root),ee),R),dropdownMatchSelectWidth:eT,transitionName:(0,ex.m)(el,"slide-up",T),builtinPlacements:k||eN(Q),listHeight:x,listItemHeight:ei,mode:ew,prefixCls:ec,placement:eQ,direction:es,prefix:B,suffixIcon:eW,menuItemSelectedIcon:eV,removeIcon:eq,allowClear:!0===N?{clearIcon:eX}:N,notFoundContent:f,className:eY,getPopupContainer:h||X,dropdownClassName:eU,disabled:null!=Z?Z:eK,dropdownStyle:Object.assign(Object.assign({},eA),{zIndex:eJ}),maxCount:eP?_:void 0,tagRender:eP?A:void 0,dropdownRender:e_,onDropdownVisibleChange:D||L})))}),td=(0,ew.Z)(tu,"dropdownAlign");tu.SECRET_COMBOBOX_MODE_DO_NOT_USE=ts,tu.Option=ee,tu.OptGroup=J,tu._InternalPanelDoNotUseOrYouWillBeFired=td;var tf=tu},77685:function(e,t,n){"use strict";n.d(t,{BR:function(){return g},ZP:function(){return h},ri:function(){return m}});var r=n(2265),o=n(36760),a=n.n(o),i=n(45287),c=n(71744),l=n(33759),s=n(99320);let u=e=>{let{componentCls:t}=e;return{[t]:{display:"inline-flex","&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"},"&-rtl":{direction:"rtl"}}}};var d=(0,s.I$)(["Space","Compact"],e=>[u(e)],()=>({}),{resetStyle:!1}),f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let p=r.createContext(null),m=(e,t)=>{let n=r.useContext(p),o=r.useMemo(()=>{if(!n)return"";let{compactDirection:r,isFirstItem:o,isLastItem:i}=n,c="vertical"===r?"-vertical-":"-";return a()("".concat(e,"-compact").concat(c,"item"),{["".concat(e,"-compact").concat(c,"first-item")]:o,["".concat(e,"-compact").concat(c,"last-item")]:i,["".concat(e,"-compact").concat(c,"item-rtl")]:"rtl"===t})},[e,t,n]);return{compactSize:null==n?void 0:n.compactSize,compactDirection:null==n?void 0:n.compactDirection,compactItemClassnames:o}},g=e=>{let{children:t}=e;return r.createElement(p.Provider,{value:null},t)},v=e=>{let{children:t}=e,n=f(e,["children"]);return r.createElement(p.Provider,{value:r.useMemo(()=>n,[n])},t)};var h=e=>{let{getPrefixCls:t,direction:n}=r.useContext(c.E_),{size:o,direction:s,block:u,prefixCls:m,className:g,rootClassName:h,children:b}=e,y=f(e,["size","direction","block","prefixCls","className","rootClassName","children"]),x=(0,l.Z)(e=>null!=o?o:e),w=t("space-compact",m),[E,C]=d(w),Z=a()(w,C,{["".concat(w,"-rtl")]:"rtl"===n,["".concat(w,"-block")]:u,["".concat(w,"-vertical")]:"vertical"===s},g,h),S=r.useContext(p),O=(0,i.Z)(b),k=r.useMemo(()=>O.map((e,t)=>{let n=(null==e?void 0:e.key)||"".concat(w,"-item-").concat(t);return r.createElement(v,{key:n,compactSize:x,compactDirection:s,isFirstItem:0===t&&(!S||(null==S?void 0:S.isFirstItem)),isLastItem:t===O.length-1&&(!S||(null==S?void 0:S.isLastItem))},e)}),[O,S,s,x,w]);return 0===O.length?null:E(r.createElement("div",Object.assign({className:Z},y),k))}},17691:function(e,t,n){"use strict";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{focus:!0},{componentCls:n}=e,{componentCls:r}=t,o=r||n,a="".concat(o,"-compact");return{[a]:Object.assign(Object.assign({},function(e,t,n,r){let{focusElCls:o,focus:a,borderElCls:i}=n,c=i?"> *":"",l=["hover",a?"focus":null,"active"].filter(Boolean).map(e=>"&:".concat(e," ").concat(c)).join(",");return{["&-item:not(".concat(t,"-last-item)")]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal()},["&-item:not(".concat(r,"-status-success)")]:{zIndex:2},"&-item":Object.assign(Object.assign({[l]:{zIndex:3}},o?{["&".concat(o)]:{zIndex:3}}:{}),{["&[disabled] ".concat(c)]:{zIndex:0}})}}(e,a,t,o)),function(e,t,n){let{borderElCls:r}=n,o=r?"> ".concat(r):"";return{["&-item:not(".concat(t,"-first-item):not(").concat(t,"-last-item) ").concat(o)]:{borderRadius:0},["&-item:not(".concat(t,"-last-item)").concat(t,"-first-item")]:{["& ".concat(o,", &").concat(e,"-sm ").concat(o,", &").concat(e,"-lg ").concat(o)]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&-item:not(".concat(t,"-first-item)").concat(t,"-last-item")]:{["& ".concat(o,", &").concat(e,"-sm ").concat(o,", &").concat(e,"-lg ").concat(o)]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}(o,a,t))}}n.d(t,{c:function(){return r}})},12918:function(e,t,n){"use strict";n.d(t,{JT:function(){return f},Lx:function(){return l},Nd:function(){return p},Qy:function(){return d},Ro:function(){return i},Wf:function(){return a},dF:function(){return c},du:function(){return s},oN:function(){return u},vS:function(){return o}});var r=n(93463);let o={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:t?"inherit":e.fontFamily}},i=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),c=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),l=e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),"-webkit-text-decoration-skip":"objects","&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active, &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}),s=(e,t,n,r)=>{let o='[class^="'.concat(t,'"], [class*=" ').concat(t,'"]'),a=n?".".concat(n):o,i={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}},c={};return!1!==r&&(c={fontFamily:e.fontFamily,fontSize:e.fontSize}),{[a]:Object.assign(Object.assign(Object.assign({},c),i),{[o]:i})}},u=(e,t)=>({outline:"".concat((0,r.bf)(e.lineWidthFocus)," solid ").concat(e.colorPrimaryBorder),outlineOffset:null!=t?t:1,transition:"outline-offset 0s, outline 0s"}),d=(e,t)=>({"&:focus-visible":u(e,t)}),f=e=>({[".".concat(e)]:Object.assign(Object.assign({},i()),{[".".concat(e," .").concat(e,"-icon")]:{display:"block"}})}),p=e=>Object.assign(Object.assign({color:e.colorLink,textDecoration:e.linkDecoration,outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),border:0,padding:0,background:"none",userSelect:"none"},d(e)),{"&:hover":{color:e.colorLinkHover,textDecoration:e.linkHoverDecoration},"&:focus":{color:e.colorLinkHover,textDecoration:e.linkFocusDecoration},"&:active":{color:e.colorLinkActive,textDecoration:e.linkHoverDecoration}})},63074:function(e,t){"use strict";t.Z=e=>({[e.componentCls]:{["".concat(e.antCls,"-motion-collapse-legacy")]:{overflow:"hidden","&-active":{transition:"height ".concat(e.motionDurationMid," ").concat(e.motionEaseInOut,",\n opacity ").concat(e.motionDurationMid," ").concat(e.motionEaseInOut," !important")}},["".concat(e.antCls,"-motion-collapse")]:{overflow:"hidden",transition:"height ".concat(e.motionDurationMid," ").concat(e.motionEaseInOut,",\n opacity ").concat(e.motionDurationMid," ").concat(e.motionEaseInOut," !important")}}})},37133:function(e,t,n){"use strict";n.d(t,{R:function(){return a}});let r=e=>({animationDuration:e,animationFillMode:"both"}),o=e=>({animationDuration:e,animationFillMode:"both"}),a=function(e,t,n,a){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=i?"&":"";return{["\n ".concat(c).concat(e,"-enter,\n ").concat(c).concat(e,"-appear\n ")]:Object.assign(Object.assign({},r(a)),{animationPlayState:"paused"}),["".concat(c).concat(e,"-leave")]:Object.assign(Object.assign({},o(a)),{animationPlayState:"paused"}),["\n ".concat(c).concat(e,"-enter").concat(e,"-enter-active,\n ").concat(c).concat(e,"-appear").concat(e,"-appear-active\n ")]:{animationName:t,animationPlayState:"running"},["".concat(c).concat(e,"-leave").concat(e,"-leave-active")]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}}},29382:function(e,t,n){"use strict";n.d(t,{Fm:function(){return f}});var r=n(93463),o=n(37133);let a=new r.E4("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),i=new r.E4("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),c=new r.E4("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),l=new r.E4("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),s=new r.E4("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),u=new r.E4("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),d={"move-up":{inKeyframes:new r.E4("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),outKeyframes:new r.E4("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}})},"move-down":{inKeyframes:a,outKeyframes:i},"move-left":{inKeyframes:c,outKeyframes:l},"move-right":{inKeyframes:s,outKeyframes:u}},f=(e,t)=>{let{antCls:n}=e,r="".concat(n,"-").concat(t),{inKeyframes:a,outKeyframes:i}=d[t];return[(0,o.R)(r,a,i,e.motionDurationMid),{["\n ".concat(r,"-enter,\n ").concat(r,"-appear\n ")]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},["".concat(r,"-leave")]:{animationTimingFunction:e.motionEaseInOutCirc}}]}},18544:function(e,t,n){"use strict";n.d(t,{Qt:function(){return c},Uw:function(){return i},fJ:function(){return a},ly:function(){return l},oN:function(){return d}});var r=n(93463),o=n(37133);let a=new r.E4("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),i=new r.E4("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),c=new r.E4("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),l=new r.E4("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),s=new r.E4("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),u={"slide-up":{inKeyframes:a,outKeyframes:i},"slide-down":{inKeyframes:c,outKeyframes:l},"slide-left":{inKeyframes:s,outKeyframes:new r.E4("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}})},"slide-right":{inKeyframes:new r.E4("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),outKeyframes:new r.E4("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}})}},d=(e,t)=>{let{antCls:n}=e,r="".concat(n,"-").concat(t),{inKeyframes:a,outKeyframes:i}=u[t];return[(0,o.R)(r,a,i,e.motionDurationMid),{["\n ".concat(r,"-enter,\n ").concat(r,"-appear\n ")]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:e.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},["".concat(r,"-leave")]:{animationTimingFunction:e.motionEaseInQuint}}]}},691:function(e,t,n){"use strict";n.d(t,{_y:function(){return g},kr:function(){return a}});var r=n(93463),o=n(37133);let a=new r.E4("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),i=new r.E4("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),c=new r.E4("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),l=new r.E4("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),s=new r.E4("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),u=new r.E4("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),d=new r.E4("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),f=new r.E4("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),p=new r.E4("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),m={zoom:{inKeyframes:a,outKeyframes:i},"zoom-big":{inKeyframes:c,outKeyframes:l},"zoom-big-fast":{inKeyframes:c,outKeyframes:l},"zoom-left":{inKeyframes:d,outKeyframes:f},"zoom-right":{inKeyframes:p,outKeyframes:new r.E4("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}})},"zoom-up":{inKeyframes:s,outKeyframes:u},"zoom-down":{inKeyframes:new r.E4("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),outKeyframes:new r.E4("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}})}},g=(e,t)=>{let{antCls:n}=e,r="".concat(n,"-").concat(t),{inKeyframes:a,outKeyframes:i}=m[t];return[(0,o.R)(r,a,i,"zoom-big-fast"===t?e.motionDurationFast:e.motionDurationMid),{["\n ".concat(r,"-enter,\n ").concat(r,"-appear\n ")]:{transform:"scale(0)",opacity:0,animationTimingFunction:e.motionEaseOutCirc,"&-prepare":{transform:"none"}},["".concat(r,"-leave")]:{animationTimingFunction:e.motionEaseInOutCirc}}]}},88260:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},qN:function(){return a},wZ:function(){return i}});var r=n(93463),o=n(34442);let a=8;function i(e){let{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?a:r}}function c(e,t,n){var a,i,c,l,s,u,d,f;let{componentCls:p,boxShadowPopoverArrow:m,arrowOffsetVertical:g,arrowOffsetHorizontal:v}=e,{arrowDistance:h=0,arrowPlacement:b={left:!0,right:!0,top:!0,bottom:!0}}=n||{};return{[p]:Object.assign(Object.assign(Object.assign(Object.assign({["".concat(p,"-arrow")]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,o.W)(e,t,m)),{"&:before":{background:t}})]},(a=!!b.top,i={[["&-placement-top > ".concat(p,"-arrow"),"&-placement-topLeft > ".concat(p,"-arrow"),"&-placement-topRight > ".concat(p,"-arrow")].join(",")]:{bottom:h,transform:"translateY(100%) rotate(180deg)"},["&-placement-top > ".concat(p,"-arrow")]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":v,["> ".concat(p,"-arrow")]:{left:{_skip_check_:!0,value:v}}},"&-placement-topRight":{"--arrow-offset-horizontal":"calc(100% - ".concat((0,r.bf)(v),")"),["> ".concat(p,"-arrow")]:{right:{_skip_check_:!0,value:v}}}},a?i:{})),(c=!!b.bottom,l={[["&-placement-bottom > ".concat(p,"-arrow"),"&-placement-bottomLeft > ".concat(p,"-arrow"),"&-placement-bottomRight > ".concat(p,"-arrow")].join(",")]:{top:h,transform:"translateY(-100%)"},["&-placement-bottom > ".concat(p,"-arrow")]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":v,["> ".concat(p,"-arrow")]:{left:{_skip_check_:!0,value:v}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":"calc(100% - ".concat((0,r.bf)(v),")"),["> ".concat(p,"-arrow")]:{right:{_skip_check_:!0,value:v}}}},c?l:{})),(s=!!b.left,u={[["&-placement-left > ".concat(p,"-arrow"),"&-placement-leftTop > ".concat(p,"-arrow"),"&-placement-leftBottom > ".concat(p,"-arrow")].join(",")]:{right:{_skip_check_:!0,value:h},transform:"translateX(100%) rotate(90deg)"},["&-placement-left > ".concat(p,"-arrow")]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},["&-placement-leftTop > ".concat(p,"-arrow")]:{top:g},["&-placement-leftBottom > ".concat(p,"-arrow")]:{bottom:g}},s?u:{})),(d=!!b.right,f={[["&-placement-right > ".concat(p,"-arrow"),"&-placement-rightTop > ".concat(p,"-arrow"),"&-placement-rightBottom > ".concat(p,"-arrow")].join(",")]:{left:{_skip_check_:!0,value:h},transform:"translateX(-100%) rotate(-90deg)"},["&-placement-right > ".concat(p,"-arrow")]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},["&-placement-rightTop > ".concat(p,"-arrow")]:{top:g},["&-placement-rightBottom > ".concat(p,"-arrow")]:{bottom:g}},d?f:{}))}}},34442:function(e,t,n){"use strict";n.d(t,{W:function(){return a},w:function(){return o}});var r=n(93463);function o(e){let{sizePopupArrow:t,borderRadiusXS:n,borderRadiusOuter:r}=e,o=t/2,a=1*r/Math.sqrt(2),i=o-r*(1-1/Math.sqrt(2)),c=o-1/Math.sqrt(2)*n,l=r*(Math.sqrt(2)-1)+1/Math.sqrt(2)*n,s=2*o-c,u=2*o-a,d=2*o-0,f=o*Math.sqrt(2)+r*(Math.sqrt(2)-2),p=r*(Math.sqrt(2)-1),m="polygon(".concat(p,"px 100%, 50% ").concat(p,"px, ").concat(2*o-p,"px 100%, ").concat(p,"px 100%)");return{arrowShadowWidth:f,arrowPath:"path('M ".concat(0," ").concat(o," A ").concat(r," ").concat(r," 0 0 0 ").concat(a," ").concat(i," L ").concat(c," ").concat(l," A ").concat(n," ").concat(n," 0 0 1 ").concat(s," ").concat(l," L ").concat(u," ").concat(i," A ").concat(r," ").concat(r," 0 0 0 ").concat(d," ").concat(o," Z')"),arrowPolygon:m}}let a=(e,t,n)=>{let{sizePopupArrow:o,arrowPolygon:a,arrowPath:i,arrowShadowWidth:c,borderRadiusXS:l,calc:s}=e;return{pointerEvents:"none",width:o,height:o,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:o,height:s(o).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[a,i]},content:'""'},"&::after":{content:'""',position:"absolute",width:c,height:c,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:"0 0 ".concat((0,r.bf)(l)," 0")},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}}},25119:function(e,t,n){"use strict";n.d(t,{Mj:function(){return i},u_:function(){return a}});var r=n(2265),o=n(70774);let a={token:o.Z,override:{override:o.Z},hashed:!0},i=r.createContext(a)},53454:function(e,t,n){"use strict";n.d(t,{i:function(){return r}});let r=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},57862:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var r=n(93463),o=n(57943),a=n(70774),i=n(54558),c=e=>{let t=e,n=e,r=e,o=e;return e<6&&e>=5?t=e+1:e<16&&e>=6?t=e+2:e>=16&&(t=16),e<7&&e>=5?n=4:e<8&&e>=7?n=5:e<14&&e>=8?n=6:e<16&&e>=14?n=7:e>=16&&(n=8),e<6&&e>=2?r=1:e>=6&&(r=2),e>4&&e<8?o=4:e>=8&&(o=6),{borderRadius:e,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:t,borderRadiusOuter:o}},l=e=>{let{controlHeight:t}=e;return{controlHeightSM:.75*t,controlHeightXS:.5*t,controlHeightLG:1.25*t}},s=n(1319),u=e=>{let t=(0,s.Z)(e),n=t.map(e=>e.size),r=t.map(e=>e.lineHeight),o=n[1],a=n[0],i=n[2],c=r[1],l=r[0],u=r[2];return{fontSizeSM:a,fontSize:o,fontSizeLG:i,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:c,lineHeightLG:u,lineHeightSM:l,fontHeight:Math.round(c*o),fontHeightLG:Math.round(u*i),fontHeightSM:Math.round(l*a),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};let d=(e,t)=>new i.t(e).setA(t).toRgbString(),f=(e,t)=>new i.t(e).darken(t).toHexString(),p=e=>{let t=(0,o.R_)(e);return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[4],6:t[5],7:t[6],8:t[4],9:t[5],10:t[6]}},m=(e,t)=>{let n=e||"#fff",r=t||"#000";return{colorBgBase:n,colorTextBase:r,colorText:d(r,.88),colorTextSecondary:d(r,.65),colorTextTertiary:d(r,.45),colorTextQuaternary:d(r,.25),colorFill:d(r,.15),colorFillSecondary:d(r,.06),colorFillTertiary:d(r,.04),colorFillQuaternary:d(r,.02),colorBgSolid:d(r,1),colorBgSolidHover:d(r,.75),colorBgSolidActive:d(r,.95),colorBgLayout:f(n,4),colorBgContainer:f(n,0),colorBgElevated:f(n,0),colorBgSpotlight:d(r,.85),colorBgBlur:"transparent",colorBorder:f(n,15),colorBorderSecondary:f(n,6)}};var g=(0,r.jG)(function(e){o.ez.pink=o.ez.magenta,o.Ti.pink=o.Ti.magenta;let t=Object.keys(a.M).map(t=>{let n=e[t]===o.ez[t]?o.Ti[t]:(0,o.R_)(e[t]);return Array.from({length:10},()=>1).reduce((e,r,o)=>(e["".concat(t,"-").concat(o+1)]=n[o],e["".concat(t).concat(o+1)]=n[o],e),{})}).reduce((e,t)=>e=Object.assign(Object.assign({},e),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),t),function(e,t){let{generateColorPalettes:n,generateNeutralColorPalettes:r}=t,{colorSuccess:o,colorWarning:a,colorError:c,colorInfo:l,colorPrimary:s,colorBgBase:u,colorTextBase:d}=e,f=n(s),p=n(o),m=n(a),g=n(c),v=n(l),h=r(u,d),b=n(e.colorLink||e.colorInfo),y=new i.t(g[1]).mix(new i.t(g[3]),50).toHexString();return Object.assign(Object.assign({},h),{colorPrimaryBg:f[1],colorPrimaryBgHover:f[2],colorPrimaryBorder:f[3],colorPrimaryBorderHover:f[4],colorPrimaryHover:f[5],colorPrimary:f[6],colorPrimaryActive:f[7],colorPrimaryTextHover:f[8],colorPrimaryText:f[9],colorPrimaryTextActive:f[10],colorSuccessBg:p[1],colorSuccessBgHover:p[2],colorSuccessBorder:p[3],colorSuccessBorderHover:p[4],colorSuccessHover:p[4],colorSuccess:p[6],colorSuccessActive:p[7],colorSuccessTextHover:p[8],colorSuccessText:p[9],colorSuccessTextActive:p[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBgFilledHover:y,colorErrorBgActive:g[3],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:m[1],colorWarningBgHover:m[2],colorWarningBorder:m[3],colorWarningBorderHover:m[4],colorWarningHover:m[4],colorWarning:m[6],colorWarningActive:m[7],colorWarningTextHover:m[8],colorWarningText:m[9],colorWarningTextActive:m[10],colorInfoBg:v[1],colorInfoBgHover:v[2],colorInfoBorder:v[3],colorInfoBorderHover:v[4],colorInfoHover:v[4],colorInfo:v[6],colorInfoActive:v[7],colorInfoTextHover:v[8],colorInfoText:v[9],colorInfoTextActive:v[10],colorLinkHover:b[4],colorLink:b[6],colorLinkActive:b[7],colorBgMask:new i.t("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}(e,{generateColorPalettes:p,generateNeutralColorPalettes:m})),u(e.fontSize)),function(e){let{sizeUnit:t,sizeStep:n}=e;return{sizeXXL:t*(n+8),sizeXL:t*(n+4),sizeLG:t*(n+2),sizeMD:t*(n+1),sizeMS:t*n,size:t*n,sizeSM:t*(n-1),sizeXS:t*(n-2),sizeXXS:t*(n-3)}}(e)),l(e)),function(e){let{motionUnit:t,motionBase:n,borderRadius:r,lineWidth:o}=e;return Object.assign({motionDurationFast:"".concat((n+t).toFixed(1),"s"),motionDurationMid:"".concat((n+2*t).toFixed(1),"s"),motionDurationSlow:"".concat((n+3*t).toFixed(1),"s"),lineWidthBold:o+1},c(r))}(e))})},70774:function(e,t,n){"use strict";n.d(t,{M:function(){return r}});let r={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},o=Object.assign(Object.assign({},r),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,\n'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',\n'Noto Color Emoji'",fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});t.Z=o},1319:function(e,t,n){"use strict";function r(e){return(e+8)/e}function o(e){let t=Array.from({length:10}).map((t,n)=>{let r=e*Math.pow(Math.E,(n-1)/5);return 2*Math.floor((n>1?Math.floor(r):Math.ceil(r))/2)});return t[1]=e,t.map(e=>({size:e,lineHeight:r(e)}))}n.d(t,{D:function(){return r},Z:function(){return o}})},84951:function(e,t,n){"use strict";n.d(t,{ZP:function(){return h},NJ:function(){return p}});var r=n(2265),o=n(93463),a=n(25119),i=n(57862),c=n(70774),l=n(54558),s=n(17431),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 o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function d(e){let{override:t}=e,n=u(e,["override"]),r=Object.assign({},t);Object.keys(c.Z).forEach(e=>{delete r[e]});let o=Object.assign(Object.assign({},n),r);return!1===o.motion&&(o.motionDurationFast="0s",o.motionDurationMid="0s",o.motionDurationSlow="0s"),Object.assign(Object.assign(Object.assign({},o),{colorFillContent:o.colorFillSecondary,colorFillContentHover:o.colorFill,colorFillAlter:o.colorFillQuaternary,colorBgContainerDisabled:o.colorFillTertiary,colorBorderBg:o.colorBgContainer,colorSplit:(0,s.Z)(o.colorBorderSecondary,o.colorBgContainer),colorTextPlaceholder:o.colorTextQuaternary,colorTextDisabled:o.colorTextQuaternary,colorTextHeading:o.colorText,colorTextLabel:o.colorTextSecondary,colorTextDescription:o.colorTextTertiary,colorTextLightSolid:o.colorWhite,colorHighlight:o.colorError,colorBgTextHover:o.colorFillSecondary,colorBgTextActive:o.colorFill,colorIcon:o.colorTextTertiary,colorIconHover:o.colorText,colorErrorOutline:(0,s.Z)(o.colorErrorBg,o.colorBgContainer),colorWarningOutline:(0,s.Z)(o.colorWarningBg,o.colorBgContainer),fontSizeIcon:o.fontSizeSM,lineWidthFocus:3*o.lineWidth,lineWidth:o.lineWidth,controlOutlineWidth:2*o.lineWidth,controlInteractiveSize:o.controlHeight/2,controlItemBgHover:o.colorFillTertiary,controlItemBgActive:o.colorPrimaryBg,controlItemBgActiveHover:o.colorPrimaryBgHover,controlItemBgActiveDisabled:o.colorFill,controlTmpOutline:o.colorFillQuaternary,controlOutline:(0,s.Z)(o.colorPrimaryBg,o.colorBgContainer),lineType:o.lineType,borderRadius:o.borderRadius,borderRadiusXS:o.borderRadiusXS,borderRadiusSM:o.borderRadiusSM,borderRadiusLG:o.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:o.sizeXXS,paddingXS:o.sizeXS,paddingSM:o.sizeSM,padding:o.size,paddingMD:o.sizeMD,paddingLG:o.sizeLG,paddingXL:o.sizeXL,paddingContentHorizontalLG:o.sizeLG,paddingContentVerticalLG:o.sizeMS,paddingContentHorizontal:o.sizeMS,paddingContentVertical:o.sizeSM,paddingContentHorizontalSM:o.size,paddingContentVerticalSM:o.sizeXS,marginXXS:o.sizeXXS,marginXS:o.sizeXS,marginSM:o.sizeSM,margin:o.size,marginMD:o.sizeMD,marginLG:o.sizeLG,marginXL:o.sizeXL,marginXXL:o.sizeXXL,boxShadow:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowSecondary:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowTertiary:"\n 0 1px 2px 0 rgba(0, 0, 0, 0.03),\n 0 1px 6px -1px rgba(0, 0, 0, 0.02),\n 0 2px 4px 0 rgba(0, 0, 0, 0.02)\n ",screenXS:480,screenXSMin:480,screenXSMax:575,screenSM:576,screenSMMin:576,screenSMMax:767,screenMD:768,screenMDMin:768,screenMDMax:991,screenLG:992,screenLGMin:992,screenLGMax:1199,screenXL:1200,screenXLMin:1200,screenXLMax:1599,screenXXL:1600,screenXXLMin:1600,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:"\n 0 1px 2px -2px ".concat(new l.t("rgba(0, 0, 0, 0.16)").toRgbString(),",\n 0 3px 6px 0 ").concat(new l.t("rgba(0, 0, 0, 0.12)").toRgbString(),",\n 0 5px 12px 4px ").concat(new l.t("rgba(0, 0, 0, 0.09)").toRgbString(),"\n "),boxShadowDrawerRight:"\n -6px 0 16px 0 rgba(0, 0, 0, 0.08),\n -3px 0 6px -4px rgba(0, 0, 0, 0.12),\n -9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerLeft:"\n 6px 0 16px 0 rgba(0, 0, 0, 0.08),\n 3px 0 6px -4px rgba(0, 0, 0, 0.12),\n 9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerUp:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerDown:"\n 0 -6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 -3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 -9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let p={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},m={motionBase:!0,motionUnit:!0},g={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},v=(e,t,n)=>{let r=n.getDerivativeToken(e),{override:o}=t,a=f(t,["override"]),i=Object.assign(Object.assign({},r),{override:o});return i=d(i),a&&Object.entries(a).forEach(e=>{let[t,n]=e,{theme:r}=n,o=f(n,["theme"]),a=o;r&&(a=v(Object.assign(Object.assign({},i),o),{override:o},r)),i[t]=a}),i};function h(){let{token:e,hashed:t,theme:n,override:l,cssVar:s}=r.useContext(a.Mj),u="".concat("5.29.1","-").concat(t||""),f=n||i.Z,[h,b,y]=(0,o.fp)(f,[c.Z,e],{salt:u,override:l,getComputedToken:v,formatToken:d,cssVar:s&&{prefix:s.prefix,key:s.key,unitless:p,ignore:m,preserve:g}});return[f,y,t?b:"",h,s]}},18536:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(53454);function o(e,t){return r.i.reduce((n,r)=>{let o=e["".concat(r,"1")],a=e["".concat(r,"3")],i=e["".concat(r,"6")],c=e["".concat(r,"7")];return Object.assign(Object.assign({},n),t(r,{lightColor:o,lightBorderColor:a,darkColor:i,textColor:c}))},{})}},99320:function(e,t,n){"use strict";n.d(t,{A1:function(){return s},I$:function(){return l},bk:function(){return u}});var r=n(2265),o=n(71140),a=n(71744),i=n(12918),c=n(84951);let{genStyleHooks:l,genComponentStyleHook:s,genSubStyleComponent:u}=(0,o.rb)({usePrefix:()=>{let{getPrefixCls:e,iconPrefixCls:t}=(0,r.useContext)(a.E_);return{rootPrefixCls:e(),iconPrefixCls:t}},useToken:()=>{let[e,t,n,r,o]=(0,c.ZP)();return{theme:e,realToken:t,hashId:n,token:r,cssVar:o}},useCSP:()=>{let{csp:e}=(0,r.useContext)(a.E_);return null!=e?e:{}},getResetStyles:(e,t)=>{var n;let r=(0,i.Lx)(e);return[r,{"&":r},(0,i.JT)(null!==(n=null==t?void 0:t.prefix.iconPrefixCls)&&void 0!==n?n:a.oR)]},getCommonStyle:i.du,getCompUnitless:()=>c.NJ})},17431:function(e,t,n){"use strict";var r=n(54558);function o(e){return e>=0&&e<=255}t.Z=function(e,t){let{r:n,g:a,b:i,a:c}=new r.t(e).toRgb();if(c<1)return e;let{r:l,g:s,b:u}=new r.t(t).toRgb();for(let e=.01;e<=1;e+=.01){let t=Math.round((n-l*(1-e))/e),c=Math.round((a-s*(1-e))/e),d=Math.round((i-u*(1-e))/e);if(o(t)&&o(c)&&o(d))return new r.t({r:t,g:c,b:d,a:Math.round(100*e)/100}).toRgbString()}return new r.t({r:n,g:a,b:i,a:1}).toRgbString()}},99981:function(e,t,n){"use strict";n.d(t,{Z:function(){return F}});var r=n(2265),o=n(36760),a=n.n(o),i=n(5769),c=n(50506),l=n(391),s=n(62236),u=n(68710),d=n(92736),f=n(19722),p=n(13613),m=n(95140),g=n(71744),v=n(84951),h=n(93463),b=n(12918),y=n(691),x=n(88260),w=n(34442),E=n(18536),C=n(71140),Z=n(99320);let S=e=>{let{calc:t,componentCls:n,tooltipMaxWidth:r,tooltipColor:o,tooltipBg:a,tooltipBorderRadius:i,zIndexPopup:c,controlHeight:l,boxShadowSecondary:s,paddingSM:u,paddingXS:d,arrowOffsetHorizontal:f,sizePopupArrow:p}=e,m=t(i).add(p).add(f).equal(),g=t(i).mul(2).add(p).equal();return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,b.Wf)(e)),{position:"absolute",zIndex:c,display:"block",width:"max-content",maxWidth:r,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:"var(--valid-offset-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":a,["".concat(n,"-inner")]:{minWidth:g,minHeight:l,padding:"".concat((0,h.bf)(e.calc(u).div(2).equal())," ").concat((0,h.bf)(d)),color:"var(--ant-tooltip-color, ".concat(o,")"),textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:a,borderRadius:i,boxShadow:s,boxSizing:"border-box"},"&-placement-topLeft,&-placement-topRight,&-placement-bottomLeft,&-placement-bottomRight":{minWidth:m},"&-placement-left,&-placement-leftTop,&-placement-leftBottom,&-placement-right,&-placement-rightTop,&-placement-rightBottom":{["".concat(n,"-inner")]:{borderRadius:e.min(i,x.qN)}},["".concat(n,"-content")]:{position:"relative"}}),(0,E.Z)(e,(e,t)=>{let{darkColor:r}=t;return{["&".concat(n,"-").concat(e)]:{["".concat(n,"-inner")]:{backgroundColor:r},["".concat(n,"-arrow")]:{"--antd-arrow-background-color":r}}}})),{"&-rtl":{direction:"rtl"}})},(0,x.ZP)(e,"var(--antd-arrow-background-color)"),{["".concat(n,"-pure")]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow}}]},O=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+70},(0,x.wZ)({contentRadius:e.borderRadius,limitVerticalRadius:!0})),(0,w.w)((0,C.IX)(e,{borderRadiusOuter:Math.min(e.borderRadiusOuter,4)})));function k(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return(0,Z.I$)("Tooltip",e=>{let{borderRadius:t,colorTextLightSolid:n,colorBgSpotlight:r}=e;return[S((0,C.IX)(e,{tooltipMaxWidth:250,tooltipColor:n,tooltipBorderRadius:t,tooltipBg:r})),(0,y._y)(e,"zoom-big-fast")]},O,{resetStyle:!1,injectStyle:t})(e)}var j=n(93350);n(75669);var I=n(11357);let M=e=>e instanceof I.y9?e:new I.y9(e);function R(e,t){let n=(0,j.o2)(t),r=a()({["".concat(e,"-").concat(t)]:t&&n}),o={},i={},c=M(t).toRgb(),l=(.299*c.r+.587*c.g+.114*c.b)/255;return t&&!n&&(o.background=t,o["--ant-tooltip-color"]=l<.5?"#FFF":"#000",i["--antd-arrow-background-color"]=t),{className:r,overlayStyle:o,arrowStyle:i}}var N=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let P=r.forwardRef((e,t)=>{var n,o;let{prefixCls:h,openClassName:b,getTooltipContainer:y,color:x,overlayInnerStyle:w,children:E,afterOpenChange:C,afterVisibleChange:Z,destroyTooltipOnHide:S,destroyOnHidden:O,arrow:j=!0,title:I,overlay:M,builtinPlacements:P,arrowPointAtCenter:F=!1,autoAdjustOverflow:T=!0,motion:A,getPopupContainer:_,placement:B="top",mouseEnterDelay:H=.1,mouseLeaveDelay:z=.1,overlayStyle:L,rootClassName:D,overlayClassName:W,styles:V,classNames:q}=e,X=N(e,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","destroyOnHidden","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),G=!!j,[,U]=(0,v.ZP)(),{getPopupContainer:$,getPrefixCls:K,direction:Y,className:Q,style:J,classNames:ee,styles:et}=(0,g.dj)("tooltip"),en=(0,p.ln)("Tooltip"),er=r.useRef(null),eo=()=>{var e;null===(e=er.current)||void 0===e||e.forceAlign()};r.useImperativeHandle(t,()=>{var e,t;return{forceAlign:eo,forcePopupAlign:()=>{en.deprecated(!1,"forcePopupAlign","forceAlign"),eo()},nativeElement:null===(e=er.current)||void 0===e?void 0:e.nativeElement,popupElement:null===(t=er.current)||void 0===t?void 0:t.popupElement}});let[ea,ei]=(0,c.Z)(!1,{value:null!==(n=e.open)&&void 0!==n?n:e.visible,defaultValue:null!==(o=e.defaultOpen)&&void 0!==o?o:e.defaultVisible}),ec=!I&&!M&&0!==I,el=r.useMemo(()=>{var e,t;let n=F;return"object"==typeof j&&(n=null!==(t=null!==(e=j.pointAtCenter)&&void 0!==e?e:j.arrowPointAtCenter)&&void 0!==t?t:F),P||(0,d.Z)({arrowPointAtCenter:n,autoAdjustOverflow:T,arrowWidth:G?U.sizePopupArrow:0,borderRadius:U.borderRadius,offset:U.marginXXS,visibleFirst:!0})},[F,j,P,U]),es=r.useMemo(()=>0===I?I:M||I||"",[M,I]),eu=r.createElement(l.Z,{space:!0},"function"==typeof es?es():es),ed=K("tooltip",h),ef=K(),ep=e["data-popover-inject"],em=ea;"open"in e||"visible"in e||!ec||(em=!1);let eg=r.isValidElement(E)&&!(0,f.M2)(E)?E:r.createElement("span",null,E),ev=eg.props,eh=ev.className&&"string"!=typeof ev.className?ev.className:a()(ev.className,b||"".concat(ed,"-open")),[eb,ey,ex]=k(ed,!ep),ew=R(ed,x),eE=ew.arrowStyle,eC=a()(W,{["".concat(ed,"-rtl")]:"rtl"===Y},ew.className,D,ey,ex,Q,ee.root,null==q?void 0:q.root),eZ=a()(ee.body,null==q?void 0:q.body),[eS,eO]=(0,s.Cn)("Tooltip",X.zIndex),ek=r.createElement(i.Z,Object.assign({},X,{zIndex:eS,showArrow:G,placement:B,mouseEnterDelay:H,mouseLeaveDelay:z,prefixCls:ed,classNames:{root:eC,body:eZ},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},eE),et.root),J),L),null==V?void 0:V.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},et.body),w),null==V?void 0:V.body),ew.overlayStyle)},getTooltipContainer:_||y||$,ref:er,builtinPlacements:el,overlay:eu,visible:em,onVisibleChange:t=>{var n,r;ei(!ec&&t),ec||(null===(n=e.onOpenChange)||void 0===n||n.call(e,t),null===(r=e.onVisibleChange)||void 0===r||r.call(e,t))},afterVisibleChange:null!=C?C:Z,arrowContent:r.createElement("span",{className:"".concat(ed,"-arrow-content")}),motion:{motionName:(0,u.m)(ef,"zoom-big-fast",e.transitionName),motionDeadline:1e3},destroyTooltipOnHide:null!=O?O:!!S}),em?(0,f.Tm)(eg,{className:eh}):eg);return eb(r.createElement(m.Z.Provider,{value:eO},ek))});P._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,className:n,placement:o="top",title:c,color:l,overlayInnerStyle:s}=e,{getPrefixCls:u}=r.useContext(g.E_),d=u("tooltip",t),[f,p,m]=k(d),v=R(d,l),h=v.arrowStyle,b=Object.assign(Object.assign({},s),v.overlayStyle),y=a()(p,m,d,"".concat(d,"-pure"),"".concat(d,"-placement-").concat(o),n,v.className);return f(r.createElement("div",{className:y,style:h},r.createElement("div",{className:"".concat(d,"-arrow")}),r.createElement(i.G,Object.assign({},e,{className:p,prefixCls:d,overlayInnerStyle:b}),c)))};var F=P},99376:function(e,t,n){"use strict";var r=n(35475);n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useRouter")&&n.d(t,{useRouter:function(){return r.useRouter}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})},40257:function(e,t,n){"use strict";var r,o;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(o=n.g.process)?void 0:o.env)?n.g.process:n(44227)},44227:function(e){!function(){var t={229:function(e){var t,n,r,o=e.exports={};function a(){throw Error("setTimeout has not been defined")}function i(){throw Error("clearTimeout has not been defined")}function c(e){if(t===setTimeout)return setTimeout(e,0);if((t===a||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:a}catch(e){t=a}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var l=[],s=!1,u=-1;function d(){s&&r&&(s=!1,r.length?l=r.concat(l):u=-1,l.length&&f())}function f(){if(!s){var e=c(d);s=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;n1?t-1:0),r=1;r=a)return e;switch(e){case"%s":return String(n[o++]);case"%d":return Number(n[o++]);case"%j":try{return JSON.stringify(n[o++])}catch(e){return"[Circular]"}break;default:return e}}):e}function A(e,t){return!!(null==e||"array"===t&&Array.isArray(e)&&!e.length)||("string"===t||"url"===t||"hex"===t||"email"===t||"date"===t||"pattern"===t)&&"string"==typeof e&&!e}function _(e,t,n){var r=0,o=e.length;!function a(i){if(i&&i.length){n(i);return}var c=r;r+=1,c()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},q={integer:function(e){return q.number(e)&&parseInt(e,10)===e},float:function(e){return q.number(e)&&!q.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return new RegExp(e),!0}catch(e){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"===(0,S.Z)(e)&&!q.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&e.length<=320&&!!e.match(V.email)},url:function(e){return"string"==typeof e&&e.length<=2048&&!!e.match(W())},hex:function(e){return"string"==typeof e&&!!e.match(V.hex)}},X={required:D,whitespace:function(e,t,n,r,o){(/^\s+$/.test(t)||""===t)&&r.push(T(o.messages.whitespace,e.fullField))},type:function(e,t,n,r,o){if(e.required&&void 0===t){D(e,t,n,r,o);return}var a=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(a)>-1?q[a](t)||r.push(T(o.messages.types[a],e.fullField,e.type)):a&&(0,S.Z)(t)!==e.type&&r.push(T(o.messages.types[a],e.fullField,e.type))},range:function(e,t,n,r,o){var a="number"==typeof e.len,i="number"==typeof e.min,c="number"==typeof e.max,l=t,s=null,u="number"==typeof t,d="string"==typeof t,f=Array.isArray(t);if(u?s="number":d?s="string":f&&(s="array"),!s)return!1;f&&(l=t.length),d&&(l=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),a?l!==e.len&&r.push(T(o.messages[s].len,e.fullField,e.len)):i&&!c&&le.max?r.push(T(o.messages[s].max,e.fullField,e.max)):i&&c&&(le.max)&&r.push(T(o.messages[s].range,e.fullField,e.min,e.max))},enum:function(e,t,n,r,o){e[L]=Array.isArray(e[L])?e[L]:[],-1===e[L].indexOf(t)&&r.push(T(o.messages[L],e.fullField,e[L].join(", ")))},pattern:function(e,t,n,r,o){!e.pattern||(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(T(o.messages.pattern.mismatch,e.fullField,t,e.pattern))):"string"!=typeof e.pattern||new RegExp(e.pattern).test(t)||r.push(T(o.messages.pattern.mismatch,e.fullField,t,e.pattern)))}},G=function(e,t,n,r,o){var a=e.type,i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t,a)&&!e.required)return n();X.required(e,t,r,i,o,a),A(t,a)||X.type(e,t,r,i,o)}n(i)},U={string:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t,"string")&&!e.required)return n();X.required(e,t,r,a,o,"string"),A(t,"string")||(X.type(e,t,r,a,o),X.range(e,t,r,a,o),X.pattern(e,t,r,a,o),!0===e.whitespace&&X.whitespace(e,t,r,a,o))}n(a)},method:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&X.type(e,t,r,a,o)}n(a)},number:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(""===t&&(t=void 0),A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&(X.type(e,t,r,a,o),X.range(e,t,r,a,o))}n(a)},boolean:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&X.type(e,t,r,a,o)}n(a)},regexp:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),A(t)||X.type(e,t,r,a,o)}n(a)},integer:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&(X.type(e,t,r,a,o),X.range(e,t,r,a,o))}n(a)},float:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&(X.type(e,t,r,a,o),X.range(e,t,r,a,o))}n(a)},array:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(null==t&&!e.required)return n();X.required(e,t,r,a,o,"array"),null!=t&&(X.type(e,t,r,a,o),X.range(e,t,r,a,o))}n(a)},object:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&X.type(e,t,r,a,o)}n(a)},enum:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&X.enum(e,t,r,a,o)}n(a)},pattern:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t,"string")&&!e.required)return n();X.required(e,t,r,a,o),A(t,"string")||X.pattern(e,t,r,a,o)}n(a)},date:function(e,t,n,r,o){var a,i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t,"date")&&!e.required)return n();X.required(e,t,r,i,o),!A(t,"date")&&(a=t instanceof Date?t:new Date(t),X.type(e,a,r,i,o),a&&X.range(e,a.getTime(),r,i,o))}n(i)},url:G,hex:G,email:G,required:function(e,t,n,r,o){var a=[],i=Array.isArray(t)?"array":(0,S.Z)(t);X.required(e,t,r,a,o,i),n(a)},any:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o)}n(a)}},$=function(){function e(t){(0,d.Z)(this,e),(0,v.Z)(this,"rules",null),(0,v.Z)(this,"_messages",k),this.define(t)}return(0,f.Z)(e,[{key:"define",value:function(e){var t=this;if(!e)throw Error("Cannot configure a schema with no rules");if("object"!==(0,S.Z)(e)||Array.isArray(e))throw Error("Rules must be an object");this.rules={},Object.keys(e).forEach(function(n){var r=e[n];t.rules[n]=Array.isArray(r)?r:[r]})}},{key:"messages",value:function(e){return e&&(this._messages=z(O(),e)),this._messages}},{key:"validate",value:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},a=t,i=r,c=o;if("function"==typeof i&&(c=i,i={}),!this.rules||0===Object.keys(this.rules).length)return c&&c(null,a),Promise.resolve(a);if(i.messages){var l=this.messages();l===k&&(l=O()),z(l,i.messages),i.messages=l}else i.messages=this.messages();var d={};(i.keys||Object.keys(this.rules)).forEach(function(e){var r=n.rules[e],o=a[e];r.forEach(function(r){var i=r;"function"==typeof i.transform&&(a===t&&(a=(0,s.Z)({},a)),null!=(o=a[e]=i.transform(o))&&(i.type=i.type||(Array.isArray(o)?"array":(0,S.Z)(o)))),(i="function"==typeof i?{validator:i}:(0,s.Z)({},i)).validator=n.getValidationMethod(i),i.validator&&(i.field=e,i.fullField=i.fullField||e,i.type=n.getType(i),d[e]=d[e]||[],d[e].push({rule:i,value:o,source:a,field:e}))})});var f={};return function(e,t,n,r,o){if(t.first){var a=new Promise(function(t,a){var i;_((i=[],Object.keys(e).forEach(function(t){i.push.apply(i,(0,u.Z)(e[t]||[]))}),i),n,function(e){return r(e),e.length?a(new B(e,F(e))):t(o)})});return a.catch(function(e){return e}),a}var i=!0===t.firstFields?Object.keys(e):t.firstFields||[],c=Object.keys(e),l=c.length,s=0,d=[],f=new Promise(function(t,a){var f=function(e){if(d.push.apply(d,e),++s===l)return r(d),d.length?a(new B(d,F(d))):t(o)};c.length||(r(d),t(o)),c.forEach(function(t){var r=e[t];-1!==i.indexOf(t)?_(r,n,f):function(e,t,n){var r=[],o=0,a=e.length;function i(e){r.push.apply(r,(0,u.Z)(e||[])),++o===a&&n(r)}e.forEach(function(e){t(e,i)})}(r,n,f)})});return f.catch(function(e){return e}),f}(d,i,function(t,n){var r,o,c,l=t.rule,d=("object"===l.type||"array"===l.type)&&("object"===(0,S.Z)(l.fields)||"object"===(0,S.Z)(l.defaultField));function p(e,t){return(0,s.Z)((0,s.Z)({},t),{},{fullField:"".concat(l.fullField,".").concat(e),fullFields:l.fullFields?[].concat((0,u.Z)(l.fullFields),[e]):[e]})}function m(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=Array.isArray(r)?r:[r];!i.suppressWarning&&o.length&&e.warning("async-validator:",o),o.length&&void 0!==l.message&&(o=[].concat(l.message));var c=o.map(H(l,a));if(i.first&&c.length)return f[l.field]=1,n(c);if(d){if(l.required&&!t.value)return void 0!==l.message?c=[].concat(l.message).map(H(l,a)):i.error&&(c=[i.error(l,T(i.messages.required,l.field))]),n(c);var m={};l.defaultField&&Object.keys(t.value).map(function(e){m[e]=l.defaultField});var g={};Object.keys(m=(0,s.Z)((0,s.Z)({},m),t.rule.fields)).forEach(function(e){var t=m[e],n=Array.isArray(t)?t:[t];g[e]=n.map(p.bind(null,e))});var v=new e(g);v.messages(i.messages),t.rule.options&&(t.rule.options.messages=i.messages,t.rule.options.error=i.error),v.validate(t.value,t.rule.options||i,function(e){var t=[];c&&c.length&&t.push.apply(t,(0,u.Z)(c)),e&&e.length&&t.push.apply(t,(0,u.Z)(e)),n(t.length?t:null)})}else n(c)}if(d=d&&(l.required||!l.required&&t.value),l.field=t.field,l.asyncValidator)r=l.asyncValidator(l,t.value,m,t.source,i);else if(l.validator){try{r=l.validator(l,t.value,m,t.source,i)}catch(e){null===(o=(c=console).error)||void 0===o||o.call(c,e),i.suppressValidatorError||setTimeout(function(){throw e},0),m(e.message)}!0===r?m():!1===r?m("function"==typeof l.message?l.message(l.fullField||l.field):l.message||"".concat(l.fullField||l.field," fails")):r instanceof Array?m(r):r instanceof Error&&m(r.message)}r&&r.then&&r.then(function(){return m()},function(e){return m(e)})},function(e){!function(e){for(var t=[],n={},r=0;r0)){e.next=23;break}return e.next=21,Promise.all(n.map(function(e,n){return ee("".concat(t,".").concat(n),e,f,a,i)}));case 21:return h=e.sent,e.abrupt("return",h.reduce(function(e,t){return[].concat((0,u.Z)(e),(0,u.Z)(t))},[]));case 23:return b=(0,s.Z)((0,s.Z)({},r),{},{name:t,enum:(r.enum||[]).join(", ")},i),y=g.map(function(e){return"string"==typeof e?function(e,t){return e.replace(/\\?\$\{\w+\}/g,function(e){return e.startsWith("\\")?e.slice(1):t[e.slice(2,-1)]})}(e,b):e}),e.abrupt("return",y);case 26:case"end":return e.stop()}},e,null,[[10,15]])}))).apply(this,arguments)}function en(){return(en=(0,l.Z)((0,c.Z)().mark(function e(t){return(0,c.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(t).then(function(e){var t;return(t=[]).concat.apply(t,(0,u.Z)(e))}));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function er(){return(er=(0,l.Z)((0,c.Z)().mark(function e(t){var n;return(0,c.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=0,e.abrupt("return",new Promise(function(e){t.forEach(function(r){r.then(function(r){r.errors.length&&e([r]),(n+=1)===t.length&&e([])})})}));case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}var eo=n(16847);function ea(e){return Z(e)}function ei(e,t){var n={};return t.forEach(function(t){var r=(0,eo.Z)(e,t);n=(0,Q.Z)(n,t,r)}),n}function ec(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e&&e.some(function(e){return el(t,e,n)})}function el(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!!e&&!!t&&(!!n||e.length===t.length)&&t.every(function(t,n){return e[n]===t})}function es(e){var t=arguments.length<=1?void 0:arguments[1];return t&&t.target&&"object"===(0,S.Z)(t.target)&&e in t.target?t.target[e]:t}function eu(e,t,n){var r=e.length;if(t<0||t>=r||n<0||n>=r)return e;var o=e[t],a=t-n;return a>0?[].concat((0,u.Z)(e.slice(0,n)),[o],(0,u.Z)(e.slice(n,t)),(0,u.Z)(e.slice(t+1,r))):a<0?[].concat((0,u.Z)(e.slice(0,t)),(0,u.Z)(e.slice(t+1,n+1)),[o],(0,u.Z)(e.slice(n+1,r))):e}var ed=["name"],ef=[];function ep(e,t,n,r,o,a){return"function"==typeof e?e(t,n,"source"in a?{source:a.source}:{}):r!==o}var em=function(e){(0,m.Z)(n,e);var t=(0,g.Z)(n);function n(e){var r;return(0,d.Z)(this,n),r=t.call(this,e),(0,v.Z)((0,p.Z)(r),"state",{resetCount:0}),(0,v.Z)((0,p.Z)(r),"cancelRegisterFunc",null),(0,v.Z)((0,p.Z)(r),"mounted",!1),(0,v.Z)((0,p.Z)(r),"touched",!1),(0,v.Z)((0,p.Z)(r),"dirty",!1),(0,v.Z)((0,p.Z)(r),"validatePromise",void 0),(0,v.Z)((0,p.Z)(r),"prevValidating",void 0),(0,v.Z)((0,p.Z)(r),"errors",ef),(0,v.Z)((0,p.Z)(r),"warnings",ef),(0,v.Z)((0,p.Z)(r),"cancelRegister",function(){var e=r.props,t=e.preserve,n=e.isListField,o=e.name;r.cancelRegisterFunc&&r.cancelRegisterFunc(n,t,ea(o)),r.cancelRegisterFunc=null}),(0,v.Z)((0,p.Z)(r),"getNamePath",function(){var e=r.props,t=e.name,n=e.fieldContext.prefixName;return void 0!==t?[].concat((0,u.Z)(void 0===n?[]:n),(0,u.Z)(t)):[]}),(0,v.Z)((0,p.Z)(r),"getRules",function(){var e=r.props,t=e.rules,n=e.fieldContext;return(void 0===t?[]:t).map(function(e){return"function"==typeof e?e(n):e})}),(0,v.Z)((0,p.Z)(r),"refresh",function(){r.mounted&&r.setState(function(e){return{resetCount:e.resetCount+1}})}),(0,v.Z)((0,p.Z)(r),"metaCache",null),(0,v.Z)((0,p.Z)(r),"triggerMetaEvent",function(e){var t=r.props.onMetaChange;if(t){var n=(0,s.Z)((0,s.Z)({},r.getMeta()),{},{destroy:e});(0,b.Z)(r.metaCache,n)||t(n),r.metaCache=n}else r.metaCache=null}),(0,v.Z)((0,p.Z)(r),"onStoreChange",function(e,t,n){var o=r.props,a=o.shouldUpdate,i=o.dependencies,c=void 0===i?[]:i,l=o.onReset,s=n.store,u=r.getNamePath(),d=r.getValue(e),f=r.getValue(s),p=t&&ec(t,u);switch("valueUpdate"!==n.type||"external"!==n.source||(0,b.Z)(d,f)||(r.touched=!0,r.dirty=!0,r.validatePromise=null,r.errors=ef,r.warnings=ef,r.triggerMetaEvent()),n.type){case"reset":if(!t||p){r.touched=!1,r.dirty=!1,r.validatePromise=void 0,r.errors=ef,r.warnings=ef,r.triggerMetaEvent(),null==l||l(),r.refresh();return}break;case"remove":if(a&&ep(a,e,s,d,f,n)){r.reRender();return}break;case"setField":var m=n.data;if(p){"touched"in m&&(r.touched=m.touched),"validating"in m&&!("originRCField"in m)&&(r.validatePromise=m.validating?Promise.resolve([]):null),"errors"in m&&(r.errors=m.errors||ef),"warnings"in m&&(r.warnings=m.warnings||ef),r.dirty=!0,r.triggerMetaEvent(),r.reRender();return}if("value"in m&&ec(t,u,!0)||a&&!u.length&&ep(a,e,s,d,f,n)){r.reRender();return}break;case"dependenciesUpdate":if(c.map(ea).some(function(e){return ec(n.relatedFields,e)})){r.reRender();return}break;default:if(p||(!c.length||u.length||a)&&ep(a,e,s,d,f,n)){r.reRender();return}}!0===a&&r.reRender()}),(0,v.Z)((0,p.Z)(r),"validateRules",function(e){var t=r.getNamePath(),n=r.getValue(),o=e||{},a=o.triggerName,i=o.validateOnly,d=Promise.resolve().then((0,l.Z)((0,c.Z)().mark(function o(){var i,f,p,m,g,v,h;return(0,c.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(r.mounted){o.next=2;break}return o.abrupt("return",[]);case 2:if(p=void 0!==(f=(i=r.props).validateFirst)&&f,m=i.messageVariables,g=i.validateDebounce,v=r.getRules(),a&&(v=v.filter(function(e){return e}).filter(function(e){var t=e.validateTrigger;return!t||Z(t).includes(a)})),!(g&&a)){o.next=10;break}return o.next=8,new Promise(function(e){setTimeout(e,g)});case 8:if(!(r.validatePromise!==d)){o.next=10;break}return o.abrupt("return",[]);case 10:return(h=function(e,t,n,r,o,a){var i,u,d=e.join("."),f=n.map(function(e,t){var n=e.validator,r=(0,s.Z)((0,s.Z)({},e),{},{ruleIndex:t});return n&&(r.validator=function(e,t,r){var o=!1,a=n(e,t,function(){for(var e=arguments.length,t=Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:ef;if(r.validatePromise===d){r.validatePromise=null;var t,n=[],o=[];null===(t=e.forEach)||void 0===t||t.call(e,function(e){var t=e.rule.warningOnly,r=e.errors,a=void 0===r?ef:r;t?o.push.apply(o,(0,u.Z)(a)):n.push.apply(n,(0,u.Z)(a))}),r.errors=n,r.warnings=o,r.triggerMetaEvent(),r.reRender()}}),o.abrupt("return",h);case 13:case"end":return o.stop()}},o)})));return void 0!==i&&i||(r.validatePromise=d,r.dirty=!0,r.errors=ef,r.warnings=ef,r.triggerMetaEvent(),r.reRender()),d}),(0,v.Z)((0,p.Z)(r),"isFieldValidating",function(){return!!r.validatePromise}),(0,v.Z)((0,p.Z)(r),"isFieldTouched",function(){return r.touched}),(0,v.Z)((0,p.Z)(r),"isFieldDirty",function(){return!!r.dirty||void 0!==r.props.initialValue||void 0!==(0,r.props.fieldContext.getInternalHooks(x).getInitialValue)(r.getNamePath())}),(0,v.Z)((0,p.Z)(r),"getErrors",function(){return r.errors}),(0,v.Z)((0,p.Z)(r),"getWarnings",function(){return r.warnings}),(0,v.Z)((0,p.Z)(r),"isListField",function(){return r.props.isListField}),(0,v.Z)((0,p.Z)(r),"isList",function(){return r.props.isList}),(0,v.Z)((0,p.Z)(r),"isPreserve",function(){return r.props.preserve}),(0,v.Z)((0,p.Z)(r),"getMeta",function(){return r.prevValidating=r.isFieldValidating(),{touched:r.isFieldTouched(),validating:r.prevValidating,errors:r.errors,warnings:r.warnings,name:r.getNamePath(),validated:null===r.validatePromise}}),(0,v.Z)((0,p.Z)(r),"getOnlyChild",function(e){if("function"==typeof e){var t=r.getMeta();return(0,s.Z)((0,s.Z)({},r.getOnlyChild(e(r.getControlled(),t,r.props.fieldContext))),{},{isFunction:!0})}var n=(0,h.Z)(e);return 1===n.length&&o.isValidElement(n[0])?{child:n[0],isFunction:!1}:{child:n,isFunction:!1}}),(0,v.Z)((0,p.Z)(r),"getValue",function(e){var t=r.props.fieldContext.getFieldsValue,n=r.getNamePath();return(0,eo.Z)(e||t(!0),n)}),(0,v.Z)((0,p.Z)(r),"getControlled",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=r.props,n=t.name,o=t.trigger,a=t.validateTrigger,i=t.getValueFromEvent,c=t.normalize,l=t.valuePropName,u=t.getValueProps,d=t.fieldContext,f=void 0!==a?a:d.validateTrigger,p=r.getNamePath(),m=d.getInternalHooks,g=d.getFieldsValue,h=m(x).dispatch,b=r.getValue(),y=u||function(e){return(0,v.Z)({},l,e)},w=e[o],E=void 0!==n?y(b):{},C=(0,s.Z)((0,s.Z)({},e),E);return C[o]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var e,t=arguments.length,n=Array(t),o=0;o=0&&t<=n.length?(f.keys=[].concat((0,u.Z)(f.keys.slice(0,t)),[f.id],(0,u.Z)(f.keys.slice(t))),o([].concat((0,u.Z)(n.slice(0,t)),[e],(0,u.Z)(n.slice(t))))):(f.keys=[].concat((0,u.Z)(f.keys),[f.id]),o([].concat((0,u.Z)(n),[e]))),f.id+=1},remove:function(e){var t=i(),n=new Set(Array.isArray(e)?e:[e]);n.size<=0||(f.keys=f.keys.filter(function(e,t){return!n.has(t)}),o(t.filter(function(e,t){return!n.has(t)})))},move:function(e,t){if(e!==t){var n=i();e<0||e>=n.length||t<0||t>=n.length||(f.keys=eu(f.keys,e,t),o(eu(n,e,t)))}}},t)})))},eh=n(26365),eb="__@field_split__";function ey(e){return e.map(function(e){return"".concat((0,S.Z)(e),":").concat(e)}).join(eb)}var ex=function(){function e(){(0,d.Z)(this,e),(0,v.Z)(this,"kvs",new Map)}return(0,f.Z)(e,[{key:"set",value:function(e,t){this.kvs.set(ey(e),t)}},{key:"get",value:function(e){return this.kvs.get(ey(e))}},{key:"update",value:function(e,t){var n=t(this.get(e));n?this.set(e,n):this.delete(e)}},{key:"delete",value:function(e){this.kvs.delete(ey(e))}},{key:"map",value:function(e){return(0,u.Z)(this.kvs.entries()).map(function(t){var n=(0,eh.Z)(t,2),r=n[0],o=n[1];return e({key:r.split(eb).map(function(e){var t=e.match(/^([^:]*):(.*)$/),n=(0,eh.Z)(t,3),r=n[1],o=n[2];return"number"===r?Number(o):o}),value:o})})}},{key:"toJSON",value:function(){var e={};return this.map(function(t){var n=t.key,r=t.value;return e[n.join(".")]=r,null}),e}}]),e}(),ew=["name"],eE=(0,f.Z)(function e(t){var n=this;(0,d.Z)(this,e),(0,v.Z)(this,"formHooked",!1),(0,v.Z)(this,"forceRootUpdate",void 0),(0,v.Z)(this,"subscribable",!0),(0,v.Z)(this,"store",{}),(0,v.Z)(this,"fieldEntities",[]),(0,v.Z)(this,"initialValues",{}),(0,v.Z)(this,"callbacks",{}),(0,v.Z)(this,"validateMessages",null),(0,v.Z)(this,"preserve",null),(0,v.Z)(this,"lastValidatePromise",null),(0,v.Z)(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),(0,v.Z)(this,"getInternalHooks",function(e){return e===x?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):((0,y.ZP)(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),(0,v.Z)(this,"useSubscribe",function(e){n.subscribable=e}),(0,v.Z)(this,"prevWithoutPreserves",null),(0,v.Z)(this,"setInitialValues",function(e,t){if(n.initialValues=e||{},t){var r,o=(0,Q.T)(e,n.store);null===(r=n.prevWithoutPreserves)||void 0===r||r.map(function(t){var n=t.key;o=(0,Q.Z)(o,n,(0,eo.Z)(e,n))}),n.prevWithoutPreserves=null,n.updateStore(o)}}),(0,v.Z)(this,"destroyForm",function(e){if(e)n.updateStore({});else{var t=new ex;n.getFieldEntities(!0).forEach(function(e){n.isMergedPreserve(e.isPreserve())||t.set(e.getNamePath(),!0)}),n.prevWithoutPreserves=t}}),(0,v.Z)(this,"getInitialValue",function(e){var t=(0,eo.Z)(n.initialValues,e);return e.length?(0,Q.T)(t):t}),(0,v.Z)(this,"setCallbacks",function(e){n.callbacks=e}),(0,v.Z)(this,"setValidateMessages",function(e){n.validateMessages=e}),(0,v.Z)(this,"setPreserve",function(e){n.preserve=e}),(0,v.Z)(this,"watchList",[]),(0,v.Z)(this,"registerWatch",function(e){return n.watchList.push(e),function(){n.watchList=n.watchList.filter(function(t){return t!==e})}}),(0,v.Z)(this,"notifyWatch",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(n.watchList.length){var t=n.getFieldsValue(),r=n.getFieldsValue(!0);n.watchList.forEach(function(n){n(t,r,e)})}}),(0,v.Z)(this,"timeoutId",null),(0,v.Z)(this,"warningUnhooked",function(){}),(0,v.Z)(this,"updateStore",function(e){n.store=e}),(0,v.Z)(this,"getFieldEntities",function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?n.fieldEntities.filter(function(e){return e.getNamePath().length}):n.fieldEntities}),(0,v.Z)(this,"getFieldsMap",function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=new ex;return n.getFieldEntities(e).forEach(function(e){var n=e.getNamePath();t.set(n,e)}),t}),(0,v.Z)(this,"getFieldEntitiesForNamePathList",function(e){if(!e)return n.getFieldEntities(!0);var t=n.getFieldsMap(!0);return e.map(function(e){var n=ea(e);return t.get(n)||{INVALIDATE_NAME_PATH:ea(e)}})}),(0,v.Z)(this,"getFieldsValue",function(e,t){if(n.warningUnhooked(),!0===e||Array.isArray(e)?(r=e,o=t):e&&"object"===(0,S.Z)(e)&&(a=e.strict,o=e.filter),!0===r&&!o)return n.store;var r,o,a,i=n.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),c=[];return i.forEach(function(e){var t,n,i,l="INVALIDATE_NAME_PATH"in e?e.INVALIDATE_NAME_PATH:e.getNamePath();if(a){if(null!==(i=e.isList)&&void 0!==i&&i.call(e))return}else if(!r&&null!==(t=(n=e).isListField)&&void 0!==t&&t.call(n))return;if(o){var s="getMeta"in e?e.getMeta():null;o(s)&&c.push(l)}else c.push(l)}),ei(n.store,c.map(ea))}),(0,v.Z)(this,"getFieldValue",function(e){n.warningUnhooked();var t=ea(e);return(0,eo.Z)(n.store,t)}),(0,v.Z)(this,"getFieldsError",function(e){return n.warningUnhooked(),n.getFieldEntitiesForNamePathList(e).map(function(t,n){return!t||"INVALIDATE_NAME_PATH"in t?{name:ea(e[n]),errors:[],warnings:[]}:{name:t.getNamePath(),errors:t.getErrors(),warnings:t.getWarnings()}})}),(0,v.Z)(this,"getFieldError",function(e){n.warningUnhooked();var t=ea(e);return n.getFieldsError([t])[0].errors}),(0,v.Z)(this,"getFieldWarning",function(e){n.warningUnhooked();var t=ea(e);return n.getFieldsError([t])[0].warnings}),(0,v.Z)(this,"isFieldsTouched",function(){n.warningUnhooked();for(var e,t=arguments.length,r=Array(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},r=new ex,o=n.getFieldEntities(!0);o.forEach(function(e){var t=e.props.initialValue,n=e.getNamePath();if(void 0!==t){var o=r.get(n)||new Set;o.add({entity:e,value:t}),r.set(n,o)}}),t.entities?e=t.entities:t.namePathList?(e=[],t.namePathList.forEach(function(t){var n,o=r.get(t);o&&(n=e).push.apply(n,(0,u.Z)((0,u.Z)(o).map(function(e){return e.entity})))})):e=o,function(e){e.forEach(function(e){if(void 0!==e.props.initialValue){var o=e.getNamePath();if(void 0!==n.getInitialValue(o))(0,y.ZP)(!1,"Form already set 'initialValues' with path '".concat(o.join("."),"'. Field can not overwrite it."));else{var a=r.get(o);if(a&&a.size>1)(0,y.ZP)(!1,"Multiple Field with path '".concat(o.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(a){var i=n.getFieldValue(o);e.isListField()||t.skipExist&&void 0!==i||n.updateStore((0,Q.Z)(n.store,o,(0,u.Z)(a)[0].value))}}}})}(e)}),(0,v.Z)(this,"resetFields",function(e){n.warningUnhooked();var t=n.store;if(!e){n.updateStore((0,Q.T)(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(t,null,{type:"reset"}),n.notifyWatch();return}var r=e.map(ea);r.forEach(function(e){var t=n.getInitialValue(e);n.updateStore((0,Q.Z)(n.store,e,t))}),n.resetWithFieldInitialValue({namePathList:r}),n.notifyObservers(t,r,{type:"reset"}),n.notifyWatch(r)}),(0,v.Z)(this,"setFields",function(e){n.warningUnhooked();var t=n.store,r=[];e.forEach(function(e){var o=e.name,a=(0,i.Z)(e,ew),c=ea(o);r.push(c),"value"in a&&n.updateStore((0,Q.Z)(n.store,c,a.value)),n.notifyObservers(t,[c],{type:"setField",data:e})}),n.notifyWatch(r)}),(0,v.Z)(this,"getFields",function(){return n.getFieldEntities(!0).map(function(e){var t=e.getNamePath(),r=e.getMeta(),o=(0,s.Z)((0,s.Z)({},r),{},{name:t,value:n.getFieldValue(t)});return Object.defineProperty(o,"originRCField",{value:!0}),o})}),(0,v.Z)(this,"initEntityValue",function(e){var t=e.props.initialValue;if(void 0!==t){var r=e.getNamePath();void 0===(0,eo.Z)(n.store,r)&&n.updateStore((0,Q.Z)(n.store,r,t))}}),(0,v.Z)(this,"isMergedPreserve",function(e){var t=void 0!==e?e:n.preserve;return null==t||t}),(0,v.Z)(this,"registerField",function(e){n.fieldEntities.push(e);var t=e.getNamePath();if(n.notifyWatch([t]),void 0!==e.props.initialValue){var r=n.store;n.resetWithFieldInitialValue({entities:[e],skipExist:!0}),n.notifyObservers(r,[e.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(r,o){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(t){return t!==e}),!n.isMergedPreserve(o)&&(!r||a.length>1)){var i=r?void 0:n.getInitialValue(t);if(t.length&&n.getFieldValue(t)!==i&&n.fieldEntities.every(function(e){return!el(e.getNamePath(),t)})){var c=n.store;n.updateStore((0,Q.Z)(c,t,i,!0)),n.notifyObservers(c,[t],{type:"remove"}),n.triggerDependenciesUpdate(c,t)}}n.notifyWatch([t])}}),(0,v.Z)(this,"dispatch",function(e){switch(e.type){case"updateValue":var t=e.namePath,r=e.value;n.updateValue(t,r);break;case"validateField":var o=e.namePath,a=e.triggerName;n.validateFields([o],{triggerName:a})}}),(0,v.Z)(this,"notifyObservers",function(e,t,r){if(n.subscribable){var o=(0,s.Z)((0,s.Z)({},r),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(n){(0,n.onStoreChange)(e,t,o)})}else n.forceRootUpdate()}),(0,v.Z)(this,"triggerDependenciesUpdate",function(e,t){var r=n.getDependencyChildrenFields(t);return r.length&&n.validateFields(r),n.notifyObservers(e,r,{type:"dependenciesUpdate",relatedFields:[t].concat((0,u.Z)(r))}),r}),(0,v.Z)(this,"updateValue",function(e,t){var r=ea(e),o=n.store;n.updateStore((0,Q.Z)(n.store,r,t)),n.notifyObservers(o,[r],{type:"valueUpdate",source:"internal"}),n.notifyWatch([r]);var a=n.triggerDependenciesUpdate(o,r),i=n.callbacks.onValuesChange;i&&i(ei(n.store,[r]),n.getFieldsValue()),n.triggerOnFieldsChange([r].concat((0,u.Z)(a)))}),(0,v.Z)(this,"setFieldsValue",function(e){n.warningUnhooked();var t=n.store;if(e){var r=(0,Q.T)(n.store,e);n.updateStore(r)}n.notifyObservers(t,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),(0,v.Z)(this,"setFieldValue",function(e,t){n.setFields([{name:e,value:t,errors:[],warnings:[]}])}),(0,v.Z)(this,"getDependencyChildrenFields",function(e){var t=new Set,r=[],o=new ex;return n.getFieldEntities().forEach(function(e){(e.props.dependencies||[]).forEach(function(t){var n=ea(t);o.update(n,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Set;return t.add(e),t})})}),function e(n){(o.get(n)||new Set).forEach(function(n){if(!t.has(n)){t.add(n);var o=n.getNamePath();n.isFieldDirty()&&o.length&&(r.push(o),e(o))}})}(e),r}),(0,v.Z)(this,"triggerOnFieldsChange",function(e,t){var r=n.callbacks.onFieldsChange;if(r){var o=n.getFields();if(t){var a=new ex;t.forEach(function(e){var t=e.name,n=e.errors;a.set(t,n)}),o.forEach(function(e){e.errors=a.get(e.name)||e.errors})}var i=o.filter(function(t){return ec(e,t.name)});i.length&&r(i,o)}}),(0,v.Z)(this,"validateFields",function(e,t){n.warningUnhooked(),Array.isArray(e)||"string"==typeof e||"string"==typeof t?(i=e,c=t):c=e;var r,o,a,i,c,l=!!i,d=l?i.map(ea):[],f=[],p=String(Date.now()),m=new Set,g=c||{},v=g.recursive,h=g.dirty;n.getFieldEntities(!0).forEach(function(e){if(l||d.push(e.getNamePath()),e.props.rules&&e.props.rules.length&&(!h||e.isFieldDirty())){var t=e.getNamePath();if(m.add(t.join(p)),!l||ec(d,t,v)){var r=e.validateRules((0,s.Z)({validateMessages:(0,s.Z)((0,s.Z)({},Y),n.validateMessages)},c));f.push(r.then(function(){return{name:t,errors:[],warnings:[]}}).catch(function(e){var n,r=[],o=[];return(null===(n=e.forEach)||void 0===n||n.call(e,function(e){var t=e.rule.warningOnly,n=e.errors;t?o.push.apply(o,(0,u.Z)(n)):r.push.apply(r,(0,u.Z)(n))}),r.length)?Promise.reject({name:t,errors:r,warnings:o}):{name:t,errors:r,warnings:o}}))}}});var b=(r=!1,o=f.length,a=[],f.length?new Promise(function(e,t){f.forEach(function(n,i){n.catch(function(e){return r=!0,e}).then(function(n){o-=1,a[i]=n,o>0||(r&&t(a),e(a))})})}):Promise.resolve([]));n.lastValidatePromise=b,b.catch(function(e){return e}).then(function(e){var t=e.map(function(e){return e.name});n.notifyObservers(n.store,t,{type:"validateFinish"}),n.triggerOnFieldsChange(t,e)});var y=b.then(function(){return n.lastValidatePromise===b?Promise.resolve(n.getFieldsValue(d)):Promise.reject([])}).catch(function(e){var t=e.filter(function(e){return e&&e.errors.length});return Promise.reject({values:n.getFieldsValue(d),errorFields:t,outOfDate:n.lastValidatePromise!==b})});y.catch(function(e){return e});var x=d.filter(function(e){return m.has(e.join(p))});return n.triggerOnFieldsChange(x),y}),(0,v.Z)(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(e){var t=n.callbacks.onFinish;if(t)try{t(e)}catch(e){console.error(e)}}).catch(function(e){var t=n.callbacks.onFinishFailed;t&&t(e)})}),this.forceRootUpdate=t}),eC=function(e){var t=o.useRef(),n=o.useState({}),r=(0,eh.Z)(n,2)[1];if(!t.current){if(e)t.current=e;else{var a=new eE(function(){r({})});t.current=a.getForm()}}return[t.current]},eZ=o.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),eS=function(e){var t=e.validateMessages,n=e.onFormChange,r=e.onFormFinish,a=e.children,i=o.useContext(eZ),c=o.useRef({});return o.createElement(eZ.Provider,{value:(0,s.Z)((0,s.Z)({},i),{},{validateMessages:(0,s.Z)((0,s.Z)({},i.validateMessages),t),triggerFormChange:function(e,t){n&&n(e,{changedFields:t,forms:c.current}),i.triggerFormChange(e,t)},triggerFormFinish:function(e,t){r&&r(e,{values:t,forms:c.current}),i.triggerFormFinish(e,t)},registerForm:function(e,t){e&&(c.current=(0,s.Z)((0,s.Z)({},c.current),{},(0,v.Z)({},e,t))),i.registerForm(e,t)},unregisterForm:function(e){var t=(0,s.Z)({},c.current);delete t[e],c.current=t,i.unregisterForm(e)}})},a)},eO=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"];function ek(e){try{return JSON.stringify(e)}catch(e){return Math.random()}}var ej=function(){},eI=function(){for(var e=arguments.length,t=Array(e),n=0;n1?t-1:0),o=1;oea;(0,s.useImperativeHandle)(t,function(){var e;return{focus:U,blur:function(){var e;null===(e=X.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var r;null===(r=X.current)||void 0===r||r.setSelectionRange(e,t,n)},select:function(){var e;null===(e=X.current)||void 0===e||e.select()},input:X.current,nativeElement:(null===(e=G.current)||void 0===e?void 0:e.nativeElement)||X.current}}),(0,s.useEffect)(function(){q.current&&(q.current=!1),W(function(e){return(!e||!O)&&e})},[O]);var el=function(e,t,n){var r,o,a=t;if(!V.current&&eo.exceedFormatter&&eo.max&&eo.strategy(t)>eo.max)a=eo.exceedFormatter(t,{max:eo.max}),t!==a&&er([(null===(r=X.current)||void 0===r?void 0:r.selectionStart)||0,(null===(o=X.current)||void 0===o?void 0:o.selectionEnd)||0]);else if("compositionEnd"===n.source)return;Q(a),X.current&&(0,u.rJ)(X.current,e,c,a)};(0,s.useEffect)(function(){if(en){var e;null===(e=X.current)||void 0===e||e.setSelectionRange.apply(e,(0,f.Z)(en))}},[en]);var es=ec&&"".concat(S,"-out-of-range");return s.createElement(d,(0,o.Z)({},H,{prefixCls:S,className:l()(j,es),handleReset:function(e){Q(""),U(),X.current&&(0,u.rJ)(X.current,e,c)},value:J,focused:D,triggerFocus:U,suffix:function(){var e=Number(ea)>0;if(M||eo.show){var t=eo.showFormatter?eo.showFormatter({value:J,count:ei,maxLength:ea}):"".concat(ei).concat(e?" / ".concat(ea):"");return s.createElement(s.Fragment,null,eo.show&&s.createElement("span",{className:l()("".concat(S,"-show-count-suffix"),(0,a.Z)({},"".concat(S,"-show-count-has-suffix"),!!M),null==T?void 0:T.count),style:(0,r.Z)({},null==A?void 0:A.count)},t),M)}return null}(),disabled:O,classes:F,classNames:T,styles:A,ref:G}),(n=(0,v.Z)(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]),s.createElement("input",(0,o.Z)({autoComplete:i},n,{onChange:function(e){el(e,e.target.value,{source:"change"})},onFocus:function(e){W(!0),null==y||y(e)},onBlur:function(e){q.current&&(q.current=!1),W(!1),null==x||x(e)},onKeyDown:function(e){w&&"Enter"===e.key&&!q.current&&(q.current=!0,w(e)),null==E||E(e)},onKeyUp:function(e){"Enter"===e.key&&(q.current=!1),null==C||C(e)},className:l()(S,(0,a.Z)({},"".concat(S,"-disabled"),O),null==T?void 0:T.input),style:null==A?void 0:A.input,ref:X,size:k,type:void 0===P?"text":P,onCompositionStart:function(e){V.current=!0,null==_||_(e)},onCompositionEnd:function(e){V.current=!1,el(e,e.currentTarget.value,{source:"compositionEnd"}),null==B||B(e)}}))))})},55041:function(e,t,n){"use strict";function r(e){return!!(e.addonBefore||e.addonAfter)}function o(e){return!!(e.prefix||e.suffix||e.allowClear)}function a(e,t,n){var r=t.cloneNode(!0),o=Object.create(e,{target:{value:r},currentTarget:{value:r}});return r.value=n,"number"==typeof t.selectionStart&&"number"==typeof t.selectionEnd&&(r.selectionStart=t.selectionStart,r.selectionEnd=t.selectionEnd),r.setSelectionRange=function(){t.setSelectionRange.apply(t,arguments)},o}function i(e,t,n,r){if(n){var o=t;if("click"===t.type){n(o=a(t,e,""));return}if("file"!==e.type&&void 0!==r){n(o=a(t,e,r));return}n(o)}}function c(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}n.d(t,{He:function(){return r},X3:function(){return o},nH:function(){return c},rJ:function(){return i}})},66632:function(e,t,n){"use strict";n.d(t,{V4:function(){return eg},zt:function(){return x},ZP:function(){return ev}});var r,o,a,i,c,l=n(11993),s=n(31686),u=n(26365),d=n(41154),f=n(36760),p=n.n(f),m=n(2868),g=n(28791),v=n(2265),h=n(6989),b=["children"],y=v.createContext({});function x(e){var t=e.children,n=(0,h.Z)(e,b);return v.createElement(y.Provider,{value:n},t)}var w=n(76405),E=n(25049),C=n(41690),Z=n(15900),S=function(e){(0,C.Z)(n,e);var t=(0,Z.Z)(n);function n(){return(0,w.Z)(this,n),t.apply(this,arguments)}return(0,E.Z)(n,[{key:"render",value:function(){return this.props.children}}]),n}(v.Component),O=n(74126),k=n(69819),j=n(58525),I="none",M="appear",R="enter",N="leave",P="none",F="prepare",T="start",A="active",_="prepared",B=n(94981);function H(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var z=(r=(0,B.Z)(),o="undefined"!=typeof window?window:{},a={animationend:H("Animation","AnimationEnd"),transitionend:H("Transition","TransitionEnd")},!r||("AnimationEvent"in o||delete a.animationend.animation,"TransitionEvent"in o||delete a.transitionend.transition),a),L={};(0,B.Z)()&&(L=document.createElement("div").style);var D={};function W(e){if(D[e])return D[e];var t=z[e];if(t)for(var n=Object.keys(t),r=n.length,o=0;o1&&void 0!==arguments[1]?arguments[1]:2;t();var a=(0,Q.Z)(function(){o<=1?r({isCanceled:function(){return a!==e.current}}):n(r,o-1)});e.current=a},t]},ee=[F,T,A,"end"],et=[F,_];function en(e){return e===A||"end"===e}var er=function(e,t,n){var r=(0,k.Z)(P),o=(0,u.Z)(r,2),a=o[0],i=o[1],c=J(),l=(0,u.Z)(c,2),s=l[0],d=l[1],f=t?et:ee;return Y(function(){if(a!==P&&"end"!==a){var e=f.indexOf(a),t=f[e+1],r=n(a);!1===r?i(t,!0):t&&s(function(e){function n(){e.isCanceled()||i(t,!0)}!0===r?n():Promise.resolve(r).then(n)})}},[e,a]),v.useEffect(function(){return function(){d()}},[]),[function(){i(F,!0)},a]},eo=(i=X,"object"===(0,d.Z)(X)&&(i=X.transitionSupport),(c=v.forwardRef(function(e,t){var n=e.visible,r=void 0===n||n,o=e.removeOnLeave,a=void 0===o||o,c=e.forceRender,d=e.children,f=e.motionName,h=e.leavedClassName,b=e.eventProps,x=v.useContext(y).motion,w=!!(e.motionName&&i&&!1!==x),E=(0,v.useRef)(),C=(0,v.useRef)(),Z=function(e,t,n,r){var o,a,i,c=r.motionEnter,d=void 0===c||c,f=r.motionAppear,p=void 0===f||f,m=r.motionLeave,g=void 0===m||m,h=r.motionDeadline,b=r.motionLeaveImmediately,y=r.onAppearPrepare,x=r.onEnterPrepare,w=r.onLeavePrepare,E=r.onAppearStart,C=r.onEnterStart,Z=r.onLeaveStart,S=r.onAppearActive,P=r.onEnterActive,B=r.onLeaveActive,H=r.onAppearEnd,z=r.onEnterEnd,L=r.onLeaveEnd,D=r.onVisibleChanged,W=(0,k.Z)(),V=(0,u.Z)(W,2),q=V[0],X=V[1],G=(o=v.useReducer(function(e){return e+1},0),a=(0,u.Z)(o,2)[1],i=v.useRef(I),[(0,j.Z)(function(){return i.current}),(0,j.Z)(function(e){i.current="function"==typeof e?e(i.current):e,a()})]),U=(0,u.Z)(G,2),$=U[0],Q=U[1],J=(0,k.Z)(null),ee=(0,u.Z)(J,2),et=ee[0],eo=ee[1],ea=$(),ei=(0,v.useRef)(!1),ec=(0,v.useRef)(null),el=(0,v.useRef)(!1);function es(){Q(I),eo(null,!0)}var eu=(0,O.zX)(function(e){var t,r=$();if(r!==I){var o=n();if(!e||e.deadline||e.target===o){var a=el.current;r===M&&a?t=null==H?void 0:H(o,e):r===R&&a?t=null==z?void 0:z(o,e):r===N&&a&&(t=null==L?void 0:L(o,e)),a&&!1!==t&&es()}}}),ed=K(eu),ef=(0,u.Z)(ed,1)[0],ep=function(e){switch(e){case M:return(0,l.Z)((0,l.Z)((0,l.Z)({},F,y),T,E),A,S);case R:return(0,l.Z)((0,l.Z)((0,l.Z)({},F,x),T,C),A,P);case N:return(0,l.Z)((0,l.Z)((0,l.Z)({},F,w),T,Z),A,B);default:return{}}},em=v.useMemo(function(){return ep(ea)},[ea]),eg=er(ea,!e,function(e){if(e===F){var t,r=em[F];return!!r&&r(n())}return eb in em&&eo((null===(t=em[eb])||void 0===t?void 0:t.call(em,n(),null))||null),eb===A&&ea!==I&&(ef(n()),h>0&&(clearTimeout(ec.current),ec.current=setTimeout(function(){eu({deadline:!0})},h))),eb===_&&es(),!0}),ev=(0,u.Z)(eg,2),eh=ev[0],eb=ev[1],ey=en(eb);el.current=ey;var ex=(0,v.useRef)(null);Y(function(){if(!ei.current||ex.current!==t){X(t);var n,r=ei.current;ei.current=!0,!r&&t&&p&&(n=M),r&&t&&d&&(n=R),(r&&!t&&g||!r&&b&&!t&&g)&&(n=N);var o=ep(n);n&&(e||o[F])?(Q(n),eh()):Q(I),ex.current=t}},[t]),(0,v.useEffect)(function(){(ea!==M||p)&&(ea!==R||d)&&(ea!==N||g)||Q(I)},[p,d,g]),(0,v.useEffect)(function(){return function(){ei.current=!1,clearTimeout(ec.current)}},[]);var ew=v.useRef(!1);(0,v.useEffect)(function(){q&&(ew.current=!0),void 0!==q&&ea===I&&((ew.current||q)&&(null==D||D(q)),ew.current=!0)},[q,ea]);var eE=et;return em[F]&&eb===T&&(eE=(0,s.Z)({transition:"none"},eE)),[ea,eb,eE,null!=q?q:t]}(w,r,function(){try{return E.current instanceof HTMLElement?E.current:(0,m.ZP)(C.current)}catch(e){return null}},e),P=(0,u.Z)(Z,4),B=P[0],H=P[1],z=P[2],L=P[3],D=v.useRef(L);L&&(D.current=!0);var W=v.useCallback(function(e){E.current=e,(0,g.mH)(t,e)},[t]),V=(0,s.Z)((0,s.Z)({},b),{},{visible:r});if(d){if(B===I)q=L?d((0,s.Z)({},V),W):!a&&D.current&&h?d((0,s.Z)((0,s.Z)({},V),{},{className:h}),W):!c&&(a||h)?null:d((0,s.Z)((0,s.Z)({},V),{},{style:{display:"none"}}),W);else{H===F?X="prepare":en(H)?X="active":H===T&&(X="start");var q,X,G=$(f,"".concat(B,"-").concat(X));q=d((0,s.Z)((0,s.Z)({},V),{},{className:p()($(f,B),(0,l.Z)((0,l.Z)({},G,G&&X),f,"string"==typeof f)),style:z}),W)}}else q=null;return v.isValidElement(q)&&(0,g.Yr)(q)&&!(0,g.C4)(q)&&(q=v.cloneElement(q,{ref:W})),v.createElement(S,{ref:C},q)})).displayName="CSSMotion",c),ea=n(1119),ei=n(63496),ec="keep",el="remove",es="removed";function eu(e){var t;return t=e&&"object"===(0,d.Z)(e)&&"key"in e?e:{key:e},(0,s.Z)((0,s.Z)({},t),{},{key:String(t.key)})}function ed(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(eu)}var ef=["component","children","onVisibleChanged","onAllRemoved"],ep=["status"],em=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"],eg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eo,n=function(e){(0,C.Z)(r,e);var n=(0,Z.Z)(r);function r(){var e;(0,w.Z)(this,r);for(var t=arguments.length,o=Array(t),a=0;a0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,o=t.length,a=ed(e),i=ed(t);a.forEach(function(e){for(var t=!1,a=r;a1}).forEach(function(e){(n=n.filter(function(t){var n=t.key,r=t.status;return n!==e||r!==el})).forEach(function(t){t.key===e&&(t.status=ec)})}),n})(r,ed(n)).filter(function(e){var t=r.find(function(t){var n=t.key;return e.key===n});return!t||t.status!==es||e.status!==el})}}}]),r}(v.Component);return(0,l.Z)(n,"defaultProps",{component:"div"}),n}(X),ev=eo},49283:function(e,t,n){"use strict";n.d(t,{qX:function(){return h},JB:function(){return y},lm:function(){return j}});var r=n(83145),o=n(26365),a=n(6989),i=n(2265),c=n(31686),l=n(54887),s=n(1119),u=n(11993),d=n(36760),f=n.n(d),p=n(66632),m=n(41154),g=n(95814),v=n(18242),h=i.forwardRef(function(e,t){var n=e.prefixCls,r=e.style,a=e.className,c=e.duration,l=void 0===c?4.5:c,d=e.showProgress,p=e.pauseOnHover,h=void 0===p||p,b=e.eventKey,y=e.content,x=e.closable,w=e.closeIcon,E=void 0===w?"x":w,C=e.props,Z=e.onClick,S=e.onNoticeClose,O=e.times,k=e.hovering,j=i.useState(!1),I=(0,o.Z)(j,2),M=I[0],R=I[1],N=i.useState(0),P=(0,o.Z)(N,2),F=P[0],T=P[1],A=i.useState(0),_=(0,o.Z)(A,2),B=_[0],H=_[1],z=k||M,L=l>0&&d,D=function(){S(b)};i.useEffect(function(){if(!z&&l>0){var e=Date.now()-B,t=setTimeout(function(){D()},1e3*l-B);return function(){h&&clearTimeout(t),H(Date.now()-e)}}},[l,z,O]),i.useEffect(function(){if(!z&&L&&(h||0===B)){var e,t=performance.now();return function n(){cancelAnimationFrame(e),e=requestAnimationFrame(function(e){var r=Math.min((e+B-t)/(1e3*l),1);T(100*r),r<1&&n()})}(),function(){h&&cancelAnimationFrame(e)}}},[l,B,z,L,O]);var W=i.useMemo(function(){return"object"===(0,m.Z)(x)&&null!==x?x:x?{closeIcon:E}:{}},[x,E]),V=(0,v.Z)(W,!0),q=100-(!F||F<0?0:F>100?100:F),X="".concat(n,"-notice");return i.createElement("div",(0,s.Z)({},C,{ref:t,className:f()(X,a,(0,u.Z)({},"".concat(X,"-closable"),x)),style:r,onMouseEnter:function(e){var t;R(!0),null==C||null===(t=C.onMouseEnter)||void 0===t||t.call(C,e)},onMouseLeave:function(e){var t;R(!1),null==C||null===(t=C.onMouseLeave)||void 0===t||t.call(C,e)},onClick:Z}),i.createElement("div",{className:"".concat(X,"-content")},y),x&&i.createElement("a",(0,s.Z)({tabIndex:0,className:"".concat(X,"-close"),onKeyDown:function(e){("Enter"===e.key||"Enter"===e.code||e.keyCode===g.Z.ENTER)&&D()},"aria-label":"Close"},V,{onClick:function(e){e.preventDefault(),e.stopPropagation(),D()}}),W.closeIcon),L&&i.createElement("progress",{className:"".concat(X,"-progress"),max:"100",value:q},q+"%"))}),b=i.createContext({}),y=function(e){var t=e.children,n=e.classNames;return i.createElement(b.Provider,{value:{classNames:n}},t)},x=function(e){var t,n,r,o={offset:8,threshold:3,gap:16};return e&&"object"===(0,m.Z)(e)&&(o.offset=null!==(t=e.offset)&&void 0!==t?t:8,o.threshold=null!==(n=e.threshold)&&void 0!==n?n:3,o.gap=null!==(r=e.gap)&&void 0!==r?r:16),[!!e,o]},w=["className","style","classNames","styles"],E=function(e){var t=e.configList,n=e.placement,l=e.prefixCls,d=e.className,m=e.style,g=e.motion,v=e.onAllNoticeRemoved,y=e.onNoticeClose,E=e.stack,C=(0,i.useContext)(b).classNames,Z=(0,i.useRef)({}),S=(0,i.useState)(null),O=(0,o.Z)(S,2),k=O[0],j=O[1],I=(0,i.useState)([]),M=(0,o.Z)(I,2),R=M[0],N=M[1],P=t.map(function(e){return{config:e,key:String(e.key)}}),F=x(E),T=(0,o.Z)(F,2),A=T[0],_=T[1],B=_.offset,H=_.threshold,z=_.gap,L=A&&(R.length>0||P.length<=H),D="function"==typeof g?g(n):g;return(0,i.useEffect)(function(){A&&R.length>1&&N(function(e){return e.filter(function(e){return P.some(function(t){return e===t.key})})})},[R,P,A]),(0,i.useEffect)(function(){var e,t;A&&Z.current[null===(e=P[P.length-1])||void 0===e?void 0:e.key]&&j(Z.current[null===(t=P[P.length-1])||void 0===t?void 0:t.key])},[P,A]),i.createElement(p.V4,(0,s.Z)({key:n,className:f()(l,"".concat(l,"-").concat(n),null==C?void 0:C.list,d,(0,u.Z)((0,u.Z)({},"".concat(l,"-stack"),!!A),"".concat(l,"-stack-expanded"),L)),style:m,keys:P,motionAppear:!0},D,{onAllRemoved:function(){v(n)}}),function(e,t){var o=e.config,u=e.className,d=e.style,p=e.index,m=o.key,g=o.times,v=String(m),b=o.className,x=o.style,E=o.classNames,S=o.styles,O=(0,a.Z)(o,w),j=P.findIndex(function(e){return e.key===v}),I={};if(A){var M=P.length-1-(j>-1?j:p-1),F="top"===n||"bottom"===n?"-50%":"0";if(M>0){I.height=L?null===(T=Z.current[v])||void 0===T?void 0:T.offsetHeight:null==k?void 0:k.offsetHeight;for(var T,_,H,D,W=0,V=0;V-1?Z.current[v]=e:delete Z.current[v]},prefixCls:l,classNames:E,styles:S,className:f()(b,null==C?void 0:C.notice),style:x,times:g,key:m,eventKey:m,onNoticeClose:y,hovering:A&&R.length>0})))})},C=i.forwardRef(function(e,t){var n=e.prefixCls,a=void 0===n?"rc-notification":n,s=e.container,u=e.motion,d=e.maxCount,f=e.className,p=e.style,m=e.onAllRemoved,g=e.stack,v=e.renderNotifications,h=i.useState([]),b=(0,o.Z)(h,2),y=b[0],x=b[1],w=function(e){var t,n=y.find(function(t){return t.key===e});null==n||null===(t=n.onClose)||void 0===t||t.call(n),x(function(t){return t.filter(function(t){return t.key!==e})})};i.useImperativeHandle(t,function(){return{open:function(e){x(function(t){var n,o=(0,r.Z)(t),a=o.findIndex(function(t){return t.key===e.key}),i=(0,c.Z)({},e);return a>=0?(i.times=((null===(n=t[a])||void 0===n?void 0:n.times)||0)+1,o[a]=i):(i.times=0,o.push(i)),d>0&&o.length>d&&(o=o.slice(-d)),o})},close:function(e){w(e)},destroy:function(){x([])}}});var C=i.useState({}),Z=(0,o.Z)(C,2),S=Z[0],O=Z[1];i.useEffect(function(){var e={};y.forEach(function(t){var n=t.placement,r=void 0===n?"topRight":n;r&&(e[r]=e[r]||[],e[r].push(t))}),Object.keys(S).forEach(function(t){e[t]=e[t]||[]}),O(e)},[y]);var k=function(e){O(function(t){var n=(0,c.Z)({},t);return(n[e]||[]).length||delete n[e],n})},j=i.useRef(!1);if(i.useEffect(function(){Object.keys(S).length>0?j.current=!0:j.current&&(null==m||m(),j.current=!1)},[S]),!s)return null;var I=Object.keys(S);return(0,l.createPortal)(i.createElement(i.Fragment,null,I.map(function(e){var t=S[e],n=i.createElement(E,{key:e,configList:t,placement:e,prefixCls:a,className:null==f?void 0:f(e),style:null==p?void 0:p(e),motion:u,onNoticeClose:w,onAllNoticeRemoved:k,stack:g});return v?v(n,{prefixCls:a,key:e}):n})),s)}),Z=n(74126),S=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],O=function(){return document.body},k=0;function j(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.getContainer,n=void 0===t?O:t,c=e.motion,l=e.prefixCls,s=e.maxCount,u=e.className,d=e.style,f=e.onAllRemoved,p=e.stack,m=e.renderNotifications,g=(0,a.Z)(e,S),v=i.useState(),h=(0,o.Z)(v,2),b=h[0],y=h[1],x=i.useRef(),w=i.createElement(C,{container:b,ref:x,prefixCls:l,motion:c,maxCount:s,className:u,style:d,onAllRemoved:f,stack:p,renderNotifications:m}),E=i.useState([]),j=(0,o.Z)(E,2),I=j[0],M=j[1],R=(0,Z.zX)(function(e){var t=function(){for(var e={},t=arguments.length,n=Array(t),r=0;rN,eP=(0,c.useMemo)(function(){var e=g;return eM?e=null===q&&L?g:g.slice(0,Math.min(g.length,G/j)):"number"==typeof N&&(e=g.slice(0,N)),e},[g,j,q,N,eM]),eF=(0,c.useMemo)(function(){return eM?g.slice(eE+1):g.slice(eP.length)},[g,eP,eM,eE]),eT=(0,c.useCallback)(function(e,t){var n;return"function"==typeof E?E(e):null!==(n=E&&(null==e?void 0:e[E]))&&void 0!==n?n:t},[E]),eA=(0,c.useCallback)(x||function(e){return e},[x]);function e_(e,t,n){(ex!==e||void 0!==t&&t!==ev)&&(ew(e),n||(eO(eG){e_(r-1,e-o-ef+eo);break}}A&&eH(0)+ef>G&&eh(null)}},[G,K,eo,el,ef,eT,eP]);var ez=eS&&!!eF.length,eL={};null!==ev&&eM&&(eL={position:"absolute",left:ev,top:0});var eD={prefixCls:ek,responsive:eM,component:B,invalidate:eR},eW=w?function(e,t){var n=eT(e,t);return c.createElement(y.Provider,{key:n,value:(0,o.Z)((0,o.Z)({},eD),{},{order:t,item:e,itemKey:n,registerSize:eB,display:t<=eE})},w(e,t))}:function(e,t){var n=eT(e,t);return c.createElement(m,(0,r.Z)({},eD,{order:t,key:n,item:e,renderItem:eA,itemKey:n,registerSize:eB,display:t<=eE}))},eV={order:ez?eE:Number.MAX_SAFE_INTEGER,className:"".concat(ek,"-rest"),registerSize:function(e,t){ea(t),et(eo)},display:ez},eq=P||k,eX=F?c.createElement(y.Provider,{value:(0,o.Z)((0,o.Z)({},eD),eV)},F(eF)):c.createElement(m,(0,r.Z)({},eD,eV),"function"==typeof eq?eq(eF):eq),eG=c.createElement(void 0===_?"div":_,(0,r.Z)({className:s()(!eR&&f,R),style:M,ref:t},z),T&&c.createElement(m,(0,r.Z)({},eD,{responsive:eI,responsiveDisabled:!eM,order:-1,className:"".concat(ek,"-prefix"),registerSize:function(e,t){es(t)},display:!0}),T),eP.map(eW),eN?eX:null,A&&c.createElement(m,(0,r.Z)({},eD,{responsive:eI,responsiveDisabled:!eM,order:eE,className:"".concat(ek,"-suffix"),registerSize:function(e,t){ep(t)},display:!0,style:eL}),A));return eI?c.createElement(u.Z,{onResize:function(e,t){X(t.clientWidth)},disabled:!eM},eG):eG});j.displayName="Overflow",j.Item=C,j.RESPONSIVE=S,j.INVALIDATE=O;var I=j},96257:function(e,t){"use strict";t.Z={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"}},31474:function(e,t,n){"use strict";n.d(t,{Z:function(){return z}});var r=n(1119),o=n(2265),a=n(45287);n(32559);var i=n(31686),c=n(41154),l=n(2868),s=n(28791),u=o.createContext(null),d=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){f&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),v?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){f&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;g.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),b=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),j="undefined"!=typeof WeakMap?new WeakMap:new d,I=function e(t){if(!(this instanceof e))throw TypeError("Cannot call a class as a function.");if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");var n=new k(t,h.getInstance(),this);j.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){I.prototype[e]=function(){var t;return(t=j.get(this))[e].apply(t,arguments)}});var M=void 0!==p.ResizeObserver?p.ResizeObserver:I,R=new Map,N=new M(function(e){e.forEach(function(e){var t,n=e.target;null===(t=R.get(n))||void 0===t||t.forEach(function(e){return e(n)})})}),P=n(76405),F=n(25049),T=n(41690),A=n(15900),_=function(e){(0,T.Z)(n,e);var t=(0,A.Z)(n);function n(){return(0,P.Z)(this,n),t.apply(this,arguments)}return(0,F.Z)(n,[{key:"render",value:function(){return this.props.children}}]),n}(o.Component),B=o.forwardRef(function(e,t){var n=e.children,r=e.disabled,a=o.useRef(null),d=o.useRef(null),f=o.useContext(u),p="function"==typeof n,m=p?n(a):n,g=o.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),v=!p&&o.isValidElement(m)&&(0,s.Yr)(m),h=v?(0,s.C4)(m):null,b=(0,s.x1)(h,a),y=function(){var e;return(0,l.ZP)(a.current)||(a.current&&"object"===(0,c.Z)(a.current)?(0,l.ZP)(null===(e=a.current)||void 0===e?void 0:e.nativeElement):null)||(0,l.ZP)(d.current)};o.useImperativeHandle(t,function(){return y()});var x=o.useRef(e);x.current=e;var w=o.useCallback(function(e){var t=x.current,n=t.onResize,r=t.data,o=e.getBoundingClientRect(),a=o.width,c=o.height,l=e.offsetWidth,s=e.offsetHeight,u=Math.floor(a),d=Math.floor(c);if(g.current.width!==u||g.current.height!==d||g.current.offsetWidth!==l||g.current.offsetHeight!==s){var p={width:u,height:d,offsetWidth:l,offsetHeight:s};g.current=p;var m=(0,i.Z)((0,i.Z)({},p),{},{offsetWidth:l===Math.round(a)?a:l,offsetHeight:s===Math.round(c)?c:s});null==f||f(m,e,r),n&&Promise.resolve().then(function(){n(m,e)})}},[]);return o.useEffect(function(){var e=y();return e&&!r&&(R.has(e)||(R.set(e,new Set),N.observe(e)),R.get(e).add(w)),function(){R.has(e)&&(R.get(e).delete(w),R.get(e).size||(N.unobserve(e),R.delete(e)))}},[a.current,r]),o.createElement(_,{ref:d},v?o.cloneElement(m,{ref:b}):m)}),H=o.forwardRef(function(e,t){var n=e.children;return("function"==typeof n?[n]:(0,a.Z)(n)).map(function(n,a){var i=(null==n?void 0:n.key)||"".concat("rc-observer-key","-").concat(a);return o.createElement(B,(0,r.Z)({},e,{key:i,ref:0===a?t:void 0}),n)})});H.Collection=function(e){var t=e.children,n=e.onBatchResize,r=o.useRef(0),a=o.useRef([]),i=o.useContext(u),c=o.useCallback(function(e,t,o){r.current+=1;var c=r.current;a.current.push({size:e,element:t,data:o}),Promise.resolve().then(function(){c===r.current&&(null==n||n(a.current),a.current=[])}),null==i||i(e,t,o)},[n,i]);return o.createElement(u.Provider,{value:c},t)};var z=H},5769:function(e,t,n){"use strict";n.d(t,{G:function(){return i},Z:function(){return h}});var r=n(36760),o=n.n(r),a=n(2265);function i(e){var t=e.children,n=e.prefixCls,r=e.id,i=e.overlayInnerStyle,c=e.bodyClassName,l=e.className,s=e.style;return a.createElement("div",{className:o()("".concat(n,"-content"),l),style:s},a.createElement("div",{className:o()("".concat(n,"-inner"),c),id:r,role:"tooltip",style:i},"function"==typeof t?t():t))}var c=n(1119),l=n(31686),s=n(6989),u=n(97821),d={shiftX:64,adjustY:1},f={adjustX:1,shiftY:!0},p=[0,0],m={left:{points:["cr","cl"],overflow:f,offset:[-4,0],targetOffset:p},right:{points:["cl","cr"],overflow:f,offset:[4,0],targetOffset:p},top:{points:["bc","tc"],overflow:d,offset:[0,-4],targetOffset:p},bottom:{points:["tc","bc"],overflow:d,offset:[0,4],targetOffset:p},topLeft:{points:["bl","tl"],overflow:d,offset:[0,-4],targetOffset:p},leftTop:{points:["tr","tl"],overflow:f,offset:[-4,0],targetOffset:p},topRight:{points:["br","tr"],overflow:d,offset:[0,-4],targetOffset:p},rightTop:{points:["tl","tr"],overflow:f,offset:[4,0],targetOffset:p},bottomRight:{points:["tr","br"],overflow:d,offset:[0,4],targetOffset:p},rightBottom:{points:["bl","br"],overflow:f,offset:[4,0],targetOffset:p},bottomLeft:{points:["tl","bl"],overflow:d,offset:[0,4],targetOffset:p},leftBottom:{points:["br","bl"],overflow:f,offset:[-4,0],targetOffset:p}},g=n(92491),v=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],h=(0,a.forwardRef)(function(e,t){var n,r,d,f=e.overlayClassName,p=e.trigger,h=e.mouseEnterDelay,b=e.mouseLeaveDelay,y=e.overlayStyle,x=e.prefixCls,w=void 0===x?"rc-tooltip":x,E=e.children,C=e.onVisibleChange,Z=e.afterVisibleChange,S=e.transitionName,O=e.animation,k=e.motion,j=e.placement,I=e.align,M=e.destroyTooltipOnHide,R=e.defaultVisible,N=e.getTooltipContainer,P=e.overlayInnerStyle,F=(e.arrowContent,e.overlay),T=e.id,A=e.showArrow,_=e.classNames,B=e.styles,H=(0,s.Z)(e,v),z=(0,g.Z)(T),L=(0,a.useRef)(null);(0,a.useImperativeHandle)(t,function(){return L.current});var D=(0,l.Z)({},H);return"visible"in e&&(D.popupVisible=e.visible),a.createElement(u.Z,(0,c.Z)({popupClassName:o()(f,null==_?void 0:_.root),prefixCls:w,popup:function(){return a.createElement(i,{key:"content",prefixCls:w,id:z,bodyClassName:null==_?void 0:_.body,overlayInnerStyle:(0,l.Z)((0,l.Z)({},P),null==B?void 0:B.body)},F)},action:void 0===p?["hover"]:p,builtinPlacements:m,popupPlacement:void 0===j?"right":j,ref:L,popupAlign:void 0===I?{}:I,getPopupContainer:N,onPopupVisibleChange:C,afterPopupVisibleChange:Z,popupTransitionName:S,popupAnimation:O,popupMotion:k,defaultPopupVisible:R,autoDestroy:void 0!==M&&M,mouseLeaveDelay:void 0===b?.1:b,popupStyle:(0,l.Z)((0,l.Z)({},y),null==B?void 0:B.root),mouseEnterDelay:void 0===h?0:h,arrow:void 0===A||A},D),(r=(null==(n=a.Children.only(E))?void 0:n.props)||{},d=(0,l.Z)((0,l.Z)({},r),{},{"aria-describedby":F?z:null}),a.cloneElement(E,d)))})},45287:function(e,t,n){"use strict";n.d(t,{Z:function(){return function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=[];return o.Children.forEach(t,function(t){(null!=t||n.keepEmpty)&&(Array.isArray(t)?a=a.concat(e(t)):(0,r.Z)(t)&&t.props?a=a.concat(e(t.props.children,n)):a.push(t))}),a}}});var r=n(10477),o=n(2265)},94981:function(e,t,n){"use strict";function r(){return!!("undefined"!=typeof window&&window.document&&window.document.createElement)}n.d(t,{Z:function(){return r}})},2161:function(e,t,n){"use strict";function r(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}n.d(t,{Z:function(){return r}})},21717:function(e,t,n){"use strict";n.d(t,{hq:function(){return g},jL:function(){return m}});var r=n(31686),o=n(94981),a=n(2161),i="data-rc-order",c="data-rc-priority",l=new Map;function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):"rc-util-key"}function u(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function d(e){return Array.from((l.get(e)||e).children).filter(function(e){return"STYLE"===e.tagName})}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,o.Z)())return null;var n=t.csp,r=t.prepend,a=t.priority,l=void 0===a?0:a,s="queue"===r?"prependQueue":r?"prepend":"append",f="prependQueue"===s,p=document.createElement("style");p.setAttribute(i,s),f&&l&&p.setAttribute(c,"".concat(l)),null!=n&&n.nonce&&(p.nonce=null==n?void 0:n.nonce),p.innerHTML=e;var m=u(t),g=m.firstChild;if(r){if(f){var v=(t.styles||d(m)).filter(function(e){return!!["prepend","prependQueue"].includes(e.getAttribute(i))&&l>=Number(e.getAttribute(c)||0)});if(v.length)return m.insertBefore(p,v[v.length-1].nextSibling),p}m.insertBefore(p,g)}else m.appendChild(p);return p}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=u(t);return(t.styles||d(n)).find(function(n){return n.getAttribute(s(t))===e})}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=p(e,t);n&&u(t).removeChild(n)}function g(e,t){var n,o,i,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},m=u(c),g=d(m),v=(0,r.Z)((0,r.Z)({},c),{},{styles:g});!function(e,t){var n=l.get(e);if(!n||!(0,a.Z)(document,n)){var r=f("",t),o=r.parentNode;l.set(e,o),e.removeChild(r)}}(m,v);var h=p(t,v);if(h)return null!==(n=v.csp)&&void 0!==n&&n.nonce&&h.nonce!==(null===(o=v.csp)||void 0===o?void 0:o.nonce)&&(h.nonce=null===(i=v.csp)||void 0===i?void 0:i.nonce),h.innerHTML!==e&&(h.innerHTML=e),h;var b=f(e,v);return b.setAttribute(s(v),t),b}},2868:function(e,t,n){"use strict";n.d(t,{Sh:function(){return i},ZP:function(){return l},bn:function(){return c}});var r=n(41154),o=n(2265),a=n(54887);function i(e){return e instanceof HTMLElement||e instanceof SVGElement}function c(e){return e&&"object"===(0,r.Z)(e)&&i(e.nativeElement)?e.nativeElement:i(e)?e:null}function l(e){var t;return c(e)||(e instanceof o.Component?null===(t=a.findDOMNode)||void 0===t?void 0:t.call(a,e):null)}},2857:function(e,t){"use strict";t.Z=function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e.getBoundingClientRect){var o=e.getBoundingClientRect(),a=o.width,i=o.height;if(a||i)return!0}}return!1}},13211:function(e,t,n){"use strict";function r(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}function o(e){return r(e) instanceof ShadowRoot?r(e):null}n.d(t,{A:function(){return o}})},95814:function(e,t){"use strict";var n={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=n.F1&&t<=n.F12)return!1;switch(t){case n.ALT:case n.CAPS_LOCK:case n.CONTEXT_MENU:case n.CTRL:case n.DOWN:case n.END:case n.ESC:case n.HOME:case n.INSERT:case n.LEFT:case n.MAC_FF_META:case n.META:case n.NUMLOCK:case n.NUM_CENTER:case n.PAGE_DOWN:case n.PAGE_UP:case n.PAUSE:case n.PRINT_SCREEN:case n.RIGHT:case n.SHIFT:case n.UP:case n.WIN_KEY:case n.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=n.ZERO&&e<=n.NINE||e>=n.NUM_ZERO&&e<=n.NUM_MULTIPLY||e>=n.A&&e<=n.Z||-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case n.SPACE:case n.QUESTION_MARK:case n.NUM_PLUS:case n.NUM_MINUS:case n.NUM_PERIOD:case n.NUM_DIVISION:case n.SEMICOLON:case n.DASH:case n.EQUALS:case n.COMMA:case n.PERIOD:case n.SLASH:case n.APOSTROPHE:case n.SINGLE_QUOTE:case n.OPEN_SQUARE_BRACKET:case n.BACKSLASH:case n.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};t.Z=n},10477:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(41154),o=Symbol.for("react.element"),a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function c(e){return e&&"object"===(0,r.Z)(e)&&(e.$$typeof===o||e.$$typeof===a)&&e.type===i}},3208:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},o:function(){return c}});var r,o=n(21717);function a(e){var t,n,r="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),a=document.createElement("div");a.id=r;var i=a.style;if(i.position="absolute",i.left="0",i.top="0",i.width="100px",i.height="100px",i.overflow="scroll",e){var c=getComputedStyle(e);i.scrollbarColor=c.scrollbarColor,i.scrollbarWidth=c.scrollbarWidth;var l=getComputedStyle(e,"::-webkit-scrollbar"),s=parseInt(l.width,10),u=parseInt(l.height,10);try{var d=s?"width: ".concat(l.width,";"):"",f=u?"height: ".concat(l.height,";"):"";(0,o.hq)("\n#".concat(r,"::-webkit-scrollbar {\n").concat(d,"\n").concat(f,"\n}"),r)}catch(e){console.error(e),t=s,n=u}}document.body.appendChild(a);var p=e&&t&&!isNaN(t)?t:a.offsetWidth-a.clientWidth,m=e&&n&&!isNaN(n)?n:a.offsetHeight-a.clientHeight;return document.body.removeChild(a),(0,o.jL)(r),{width:p,height:m}}function i(e){return"undefined"==typeof document?0:((e||void 0===r)&&(r=a()),r.width)}function c(e){return"undefined"!=typeof document&&e&&e instanceof Element?a(e):{width:0,height:0}}},58525:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);function o(e){var t=r.useRef();return t.current=e,r.useCallback(function(){for(var e,n=arguments.length,r=Array(n),o=0;o2&&void 0!==arguments[2]&&arguments[2],a=new Set;return function e(t,i){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=a.has(t);if((0,o.ZP)(!l,"Warning: There may be circular references"),l)return!1;if(t===i)return!0;if(n&&c>1)return!1;a.add(t);var s=c+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var u=0;u